diff --git a/.jshintrc b/.jshintrc index 589cec4..21d1bf4 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,9 @@ { + "globals": { + "AbortController": true, + "crypto": false, + "EventSource": false + }, "browser": true, "node": true, "esversion": 11, @@ -16,7 +21,6 @@ "plusplus": true, "undef": true, "unused": "vars", - "strict": true, "maxdepth": 4, "maxstatements": 100, "maxcomplexity": 20 diff --git a/1-create-asset-lock.js b/1-create-asset-lock.js new file mode 100644 index 0000000..0502bf2 --- /dev/null +++ b/1-create-asset-lock.js @@ -0,0 +1,768 @@ +import Fs from "node:fs/promises"; + +import Dotenv from "dotenv"; +import DashPhrase from "dashphrase"; +import DashHd from "./dashhd-utils.js"; +import DashKeys from "dashkeys"; +import DashTx from "dashtx/dashtx.js"; +import DashPlatform from "./dashplatform.js"; +import Bincode from "./bincode.js"; +import QRCode from "./_qr.js"; +import KeyUtils from "./key-utils.js"; + +import Thingy from "./2-create-identity-transition.js"; + +import EventSourcePackage from "launchdarkly-eventsource"; + +Dotenv.config({ path: ".env" }); + +let EventSourceShim = EventSourcePackage.EventSource; + +// let DapiGrpc = require("@dashevo/dapi-grpc"); +// let WasmDpp = require("@dashevo/wasm-dpp"); +// let Dpp = WasmDpp.DashPlatformProtocol; + +//@ts-ignore - sssssh, yes Base58 does exist +// let b58 = DashKeys.Base58.create(); + +let rpcAuthUrl = "https://api:null@trpc.digitalcash.dev"; +let zmqUuid = crypto.randomUUID(); +let zmqAuthUrl = `https://tzmq.digitalcash.dev/api/zmq/eventsource/${zmqUuid}`; + +const L1_VERSION_PLATFORM = 3; +// const L1_VERSION_PLATFORM = 0; +const TYPE_ASSET_LOCK = 8; +const VERSION_ASSET_LOCK = 1; +// const L2_VERSION_PLATFORM = 1; // actually constant "0" ?? +// const ST_CREATE_IDENTITY = 2; + +let VERSIONS_TESTNET = ["8c", "ef"]; + +let KEY_LEVELS = { + 0: "MASTER", + 1: "CRITICAL", + 2: "HIGH", + 3: "MEDIUM", + MASTER: 0, + CRITICAL: 1, + HIGH: 2, + MEDIUM: 3, +}; + +let KEY_PURPOSES = { + 0: "AUTHENTICATION", + 1: "ENCRYPTION", + 2: "DECRYPTION", + 3: "TRANSFER", + 4: "SYSTEM", + 5: "VOTING", + AUTHENTICATION: 0, + ENCRYPTION: 1, + DECRYPTION: 2, + TRANSFER: 3, + SYSTEM: 4, + VOTING: 5, +}; + +let KEY_TYPES = { + 0: "ECDSA_SECP256K1", + ECDSA_SECP256K1: 0, +}; + +let network = "testnet"; +let coinType = 5; // DASH +if (network === "testnet") { + coinType = 1; // testnet +} +//coinType = 1; + +let identityEcdsaPath = ""; +{ + // m/purpose'/coin_type'/feature'/subfeature'/keytype'/identityindex'/keyindex' + // ex: m/9'/5'/5'/0'/0'// + let purposeDip13 = 9; + let featureId = 5; + let subfeatureKey = 0; + let keyType = KEY_TYPES.ECDSA_SECP256K1; + identityEcdsaPath = `m/${purposeDip13}'/${coinType}'/${featureId}'/${subfeatureKey}'/${keyType}'`; +} + +async function main() { + let coinType = 5; + let testnet = true; // TODO + if (testnet) { + coinType = 1; + } + + // void (await WasmDpp.default()); + + let walletPhrase = process.env.DASH_WALLET_PHRASE; + let walletSalt = process.env.DASH_WALLET_SALT ?? ""; + if (!walletPhrase) { + console.error(""); + console.error("ERROR"); + console.error(" 'DASH_WALLET_PHRASE' is not set"); + console.error(""); + console.error("SOLUTION"); + let newPhrase = await DashPhrase.generate(); + console.error(` echo 'DASH_WALLET_PHRASE="${newPhrase}"' >> .env`); + console.error(` echo 'DASH_WALLET_SALT=""' >> .env`); + console.error(""); + process.exit(1); + return; + } + + let identityIndexStr = process.argv[2]; + let identityIndex = parseInt(identityIndexStr, 10); + if (isNaN(identityIndex)) { + console.error(""); + console.error("USAGE"); + console.error(" ./demo.js "); + console.error(""); + console.error("EXAMPLE"); + console.error(" ./demo.js 0"); + console.error(""); + process.exit(1); + return; + } + + let seed = await DashPhrase.toSeed(walletPhrase, walletSalt); + let walletKey = await DashHd.fromSeed(seed); + + let hdOpts = { version: "testnet" }; // TODO + + let regFundAddressPath = `m/9'/${coinType}'/5'/1'/${identityIndex}`; + //@ts-expect-error - monkey patch + let regFundKey = await DashHd.deriveIdentRegFundKeyPath( + walletKey, + regFundAddressPath, + ); + + let assetKey = await DashHd.deriveChild(regFundKey, 0, DashHd.HARDENED); + let assetWif = await DashHd.toWif(assetKey.privateKey, hdOpts); + let assetInfo = await wifToInfo(assetWif, "testnet"); + console.log("Asset WIF", assetWif, "(would be ephemeral, non-hd)"); + // TODO the asset wif isn't used that way... + // { + // let assetDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressdeltas", { + // addresses: [assetInfo.address], + // }); + // let memDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressmempool", { + // addresses: [assetInfo.address], + // }); + // let isUsed = assetDeltas.length > 0 || memDeltas.length; + // if (isUsed) { + // throw new Error(`asset key has been used`); + // } + // } + + let topupAddressPath = `m/9'/${coinType}'/5'/2'/0`; + //@ts-expect-error - monkey patch + let topupKey = await DashHd.deriveIdentTopupKeyPath( + walletKey, + topupAddressPath, + ); + + let { identityIdHex, txidHex, assetProof } = await createPlatformAssetLock( + hdOpts, + regFundKey, + topupKey, // TODO next change key from wallet + assetInfo, + ); + + let txlocksigHex; + let txCore; + if (assetProof.data.raw) { + txlocksigHex = assetProof.data.raw; + } else if (assetProof.data.vin) { + txCore = assetProof.data; + } else { + console.log(`DEBUG assetProof`); + console.log(assetProof); + throw new Error("internal error: no acceptable asset proof"); + } + + console.log(); + console.log(`txidHex: `, txidHex); + console.log(`identityIdHex:`, identityIdHex); + console.log(`txlocksigHex:`, txlocksigHex); + console.log(`txCore:`, txCore); + + let authWalletPath = `m/9'/${coinType}'/5'/0'/0'/${identityIndex}'`; + //@ts-expect-error - monkey patch + let authWallet = await DashHd.deriveIdentAuthWalletPath( + walletKey, + authWalletPath, + ); + let masterKey = await authWallet.deriveAuthKey(0); + let otherKey = await authWallet.deriveAuthKey(1); + + await Thingy.doStuff( + assetKey, + masterKey, + otherKey, + identityIdHex, + txidHex, + txlocksigHex, + txCore, + ); + // walletKey, coinType, identityIndex +} + +/** + * @param {import('dashhd').HDToAddressOpts} hdOpts + * @param {import('dashhd').HDWallet} regFundKey + * @param {import('dashhd').HDWallet} changeKey + * @param {import('dashhd').HDKey} assetInfo + */ +async function createPlatformAssetLock( + hdOpts, + regFundKey, + changeKey, + assetInfo, +) { + let dashTx = DashTx.create(KeyUtils); + + if (!regFundKey.privateKey) { + throw new Error("'regFundKey' is missing 'privateKey'"); + } + let fundingWif = await DashHd.toWif(regFundKey.privateKey, hdOpts); + let fundingInfo = await wifToInfo(fundingWif, "testnet"); + { + let fundingDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressdeltas", { + addresses: [fundingInfo.address], + }); + let memDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressmempool", { + addresses: [fundingInfo.address], + }); + let totalUses = fundingDeltas.length + memDeltas.length; + if (totalUses >= 2) { + throw new Error(`funding key has been used 2+ times`); + } + } + + KeyUtils.set(fundingInfo.address, { + address: fundingInfo.address, + privateKey: fundingInfo.privateKey, + publicKey: fundingInfo.publicKey, + pubKeyHash: fundingInfo.pubKeyHashHex, + }); + + if (!changeKey.privateKey) { + throw new Error("'topupKey' is missing 'privateKey'"); + } + let changeWif = await DashHd.toWif(changeKey.privateKey, hdOpts); + let changeInfo = await wifToInfo(changeWif, "testnet"); + + //@ts-expect-error - monkey patch + let fundingUtxos = await DashTx.TODOgetUtxos([fundingInfo.address]); + for (let utxo of fundingUtxos) { + utxo.squence = "00000000"; // ?? + } + + // TODO list transactions from funding address and check for + // - check the funding address for transactions + let fundingTotal = DashTx.sum(fundingUtxos); + console.log(); + console.log(`funding utxos (${fundingTotal})`); + console.log(fundingUtxos); + + let transferSats = 100000000; + let feeSats = 500; // enough for 1 input and 2 outputs + extrapayload + let changeSats = fundingTotal + -transferSats + -feeSats; + + let burnOutput = { memo: "", satoshis: transferSats }; + + /** @type {Array} */ + let outputs = [burnOutput]; + if (changeSats >= 10000) { + outputs.push({ + satoshis: changeSats, + pubKeyHash: changeInfo.pubKeyHashHex, + }); + } else if (changeSats < 250) { + let needSats = 250 - changeSats; + promptQr(fundingInfo.address, needSats); + process.exit(1); + // throw new Error( + // `too few sats for test: ${fundingTotal} (needs at least 100000000 + 250 + 10000)`, + // ); + } + + let assetExtraOutput = { + satoshis: transferSats, + pubKeyHash: assetInfo.pubKeyHashHex, + }; + //@ts-expect-error - TODO add types + let assetLockScript = DashPlatform.Tx.packAssetLock({ + version: VERSION_ASSET_LOCK, + creditOutputs: [assetExtraOutput], + }); + let txDraft = { + version: L1_VERSION_PLATFORM, + type: TYPE_ASSET_LOCK, + inputs: fundingUtxos, + outputs: outputs, // burnOutput, changeOutput + extraPayload: assetLockScript, + }; + console.log(); + console.log(`Transaction Draft:`); + console.log(txDraft); + + // to guarantee order + // txDraft.inputs.sort(DashTx.sortInputs); + // txDraft.outputs.sort(DashTx.sortOutputs); + let vout = txDraft.outputs.indexOf(burnOutput); + + console.log(`DEBUG fundingInfo`, fundingInfo); + + console.log(); + let txProof = DashTx.createRaw(txDraft); + // txProof.inputs[0].script = `76a914${fundingInfo.pubKeyHashHex}88ac`; + txProof.inputs[0].sequence = "00000000"; // Non-final DashTx.NON_FINAL = "00000000" + console.log(`Transaction Proof:`); + console.log(txProof); + + console.log(); + let txProofHex = await DashTx.serialize(txProof, null); + console.log(`Transaction Proof Hex:`); + console.log(txProofHex); + + console.log(); + console.log(`Ready-to-Broadcast (Signed) Transaction:`); + console.log( + `('sendrawtransaction' via https://rpc.digitalcash.dev or https://trpc.digitalcash.dev)`, + ); + let txSigned = await dashTx.hashAndSignAll(txDraft); + console.log(txSigned.transaction); + + // process.exit(1); + console.log(); + console.log( + `IMPORTANT: before broadcast, listen to 'rawtxlocksig' on https://tzmq.digitalcash.dev`, + ); + + console.log(); + console.log(`Funding Outpoint Info (BE, internal)`); + let outpoint = await getFundingOutPoint(txSigned.transaction, vout); + console.log(outpoint); + + let txidHex = await DashTx.utils.rpc( + rpcAuthUrl, + "sendrawtransaction", + txSigned.transaction, + ); + console.log("DEBUG send result (txidHex) (LE, for RPC)", txidHex); + + let assetProof; + { + let assetInstantEvent = startEventSource( + zmqAuthUrl, + "rawtxlocksig", + createCheckDataIsProof(txSigned), + ); + let assetChainPoll = pollAssetLockChainProof(txidHex); + assetProof = await Promise.race([ + assetInstantEvent.promise, + assetChainPoll.promise, + ]); + assetInstantEvent.source.close(); + assetChainPoll.source.close(); + } + + console.log(); + console.log(`Funding Outpoint Hex`); + let fundingOutPointHex = `${outpoint.txid}${outpoint.voutHex}`; + console.log(fundingOutPointHex); + + let identityId = await createIdentityId(fundingOutPointHex); + let identityIdHex = DashTx.utils.bytesToHex(identityId); + + return { + txidHex, + identityIdHex, + assetProof, + }; +} + +/** + * @param {String} fundingAddress + * @param {Number} needSats + */ +function promptQr(fundingAddress, needSats) { + let dashAmount = DashTx.toDash(needSats); + let content = `dash:${fundingAddress}?amount=${dashAmount}`; + let ascii = QRCode.ascii(content, { + indent: 3, + padding: 4, + width: 256, + height: 256, + color: "#000000", + background: "#ffffff", + ecl: "M", + }); + console.error(); + console.error(`ERROR`); + console.error( + ` not enough DASH at funding address (including instant send)`, + ); + console.error(); + console.error(`SOLUTION`); + console.error(` send ${dashAmount} to ${fundingAddress}`); + console.error(``); + console.error(ascii); + console.error(); +} + +/** + * @param {import('dashtx').TxInfoSigned} txProofSigned + * @returns {CheckData} + */ +function createCheckDataIsProof(txProofSigned) { + /** + * @param {Object.} txlocksig + */ + async function checkDataIsProof(txlocksig) { + if (!txlocksig?.raw) { + console.warn(`unknown data:`, txlocksig); + return false; + } + + return txlocksig.raw.startsWith(txProofSigned.transaction); + } + + return checkDataIsProof; +} + +/** + * @param {String} txidHex + */ +function pollAssetLockChainProof(txidHex) { + let isActive = true; + /** @type {any} */ + let timeoutToken; + + /** + * @param {any} token + */ + function setTimeoutToken(token) { + timeoutToken = token; + } + + let promise = new Promise(async function (resolve) { + for (;;) { + console.log("Fetch (rawtransaction): sleeping for 15s..."); + await sleep(15000, setTimeoutToken); + + if (!isActive) { + resolve(null); + return; + } + // TODO DashTx.TxCoreInfo + let txCore = await getTransactionJson(txidHex); + if (txCore) { + resolve({ + source: "rawtransaction", + data: txCore, + }); + return; + } + } + }); + + let source = { + close: function () { + isActive = false; + clearTimeout(timeoutToken); + }, + }; + + return { + promise, + source, + }; +} + +/** + * @param {HexString} txidHex + */ +async function getTransactionJson(txidHex) { + const E_NO_TX = -5; + let getJson = true; + + let txInfo = await DashTx.utils + .rpc(rpcAuthUrl, "getrawtransaction", txidHex, getJson) + .catch( + /** @param {Error} err */ + function (err) { + //@ts-expect-error - it may have .code + if (err.code === E_NO_TX) { + return null; + } + throw err; + }, + ); + if (!txInfo?.vout) { + return null; + } + + return txInfo; +} + +/** + * @param {Uint32} ms + * @param {Function} setTimeoutToken + */ +async function sleep(ms, setTimeoutToken) { + return await new Promise(function (resolve) { + let token = setTimeout(resolve, ms); + if (token.unref) { + token.unref(); + } + if (setTimeoutToken) { + setTimeoutToken(token); + } + }); +} + +/** + * @callback CheckData + * @param {String} message + * @returns {Promise} + */ + +/** + * @param {String} url + * @param {String} eventName + * @param {CheckData} checkData + */ +function startEventSource(url, eventName, checkData) { + let isActive = true; + + let tickerHeartbeatMs = 5 * 1000; + // in case of a network hiccup lasting several seconds + let tickerHeartbeatTimeout = 3 * tickerHeartbeatMs; + let source = new EventSourceShim(url, { + readTimeoutMillis: tickerHeartbeatTimeout, + }); + let promise = new Promise(async function (resolve, reject) { + let basicAuth = btoa(`api:null`); + let resp = await fetch(zmqAuthUrl, { + method: "PUT", + headers: { + Authorization: `Basic ${basicAuth}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ topics: ["debug:ticker", eventName] }), + }).catch(reject); + if (!resp) { + // rejected; + return null; + } + + let result = await resp.text(); + console.log(`[DEBUG] status: ${result}`); + + /** @param {MessageEvent} event */ + async function onMessage(event) { + if (!isActive) { + console.log("EventSource: received message after close"); + source.close(); + return; + } + + console.log(`DEBUG MessageEvent`, event); + let data = JSON.parse(event.data); + + let isValidData = await checkData(data).catch(function (err) { + console.error(`error checking event source data`); + console.error(err); + return false; + }); + if (!isValidData) { + return; + } + + resolve({ + source: "txlocksig", + data: data, + }); + source.close(); + } + + console.log(`EventSource: listening for debug:ticker`); + source.addEventListener("debug:ticker", function (event) { + console.log("EventSource: ticker", event); + }); + if (eventName) { + console.log(`EventSource: listening for ${eventName}`); + source.addEventListener(eventName, onMessage); + } else { + console.log(`EventSource: listening for all messages`); + source.addEventListener("message", onMessage); + } + + source.addEventListener("error", function (err) { + if (!isActive) { + console.log("EventSource: received error after close (probably okay)"); + source.close(); + return; + } + + console.error("error: disconnected from EventSource", err); + // TODO reconnect? + }); + + source.addEventListener("close", function () { + console.log("DEBUG: closed EventSource"); + }); + }); + + return { + promise: promise, + source: { + close: function () { + isActive = false; + source.close(); + }, + }, + }; +} + +/** + * @typedef Delta + * @prop {String} txid + * @prop {Uint32} index + * @prop {String} pubKeyHash + * @prop {String} address + * @prop {Uint32} satoshis + */ + +/** + * THIS IS PROBABLY WRONG + * We'd actually need to do getaddresstxids, getrawtransaction, getaddressutxos, getaddressmempool to get all of the data to pair the coins properly + * @param {Array} addresses + */ +//@ts-expect-error - monkey patch +DashTx.TODOgetUtxos = async function (addresses) { + // let oldDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressdeltas", { + let utxos = await DashTx.utils.rpc(rpcAuthUrl, "getaddressutxos", { + addresses: addresses, + }); + console.log(`DEBUG utxos`); + console.log(utxos); + + let memDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressmempool", { + addresses: addresses, + }); + + let oldTotal = DashTx.sum(utxos); + let newTotal = DashTx.sum(memDeltas); + let total = newTotal + oldTotal; + if (total === 0) { + return []; + } else if (total < 0) { + throw new Error("sanity fail: double spend detected"); + } + + for (let delta of memDeltas) { + if (delta.satoshis < 0) { + throw new Error( + "dev error: reconciling instant-send debits is not yet supported", + ); + } + + // TODO expose decodeUnchecked(), rename 'pubKeyHash' (data) to 'hex' + let pubKeyHashCheck = DashKeys._dash58check.decode(delta.address, { + //@ts-expect-error + versions: VERSIONS_TESTNET, + }); + let utxo = { + address: delta.address, + //@ts-expect-error - needs better abstraction + pubKeyHash: pubKeyHashCheck.pubKeyHash, + txid: delta.txid, + outputIndex: delta.index, + satoshis: delta.satoshis, + //@ts-expect-error - needs better abstraction + script: `76a914${pubKeyHashCheck.pubKeyHash}88ac`, + }; + utxos.push(utxo); + } + + return utxos; +}; + +// /** +// * @param {String} path +// */ +// async function readWif(path) { +// let wif = await Fs.readFile(path, "utf8"); +// wif = wif.trim(); + +// return wif; +// } + +/** + * @param {String} wif + * @param {DashKeys.VERSION_PRIVATE} version - mainnet, testnet + */ +async function wifToInfo(wif, version) { + let privateKey = await DashKeys.wifToPrivKey(wif, { version }); + let publicKey = await KeyUtils.toPublicKey(privateKey); + let pubKeyHash = await DashKeys.pubkeyToPkh(publicKey); + let address = await DashKeys.pkhToAddr(pubKeyHash, { + version, + }); + + let privateKeyHex = DashKeys.utils.bytesToHex(privateKey); + let publicKeyHex = DashKeys.utils.bytesToHex(publicKey); + let pubKeyHashHex = DashKeys.utils.bytesToHex(pubKeyHash); + + let info = { + wif, + privateKey, + privateKeyHex, + publicKey, + publicKeyHex, + pubKeyHash, + pubKeyHashHex, + address, + }; + // console.log(info); + // process.exit(1); + return info; +} + +/** + * @param {HexString} txSignedHex + * @param {Uint32} outputIndex + */ +async function getFundingOutPoint(txSignedHex, outputIndex) { + let txBytes = DashTx.utils.hexToBytes(txSignedHex); + let txidBytes = await DashTx.doubleSha256(txBytes); + let txidBE = DashTx.utils.bytesToHex(txidBytes); + let voutLE = DashTx.utils.toUint32LE(outputIndex); + + return { txid: txidBE, voutHex: voutLE, vout: outputIndex }; +} + +/** + * @param {HexString} fundingOutPointHex + */ +function createIdentityId(fundingOutPointHex) { + let fundingOutPointBytes = DashTx.utils.hexToBytes(fundingOutPointHex); + let identityHashBytes = DashTx.doubleSha256(fundingOutPointBytes); + // let identityId = b58.encode(identityHashBytes); + // return identityId; + return identityHashBytes; +} + +main(); + +/** @typedef {String} Base58 */ +/** @typedef {String} Base64 */ +/** @typedef {String} HexString */ +/** @typedef {Number} Uint53 */ +/** @typedef {Number} Uint32 */ +/** @typedef {Number} Uint8 */ diff --git a/2-create-identity-transition.js b/2-create-identity-transition.js new file mode 100644 index 0000000..74b8512 --- /dev/null +++ b/2-create-identity-transition.js @@ -0,0 +1,409 @@ +import Fs from "node:fs/promises"; + +// import DashKeys from "dashkeys"; +import DashTx from "dashtx/dashtx.js"; + +import Bincode from "./bincode.js"; +import KeyUtils from "./key-utils.js"; +import baseX from "base-x"; + +const ST_CREATE_IDENTITY = 2; +const L2_VERSION_PLATFORM = 1; // actually constant "0" ?? + +let KEY_LEVELS = { + 0: "MASTER", + 1: "CRITICAL", + 2: "HIGH", + 3: "MEDIUM", + MASTER: 0, + CRITICAL: 1, + HIGH: 2, + MEDIUM: 3, +}; + +let KEY_PURPOSES = { + 0: "AUTHENTICATION", + 1: "ENCRYPTION", + 2: "DECRYPTION", + 3: "TRANSFER", + 4: "SYSTEM", + 5: "VOTING", + AUTHENTICATION: 0, + ENCRYPTION: 1, + DECRYPTION: 2, + TRANSFER: 3, + SYSTEM: 4, + VOTING: 5, +}; + +let KEY_TYPES = { + 0: "ECDSA_SECP256K1", + ECDSA_SECP256K1: 0, +}; + +const BASE58 = `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`; +let base58 = baseX(BASE58); + +let Thingy = {}; + +/** + * @typedef AssetLockChainProof + * @prop {Number} core_chain_locked_height + * @prop {Object} out_point + * @prop {String} out_point.txid + * @prop {Number} out_point.vout + */ + +/** + * @param {import('dashhd').HDWallet} assetKey + * @param {import('dashhd').HDWallet} masterKey + * @param {import('dashhd').HDWallet} otherKey + * @param {String} identityIdHex + * @param {String} txidHex + * @param {String} [txlocksigHex] + * @param {import('dashtx').TxInfo} [txCore] + */ +Thingy.doStuff = async function ( + assetKey, + masterKey, + otherKey, + identityIdHex, + txidHex, + txlocksigHex, + txCore, +) { + // const INSTANT_ALP = 0; + // const CHAIN_ALP = 1; + + let assetLockProof; + if (txlocksigHex) { + assetLockProof = await getAssetLockInstantProof(txlocksigHex); + } else { + assetLockProof = await getAssetLockChainProof(txidHex, txCore); + } + + if (!masterKey.privateKey) { + throw new Error("'masterKey' is missing 'privateKey'"); + } + if (!otherKey.privateKey) { + throw new Error("'otherKey' is missing 'privateKey'"); + } + let identityKeys = await getKnownIdentityKeys( + { privateKey: masterKey.privateKey, publicKey: masterKey.publicKey }, + { privateKey: otherKey.privateKey, publicKey: otherKey.publicKey }, + ); + let stKeys = await getIdentityTransitionKeys(identityKeys); + + let stateTransition = { + //protocolVersion: L2_VERSION_PLATFORM, + $version: L2_VERSION_PLATFORM.toString(), + type: ST_CREATE_IDENTITY, + // ecdsaSig(assetLockPrivateKey, CBOR(thisStateTransition)) + // "signature":"IBTTgge+/VDa/9+n2q3pb4tAqZYI48AX8X3H/uedRLH5dN8Ekh/sxRRQQS9LaOPwZSCVED6XIYD+vravF2dhYOE=", + asset_lock_proof: assetLockProof, + // publicKeys: stKeys, + public_keys: stKeys, + // [ + // { + // id: 0, + // type: 0, + // purpose: 0, + // securityLevel: 0, + // data: "AkWRfl3DJiyyy6YPUDQnNx5KERRnR8CoTiFUvfdaYSDS", + // readOnly: false, + // }, + // ], + user_fee_increase: 0, + }; + console.log(`stKeys:`); + console.log(stKeys); + + let nullSigTransitionAb = Bincode.encode( + Bincode.StateTransition, + //@ts-expect-error -- TODO ?? + stateTransition, + { + signable: true, + }, + ); + let nullSigTransition = new Uint8Array(nullSigTransitionAb); + console.log(); + console.log(`nullSigTransition (ready-to-sign by identity keys):`); + console.log(DashTx.utils.bytesToHex(nullSigTransition)); + console.log(bytesToBase64(nullSigTransition)); + + let nullSigMagicHash = await KeyUtils.doubleSha256(nullSigTransition); + + if (!assetKey.privateKey) { + throw new Error("'assetKey' is missing 'privateKey'"); + } + { + let magicSigBytes = await KeyUtils.magicSign({ + privKeyBytes: assetKey.privateKey, + doubleSha256Bytes: nullSigMagicHash, + }); + + Object.assign(stateTransition, { + identity_id: DashTx.utils.hexToBytes(identityIdHex), + signature: magicSigBytes, + }); + } + + for (let i = 0; i < identityKeys.length; i += 1) { + let key = identityKeys[i]; + let stPub = stateTransition.public_keys[i]; + let magicSigBytes = await KeyUtils.magicSign({ + privKeyBytes: key.privateKey, + doubleSha256Bytes: nullSigMagicHash, + }); + + Object.assign(stPub, { + signature: magicSigBytes, + }); + } + + console.log(); + console.log(JSON.stringify(stateTransition, null, 2)); + + let grpcTransition = ""; + let transitionHashHex = ""; + { + let fullSigTransitionAb = Bincode.encode( + Bincode.StateTransition, + //@ts-expect-error + stateTransition, + { + signable: false, + }, + ); + let fullSigTransition = new Uint8Array(fullSigTransitionAb); + console.log(); + console.log(`transition (fully signed):`); + console.log(DashTx.utils.bytesToHex(fullSigTransition)); + let transitionHashAb = await crypto.subtle.digest( + { name: "SHA-256" }, + fullSigTransition, + ); + let transitionHash = new Uint8Array(transitionHashAb); + transitionHashHex = DashTx.utils.bytesToHex(transitionHash); + grpcTransition = bytesToBase64(fullSigTransition); + } + + console.log(); + console.log(); + console.log(`grpcurl -plaintext -d '{ + "stateTransition": "${grpcTransition}" +}' seed-1.testnet.networks.dash.org:1443 org.dash.platform.dapi.v0.Platform.broadcastStateTransition`); + console.log(); + let identityIdBytes = DashTx.utils.hexToBytes(identityIdHex); + let identity = base58.encode(identityIdBytes); + console.log(`https://testnet.platform-explorer.com/identity/${identity}`); + console.log( + `https://testnet.platform-explorer.com/transaction/${transitionHashHex}`, + ); +}; + +export default Thingy; + +/** @param {HexString} txlocksigHex */ +async function getAssetLockInstantProof(txlocksigHex) { + { + let len = txlocksigHex.length / 2; + console.log(); + console.log(`Tx Lock Sig Hex (${len}):`); + console.log(txlocksigHex); + } + + let vout = -1; + let instantLockTxHex = ""; + let instantLockSigHex = ""; + { + let txlocksig = DashTx.parseUnknown(txlocksigHex); + vout = 0; + //vout = txlocksig.extraPayload.outputs.findIndex(function (output) { + // //@ts-expect-error + // return output.script === "6a00"; + //}); + // console.log(txlocksig.extraPayload.outputs); + //@ts-expect-error + instantLockSigHex = txlocksig.sigHashTypeHex; + let isLen = instantLockSigHex.length / 2; + let len = txlocksigHex.length / 2; + len -= isLen; + instantLockTxHex = txlocksigHex.slice(0, len * 2); + console.log(); + console.log(`Tx Hex (${len})`); + console.log(instantLockTxHex); + console.log(); + console.log(`Tx Lock Sig Instant Lock Hex (${isLen})`); + //@ts-expect-error + console.log(txlocksig.sigHashTypeHex); + } + + let assetLockInstantProof = { + // type: INSTANT_ALP, + instant_lock: DashTx.utils.hexToBytes(instantLockSigHex), + transaction: DashTx.utils.hexToBytes(instantLockTxHex), // TODO this may need the proof, not the signed tx + // output_index: DashTx.utils.hexToBytes(vout), + output_index: vout, + }; + return assetLockInstantProof; +} + +/** + * @param {HexString} txidHex + * @param {any} txInfo - TODO CoreTx + */ +async function getAssetLockChainProof(txidHex, txInfo) { + //@ts-expect-error + let vout = txInfo.vout.findIndex(function (voutInfo) { + return voutInfo.scriptPubKey?.hex === "6a00"; // TODO match the burn + }); + + let assetLockChainProof = { + // type: CHAIN_ALP, + core_chain_locked_height: txInfo.height, + // out_point: fundingOutPointHex, + out_point: { + txid: DashTx.utils.hexToBytes(txidHex), + vout: vout, + }, + }; + + return assetLockChainProof; +} + +/** + * @param {Required>} masterKey + * @param {Required>} otherKey + * @returns {Promise>} + */ +async function getKnownIdentityKeys(masterKey, otherKey) { + if (!masterKey.privateKey) { + throw new Error("linter fail"); + } + if (!otherKey.privateKey) { + throw new Error("linter fail"); + } + let keyDescs = [ + // {"$version":"0","id":0,"purpose":0,"securityLevel":0,"contractBounds":null,"type":0,"readOnly":false,"data":[3,58,154,139,30,76,88,26,25,135,114,76,102,151,19,93,49,192,126,231,172,130,126,106,89,206,192,34,176,77,81,5,95],"disabledAt":null} + { + id: 0, + type: KEY_TYPES.ECDSA_SECP256K1, + purpose: KEY_PURPOSES.AUTHENTICATION, + securityLevel: KEY_LEVELS.MASTER, + readOnly: false, + publicKey: masterKey.publicKey, + privateKey: masterKey.privateKey, + data: "", + }, + // {"$version":"0","id":1,"purpose":0,"securityLevel":1,"contractBounds":null,"type":0,"readOnly":false,"data":[2,1,70,3,1,141,196,55,100,45,218,22,244,199,252,80,228,130,221,35,226,70,128,188,179,165,150,108,59,52,56,72,226],"disabledAt":null} + { + id: 1, + type: KEY_TYPES.ECDSA_SECP256K1, + purpose: KEY_PURPOSES.AUTHENTICATION, + securityLevel: KEY_LEVELS.CRITICAL, + readOnly: false, + privateKey: otherKey.privateKey, + publicKey: otherKey.publicKey, + data: "", + }, + ]; + return keyDescs; +} + +/** + * @typedef EvoKey + * @prop {Uint8} id + * @prop {Uint8} type - TODO constrain to members of KEY_TYPES + * @prop {Uint8} purpose - TODO constrain to members of KEY_PURPOSES + * @prop {Uint8} securityLevel - TODO constrain to members of KEY_LEVELS + * @prop {Boolean} readOnly + * @prop {Uint8Array} publicKey + * @prop {Uint8Array} privateKey + */ + +/** + * @typedef STKey + * @prop {Uint8} id + * @prop {Uint8} type - TODO constrain to members of KEY_TYPES + * @prop {Uint8} purpose - TODO constrain to members of KEY_PURPOSES + * @prop {Base64} data - base64-encoded publicKey (compact) + * @prop {Uint8} securityLevel - TODO constrain to members of KEY_LEVELS + * @prop {Boolean} readOnly + */ + +/** + * @param {Array} identityKeys - TODO + */ +function getIdentityTransitionKeys(identityKeys) { + let stKeys = []; + for (let key of identityKeys) { + // let data = bytesToBase64(key.publicKey); + let stKey = { + $version: "0", + id: key.id, + type: key.type, + purpose: key.purpose, + security_level: key.securityLevel, + contract_bounds: null, + // readOnly: key.readOnly, + read_only: key.readOnly || false, + // data: data, + data: key.publicKey, + // signature: "TODO", + }; + // if ("readOnly" in key) { + // Object.assign(stKey, { readOnly: key.readOnly }); + // } + stKeys.push(stKey); + } + return stKeys; +} + +/** + * @param {Uint8Array} bytes + */ +function bytesToBase64(bytes) { + let binstr = ""; + for (let i = 0; i < bytes.length; i += 1) { + binstr += String.fromCharCode(bytes[i]); + } + + return btoa(binstr); +} + +/** + * Reads a hex file as text, stripping comments (anything including and after a non-hex character), removing whitespace, and joining as a single string + * @param {String} path + */ +async function readHex(path) { + let text = await Fs.readFile(path, "utf8"); + let lines = text.split("\n"); + let hexes = []; + for (let line of lines) { + line = line.replace(/\s/g, ""); + line = line.replace(/[^0-9a-f].*/i, ""); + hexes.push(line); + } + + let hex = hexes.join(""); + return hex; +} + +/** + * @param {String} path + */ +async function readWif(path) { + let wif = await Fs.readFile(path, "utf8"); + wif = wif.trim(); + + return wif; +} + +/** @typedef {String} Base58 */ +/** @typedef {String} Base64 */ +/** @typedef {String} HexString */ +/** @typedef {Number} Uint53 */ +/** @typedef {Number} Uint32 */ +/** @typedef {Number} Uint8 */ diff --git a/_qr.js b/_qr.js new file mode 100644 index 0000000..43f0866 --- /dev/null +++ b/_qr.js @@ -0,0 +1,158 @@ +"use strict"; + +let Qr = module.exports; + +let QrCode = require("qrcode-svg"); + +/** + * @typedef QrOpts + * @property {String} [background] + * @property {String} [color] + * @property {String} [ecl] + * @property {Number} [height] + * @property {Number} [indent] + * @property {Number} [padding] + * @property {"full" | "mini" | "micro"} [size] + * @property {Number} [width] + */ + +/** + * @param {String} data + * @param {QrOpts} opts + */ +Qr._create = function (data, opts) { + //@ts-ignore + return new QrCode({ + content: data, + padding: opts?.padding || 4, + width: opts?.width || 256, + height: opts?.height || 256, + color: opts?.color || "#000000", + background: opts?.background || "#ffffff", + ecl: opts?.ecl || "M", + }); +}; + +/** + * @typedef {Object.} BlockMap + */ + +/** + * Encoded as top-left, top-right, bottom-left, bottom-right + * @type {Object.<"mini" | "micro", BlockMap>} + */ +let charMaps = { + micro: { + 0b0000: " ", + 0b0001: "▗", + 0b0010: "▖", + 0b0011: "▄", + 0b0100: "▝", + 0b0101: "▐", + 0b0110: "▞", + 0b0111: "▟", + 0b1000: "▘", + 0b1001: "▚", + 0b1010: "▌", + 0b1011: "▙", + 0b1100: "▀", + 0b1101: "▜", + 0b1110: "▛", + 0b1111: "█", + }, + mini: { + 0b0000: " ", + 0b0001: " ▄", + 0b0010: "▄ ", + 0b0011: "▄▄", + 0b0100: " ▀", + 0b0101: " █", + 0b0110: "▄▀", + 0b0111: "▄█", + 0b1000: "▀ ", + 0b1001: "▀▄", + 0b1010: "█ ", + 0b1011: "█▄", + 0b1100: "▀▀", + 0b1101: "▀█", + 0b1110: "█▀", + 0b1111: "██", + }, +}; + +/** + * @param {String} data + * @param {QrOpts} opts + */ +Qr.quadAscii = function (data, opts) { + let charMap = charMaps[opts.size || "mini"]; + let qrcode = Qr._create(data, opts); + let indent = opts?.indent ?? 4; + let modules = qrcode.qrcode.modules; + + let lines = []; + let length = modules.length; + for (let y = 0; y < length; y += 2) { + let line = ``.padStart(indent, " "); + for (let x = 0; x < length; x += 2) { + let count = 0; + // qr codes can be odd numbers + if (x >= length) { + line += charMap[count]; + continue; + } + if (modules[x][y]) { + count += 8; + } + if (modules[x][y + 1]) { + count += 2; + } + + if (x + 1 >= length) { + line += charMap[count]; + continue; + } + if (modules[x + 1][y]) { + count += 4; + } + if (modules[x + 1][y + 1]) { + count += 1; + } + line += charMap[count]; + } + lines.push(line); + } + return lines.join("\n"); +}; + +/** + * @param {String} data + * @param {QrOpts} opts + */ +Qr.ascii = function (data, opts) { + if (!opts.size) { + opts.size = "mini"; + } + if (["mini", "micro"].includes(opts.size)) { + return Qr.quadAscii(data, opts); + } + + let qrcode = Qr._create(data, opts); + let indent = opts?.indent ?? 4; + let modules = qrcode.qrcode.modules; + + let lines = []; + let length = modules.length; + for (let y = 0; y < length; y += 1) { + let line = ``.padStart(indent, " "); + for (let x = 0; x < length; x += 1) { + let block = " "; + if (modules[x][y]) { + block = "██"; + } + line += block; + } + lines.push(line); + } + return lines.join("\n"); +}; diff --git a/attempt-5/asset-lock.txid.hex b/attempt-5/asset-lock.txid.hex new file mode 100644 index 0000000..8619c2c --- /dev/null +++ b/attempt-5/asset-lock.txid.hex @@ -0,0 +1 @@ +17bcbc024fd9bfd177c721506f4409ee286a0dba71580ab0199829951a17dff0 diff --git a/attempt-5/asset-lock.txt b/attempt-5/asset-lock.txt new file mode 100644 index 0000000..c32ba79 --- /dev/null +++ b/attempt-5/asset-lock.txt @@ -0,0 +1,83 @@ + +funding utxos (100200000) +[ + { + address: 'yT2BsoURRGJuAei4vbtFd9gXyyoSQqv1fs', + txid: '1bb692302eb1451f9e63a48a61e40ed9c6ce2f312a106f8b648de309c0b4d741', + outputIndex: 0, + script: '76a91449854f8f4aff67d0a93f85b6c65ec5432b28160a88ac', + satoshis: 100200000, + height: 1198392, + squence: '00000000' + } +] + +Transaction Draft: +{ + version: 3, + type: 8, + inputs: [ + { + address: 'yT2BsoURRGJuAei4vbtFd9gXyyoSQqv1fs', + txid: '1bb692302eb1451f9e63a48a61e40ed9c6ce2f312a106f8b648de309c0b4d741', + outputIndex: 0, + script: '76a91449854f8f4aff67d0a93f85b6c65ec5432b28160a88ac', + satoshis: 100200000, + height: 1198392, + squence: '00000000' + } + ], + outputs: [ + { memo: '', satoshis: 100000000 }, + { + satoshis: 199500, + pubKeyHash: 'a9b38b549bdc5f97d04c75ed9d6767a33009ea35' + } + ], + extraPayload: '010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac' +} + +Transaction Proof: +{ + version: 3, + type: 8, + inputs: [ + { + txid: '1bb692302eb1451f9e63a48a61e40ed9c6ce2f312a106f8b648de309c0b4d741', + txId: '1bb692302eb1451f9e63a48a61e40ed9c6ce2f312a106f8b648de309c0b4d741', + outputIndex: 0, + script: '76a91449854f8f4aff67d0a93f85b6c65ec5432b28160a88ac', + sequence: '00000000' + } + ], + outputs: [ + { memo: '', satoshis: 100000000 }, + { + satoshis: 199500, + pubKeyHash: 'a9b38b549bdc5f97d04c75ed9d6767a33009ea35' + } + ], + extraPayload: '010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac' +} + +Transaction Proof Hex: +030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000001976a91449854f8f4aff67d0a93f85b6c65ec5432b28160a88ac000000000200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac + +Ready-to-Broadcast (Signed) Transaction: +('sendrawtransaction' via https://rpc.digitalcash.dev or https://trpc.digitalcash.dev) +030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac + +IMPORTANT: before broadcast, listen to 'rawtxlocksig' on https://tzmq.digitalcash.dev + +Funding Outpoint Info +{ + txid: 'f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17', + voutHex: '00000000', + vout: 0 +} + +Funding Outpoint Hex +f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc1700000000 + +Identity Id Hex +70e03d1f6f2ac161466ecbf29d7373c158d46ec55d7b700ff99437b35e89d030 diff --git a/attempt-5/asset.yNR9b6Jrrn22Ap2cdGRGpByKbUh9Tn5K9w.wif b/attempt-5/asset.yNR9b6Jrrn22Ap2cdGRGpByKbUh9Tn5K9w.wif new file mode 100644 index 0000000..94a5fdb --- /dev/null +++ b/attempt-5/asset.yNR9b6Jrrn22Ap2cdGRGpByKbUh9Tn5K9w.wif @@ -0,0 +1 @@ +cRUttzuuDWqVXb59i4cMhAp4Lcw6yVthFzR7RupTByYZgxKWufRD diff --git a/attempt-5/change.ybnk8aNpLTLmW1T2o8C1c1mwBmkT8nLecx.wif b/attempt-5/change.ybnk8aNpLTLmW1T2o8C1c1mwBmkT8nLecx.wif new file mode 100644 index 0000000..f79ae2f --- /dev/null +++ b/attempt-5/change.ybnk8aNpLTLmW1T2o8C1c1mwBmkT8nLecx.wif @@ -0,0 +1 @@ +cP6rWtMU3KpGVkx8yYS8ZYah3mMMnWW8RHdxEqMMgTpbcqVesybJ diff --git a/attempt-5/funding.yT2BsoURRGJuAei4vbtFd9gXyyoSQqv1fs.wif b/attempt-5/funding.yT2BsoURRGJuAei4vbtFd9gXyyoSQqv1fs.wif new file mode 100644 index 0000000..70a48b3 --- /dev/null +++ b/attempt-5/funding.yT2BsoURRGJuAei4vbtFd9gXyyoSQqv1fs.wif @@ -0,0 +1 @@ +cPk3EBqRxixQEVkyjwKWqzXoFKFLKQ5iLdDgikTEznXU8ohHgDfz diff --git a/attempt-5/identity-id.hex b/attempt-5/identity-id.hex new file mode 100644 index 0000000..b9106fd --- /dev/null +++ b/attempt-5/identity-id.hex @@ -0,0 +1 @@ +70e03d1f6f2ac161466ecbf29d7373c158d46ec55d7b700ff99437b35e89d030 diff --git a/attempt-5/identity-transition.txt b/attempt-5/identity-transition.txt new file mode 100644 index 0000000..b4546d0 --- /dev/null +++ b/attempt-5/identity-transition.txt @@ -0,0 +1,1013 @@ + +Tx Lock Sig Hex (437): +030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac010141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b00000000f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17d4deb3bdb0e5e3ec400f5eacc58b6fcd7af4d3e8b0b6d165c4fb0f5aec000000817b741aa3125e054a5b8f8bd01fe9cc73f962685a7dd1388d55d78f08ea7f35b87b6afb7e650f78f3092bc2e8e0c9dc19733789f024901a19604f0c0e3b5ce654f2264eae6d5fd356c32d4dfee1cfeeca424fbea09b6b4f23a76ddcd13cde90 + +Tx Hex (239) +030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac + +Tx Lock Sig Instant Lock Hex (198) +010141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b00000000f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17d4deb3bdb0e5e3ec400f5eacc58b6fcd7af4d3e8b0b6d165c4fb0f5aec000000817b741aa3125e054a5b8f8bd01fe9cc73f962685a7dd1388d55d78f08ea7f35b87b6afb7e650f78f3092bc2e8e0c9dc19733789f024901a19604f0c0e3b5ce654f2264eae6d5fd356c32d4dfee1cfeeca424fbea09b6b4f23a76ddcd13cde90 +stKeys: +[ + { + '$version': '0', + id: 0, + type: 0, + purpose: 0, + security_level: 0, + contract_bounds: null, + read_only: false, + data: Uint8Array(33) [ + 2, 206, 87, 47, 157, 158, 160, 119, + 120, 136, 165, 41, 43, 125, 170, 251, + 4, 118, 116, 174, 126, 128, 228, 24, + 77, 104, 25, 210, 229, 98, 5, 205, + 148 + ] + }, + { + '$version': '0', + id: 1, + type: 0, + purpose: 0, + security_level: 1, + contract_bounds: null, + read_only: false, + data: Uint8Array(33) [ + 3, 147, 125, 252, 73, 94, 128, 182, + 137, 180, 160, 40, 22, 56, 81, 33, + 37, 210, 8, 98, 156, 177, 44, 126, + 22, 247, 249, 152, 73, 200, 68, 134, + 177 + ] + } +] +DEBUG Struct IdentityCreateTransitionV0: $version +DEBUG Struct IdentityCreateTransitionV0: public_keys +DEBUG Struct IdentityPublicKeyInCreationV0: $version +DEBUG Struct IdentityPublicKeyInCreationV0: id +DEBUG Struct IdentityPublicKeyInCreationV0: type +DEBUG Struct IdentityPublicKeyInCreationV0: purpose +DEBUG Struct IdentityPublicKeyInCreationV0: security_level +DEBUG Struct IdentityPublicKeyInCreationV0: contract_bounds +DEBUG Struct IdentityPublicKeyInCreationV0: read_only +DEBUG Struct IdentityPublicKeyInCreationV0: data +DEBUG Struct IdentityPublicKeyInCreationV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 77, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>, + byteLength: 77 + } + }, + idx: 44, + options: { signable: true } +} undefined +DEBUG Struct IdentityPublicKeyInCreationV0: $version +DEBUG Struct IdentityPublicKeyInCreationV0: id +DEBUG Struct IdentityPublicKeyInCreationV0: type +DEBUG Struct IdentityPublicKeyInCreationV0: purpose +DEBUG Struct IdentityPublicKeyInCreationV0: security_level +DEBUG Struct IdentityPublicKeyInCreationV0: contract_bounds +DEBUG Struct IdentityPublicKeyInCreationV0: read_only +DEBUG Struct IdentityPublicKeyInCreationV0: data +DEBUG Struct IdentityPublicKeyInCreationV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 154, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 00 01 00 00 01 00 00 21 03 93 7d fc 49 5e 80 b6 89 b4 a0 28 16 38 51 21 25 d2 08 62 9c b1 2c 7e 16 f7 f9 98 49 c8 44 86 b1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 54 more bytes>, + byteLength: 154 + } + }, + idx: 85, + options: { signable: true } +} undefined +DEBUG Struct IdentityCreateTransitionV0: asset_lock_proof +DEBUG Struct RawInstantLockProof: instant_lock +DEBUG Struct RawInstantLockProof: transaction +DEBUG Struct RawInstantLockProof: output_index +DEBUG Struct IdentityCreateTransitionV0: user_fee_increase +DEBUG Struct IdentityCreateTransitionV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 966, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 00 01 00 00 01 00 00 21 03 93 7d fc 49 5e 80 b6 89 b4 a0 28 16 38 51 21 25 d2 08 62 9c b1 2c 7e 16 f7 f9 98 49 c8 44 86 b1 00 c6 01 01 41 d7 b4 c0 09 e3 8d 64 8b 6f 10 ... 866 more bytes>, + byteLength: 966 + } + }, + idx: 527, + options: { signable: true } +} undefined +DEBUG Struct IdentityCreateTransitionV0: identity_id +DEBUG NotSignable> BinCode { + dataview: DataView { + byteLength: 966, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 00 01 00 00 01 00 00 21 03 93 7d fc 49 5e 80 b6 89 b4 a0 28 16 38 51 21 25 d2 08 62 9c b1 2c 7e 16 f7 f9 98 49 c8 44 86 b1 00 c6 01 01 41 d7 b4 c0 09 e3 8d 64 8b 6f 10 ... 866 more bytes>, + byteLength: 966 + } + }, + idx: 527, + options: { signable: true } +} undefined + +nullSigTransition (ready-to-sign by identity keys): +030002000000000000002102ce572f9d9ea0777888a5292b7daafb047674ae7e80e4184d6819d2e56205cd94000100000100002103937dfc495e80b689b4a0281638512125d208629cb12c7e16f7f99849c84486b100c6010141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b00000000f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17d4deb3bdb0e5e3ec400f5eacc58b6fcd7af4d3e8b0b6d165c4fb0f5aec000000817b741aa3125e054a5b8f8bd01fe9cc73f962685a7dd1388d55d78f08ea7f35b87b6afb7e650f78f3092bc2e8e0c9dc19733789f024901a19604f0c0e3b5ce654f2264eae6d5fd356c32d4dfee1cfeeca424fbea09b6b4f23a76ddcd13cde90ef030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac0000 +AwACAAAAAAAAACECzlcvnZ6gd3iIpSkrfar7BHZ0rn6A5BhNaBnS5WIFzZQAAQAAAQAAIQOTffxJXoC2ibSgKBY4USEl0ghinLEsfhb3+ZhJyESGsQDGAQFB17TACeONZItvECoxL87G2Q7kYYqkY54fRbEuMJK2GwAAAADw3xcalSmYGbAKWHG6DWoo7glEb1Ahx3fRv9lPAry8F9Tes72w5ePsQA9erMWLb8169NPosLbRZcT7D1rsAAAAgXt0GqMSXgVKW4+L0B/pzHP5YmhafdE4jVXXjwjqfzW4e2r7fmUPePMJK8Lo4MncGXM3ifAkkBoZYE8MDjtc5lTyJk6ubV/TVsMtTf7hz+7KQk++oJtrTyOnbdzRPN6Q7wMACAABQde0wAnjjWSLbxAqMS/OxtkO5GGKpGOeH0WxLjCSthsAAAAAakcwRAIgTRXN1YLPPxkEuDZY8YNTEWJm1PnzQVnLK6Nm9filM6kCIAnceitSGON6+kGyJOAwiQmH3fc9KKD1HVZjxzU1RqKsgSEDjAGTP8SOVmyKRA1AFJ09Z6DpSkpKG/2W6yoZkbdEpqn/////AgDh9QUAAAAAAmoATAsDAAAAAAAZdqkUqbOLVJvcX5fQTHXtnWdnozAJ6jWIrAAAAAAkAQEA4fUFAAAAABl2qRQXBFbG+qZUAgtxgGp4/bvN4WZoV4isAAA= + +{ + "$version": "1", + "type": 2, + "asset_lock_proof": { + "instant_lock": { + "0": 1, + "1": 1, + "2": 65, + "3": 215, + "4": 180, + "5": 192, + "6": 9, + "7": 227, + "8": 141, + "9": 100, + "10": 139, + "11": 111, + "12": 16, + "13": 42, + "14": 49, + "15": 47, + "16": 206, + "17": 198, + "18": 217, + "19": 14, + "20": 228, + "21": 97, + "22": 138, + "23": 164, + "24": 99, + "25": 158, + "26": 31, + "27": 69, + "28": 177, + "29": 46, + "30": 48, + "31": 146, + "32": 182, + "33": 27, + "34": 0, + "35": 0, + "36": 0, + "37": 0, + "38": 240, + "39": 223, + "40": 23, + "41": 26, + "42": 149, + "43": 41, + "44": 152, + "45": 25, + "46": 176, + "47": 10, + "48": 88, + "49": 113, + "50": 186, + "51": 13, + "52": 106, + "53": 40, + "54": 238, + "55": 9, + "56": 68, + "57": 111, + "58": 80, + "59": 33, + "60": 199, + "61": 119, + "62": 209, + "63": 191, + "64": 217, + "65": 79, + "66": 2, + "67": 188, + "68": 188, + "69": 23, + "70": 212, + "71": 222, + "72": 179, + "73": 189, + "74": 176, + "75": 229, + "76": 227, + "77": 236, + "78": 64, + "79": 15, + "80": 94, + "81": 172, + "82": 197, + "83": 139, + "84": 111, + "85": 205, + "86": 122, + "87": 244, + "88": 211, + "89": 232, + "90": 176, + "91": 182, + "92": 209, + "93": 101, + "94": 196, + "95": 251, + "96": 15, + "97": 90, + "98": 236, + "99": 0, + "100": 0, + "101": 0, + "102": 129, + "103": 123, + "104": 116, + "105": 26, + "106": 163, + "107": 18, + "108": 94, + "109": 5, + "110": 74, + "111": 91, + "112": 143, + "113": 139, + "114": 208, + "115": 31, + "116": 233, + "117": 204, + "118": 115, + "119": 249, + "120": 98, + "121": 104, + "122": 90, + "123": 125, + "124": 209, + "125": 56, + "126": 141, + "127": 85, + "128": 215, + "129": 143, + "130": 8, + "131": 234, + "132": 127, + "133": 53, + "134": 184, + "135": 123, + "136": 106, + "137": 251, + "138": 126, + "139": 101, + "140": 15, + "141": 120, + "142": 243, + "143": 9, + "144": 43, + "145": 194, + "146": 232, + "147": 224, + "148": 201, + "149": 220, + "150": 25, + "151": 115, + "152": 55, + "153": 137, + "154": 240, + "155": 36, + "156": 144, + "157": 26, + "158": 25, + "159": 96, + "160": 79, + "161": 12, + "162": 14, + "163": 59, + "164": 92, + "165": 230, + "166": 84, + "167": 242, + "168": 38, + "169": 78, + "170": 174, + "171": 109, + "172": 95, + "173": 211, + "174": 86, + "175": 195, + "176": 45, + "177": 77, + "178": 254, + "179": 225, + "180": 207, + "181": 238, + "182": 202, + "183": 66, + "184": 79, + "185": 190, + "186": 160, + "187": 155, + "188": 107, + "189": 79, + "190": 35, + "191": 167, + "192": 109, + "193": 220, + "194": 209, + "195": 60, + "196": 222, + "197": 144 + }, + "transaction": { + "0": 3, + "1": 0, + "2": 8, + "3": 0, + "4": 1, + "5": 65, + "6": 215, + "7": 180, + "8": 192, + "9": 9, + "10": 227, + "11": 141, + "12": 100, + "13": 139, + "14": 111, + "15": 16, + "16": 42, + "17": 49, + "18": 47, + "19": 206, + "20": 198, + "21": 217, + "22": 14, + "23": 228, + "24": 97, + "25": 138, + "26": 164, + "27": 99, + "28": 158, + "29": 31, + "30": 69, + "31": 177, + "32": 46, + "33": 48, + "34": 146, + "35": 182, + "36": 27, + "37": 0, + "38": 0, + "39": 0, + "40": 0, + "41": 106, + "42": 71, + "43": 48, + "44": 68, + "45": 2, + "46": 32, + "47": 77, + "48": 21, + "49": 205, + "50": 213, + "51": 130, + "52": 207, + "53": 63, + "54": 25, + "55": 4, + "56": 184, + "57": 54, + "58": 88, + "59": 241, + "60": 131, + "61": 83, + "62": 17, + "63": 98, + "64": 102, + "65": 212, + "66": 249, + "67": 243, + "68": 65, + "69": 89, + "70": 203, + "71": 43, + "72": 163, + "73": 102, + "74": 245, + "75": 248, + "76": 165, + "77": 51, + "78": 169, + "79": 2, + "80": 32, + "81": 9, + "82": 220, + "83": 122, + "84": 43, + "85": 82, + "86": 24, + "87": 227, + "88": 122, + "89": 250, + "90": 65, + "91": 178, + "92": 36, + "93": 224, + "94": 48, + "95": 137, + "96": 9, + "97": 135, + "98": 221, + "99": 247, + "100": 61, + "101": 40, + "102": 160, + "103": 245, + "104": 29, + "105": 86, + "106": 99, + "107": 199, + "108": 53, + "109": 53, + "110": 70, + "111": 162, + "112": 172, + "113": 129, + "114": 33, + "115": 3, + "116": 140, + "117": 1, + "118": 147, + "119": 63, + "120": 196, + "121": 142, + "122": 86, + "123": 108, + "124": 138, + "125": 68, + "126": 13, + "127": 64, + "128": 20, + "129": 157, + "130": 61, + "131": 103, + "132": 160, + "133": 233, + "134": 74, + "135": 74, + "136": 74, + "137": 27, + "138": 253, + "139": 150, + "140": 235, + "141": 42, + "142": 25, + "143": 145, + "144": 183, + "145": 68, + "146": 166, + "147": 169, + "148": 255, + "149": 255, + "150": 255, + "151": 255, + "152": 2, + "153": 0, + "154": 225, + "155": 245, + "156": 5, + "157": 0, + "158": 0, + "159": 0, + "160": 0, + "161": 2, + "162": 106, + "163": 0, + "164": 76, + "165": 11, + "166": 3, + "167": 0, + "168": 0, + "169": 0, + "170": 0, + "171": 0, + "172": 25, + "173": 118, + "174": 169, + "175": 20, + "176": 169, + "177": 179, + "178": 139, + "179": 84, + "180": 155, + "181": 220, + "182": 95, + "183": 151, + "184": 208, + "185": 76, + "186": 117, + "187": 237, + "188": 157, + "189": 103, + "190": 103, + "191": 163, + "192": 48, + "193": 9, + "194": 234, + "195": 53, + "196": 136, + "197": 172, + "198": 0, + "199": 0, + "200": 0, + "201": 0, + "202": 36, + "203": 1, + "204": 1, + "205": 0, + "206": 225, + "207": 245, + "208": 5, + "209": 0, + "210": 0, + "211": 0, + "212": 0, + "213": 25, + "214": 118, + "215": 169, + "216": 20, + "217": 23, + "218": 4, + "219": 86, + "220": 198, + "221": 250, + "222": 166, + "223": 84, + "224": 2, + "225": 11, + "226": 113, + "227": 128, + "228": 106, + "229": 120, + "230": 253, + "231": 187, + "232": 205, + "233": 225, + "234": 102, + "235": 104, + "236": 87, + "237": 136, + "238": 172 + }, + "output_index": 0 + }, + "public_keys": [ + { + "$version": "0", + "id": 0, + "type": 0, + "purpose": 0, + "security_level": 0, + "contract_bounds": null, + "read_only": false, + "data": { + "0": 2, + "1": 206, + "2": 87, + "3": 47, + "4": 157, + "5": 158, + "6": 160, + "7": 119, + "8": 120, + "9": 136, + "10": 165, + "11": 41, + "12": 43, + "13": 125, + "14": 170, + "15": 251, + "16": 4, + "17": 118, + "18": 116, + "19": 174, + "20": 126, + "21": 128, + "22": 228, + "23": 24, + "24": 77, + "25": 104, + "26": 25, + "27": 210, + "28": 229, + "29": 98, + "30": 5, + "31": 205, + "32": 148 + }, + "signature": { + "0": 31, + "1": 53, + "2": 214, + "3": 201, + "4": 157, + "5": 141, + "6": 196, + "7": 132, + "8": 180, + "9": 180, + "10": 177, + "11": 60, + "12": 211, + "13": 154, + "14": 196, + "15": 21, + "16": 231, + "17": 132, + "18": 105, + "19": 105, + "20": 184, + "21": 208, + "22": 102, + "23": 250, + "24": 72, + "25": 4, + "26": 126, + "27": 180, + "28": 17, + "29": 99, + "30": 91, + "31": 176, + "32": 244, + "33": 29, + "34": 210, + "35": 145, + "36": 145, + "37": 196, + "38": 205, + "39": 216, + "40": 253, + "41": 26, + "42": 154, + "43": 90, + "44": 53, + "45": 33, + "46": 103, + "47": 239, + "48": 193, + "49": 21, + "50": 228, + "51": 23, + "52": 28, + "53": 131, + "54": 194, + "55": 175, + "56": 111, + "57": 162, + "58": 13, + "59": 36, + "60": 159, + "61": 42, + "62": 124, + "63": 248, + "64": 47 + } + }, + { + "$version": "0", + "id": 1, + "type": 0, + "purpose": 0, + "security_level": 1, + "contract_bounds": null, + "read_only": false, + "data": { + "0": 3, + "1": 147, + "2": 125, + "3": 252, + "4": 73, + "5": 94, + "6": 128, + "7": 182, + "8": 137, + "9": 180, + "10": 160, + "11": 40, + "12": 22, + "13": 56, + "14": 81, + "15": 33, + "16": 37, + "17": 210, + "18": 8, + "19": 98, + "20": 156, + "21": 177, + "22": 44, + "23": 126, + "24": 22, + "25": 247, + "26": 249, + "27": 152, + "28": 73, + "29": 200, + "30": 68, + "31": 134, + "32": 177 + }, + "signature": { + "0": 31, + "1": 117, + "2": 118, + "3": 165, + "4": 99, + "5": 249, + "6": 213, + "7": 85, + "8": 137, + "9": 92, + "10": 62, + "11": 19, + "12": 40, + "13": 78, + "14": 48, + "15": 125, + "16": 177, + "17": 38, + "18": 180, + "19": 161, + "20": 65, + "21": 133, + "22": 94, + "23": 157, + "24": 99, + "25": 123, + "26": 147, + "27": 173, + "28": 138, + "29": 130, + "30": 213, + "31": 6, + "32": 205, + "33": 68, + "34": 131, + "35": 227, + "36": 48, + "37": 82, + "38": 102, + "39": 48, + "40": 8, + "41": 234, + "42": 175, + "43": 135, + "44": 18, + "45": 107, + "46": 123, + "47": 30, + "48": 46, + "49": 155, + "50": 155, + "51": 254, + "52": 197, + "53": 18, + "54": 164, + "55": 170, + "56": 110, + "57": 165, + "58": 51, + "59": 123, + "60": 33, + "61": 34, + "62": 220, + "63": 91, + "64": 148 + } + } + ], + "user_fee_increase": 0, + "identity_id": { + "0": 112, + "1": 224, + "2": 61, + "3": 31, + "4": 111, + "5": 42, + "6": 193, + "7": 97, + "8": 70, + "9": 110, + "10": 203, + "11": 242, + "12": 157, + "13": 115, + "14": 115, + "15": 193, + "16": 88, + "17": 212, + "18": 110, + "19": 197, + "20": 93, + "21": 123, + "22": 112, + "23": 15, + "24": 249, + "25": 148, + "26": 55, + "27": 179, + "28": 94, + "29": 137, + "30": 208, + "31": 48 + }, + "signature": { + "0": 31, + "1": 157, + "2": 64, + "3": 234, + "4": 240, + "5": 148, + "6": 193, + "7": 179, + "8": 93, + "9": 146, + "10": 216, + "11": 48, + "12": 143, + "13": 175, + "14": 53, + "15": 137, + "16": 193, + "17": 250, + "18": 120, + "19": 142, + "20": 49, + "21": 225, + "22": 234, + "23": 112, + "24": 168, + "25": 134, + "26": 83, + "27": 209, + "28": 159, + "29": 236, + "30": 160, + "31": 254, + "32": 230, + "33": 111, + "34": 98, + "35": 99, + "36": 44, + "37": 88, + "38": 216, + "39": 130, + "40": 213, + "41": 242, + "42": 114, + "43": 241, + "44": 90, + "45": 213, + "46": 165, + "47": 172, + "48": 7, + "49": 162, + "50": 212, + "51": 135, + "52": 223, + "53": 122, + "54": 131, + "55": 243, + "56": 146, + "57": 41, + "58": 137, + "59": 74, + "60": 107, + "61": 163, + "62": 186, + "63": 212, + "64": 199 + } +} +DEBUG Struct IdentityCreateTransitionV0: $version +DEBUG Struct IdentityCreateTransitionV0: public_keys +DEBUG Struct IdentityPublicKeyInCreationV0: $version +DEBUG Struct IdentityPublicKeyInCreationV0: id +DEBUG Struct IdentityPublicKeyInCreationV0: type +DEBUG Struct IdentityPublicKeyInCreationV0: purpose +DEBUG Struct IdentityPublicKeyInCreationV0: security_level +DEBUG Struct IdentityPublicKeyInCreationV0: contract_bounds +DEBUG Struct IdentityPublicKeyInCreationV0: read_only +DEBUG Struct IdentityPublicKeyInCreationV0: data +DEBUG Struct IdentityPublicKeyInCreationV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 77, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>, + byteLength: 77 + } + }, + idx: 44, + options: { signable: false } +} Uint8Array(65) [ + 31, 53, 214, 201, 157, 141, 196, 132, 180, 180, 177, + 60, 211, 154, 196, 21, 231, 132, 105, 105, 184, 208, + 102, 250, 72, 4, 126, 180, 17, 99, 91, 176, 244, + 29, 210, 145, 145, 196, 205, 216, 253, 26, 154, 90, + 53, 33, 103, 239, 193, 21, 228, 23, 28, 131, 194, + 175, 111, 162, 13, 36, 159, 42, 124, 248, 47 +] +DEBUG Struct IdentityPublicKeyInCreationV0: $version +DEBUG Struct IdentityPublicKeyInCreationV0: id +DEBUG Struct IdentityPublicKeyInCreationV0: type +DEBUG Struct IdentityPublicKeyInCreationV0: purpose +DEBUG Struct IdentityPublicKeyInCreationV0: security_level +DEBUG Struct IdentityPublicKeyInCreationV0: contract_bounds +DEBUG Struct IdentityPublicKeyInCreationV0: read_only +DEBUG Struct IdentityPublicKeyInCreationV0: data +DEBUG Struct IdentityPublicKeyInCreationV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 175, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 41 1f 35 d6 c9 9d 8d c4 84 b4 b4 b1 3c d3 9a c4 15 e7 84 69 69 b8 d0 66 fa 48 04 7e b4 11 63 5b b0 f4 1d d2 91 91 c4 cd d8 fd 1a 9a 5a 35 21 67 ef c1 15 e4 17 1c 83 c2 ... 75 more bytes>, + byteLength: 175 + } + }, + idx: 151, + options: { signable: false } +} Uint8Array(65) [ + 31, 117, 118, 165, 99, 249, 213, 85, 137, 92, 62, + 19, 40, 78, 48, 125, 177, 38, 180, 161, 65, 133, + 94, 157, 99, 123, 147, 173, 138, 130, 213, 6, 205, + 68, 131, 227, 48, 82, 102, 48, 8, 234, 175, 135, + 18, 107, 123, 30, 46, 155, 155, 254, 197, 18, 164, + 170, 110, 165, 51, 123, 33, 34, 220, 91, 148 +] +DEBUG Struct IdentityCreateTransitionV0: asset_lock_proof +DEBUG Struct RawInstantLockProof: instant_lock +DEBUG Struct RawInstantLockProof: transaction +DEBUG Struct RawInstantLockProof: output_index +DEBUG Struct IdentityCreateTransitionV0: user_fee_increase +DEBUG Struct IdentityCreateTransitionV0: signature +DEBUG NotSignable BinCode { + dataview: DataView { + byteLength: 700, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 41 1f 35 d6 c9 9d 8d c4 84 b4 b4 b1 3c d3 9a c4 15 e7 84 69 69 b8 d0 66 fa 48 04 7e b4 11 63 5b b0 f4 1d d2 91 91 c4 cd d8 fd 1a 9a 5a 35 21 67 ef c1 15 e4 17 1c 83 c2 ... 600 more bytes>, + byteLength: 700 + } + }, + idx: 659, + options: { signable: false } +} Uint8Array(65) [ + 31, 157, 64, 234, 240, 148, 193, 179, 93, 146, + 216, 48, 143, 175, 53, 137, 193, 250, 120, 142, + 49, 225, 234, 112, 168, 134, 83, 209, 159, 236, + 160, 254, 230, 111, 98, 99, 44, 88, 216, 130, + 213, 242, 114, 241, 90, 213, 165, 172, 7, 162, + 212, 135, 223, 122, 131, 243, 146, 41, 137, 74, + 107, 163, 186, 212, 199 +] +DEBUG Struct IdentityCreateTransitionV0: identity_id +DEBUG NotSignable> BinCode { + dataview: DataView { + byteLength: 1400, + byteOffset: 0, + buffer: ArrayBuffer { + [Uint8Contents]: <03 00 02 00 00 00 00 00 00 00 21 02 ce 57 2f 9d 9e a0 77 78 88 a5 29 2b 7d aa fb 04 76 74 ae 7e 80 e4 18 4d 68 19 d2 e5 62 05 cd 94 41 1f 35 d6 c9 9d 8d c4 84 b4 b4 b1 3c d3 9a c4 15 e7 84 69 69 b8 d0 66 fa 48 04 7e b4 11 63 5b b0 f4 1d d2 91 91 c4 cd d8 fd 1a 9a 5a 35 21 67 ef c1 15 e4 17 1c 83 c2 ... 1300 more bytes>, + byteLength: 1400 + } + }, + idx: 725, + options: { signable: false } +} Uint8Array(32) [ + 112, 224, 61, 31, 111, 42, 193, 97, + 70, 110, 203, 242, 157, 115, 115, 193, + 88, 212, 110, 197, 93, 123, 112, 15, + 249, 148, 55, 179, 94, 137, 208, 48 +] +DEBUG val, idx Uint8Array(32) [ + 112, 224, 61, 31, 111, 42, 193, 97, + 70, 110, 203, 242, 157, 115, 115, 193, + 88, 212, 110, 197, 93, 123, 112, 15, + 249, 148, 55, 179, 94, 137, 208, 48 +] 725 + +transition (fully signed): +030002000000000000002102ce572f9d9ea0777888a5292b7daafb047674ae7e80e4184d6819d2e56205cd94411f35d6c99d8dc484b4b4b13cd39ac415e7846969b8d066fa48047eb411635bb0f41dd29191c4cdd8fd1a9a5a352167efc115e4171c83c2af6fa20d249f2a7cf82f000100000100002103937dfc495e80b689b4a0281638512125d208629cb12c7e16f7f99849c84486b1411f7576a563f9d555895c3e13284e307db126b4a141855e9d637b93ad8a82d506cd4483e33052663008eaaf87126b7b1e2e9b9bfec512a4aa6ea5337b2122dc5b9400c6010141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b00000000f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17d4deb3bdb0e5e3ec400f5eacc58b6fcd7af4d3e8b0b6d165c4fb0f5aec000000817b741aa3125e054a5b8f8bd01fe9cc73f962685a7dd1388d55d78f08ea7f35b87b6afb7e650f78f3092bc2e8e0c9dc19733789f024901a19604f0c0e3b5ce654f2264eae6d5fd356c32d4dfee1cfeeca424fbea09b6b4f23a76ddcd13cde90ef030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac0000411f9d40eaf094c1b35d92d8308faf3589c1fa788e31e1ea70a88653d19feca0fee66f62632c58d882d5f272f15ad5a5ac07a2d487df7a83f39229894a6ba3bad4c770e03d1f6f2ac161466ecbf29d7373c158d46ec55d7b700ff99437b35e89d030 + +grpcurl -plaintext -d '{ + "stateTransition": "AwACAAAAAAAAACECzlcvnZ6gd3iIpSkrfar7BHZ0rn6A5BhNaBnS5WIFzZRBHzXWyZ2NxIS0tLE805rEFeeEaWm40Gb6SAR+tBFjW7D0HdKRkcTN2P0amlo1IWfvwRXkFxyDwq9vog0knyp8+C8AAQAAAQAAIQOTffxJXoC2ibSgKBY4USEl0ghinLEsfhb3+ZhJyESGsUEfdXalY/nVVYlcPhMoTjB9sSa0oUGFXp1je5OtioLVBs1Eg+MwUmYwCOqvhxJrex4um5v+xRKkqm6lM3shItxblADGAQFB17TACeONZItvECoxL87G2Q7kYYqkY54fRbEuMJK2GwAAAADw3xcalSmYGbAKWHG6DWoo7glEb1Ahx3fRv9lPAry8F9Tes72w5ePsQA9erMWLb8169NPosLbRZcT7D1rsAAAAgXt0GqMSXgVKW4+L0B/pzHP5YmhafdE4jVXXjwjqfzW4e2r7fmUPePMJK8Lo4MncGXM3ifAkkBoZYE8MDjtc5lTyJk6ubV/TVsMtTf7hz+7KQk++oJtrTyOnbdzRPN6Q7wMACAABQde0wAnjjWSLbxAqMS/OxtkO5GGKpGOeH0WxLjCSthsAAAAAakcwRAIgTRXN1YLPPxkEuDZY8YNTEWJm1PnzQVnLK6Nm9filM6kCIAnceitSGON6+kGyJOAwiQmH3fc9KKD1HVZjxzU1RqKsgSEDjAGTP8SOVmyKRA1AFJ09Z6DpSkpKG/2W6yoZkbdEpqn/////AgDh9QUAAAAAAmoATAsDAAAAAAAZdqkUqbOLVJvcX5fQTHXtnWdnozAJ6jWIrAAAAAAkAQEA4fUFAAAAABl2qRQXBFbG+qZUAgtxgGp4/bvN4WZoV4isAABBH51A6vCUwbNdktgwj681icH6eI4x4epwqIZT0Z/soP7mb2JjLFjYgtXycvFa1aWsB6LUh996g/OSKYlKa6O61Mdw4D0fbyrBYUZuy/Kdc3PBWNRuxV17cA/5lDezXonQMA==" +}' seed-1.testnet.networks.dash.org:1443 org.dash.platform.dapi.v0.Platform.broadcastStateTransition diff --git a/attempt-5/master.yQA85bswTqvRL7FBaLER8vmFCuqfqdram8.wif b/attempt-5/master.yQA85bswTqvRL7FBaLER8vmFCuqfqdram8.wif new file mode 100644 index 0000000..57bfb2f --- /dev/null +++ b/attempt-5/master.yQA85bswTqvRL7FBaLER8vmFCuqfqdram8.wif @@ -0,0 +1 @@ +cNgmaNzP7vDYjyBqPP6itVi2eg5ZTWLE9UnnCUUmiMvyqCnXdkx1 diff --git a/attempt-5/other.yVNJBxBHsKTdScDkB3cMq3N6kJ3VKu7kgh.wif b/attempt-5/other.yVNJBxBHsKTdScDkB3cMq3N6kJ3VKu7kgh.wif new file mode 100644 index 0000000..41fbdb0 --- /dev/null +++ b/attempt-5/other.yVNJBxBHsKTdScDkB3cMq3N6kJ3VKu7kgh.wif @@ -0,0 +1 @@ +cQwjaGu3HHPseyyNX6JVth3FEbADYepPxsTH3BVk8cWRX3oNw8Gr diff --git a/attempt-5/rawtxlocksig.hex b/attempt-5/rawtxlocksig.hex new file mode 100644 index 0000000..7a77344 --- /dev/null +++ b/attempt-5/rawtxlocksig.hex @@ -0,0 +1 @@ +030008000141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b000000006a47304402204d15cdd582cf3f1904b83658f18353116266d4f9f34159cb2ba366f5f8a533a9022009dc7a2b5218e37afa41b224e030890987ddf73d28a0f51d5663c7353546a2ac8121038c01933fc48e566c8a440d40149d3d67a0e94a4a4a1bfd96eb2a1991b744a6a9ffffffff0200e1f50500000000026a004c0b0300000000001976a914a9b38b549bdc5f97d04c75ed9d6767a33009ea3588ac0000000024010100e1f505000000001976a914170456c6faa654020b71806a78fdbbcde166685788ac010141d7b4c009e38d648b6f102a312fcec6d90ee4618aa4639e1f45b12e3092b61b00000000f0df171a95299819b00a5871ba0d6a28ee09446f5021c777d1bfd94f02bcbc17d4deb3bdb0e5e3ec400f5eacc58b6fcd7af4d3e8b0b6d165c4fb0f5aec000000817b741aa3125e054a5b8f8bd01fe9cc73f962685a7dd1388d55d78f08ea7f35b87b6afb7e650f78f3092bc2e8e0c9dc19733789f024901a19604f0c0e3b5ce654f2264eae6d5fd356c32d4dfee1cfeeca424fbea09b6b4f23a76ddcd13cde90 diff --git a/bincode.js b/bincode.js new file mode 100644 index 0000000..eb57e26 --- /dev/null +++ b/bincode.js @@ -0,0 +1,843 @@ +import { toHex } from "./hex.js"; + +/** + * @template T + * @typedef BinCodeable + * @prop {string} name + * @prop {(bc: BinCode, value: T) => void} encode + * @prop {(bc: BinCode) => T} decode + */ + +/** + * @typedef BinCodeOptions + * @prop {Boolean} [signable] + */ + +/** + * @template T + * @param {BinCodeable} _type + * @param {BinCodeOptions} options + * @param {T} value + */ +export function encode(_type, value, options = {}) { + let ab = new ArrayBuffer(16); + let dv = new DataView(ab); + const bc = new BinCode(dv, 0, options); + _type.encode(bc, value); + return bc.slice(); +} + +/** + * @template T + * @param {BinCodeable} _type + * @param {ArrayBuffer} value + */ +export function decode(_type, value, options = {}) { + const bc = new BinCode(new DataView(value), 0, options); + return _type.decode(bc); +} + +export class BinCode { + /** + * + * @param {DataView} dataview + * @param {number} idx + * @param {any} options + */ + constructor(dataview, idx = 0, options = {}) { + this.dataview = dataview; + this.idx = idx; + this.options = options; + } + + /** + * Returns the slice from 0 to the current index, when done writing. + */ + slice() { + return this.dataview.buffer.slice(0, this.idx); + } + + /** + * @param {number} add + */ + _idxThenAdd(add) { + let idx = this.idx; + this.idx += add; + return idx; + } + + /** + * Returns the current index, before advancing it by `add`. If there are not enough + * bytes in the current dataview, replaces it a new one twice the size. + * @param {number} add + */ + _idxThenAddExtend(add) { + let idx = this.idx; + this.idx += add; + if (this.idx > this.dataview.byteLength) { + // not enough space, extend the dataview + let newlen = Math.max(this.dataview.byteLength * 2, this.idx + add); + let newab = new ArrayBuffer(newlen < 16 ? 32 : newlen); + new Uint8Array(newab).set(new Uint8Array(this.dataview.buffer), 0); + // console.log("Extending BinCode dataview: ", this.idx, add, this.dataview.byteLength, this.dataview.buffer, ' -> ', newab); + this.dataview = new DataView(newab); + } + return idx; + } + + /** + * @param {any} msg + */ + _debug(msg) { + console.log( + "DEBUG: " + + msg + + " at " + + this.idx + + ": " + + toHex(this.dataview.buffer.slice(this.idx)), + ); + } +} + +/** + * @template T + * @param {BinCodeable} inner + * @returns {BinCodeable} + */ +export function Vec(inner) { + return { + name: "Vec<" + inner.name + ">", + encode(bc, val) { + VarUint.encode(bc, val.length); + for (let i = 0; i < val.length; i++) { + inner.encode(bc, val[i]); + } + }, + decode(bc) { + let len = VarUint.decode(bc); + /** @type {any[]} */ + let val = new Array(len); + for (let i = 0; i < len; i++) { + val[i] = inner.decode(bc); + } + return val; + }, + }; +} + +/** + * @template {{}} T + * @param {string} name + * @param {{[k in keyof T]: BinCodeable}} inner + * @returns {BinCodeable} + */ +export function Struct(name, inner) { + return { + name, + encode(bc, val) { + for (const innerKey in inner) { + console.log(`DEBUG Struct ${name}:`, innerKey); + // const startIdx = bc.idx; + inner[innerKey].encode(bc, val[innerKey]); + // console.log('DEBUG:', 'encode', name + '.' + innerKey, '=', val[innerKey], 'at', startIdx, toHex(bc.dataview.buffer.slice(startIdx, bc.idx))); + } + }, + decode(bc) { + /** @type {any} */ + let val = {}; + for (const innerKey in inner) { + // bc._debug('decode ' + name + '.' + innerKey + ' as ' + inner[innerKey].name); + val[innerKey] = inner[innerKey].decode(bc); + // console.log('DEBUG:', 'decode', name + '.' + innerKey, '=', val[innerKey]); + } + return val; + }, + }; +} + +/** + * @template T + * @typedef {{[k in keyof T]: T[k] extends BinCodeable? U : never}[keyof T]} EnumType + */ + +/** + * @template T + * @typedef {T extends infer U? {[k in keyof U]: U[k]} : never} Expand + */ + +/** + * @template {{[k: number]: BinCodeable}} T + * @param {string} name + * @param {(val: EnumType) => number} toDiscriminant + * @param {T} definitions + * @returns {BinCodeable>} + */ +export function Enum(name, toDiscriminant, definitions) { + return { + name, + encode(bc, val) { + const discriminant = toDiscriminant(val); + VarUint.encode(bc, discriminant); + definitions[discriminant].encode(bc, val); + }, + decode(bc) { + const discriminant = Number(VarUint.decode(bc)); + if (!(discriminant in definitions)) + throw new Error( + "Enum " + name + " decode failed, bad discriminant: " + discriminant, + ); + return definitions[discriminant].decode(bc); + }, + }; +} + +/** + * @template T + * @param {BinCodeable} inner + */ +export function Option(inner) { + let name = `Option<${inner.name}>`; + + /** @param {any?} [x] */ + function getIndex(x) { + if (x === null || "undefined" === typeof x) { + return 0; + } + return 1; + } + + let values = { + 0: Null, + 1: inner, + }; + return Enum(name, getIndex, values); +} + +/** + * @template T + * @param {() => BinCodeable} makeBincodeable + * @returns {BinCodeable} + */ +export function Lazy(makeBincodeable) { + /** @type {BinCodeable | undefined} */ + let bincodeable = undefined; + return { + get name() { + if (!bincodeable) bincodeable = makeBincodeable(); + return bincodeable.name; + }, + encode(bc, val) { + if (!bincodeable) bincodeable = makeBincodeable(); + bincodeable.encode(bc, val); + }, + decode(bc) { + if (!bincodeable) bincodeable = makeBincodeable(); + return bincodeable.decode(bc); + }, + }; +} + +/** @type {BinCodeable} */ +export const TODO = { + name: "TODO", + encode(bc, num) { + throw new Error("TODO"); + }, + decode(bc) { + throw new Error("TODO"); + }, +}; + +/** @type {BinCodeable} */ +export const Nothing = { + name: "Nothing", + encode(bc, num) {}, + decode(bc) {}, +}; + +/** @type {BinCodeable} */ +export const Null = { + name: "Null", + encode(bc, num) {}, + decode(bc) { + return null; + }, +}; + +/** + * Constant doesn't encode or decode any bytes, it just always decodes to the constant value. + * @template T + * @param {T} value + * @returns {BinCodeable} + */ +export function Constant(value) { + return { + name: "Constant<" + value + ">", + encode(bc, num) {}, + decode(bc) { + return value; + }, + }; +} + +/** @type {BinCodeable} */ +export const Uint8 = { + name: "Uint8", + encode(bc, num) { + bc.dataview.setUint8(bc._idxThenAddExtend(1), num); + }, + decode(bc) { + return bc.dataview.getUint8(bc._idxThenAdd(1)); + }, +}; + +/** @type {BinCodeable} */ +export const Uint16 = { + name: "Uint16", + encode(bc, num) { + bc.dataview.setUint16(bc._idxThenAddExtend(2), num, true); + }, + decode(bc) { + return bc.dataview.getUint16(bc._idxThenAdd(2)); + }, +}; + +/** @type {BinCodeable} */ +export const Uint32 = { + name: "Uint32", + encode(bc, num) { + bc.dataview.setUint32(bc._idxThenAddExtend(4), num, true); + }, + decode(bc) { + return bc.dataview.getUint32(bc._idxThenAdd(4)); + }, +}; + +/** @type {BinCodeable} */ +export const Uint64 = { + name: "Uint64", + encode(bc, num) { + bc.dataview.setBigUint64(bc._idxThenAddExtend(8), num, true); + }, + decode(bc) { + return bc.dataview.getBigUint64(bc._idxThenAdd(8)); + }, +}; + +/** @type {BinCodeable} */ +export const Uint128 = { + name: "Uint128", + encode(bc, num) { + let a = BigInt.asUintN(64, num); + let b = BigInt.asUintN(64, num >> 64n); + bc.dataview.setBigUint64(bc._idxThenAddExtend(8), a, true); + bc.dataview.setBigUint64(bc._idxThenAddExtend(8), b, true); + }, + decode(bc) { + let a = Uint64.decode(bc); + let b = Uint64.decode(bc); + return BigInt(a.toString() + b.toString()); + }, +}; + +/** + * @param {bigint} u + */ +function _zigzag(u) { + if (u == 0n) return 0n; + + // To avoid the edge case of Signed::min_value() + // !n is equal to `-n - 1`, so this is: + // !n * 2 + 1 = 2(-n - 1) + 1 = -2n - 2 + 1 = -2n - 1 + if (u < 0) return (-u - 1n) * 2n - 1n; + if (u > 0) return u * 2n; + throw new Error("_zigzag error: " + u); +} + +/** + * @param {bigint} u + */ +function _unzigzag(u) { + if (u % 2n == 0n) { + // positive number + return u >> 1n; + } else { + // negative number + // !m * 2 + 1 = u + // !m * 2 = u - 1 + // !m = (u - 1) / 2 + // m = !((u - 1) / 2) + // since we have u is odd, we have floor(u / 2) = floor((u - 1) / 2) + return (-u >> 1n) - 1n; + } +} + +/** + * @param {bigint} value + */ +function _fitsInNumber(value) { + return value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER; +} + +/** @type {BinCodeable} */ +export const VarUint = { + name: "VarUint", + encode(bc, num) { + if (typeof num === "number" && (num | 0) !== num) + throw new Error("VarUint.encode: not an integer:" + num); + if (num < 0) throw new Error("VarUint.encode: negative:" + num); + + // console.log('DEBUG:', 'VarUint.encode', num); + + if (num < 251) Uint8.encode(bc, Number(num)); + else if (251 <= num && num < 2 ** 16) { + Uint8.encode(bc, 251); + Uint16.encode(bc, Number(num)); + } else if (2 ** 16 <= num && num < 2 ** 32) { + Uint8.encode(bc, 252); + Uint32.encode(bc, Number(num)); + } + // TODO: Bignum for the rest of these + else if (2 ** 32 <= num && num < 2 ** 64) { + Uint8.encode(bc, 253); + Uint64.encode(bc, BigInt(num)); + } else if (2 ** 64 <= num && num < 2 ** 128) { + Uint8.encode(bc, 254); + Uint128.encode(bc, BigInt(num)); + } else { + throw new Error("VarUint.encode error: " + num); + } + }, + + decode(bc) { + let u = BigInt(Uint8.decode(bc)); + if (u < 251) { + } else if (u == 251n) u = BigInt(Uint16.decode(bc)); + else if (u == 252n) u = BigInt(Uint32.decode(bc)); + // TODO: Bignum for the rest of these + else if (u == 253n) u = Uint64.decode(bc); + else if (u == 254n) u = Uint128.decode(bc); + else throw new Error("VarUint.decode error: " + u); + + if (_fitsInNumber(u)) return Number(u); + return u; + }, +}; + +/** @type {BinCodeable} */ +export const VarInt = { + name: "VarInt", + encode(bc, num) { + if (typeof num === "number" && (num | 0) !== num) + throw new Error("VarInt.encode: not an integer:" + num); + + let bnum = BigInt(num); + bnum = _zigzag(bnum); + if (bnum < 251) Uint8.encode(bc, Number(bnum)); + else if (251 <= bnum && bnum < 2 ** 16) { + Uint8.encode(bc, 251); + Uint16.encode(bc, Number(bnum)); + } else if (2 ** 16 <= bnum && bnum < 2 ** 32) { + Uint8.encode(bc, 252); + Uint32.encode(bc, Number(bnum)); + } + // TODO: Bignum for the rest of these + else if (2 ** 32 <= bnum && bnum < 2 ** 64) { + Uint8.encode(bc, 253); + Uint64.encode(bc, bnum); + } else if (2 ** 64 <= bnum && bnum < 2 ** 128) { + Uint8.encode(bc, 254); + Uint128.encode(bc, bnum); + } else { + throw new Error("VarInt.encode error: " + bnum); + } + }, + + decode(bc) { + let u = BigInt(Uint8.decode(bc)); + if (u < 251) { + } else if (u == 251n) u = BigInt(Uint16.decode(bc)); + else if (u == 252n) u = BigInt(Uint32.decode(bc)); + // TODO: Bignum for the rest of these + else if (u == 253n) u = Uint64.decode(bc); + else if (u == 254n) u = Uint128.decode(bc); + else throw new Error("VarInt.decode error: " + u); + + u = _unzigzag(u); + if (_fitsInNumber(u)) return Number(u); + return u; + }, +}; + +/** @type {BinCodeable} */ +export const Bool = { + name: "Bool", + encode(bc, val) { + return Uint8.encode(bc, val ? 1 : 0); + }, + decode(bc) { + const val = Uint8.decode(bc); + if (val !== 0 && val !== 1) throw new Error("Bool decode error: " + val); + return !!val; + }, +}; + +/** @type {BinCodeable} */ +export const Bytes = { + name: "Bytes", + encode(bc, val) { + // console.log('Bytes.encode', val, val.length); + // bc._debug('Bytes.encode length') + VarUint.encode(bc, val.length); + // console.log('After slice', bc.slice()) + let idx = bc._idxThenAddExtend(val.length); + new Uint8Array(bc.dataview.buffer).set(val, idx); + }, + decode(bc) { + let length = Number(VarUint.decode(bc)); + let idx = bc._idxThenAdd(length); + return new Uint8Array(bc.dataview.buffer, idx, length); + }, +}; + +/** @type {BinCodeable} */ +export const String = { + name: "String", + encode(bc, val) { + const bytes = new TextEncoder().encode(val); + Bytes.encode(bc, bytes); + }, + decode(bc) { + const bytes = Bytes.decode(bc); + return new TextDecoder().decode(bytes); + }, +}; + +/** + * @param {number} length + * @returns {BinCodeable} + */ +export function FixedBytes(length) { + return { + name: "FixedBytes<" + length + ">", + encode(bc, val) { + let idx = bc._idxThenAddExtend(length); + let bytes = new Uint8Array(bc.dataview.buffer); + console.log(`DEBUG val, idx`, val, idx); + bytes.set(val, idx); + }, + decode(bc) { + let idx = bc._idxThenAdd(length); + return new Uint8Array(bc.dataview.buffer, idx, length); + }, + }; +} + +/** + * @template T + * @param {BinCodeable} inner + * @returns {BinCodeable} + */ +export function NotSignable(inner) { + return { + name: "NotSignable<" + inner.name + ">", + encode(bc, value) { + console.log(`DEBUG NotSignable<${inner.name}>`, bc, value); + if (!bc.options.signable) { + inner.encode(bc, value); + } + }, + decode(bc) { + if (!bc.options.signable) { + return inner.decode(bc); + } + }, + }; +} + +export const IdentityCreateTransition = Lazy(() => + Enum("IdentityCreateTransition", (x) => 0, { + 0: Struct("IdentityCreateTransitionV0", { + $version: Constant("0"), + // // When signing, we don't sign the signatures for keys + // #[platform_signable(into = "Vec")] + public_keys: Vec(IdentityPublicKeyInCreation), + asset_lock_proof: RawAssetLockProof, + user_fee_increase: UserFeeIncrease, + // #[platform_signable(exclude_from_sig_hash)] + signature: NotSignable(BinaryData), + // #[cfg_attr(feature = "state-transition-serde-conversion", serde(skip))] + // #[platform_signable(exclude_from_sig_hash)] + identity_id: NotSignable(Identifier), + }), + }), +); + +export const KeyID = VarUint; +export const Identifier = FixedBytes(32); +export const BinaryData = Bytes; +export const UserFeeIncrease = VarUint; //Uint16; +export const TimestampMillis = VarUint; //Uint64; + +export const KeyType = VarUint; // enum +export const KeyType_values = [ + "ECDSA_SECP256K1", + "BLS12_381", + "ECDSA_HASH160", + "BIP13_SCRIPT_HASH", + "EDDSA_25519_HASH160", +]; + +export const Purpose = VarUint; // enum +export const Purpose_values = [ + "AUTHENTICATION", + "ENCRYPTION", + "DECRYPTION", + "TRANSFER", + "SYSTEM", + "VOTING", +]; + +export const SecurityLevel = VarUint; // enum +export const SecurityLevel_values = ["MASTER", "CRITICAL", "HIGH", "MEDIUM"]; + +export const ContractBounds = Lazy(() => + Enum("ContractBounds", (x) => ("document_type_name" in x ? 1 : 0), { + 0: Struct("ContractBounds0", { + id: Identifier, + }), + 1: Struct("ContractBounds1", { + id: Identifier, + document_type_name: String, + }), + }), +); + +export const IdentityPublicKeyInCreation = Enum( + "IdentityPublicKeyInCreation", + (x) => +x.$version, + { + 0: Struct("IdentityPublicKeyInCreationV0", { + $version: Constant("0"), + id: KeyID, + type: KeyType, + purpose: Purpose, + security_level: SecurityLevel, + contract_bounds: Option(ContractBounds), + read_only: Bool, + data: BinaryData, + // /// The signature is needed for ECDSA_SECP256K1 Key type and BLS12_381 Key type + // #[platform_signable(exclude_from_sig_hash)] + signature: NotSignable(BinaryData), + }), + }, +); + +export const Txid = FixedBytes(32); +export const CycleHash = FixedBytes(32); +export const BLSSignature = FixedBytes(96); +export const ScriptBuf = Bytes; + +export const OutPoint = Struct("OutPoint", { + txid: Txid, + vout: Uint32, +}); + +export const InstantLock = Struct("InstantLock", { + version: Uint8, + inputs: Vec(OutPoint), + txid: Txid, + cyclehash: CycleHash, + signature: BLSSignature, +}); + +export const Witness = Struct("Witness", { + content: Bytes, + witness_elements: Uint64, + indices_start: Uint64, +}); + +export const TxIn = Struct("TxIn", { + previous_output: OutPoint, + script_sig: ScriptBuf, + sequence: Uint32, + witness: Witness, +}); + +export const TxOut = Struct("TxOut", { + value: Uint64, + script_pubkey: ScriptBuf, +}); + +export const TransactionPayload = Enum("TransactionPayload", (x) => -1, { + // TODO - we have the normal layer 1 payload already +}); + +export const Transaction = Struct("Transaction", { + version: Uint16, + lock_time: Uint32, + input: Vec(TxIn), + output: Vec(TxOut), + special_transaction_payload: Option(TransactionPayload), +}); + +export const InstantAssetLockProof = Struct("InstantAssetLockProof", { + instant_lock: InstantLock, + transaction: Transaction, + output_index: Uint32, +}); + +export const RawInstantLockProof = Struct("RawInstantLockProof", { + instant_lock: BinaryData, + transaction: BinaryData, + output_index: VarUint, //Uint32, +}); + +export const ChainAssetLockProof = Struct("ChainAssetLockProof", { + core_chain_locked_height: Uint32, + out_point: OutPoint, +}); + +export const AssetLockProof = Enum( + "AssetLockProof", + (x) => { + return isInstantLock(x) ? 0 : 1; + }, + { + 0: InstantAssetLockProof, + 1: ChainAssetLockProof, + }, +); + +/** + * @param {any | ChainAssetLockProof | InstantAssetLockProof} x + * @returns {x is InstantAssetLockProof} + */ +function isInstantLock(x) { + return "instant_lock" in x; +} + +export const RawAssetLockProof = Enum( + "RawAssetLockProof", + (x) => ("instant_lock" in x ? 0 : 1), + { + 0: RawInstantLockProof, + 1: ChainAssetLockProof, + }, +); + +export const IdentityPublicKey = Enum("IdentityPublicKey", (x) => 0, { + 0: Struct("IdentityPublicKeyV0", { + $version: Constant("0"), + id: KeyID, + purpose: Purpose, + security_level: SecurityLevel, + contract_bounds: Option(ContractBounds), + type: KeyType, + read_only: Bool, + data: BinaryData, + disabled_at: Option(TimestampMillis), + }), +}); + +/** + * This is a JSON.stringify replacer that converts keys to camelCase + * and Uint8Array to regular Array to match what to_json* does. + * @param {string} key + * @param {any} value + */ +function jsonCamelCaseReplacer(key, value) { + if (value instanceof Uint8Array) { + return Array.from(value); + } + if (value && typeof value === "object") { + /** @type {any} */ + let replacement = {}; + for (let k of Object.keys(value)) { + let newkey = k.replace(/_[a-z]/g, (val) => val[1].toUpperCase()); + replacement[newkey] = value[k]; + } + return replacement; + } + return value; +} +/** + * @param {any} value + */ +export function toJsonCamelCase(value) { + return JSON.stringify(value, jsonCamelCaseReplacer); +} + +// TODO: Implement all the other transitions +export const StateTransition = Enum("StateTransition", (x) => 3, { + // 0: DataContractCreateTransition, //DataContractCreate(DataContractCreateTransition), + // 1: DataContractUpdateTransition, //DataContractUpdate(DataContractUpdateTransition), + // 2: DocumentsBatchTransition, //DocumentsBatch(DocumentsBatchTransition), + 3: IdentityCreateTransition, //IdentityCreate(IdentityCreateTransition), + // 4: IdentityTopUpTransition, //IdentityTopUp(IdentityTopUpTransition), + // 5: IdentityCreditWithdrawalTransition, //IdentityCreditWithdrawal(IdentityCreditWithdrawalTransition), + // 6: IdentityUpdateTransition, //IdentityUpdate(IdentityUpdateTransition), + // 7: IdentityCreditTransferTransition, //IdentityCreditTransfer(IdentityCreditTransferTransition), + // 8: MasternodeVoteTransition, //MasternodeVote(MasternodeVoteTransition), +}); + +export default { + encode, + decode, + BinCode, + Vec, + Struct, + Enum, + Option, + Lazy, + TODO, + Nothing, + Null, + Constant, + Uint8, + Uint16, + Uint32, + Uint64, + Uint128, + VarUint, + VarInt, + Bool, + Bytes, + String, + FixedBytes, + NotSignable, + IdentityCreateTransition, + KeyID, + Identifier, + BinaryData, + UserFeeIncrease, + TimestampMillis, + KeyType, + KeyType_values, + Purpose, + Purpose_values, + SecurityLevel, + SecurityLevel_values, + ContractBounds, + IdentityPublicKeyInCreation, + Txid, + CycleHash, + BLSSignature, + ScriptBuf, + OutPoint, + InstantLock, + Witness, + TxIn, + TxOut, + TransactionPayload, + Transaction, + InstantAssetLockProof, + RawInstantLockProof, + ChainAssetLockProof, + AssetLockProof, + RawAssetLockProof, + IdentityPublicKey, + toJsonCamelCase, + StateTransition, +}; diff --git a/bincode.test.js b/bincode.test.js new file mode 100644 index 0000000..fa2d918 --- /dev/null +++ b/bincode.test.js @@ -0,0 +1,254 @@ +import { it, expect } from "vitest"; +import { fromHex } from "./hex.js"; +import { + decode, + encode, + Identifier, + IdentityPublicKey, + StateTransition, + StateTransitionSignable, + toJsonCamelCase, +} from "./bincode.js"; + +it("should encode/decode IdentityPublicKey", () => { + const master_key_bytes = fromHex( + "0000000000000021033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f00", + ); + const master_key = decode(IdentityPublicKey, master_key_bytes.buffer); + + const master_key_json = { + $version: "0", + id: 0, + purpose: 0, + securityLevel: 0, + contractBounds: null, + type: 0, + readOnly: false, + data: [ + 3, 58, 154, 139, 30, 76, 88, 26, 25, 135, 114, 76, 102, 151, 19, 93, 49, + 192, 126, 231, 172, 130, 126, 106, 89, 206, 192, 34, 176, 77, 81, 5, 95, + ], + disabledAt: null, + }; + expect(master_key_json).toEqual(JSON.parse(toJsonCamelCase(master_key))); + expect(master_key_bytes).toEqual( + new Uint8Array(encode(IdentityPublicKey, master_key)), + ); + + const master_private_key = fromHex( + "6c554775029f960891e3edf2d36b26a30d9a4b10034bb49f3a6c4617f557f7bc", + ); + + const other_key_bytes = fromHex( + "000100010000002102014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e200", + ); + const other_key = decode(IdentityPublicKey, other_key_bytes.buffer); + + const other_key_json = { + $version: "0", + id: 1, + purpose: 0, + securityLevel: 1, + contractBounds: null, + type: 0, + readOnly: false, + data: [ + 2, 1, 70, 3, 1, 141, 196, 55, 100, 45, 218, 22, 244, 199, 252, 80, 228, + 130, 221, 35, 226, 70, 128, 188, 179, 165, 150, 108, 59, 52, 56, 72, 226, + ], + disabledAt: null, + }; + expect(other_key_json).toEqual(JSON.parse(toJsonCamelCase(other_key))); + + const other_private_key = fromHex( + "426ae4838204206cacdfc7a2e04ac6a2d9e3c2e94df935878581c552f22b0096", + ); +}); + +it("should encode/decode Identifier", () => { + const identifier_bytes = fromHex( + "3dc908599ef8a5a3c510c430a27d4211c805556d99e5c06ffc3ca86a5feb55c3", + ); + const identifier = decode(Identifier, identifier_bytes.buffer); + + // expect(master_key_json).toEqual(JSON.parse(toJsonCamelCase(master_key))) + expect(identifier_bytes).toEqual( + new Uint8Array(encode(Identifier, identifier)), + ); +}); + +it("should encode/decode StateTransition", () => { + // const key_signable_bytes = fromHex('0300020000000000000021033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f000100000100002102014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e200c601011dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e0000000058c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b436a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c8967c46529a967b3822e1ba8a173066296d02593f0f59b3a78a30a7eef9c8a120847729e62e4a32954339286b79fe7590221331cd28d576887a263f45b595d499272f656c3f5176987c976239cac16f972d796ad82931d532102a4f95eec7d809e00000800015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac000000000200e1f50500000000026a0088130000000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac0000000024000100e1f505000000001976a914271c99481ce1460e4fd62d5a11eecc123d78ee3288ac0000') + const asset_lock_private_key = fromHex( + "33a9f0603ba69b97dff83e08b4ee36cebbc987739e9749615e1727754f2bf2d2", + ); + + const state_transition_signable_bytes = fromHex( + "0300020000000000000021033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f000100000100002102014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e200c601011dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e0000000058c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b436a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c8967c46529a967b3822e1ba8a173066296d02593f0f59b3a78a30a7eef9c8a120847729e62e4a32954339286b79fe7590221331cd28d576887a263f45b595d499272f656c3f5176987c976239cac16f972d796ad82931d532102a4f95eec7d809e00000800015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac000000000200e1f50500000000026a0088130000000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac0000000024000100e1f505000000001976a914271c99481ce1460e4fd62d5a11eecc123d78ee3288ac0000", + ); + const state_transition_signable = decode( + StateTransition, + state_transition_signable_bytes.buffer, + { signable: true }, + ); + expect(state_transition_signable_bytes).toEqual( + new Uint8Array( + encode(StateTransition, state_transition_signable, { signable: true }), + ), + ); + + // asset_lock_proof + // + // ```json + // asset_lock_proof {"instantLock":[1,1,29,187,218,88,97,177,45,117,35,242,10,165,224,212,47,82,222,61,205,45,92,47,233,25,186,103,181,159,5,13,32,110,0,0,0,0,88,196,68,221,9,87,118,125,178,192,173,234,105,253,134,23,146,191,167,92,126,54,77,131,254,133,190,190,188,42,8,180,54,165,102,23,89,26,106,137,35,123,173,166,175,31,155,70,235,164,123,93,137,168,196,228,159,242,208,35,97,130,48,124,137,103,196,101,41,169,103,179,130,46,27,168,161,115,6,98,150,208,37,147,240,245,155,58,120,163,10,126,239,156,138,18,8,71,114,158,98,228,163,41,84,51,146,134,183,159,231,89,2,33,51,28,210,141,87,104,135,162,99,244,91,89,93,73,146,114,246,86,195,245,23,105,135,201,118,35,156,172,22,249,114,215,150,173,130,147,29,83,33,2,164,249,94,236,125,128],"transaction":[0,0,8,0,1,88,132,229,219,157,226,24,35,134,113,87,35,64,178,7,238,133,182,40,7,78,126,70,112,150,194,103,38,107,175,119,164,0,0,0,0,25,118,169,20,136,217,147,30,167,61,96,234,247,229,103,30,252,5,82,185,18,145,31,42,136,172,0,0,0,0,2,0,225,245,5,0,0,0,0,2,106,0,136,19,0,0,0,0,0,0,25,118,169,20,136,217,147,30,167,61,96,234,247,229,103,30,252,5,82,185,18,145,31,42,136,172,0,0,0,0,36,0,1,0,225,245,5,0,0,0,0,25,118,169,20,39,28,153,72,28,225,70,14,79,214,45,90,17,238,204,18,61,120,238,50,136,172],"outputIndex":0} + // ``` + // + const state_transition_bytes = fromHex( + "0300020000000000000021033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f411f6ca4070bc91c2e21f785113a4669fa32bdf24f9e0e67966b5186254265b5d2fd52ef7a9ca7e6ed03ef9838c56bbeb32bf0722f11a95982bfa14a61f56d7c523e000100000100002102014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e2411f6776128925163122c68e4ad230cf59c5a8444e518d6a5592d242e9f48e85498e371b78520812536a57ef4400a5e7a43307283c5da62ba343d8f23574c15a2db700c601011dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e0000000058c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b436a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c8967c46529a967b3822e1ba8a173066296d02593f0f59b3a78a30a7eef9c8a120847729e62e4a32954339286b79fe7590221331cd28d576887a263f45b595d499272f656c3f5176987c976239cac16f972d796ad82931d532102a4f95eec7d809e00000800015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac000000000200e1f50500000000026a0088130000000000001976a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac0000000024000100e1f505000000001976a914271c99481ce1460e4fd62d5a11eecc123d78ee3288ac0000411fea1c5e3b0c92c8d02fd52c47fe5f215a828d05c317a997a4a3419a17b9260b9717ccee2603bf5ae411bba1ab8e1d0bbc31cbd73d7d6fefcdb4feb34657b2e5093dc908599ef8a5a3c510c430a27d4211c805556d99e5c06ffc3ca86a5feb55c3", + ); + const state_transition = decode( + StateTransition, + state_transition_bytes.buffer, + { signable: false }, + ); + console.log("HEY AJ! Look Here!"); + console.log(state_transition); + expect(state_transition_bytes).toEqual( + new Uint8Array( + encode(StateTransition, state_transition, { signable: false }), + ), + ); + + /* + IdentityCreate(V0(IdentityCreateTransitionV0 { + public_keys: [ + V0(IdentityPublicKeyInCreationV0 { + id: 0, + key_type: ECDSA_SECP256K1, + purpose: AUTHENTICATION, + security_level: MASTER, + contract_bounds: None, + read_only: false, + data: BinaryData(0x033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f), + signature: BinaryData(0x1f6ca4070bc91c2e21f785113a4669fa32bdf24f9e0e67966b5186254265b5d2fd52ef7a9ca7e6ed03ef9838c56bbeb32bf0722f11a95982bfa14a61f56d7c523e) + }), + V0(IdentityPublicKeyInCreationV0 { + id: 1, + key_type: ECDSA_SECP256K1, + purpose: AUTHENTICATION, + security_level: CRITICAL, + contract_bounds: None, + read_only: false, + data: BinaryData(0x02014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e2), + signature: BinaryData(0x1f6776128925163122c68e4ad230cf59c5a8444e518d6a5592d242e9f48e85498e371b78520812536a57ef4400a5e7a43307283c5da62ba343d8f23574c15a2db7) + }) + ], + asset_lock_proof: Instant(InstantAssetLockProof { + instant_lock: InstantLock { + version: 1, + inputs: [ + OutPoint { + txid: 0x6e200d059fb567ba19e92f5c2dcd3dde522fd4e0a50af223752db16158dabb1d, + vout: 0 + } + ], + txid: b4082abcbebe85fe834d367e5ca7bf921786fd69eaadc0b27d765709dd44c458, + cyclehash: 0x7c30826123d0f29fe4c4a8895d7ba4eb469b1fafa6ad7b23896a1a591766a536, + signature: [137, 103, 196, 101, 41, 169, 103, 179, 130, 46, 27, 168, 161, 115, 6, 98, 150, 208, + 37, 147, 240, 245, 155, 58, 120, 163, 10, 126, 239, 156, 138, 18, 8, 71, 114, 158, 98, 228, 163, + 41, 84, 51, 146, 134, 183, 159, 231, 89, 2, 33, 51, 28, 210, 141, 87, 104, 135, 162, 99, 244, 91, + 89, 93, 73, 146, 114, 246, 86, 195, 245, 23, 105, 135, 201, 118, 35, 156, 172, 22, 249, 114, 215, + 150, 173, 130, 147, 29, 83, 33, 2, 164, 249, 94, 236, 125, 128] + }, + transaction: Transaction { + version: 0, + lock_time: 0, + input: [ + TxIn { + previous_output: OutPoint { + txid: 0xa477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458, + vout: 0 + }, + script_sig: Script(OP_DUP OP_HASH160 OP_PUSHBYTES_20 88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG), + sequence: 0, + witness: Witness { content: [], witness_elements: 0, indices_start: 0 } + } + ], + output: [ + TxOut { + value: 100000000, + script_pubkey: Script(OP_RETURN OP_0) + }, + TxOut { + value: 5000, + script_pubkey: Script(OP_DUP OP_HASH160 OP_PUSHBYTES_20 88d9931ea73d60eaf7e5671efc0552b912911f2a OP_EQUALVERIFY OP_CHECKSIG) + } + ], + special_transaction_payload: Some(AssetLockPayloadType(AssetLockPayload { + version: 0, + credit_outputs: [ + TxOut { + value: 100000000, + script_pubkey: Script(OP_DUP OP_HASH160 OP_PUSHBYTES_20 271c99481ce1460e4fd62d5a11eecc123d78ee32 OP_EQUALVERIFY OP_CHECKSIG) + } + ] + })) + }, + output_index: 0 + }), + user_fee_increase: 0, + signature: BinaryData(0x), + identity_id: Identifier(IdentifierBytes32([61, 201, 8, 89, 158, 248, 165, 163, 197, 16, 196, 48, 162, 125, 66, 17, 200, 5, 85, 109, 153, 229, 192, 111, 252, 60, 168, 106, 95, 235, 85, 195])) + })) + */ +}); + +// it('should encode/decode Identity', () => { +// const identity_json = { +// "$version": "0", +// "id": [61, 201, 8, 89, 158, 248, 165, 163, 197, 16, 196, 48, 162, 125, 66, 17, 200, 5, 85, 109, 153, 229, 192, 111, 252, 60, 168, 106, 95, 235, 85, 195], +// "publicKeys": [ +// { +// "$version": "0", +// "id": 0, +// "purpose": 0, +// "securityLevel": 0, +// "contractBounds": null, +// "type": 0, +// "readOnly": false, +// "data": [3, 58, 154, 139, 30, 76, 88, 26, 25, 135, 114, 76, 102, 151, 19, 93, 49, 192, 126, 231, 172, 130, 126, 106, 89, 206, 192, 34, 176, 77, 81, 5, 95], +// "disabledAt": null +// }, { +// "$version": "0", +// "id": 1, +// "purpose": 0, +// "securityLevel": 1, +// "contractBounds": null, +// "type": 0, +// "readOnly": false, +// "data": [2, 1, 70, 3, 1, 141, 196, 55, 100, 45, 218, 22, 244, 199, 252, 80, 228, 130, 221, 35, 226, 70, 128, 188, 179, 165, 150, 108, 59, 52, 56, 72, 226], +// "disabledAt": null +// } +// ], +// "balance": 1000000000, +// "revision": 0 +// } +// // +// // ``` +// // identity V0(IdentityV0 { id: Identifier(IdentifierBytes32([61, 201, 8, 89, 158, 248, 165, 163, 197, 16, 196, 48, 162, 125, 66, 17, 200, 5, 85, 109, 153, 229, 192, 111, 252, 60, 168, 106, 95, 235, 85, 195])), public_keys: {0: V0(IdentityPublicKeyV0 { id: 0, purpose: AUTHENTICATION, security_level: MASTER, contract_bounds: None, key_type: ECDSA_SECP256K1, read_only: false, data: BinaryData(0x033a9a8b1e4c581a1987724c6697135d31c07ee7ac827e6a59cec022b04d51055f), disabled_at: None }), 1: V0(IdentityPublicKeyV0 { id: 1, purpose: AUTHENTICATION, security_level: CRITICAL, contract_bounds: None, key_type: ECDSA_SECP256K1, read_only: false, data: BinaryData(0x02014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e2), disabled_at: None })}, balance: 1000000000, revision: 0 }) +// // ``` +// // +// // ``` +// // identity_create_transition +// // .public_keys +// // .iter_mut() +// // .zip(identity.public_keys().iter()) +// // .try_for_each(|(public_key_with_witness, (_, public_key))| { +// // if public_key.key_type().is_unique_key_type() { +// // let signature = signer.sign(public_key, &key_signable_bytes)?; +// // public_key_with_witness.set_signature(signature); +// // } +// // Ok::<(), ProtocolError>(()) +// // })?; +// // ``` +// }) diff --git a/dashhd-utils.js b/dashhd-utils.js new file mode 100644 index 0000000..718ab18 --- /dev/null +++ b/dashhd-utils.js @@ -0,0 +1,214 @@ +import DashHd from "dashhd"; + +/** @typedef {Number} Uint32 */ + +// https://github.com/dashpay/dips/blob/master/dip-0009.md +const PURPOSE_FEATURE_PATHS = "9'"; // DIP9 +// https://github.com/dashpay/dips/blob/master/dip-0013.md +const FEATURE_IDENTITY = "5'"; // DIP13 +// https://github.com/satoshilabs/slips/blob/master/slip-0044.md +const COIN_TYPE_DASH = "5'"; // SLIP44 +const COIN_TYPE_TESTNET = "1'"; // SLIP44 +const SUB_FEATURE_AUTH = "0'"; // DIP13 +const KEY_TYPE_ECDSA = "0'"; // DIP13 +const KEY_TYPE_BLS = "1'"; // DIP13 +const SUB_FEATURE_REG = "1'"; // DIP13 +const SUB_FEATURE_TOPUP = "2'"; // DIP13 + +// m/9'//5'/ +// const PREFIX_IDENT = `m/${PURPOSE_FEATURE_PATHS}/${COIN_TYPE_DASH}/${FEATURE_IDENTITY}`; +// const PREFIX_IDENT_TESTNET = `m/${PURPOSE_FEATURE_PATHS}/${COIN_TYPE_TESTNET}/${FEATURE_IDENTITY}`; +// const PREFIX_AUTH = `${PREFIX_IDENT}/${SUB_FEATURE_AUTH}/${KEY_TYPE_ECDSA}`; +// const PREFIX_AUTH_TESTNET = `${PREFIX_IDENT_TESTNET}/${SUB_FEATURE_AUTH}/${KEY_TYPE_ECDSA}`; +// const PREFIX_REG = `${PREFIX_IDENT}/${SUB_FEATURE_REG}`; +// const PREFIX_REG_TESTNET = `${PREFIX_IDENT_TESTNET}/${SUB_FEATURE_REG}`; +// const PREFIX_TOPUP = `${PREFIX_IDENT}/${SUB_FEATURE_TOPUP}`; +// const PREFIX_TOPUP_TESTNET = `${PREFIX_IDENT_TESTNET}/${SUB_FEATURE_TOPUP}`; + +/** + * Returns the Identity Auth Wallet, which can be used to derive Identity Auth Keys + * @param {import('dashhd').HDWallet} walletKey + * @param {String} path + */ +//@ts-expect-error - monkey-patch +DashHd.deriveIdentAuthWalletPath = async function (walletKey, path) { + let hdpath = _parseIdentityWallet(path); + let identAuthKey = await _deriveIdentAuthPath(walletKey, hdpath); + + return identAuthKey; +}; + +/** + * Returns a fully-derived Identity Auth Key + * @param {import('dashhd').HDWallet} walletKey + * @param {String} path + */ +//@ts-expect-error - monkey-patch +DashHd.deriveIdentAuthKeyPath = async function (walletKey, path) { + const INDEX_AUTH_IDENTITY_KEY = 7; + + let hdpath = _parseIdentityWallet(path); + let hasAuthKey = + hdpath.paths.length > INDEX_AUTH_IDENTITY_KEY && + hdpath.paths[INDEX_AUTH_IDENTITY_KEY].endsWith("'"); + if (!hasAuthKey) { + throw new Error( + `an auth wallet key path must be in the form \`m/9'//5'/0'///' where the key index must have a trailing apostrophe`, + ); + } + + let authWalletKey = await _deriveIdentAuthPath(walletKey, hdpath); + let authKey = await authWalletKey.deriveAuthKey(hdpath); + + return authKey; +}; + +/** + * @typedef HDPathPlatform + * @prop {String} path + * @prop {Array} paths + * @prop {"m"|"m'"} m + * @prop {"9'"} purpose + * @prop {"5'"|"1'"} coinType + * @prop {"5'"} feature + * @prop {"0'"|"1'"|"2'"} subFeature + * @prop {"0'"|"1'"} [keyType] + * @prop {String} [identityIndex] + * @prop {String} [keyIndex] + * @prop {String} [topupIndex] + * @prop {String} [fundRegIndex] + */ + +/** + * @param {import('dashhd').HDWallet} walletKey + * @param {HDPathPlatform} hdpath + */ +async function _deriveIdentAuthPath(walletKey, hdpath) { + const INDEX_KEY_TYPE = 5; + const INDEX_AUTH_IDENTITY = 6; + + let keyType = hdpath.paths[INDEX_KEY_TYPE]; + let isValidKeyType = keyType === KEY_TYPE_ECDSA || keyType === KEY_TYPE_BLS; + let hasIdentity = + hdpath.paths.length > INDEX_AUTH_IDENTITY && + hdpath.paths[INDEX_AUTH_IDENTITY].endsWith("'"); + let isIdentity = isValidKeyType && hasIdentity; + if (!isIdentity) { + throw new Error( + `an identity wallet identity auth path must be in the form \`m/9'//5'/0'//' where coin-type is 5' (DASH mainnet) or 1' (testnet), key-type is 0' (ECDSA) or 1' (BLS), and identity index must have a trailing apostrophe`, + ); + } + + // 0=m/1=purpose'/2=coin-type'/3=feature'/4=sub-feature'/5=key-type'/6=identity-index' + let authWalletPath = `m/9'/${hdpath.coinType}/5'/0'/${keyType}/${hdpath.paths[INDEX_AUTH_IDENTITY]}`; + let _authWalletKey = await DashHd.derivePath(walletKey, authWalletPath); + + let authWalletKey = Object.assign(_authWalletKey, { + /** @param {Uint32} authKeyIndex */ + deriveAuthKey: async function (authKeyIndex) { + let authKey = await DashHd.deriveChild( + _authWalletKey, + authKeyIndex, + DashHd.HARDENED, + ); + return authKey; + }, + }); + + return authWalletKey; +} + +/** + * Returns a fully-derived Identity Registration Funding Key + * @param {import('dashhd').HDWallet} walletKey + * @param {String} path + */ +//@ts-expect-error - monkey-patch +DashHd.deriveIdentRegFundKeyPath = async function (walletKey, path) { + const INDEX_REG_FUND_KEY = 5; + + let hdpath = _parseIdentityWallet(path); + let hasIdentity = + hdpath.paths.length > INDEX_REG_FUND_KEY && + !hdpath.paths[INDEX_REG_FUND_KEY].endsWith("'"); + if (!hasIdentity) { + throw new Error( + `an identity wallet identity reg path must be in the form \`m/9'//5'/1'/' where the identity index MUST NOT have a trailing apostrophe`, + ); + } + + // 0=m/1=purpose'/2=coin-type'/3=feature'/4=sub-feature'/5=identity-index + let identRegFundPath = `m/9'/${hdpath.coinType}/5'/1'/${hdpath.paths[INDEX_REG_FUND_KEY]}`; + let identRegFundKey = await DashHd.derivePath(walletKey, identRegFundPath); + + return identRegFundKey; +}; + +// async function deriveIdentTopupWallet(walletKey, path) { +// } + +/** + * Returns a fully-derived Topup Funding Key + * @param {import('dashhd').HDWallet} walletKey + * @param {String} path + */ +//@ts-expect-error - monkey-patch +DashHd.deriveIdentTopupKeyPath = async function (walletKey, path) { + const INDEX_TOPUP_KEY = 5; + + let hdpath = _parseIdentityWallet(path); + let hasIdentity = + hdpath.paths.length > INDEX_TOPUP_KEY && + !hdpath.paths[INDEX_TOPUP_KEY].endsWith("'"); + if (!hasIdentity) { + throw new Error( + `an identity wallet identity reg path must be in the form \`m/9'//5'/2'/' where the topup index MUST NOT have a trailing apostrophe`, + ); + } + + // 0=m/1=purpose'/2=coin-type'/3=feature'/4=sub-feature'/5=topup-index + let identTopupPath = `m/9'/${hdpath.coinType}/5'/2'/${hdpath.paths[INDEX_TOPUP_KEY]}`; + let identTopupKey = await DashHd.derivePath(walletKey, identTopupPath); + + return identTopupKey; +}; + +/** + * @param {String} path + * @returns {HDPathPlatform} + */ +function _parseIdentityWallet(path) { + let paths = path.split("/"); + let [m, purpose, coinType, feature, subFeature] = paths; + let hasMaster = m === "m" || m === "m'"; + let hasPurpose = purpose === PURPOSE_FEATURE_PATHS; + let hasCoinType = + coinType === COIN_TYPE_DASH || coinType === COIN_TYPE_TESTNET; + let hasFeature = feature === FEATURE_IDENTITY; + let hasSubFeature = [ + SUB_FEATURE_AUTH, + SUB_FEATURE_REG, + SUB_FEATURE_TOPUP, + ].includes(subFeature); + + let hasValidPrefix = + hasMaster && hasPurpose && hasCoinType && hasFeature && hasSubFeature; + if (!hasValidPrefix) { + throw new Error( + `identity wallet paths must be in the form \`m/9'//5'/' where coin-type is 5' (DASH mainnet) or 1' (testnet) and sub-feature is 0' (auth), 1' (registration), or 2' (topup)`, + ); + } + + //@ts-expect-error - these have been type checked + return { path, paths, m, purpose, coinType, feature, subFeature }; +} + +export default DashHd; +//@ts-expect-error - monkey patch +export let deriveIdentTopupKeyPath = DashHd.deriveIdentTopupKeyPath; +//@ts-expect-error - monkey patch +export let deriveIdentRegFundKeyPath = DashHd.deriveIdentRegFundKeyPath; +//@ts-expect-error - monkey patch +export let deriveIdentAuthKeyPath = DashHd.deriveIdentAuthKeyPath; +//@ts-expect-error - monkey patch +export let deriveIdentAuthWalletPath = DashHd.deriveIdentAuthWalletPath; diff --git a/demo-static.js b/demo-static.js new file mode 100644 index 0000000..54c9206 --- /dev/null +++ b/demo-static.js @@ -0,0 +1,848 @@ +"use strict"; + +import Dotenv from "dotenv"; +import DashPhrase from "dashphrase"; +import DashHd from "./dashhd-utils.js"; +import DashKeys from "dashkeys"; +import DashTx from "dashtx/dashtx.js"; +import DashPlatform from "./dashplatform.js"; +import Bincode from "./bincode.js"; +import QRCode from "./_qr.js"; + +import KeyUtils from "./key-utils.js"; + +Dotenv.config({ path: ".env" }); + +let rpcAuthUrl = "https://api:null@trpc.digitalcash.dev"; + +// const L1_VERSION_PLATFORM = 3; +const L1_VERSION_PLATFORM = 0; +const TYPE_ASSET_LOCK = 8; +// const L2_VERSION_PLATFORM = 1; // actually constant "0" ?? +const ST_CREATE_IDENTITY = 2; + +let KEY_LEVELS = { + 0: "MASTER", + 1: "CRITICAL", + 2: "HIGH", + 3: "MEDIUM", + MASTER: 0, + CRITICAL: 1, + HIGH: 2, + MEDIUM: 3, +}; + +let KEY_PURPOSES = { + 0: "AUTHENTICATION", + 1: "ENCRYPTION", + 2: "DECRYPTION", + 3: "TRANSFER", + 4: "SYSTEM", + 5: "VOTING", + AUTHENTICATION: 0, + ENCRYPTION: 1, + DECRYPTION: 2, + TRANSFER: 3, + SYSTEM: 4, + VOTING: 5, +}; + +let KEY_TYPES = { + 0: "ECDSA_SECP256K1", + ECDSA_SECP256K1: 0, +}; + +let network = "testnet"; +let coinType = 5; // DASH +if (network === "testnet") { + coinType = 1; // testnet +} +//coinType = 1; + +let identityEcdsaPath = ""; +{ + // m/purpose'/coin_type'/feature'/subfeature'/keytype'/identityindex'/keyindex' + // ex: m/9'/5'/5'/0'/0'// + let purposeDip13 = 9; + let featureId = 5; + let subfeatureKey = 0; + let keyType = KEY_TYPES.ECDSA_SECP256K1; + identityEcdsaPath = `m/${purposeDip13}'/${coinType}'/${featureId}'/${subfeatureKey}'/${keyType}'`; +} + + +async function createPlatformIdentity(walletKey, coinType, identityIndex) { + let authWalletPath = `m/9'/${coinType}'/5'/0'/0'/${identityIndex}'`; + //@ts-expect-error - monkey patch + let authWallet = await DashHd.deriveIdentAuthWalletPath( + walletKey, + authWalletPath, + ); + let authMasterAddress = await authWallet.deriveAuthKey(0); + let authOtherAddress = await authWallet.deriveAuthKey(1); + + let regFundAddressPath = `m/9'/${coinType}'/5'/1'/${identityIndex}`; + //@ts-expect-error - monkey patch + let regFundAddress = await DashHd.deriveIdentRegFundKeyPath( + walletKey, + regFundAddressPath, + ); + let assetAddress = await DashHd.deriveChild( + regFundAddress, + 0, + DashHd.HARDENED, + ); + + let topupAddressPath = `m/9'/${coinType}'/5'/2'/0`; + //@ts-expect-error - monkey patch + let topupAddress = await DashHd.deriveIdentTopupKeyPath( + walletKey, + topupAddressPath, + ); + + let hdOpts = { version: "testnet" }; + console.log(); + console.log(`Identity Index: ${identityIndex}, Topup Index: 0`); + console.log( + "Funding WIF", + await DashHd.toWif(regFundAddress.privateKey, hdOpts), + ); + console.log( + "Asset WIF", + await DashHd.toWif(assetAddress.privateKey, hdOpts), + "(would be ephemeral, non-hd)", + ); + console.log( + "Auth master WIF", + await DashHd.toWif(authMasterAddress.privateKey, hdOpts), + ); + console.log( + "Auth other WIF", + await DashHd.toWif(authOtherAddress.privateKey, hdOpts), + ); + console.log( + "Topup WIF", + await DashHd.toWif(topupAddress.privateKey, hdOpts), + "(will be used for change)", + ); + console.log(); +} + +async function main() { + let walletPhrase = process.env.DASH_WALLET_PHRASE; + let walletSalt = process.env.DASH_WALLET_SALT ?? ""; + if (!walletPhrase) { + console.error(""); + console.error("ERROR"); + console.error(" 'DASH_WALLET_PHRASE' is not set"); + console.error(""); + console.error("SOLUTION"); + let newPhrase = await DashPhrase.generate(); + console.error(` echo 'DASH_WALLET_PHRASE="${newPhrase}"' >> .env`); + console.error(` echo 'DASH_WALLET_SALT=""' >> .env`); + console.error(""); + process.exit(1); + return; + } + + let identityIndexStr = process.argv[2]; + let identityIndex = parseInt(identityIndexStr, 10); + if (isNaN(identityIndex)) { + console.error(""); + console.error("USAGE"); + console.error(" ./demo.js "); + console.error(""); + console.error("EXAMPLE"); + console.error(" ./demo.js 0"); + console.error(""); + process.exit(1); + return; + } + + let coinType = 5; + let testnet = true; + if (testnet) { + coinType = 1; + } + + let seed = await DashPhrase.toSeed(walletPhrase, walletSalt); + let walletKey = await DashHd.fromSeed(seed); + + await createPlatformIdentity(walletKey, coinType, identityIndex); + + let fundingAddress = await DashHd.toAddr(regFundAddress.publicKey, hdOpts); + let oldDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressdeltas", { + addresses: [fundingAddress], + }); + let newDeltas = await DashTx.utils.rpc(rpcAuthUrl, "getaddressmempool", { + addresses: [fundingAddress], + }); + let deltas = oldDeltas.concat(newDeltas); + let total = DashTx.sum(deltas); + let minimum = 100000000 + 10000 + 200; + let needed = minimum - total; + if (needed > 0) { + let dashAmount = DashTx.toDash(needed); + let content = `dash:${fundingAddress}?amount=${dashAmount}`; + let ascii = QRCode.ascii(content, { + indent: 3, + padding: 4, + width: 256, + height: 256, + color: "#000000", + background: "#ffffff", + ecl: "M", + }); + console.error(); + console.error(`ERROR`); + console.error( + ` not enough DASH at funding address (including instant send)`, + ); + console.error(); + console.error(`SOLUTION`); + console.error(` send ${dashAmount} to ${fundingAddress}`); + console.error(``); + console.error(ascii); + console.error(); + process.exit(1); + } + deltas.reverse(); + // console.log(deltas); + + let fundingUtxos = []; + for (let delta of deltas) { + if (delta.satoshis < 0) { + // TODO pair the inputs and outputs + // (this check only works for exact-match, sequenced debits and credits) + break; + } + fundingUtxos.push(delta); + } + console.log(`fundingUtxos:`); + console.log(fundingUtxos); + + // void (await WasmDpp.default()); + + let dashTx = DashTx.create(KeyUtils); + + let fundingPkh = await DashKeys.pubkeyToPkh(regFundAddress.publicKey); + let fundingPkhHex = DashKeys.utils.bytesToHex(fundingPkh); + //@ts-expect-error - incorrect type on version + let fundingAddr = await DashKeys.pkhToAddr(fundingPkh, hdOpts); + console.log( + `# DEBUG funding (${fundingPkhHex}):\ntouch ./${fundingAddr}.wif`, + ); + + for (let utxo of fundingUtxos) { + // satoshis: 100010200, + // txid: 'd17ef0f2b5093f7be6582b964f911946665a022e0c64fc084ce9955dfbe56171', + // index: 0, + // blockindex: 1, + // height: 1215439, + // address: 'yLqCzEXH2w3HH95sKrzy78d2mt9d1eP8BD' + Object.assign(utxo, { + txId: utxo.txid, + txidHex: DashTx.utils.reverseHex(utxo.txid), + outputIndexHex: utxo.index.toString(16).padStart(8, "0"), + outputIndex: utxo.index, + scriptSizeHex: "19", + scriptSize: 25, + script: `76a914${fundingPkhHex}88ac`, + // sequence: "00000000", + // sigHashType: DashTx.SIGHASH_ALL, + }); + } + process.exit(1); + + let assetLockPrivateKeyHex = + "33a9f0603ba69b97dff83e08b4ee36cebbc987739e9749615e1727754f2bf2d2"; + let assetLockPrivateKey = DashKeys.utils.hexToBytes(assetLockPrivateKeyHex); + let assetLockWif = await DashKeys.privKeyToWif(assetLockPrivateKey); + let assetLockPublicKey = await KeyUtils.toPublicKey(assetLockPrivateKey); + let assetLockPkh = await DashKeys.pubkeyToPkh(assetLockPublicKey); + // 271c99481ce1460e4fd62d5a11eecc123d78ee32 + let assetLockPkhHex = DashKeys.utils.bytesToHex(assetLockPkh); + // yPtFTm5svi9DFp3yLXf2HV4N5WF9ePLHFs + let assetLockAddr = await DashKeys.pkhToAddr(assetLockPkh, { + version: "testnet", + }); + console.log( + `# DEBUG asset lock (${assetLockPkhHex}):\necho '${assetLockWif}' > ./${assetLockAddr}.wif`, + ); + + // KeyUtils.set(fundingAddr, { + // address: fundingAddr, + // privateKey: fundingPrivateKey, + // publicKey: fundingPublicKey, + // pubKeyHash: fundingPkhHex, + // }); + + // using junk key because we're missing the funding private key + KeyUtils.set(fundingAddr, { + address: fundingAddr, + privateKey: assetLockPrivateKey, // TODO + publicKey: assetLockPublicKey, // TODO + pubKeyHash: fundingPkhHex, + }); + + // the test fixture was quick'n'dirty / unhygienic, hence the reuse of keys + let changePkhHex = fundingPkhHex; + let changePkh = fundingPkh; + // yYo3PeSBv2rMnJeyLUCCzx4Y8VhPppZKkC + let changeAddr = fundingAddr; + await DashKeys.pkhToAddr(changePkh, { version: "testnet" }); + console.log(`DEBUG change address: ${changeAddr} (${changePkhHex})`); + + let masterPrivateKeyHex = + "6c554775029f960891e3edf2d36b26a30d9a4b10034bb49f3a6c4617f557f7bc"; + let masterPrivateKey = DashKeys.utils.hexToBytes(masterPrivateKeyHex); + let masterWif = await DashKeys.privKeyToWif(masterPrivateKey); + let masterPublicKey = await KeyUtils.toPublicKey(masterPrivateKey); + let masterPkh = await DashKeys.pubkeyToPkh(masterPublicKey); + // 98f913d35dd0508e3a6b8bb0c4250221c831f3f8 + let masterPkhHex = DashKeys.utils.bytesToHex(masterPkh); + + // yaGHwZkYKSjkMnqX5N1MwrByRxv1Pb8fNY + let masterAddr = await DashKeys.pkhToAddr(masterPkh, { + version: "testnet", + }); + console.log( + `# DEBUG master key (${masterPkhHex}):\necho '${masterWif}' > ./${masterAddr}.wif`, + ); + + let otherPrivateKeyHex = + "426ae4838204206cacdfc7a2e04ac6a2d9e3c2e94df935878581c552f22b0096"; + let otherPrivateKey = DashKeys.utils.hexToBytes(otherPrivateKeyHex); + let otherWif = await DashKeys.privKeyToWif(otherPrivateKey); + let otherPublicKey = await KeyUtils.toPublicKey(otherPrivateKey); + let otherPkh = await DashKeys.pubkeyToPkh(otherPublicKey); + // d8d7386f71d85c85d46ebc06680571d4e0fb4263 + let otherPkhHex = DashKeys.utils.bytesToHex(otherPkh); + // yg5zdRAgB6EYFSownkupECHyJfuwghbuLA + let otherAddr = await DashKeys.pkhToAddr(otherPkh, { + version: "testnet", + }); + console.log( + `# DEBUG other key (${otherPkhHex}):\necho '${otherWif}' > ./${otherAddr}.wif`, + ); + + // let totalSats = 100005200; // 200 for fee + let transferSats = 100000000; + let changeSats = 5000; + let burnOutput = { memo: "", satoshis: transferSats }; + let changeOutput = { satoshis: changeSats, pubKeyHash: changePkhHex }; + let assetExtraOutput = { + satoshis: transferSats, + pubKeyHash: assetLockPkhHex, + }; + + //@ts-expect-error - TODO add types + let assetLockScript = DashPlatform.Tx.packAssetLock({ + version: 0, + creditOutputs: [assetExtraOutput], + }); + let txDraft = { + version: L1_VERSION_PLATFORM, + type: TYPE_ASSET_LOCK, + inputs: fundingUtxos, + outputs: [burnOutput, changeOutput], + extraPayload: assetLockScript, + }; + console.log(); + console.log(`txDraft:`); + console.log(txDraft); + + // txDraft.inputs.sort(DashTx.sortInputs); + // txDraft.outputs.sort(DashTx.sortOutputs); + let vout = txDraft.outputs.indexOf(burnOutput); + + let txProof = DashTx.createRaw(txDraft); + txProof.inputs[0].script = + "76a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac"; + txProof.inputs[0].sequence = "00000000"; // Non-final DashTx.NON_FINAL = "00000000" + //@ts-expect-error + let txProofHex = await DashTx.serialize(txProof, null); + console.log(`txProof:`, txProof); + console.log(txProofHex); + let txSigned = await dashTx.hashAndSignAll(txDraft); + // console.log(); + // console.log(`txSigned:`); + // console.log(txSigned); + + // let txid = await DashTx.utils.rpc( + // rpcAuthUrl, + // "sendrawtransaction", + // txSigned.transaction, + // ); + + // const INSTANT_ALP = 0; + // const CHAIN_ALP = 1; + + // let blockchaininfo = await DashTx.utils.rpc(rpcAuthUrl, "getblockchaininfo"); + // let nextBlock = blockchaininfo.blocks + 1; + + // TODO - AJ is here + console.log(`DEBUG funding outpoint`); + let outpoint = await getFundingOutPoint(txSigned.transaction, vout); + console.log(outpoint); + let fundingOutPointHex = `${outpoint.txid}${outpoint.voutHex}`; + console.log(fundingOutPointHex); + let identityId = await createIdentityId(fundingOutPointHex); + console.log(identityId); + + /** @param {any} magicZmqEmitter */ + async function getAssetLockInstantProof(magicZmqEmitter) { + let assetLockInstantProof = { + // type: INSTANT_ALP, + // ex: 01 v1 + // 01 1 input + // 1dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e prev txid + // 00000000 prev vout + // 58c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b4 txid + // 36a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c cycle hash + // 8967c46529a967b3822e1ba8a173066296d02593f0f59b3a LLMQ BLS Sig + // 78a30a7eef9c8a120847729e62e4a32954339286b79fe759 + // 0221331cd28d576887a263f45b595d499272f656c3f51769 + // 87c976239cac16f972d796ad82931d532102a4f95eec7d80 + // instant_lock: await magicZmqEmitter.once( + // "zmqpubrawtxlocksig", + // /** @param {any} instantLock */ + // function (instantLock) { + // return instantLock.toBase64(); + // }, + // ), + // not sure what "previous outpoint" this refers to, as its not the one in the transaction + instant_lock: DashTx.utils.hexToBytes( + "01011dbbda5861b12d7523f20aa5e0d42f52de3dcd2d5c2fe919ba67b59f050d206e0000000058c444dd0957767db2c0adea69fd861792bfa75c7e364d83fe85bebebc2a08b436a56617591a6a89237bada6af1f9b46eba47b5d89a8c4e49ff2d0236182307c8967c46529a967b3822e1ba8a173066296d02593f0f59b3a78a30a7eef9c8a120847729e62e4a32954339286b79fe7590221331cd28d576887a263f45b595d499272f656c3f5176987c976239cac16f972d796ad82931d532102a4f95eec7d80", + ), + transaction: DashTx.utils.hexToBytes(txProofHex), + // output_index: DashTx.utils.hexToBytes(vout), + output_index: vout, + }; + return assetLockInstantProof; + } + + async function getAssetLockChainProof() { + let assetLockChainProof = { + // type: CHAIN_ALP, + core_chain_locked_height: nextBlock, + // out_point: fundingOutPointHex, + out_point: { + txid: outpoint.txid, + vout: vout, + }, + }; + return assetLockChainProof; + } + + let assetLockProof; + let weEvenKnowHowToGetIsdlock = true; + if (weEvenKnowHowToGetIsdlock) { + assetLockProof = await getAssetLockInstantProof(null); + } else { + assetLockProof = await getAssetLockChainProof(); + } + + // let idIndex = 0; // increment to first unused + // let identityKeys = await getIdentityKeys(walletKey, idIndex); + let identityKeys = await getKnownIdentityKeys( + { privateKey: masterPrivateKey, publicKey: masterPublicKey }, + { privateKey: otherPrivateKey, publicKey: otherPublicKey }, + ); + let stKeys = await getIdentityTransitionKeys(identityKeys); + + // { + // '$version': '0', + // public_keys: [ + // { + // '$version': '0', + // id: 0, + // type: 0, + // purpose: 0, + // security_level: 0, + // contract_bounds: null, + // read_only: false, + // data: [Uint8Array], + // signature: [Uint8Array] + // }, + // { + // '$version': '0', + // id: 1, + // type: 0, + // purpose: 0, + // security_level: 1, + // contract_bounds: null, + // read_only: false, + // data: [Uint8Array], + // signature: [Uint8Array] + // } + // ], + // asset_lock_proof: { + // instant_lock: Uint8Array(198) [ + // 1, 1, 29, 187, 218, 88, 97, 177, 45, 117, 35, 242, + // 10, 165, 224, 212, 47, 82, 222, 61, 205, 45, 92, 47, + // 233, 25, 186, 103, 181, 159, 5, 13, 32, 110, 0, 0, + // 0, 0, 88, 196, 68, 221, 9, 87, 118, 125, 178, 192, + // 173, 234, 105, 253, 134, 23, 146, 191, 167, 92, 126, 54, + // 77, 131, 254, 133, 190, 190, 188, 42, 8, 180, 54, 165, + // 102, 23, 89, 26, 106, 137, 35, 123, 173, 166, 175, 31, + // 155, 70, 235, 164, 123, 93, 137, 168, 196, 228, 159, 242, + // 208, 35, 97, 130, + // ... 98 more items + // ], + // transaction: Uint8Array(158) [ + // 0, 0, 8, 0, 1, 88, 132, 229, 219, 157, 226, 24, + // 35, 134, 113, 87, 35, 64, 178, 7, 238, 133, 182, 40, + // 7, 78, 126, 70, 112, 150, 194, 103, 38, 107, 175, 119, + // 164, 0, 0, 0, 0, 25, 118, 169, 20, 136, 217, 147, + // 30, 167, 61, 96, 234, 247, 229, 103, 30, 252, 5, 82, + // 185, 18, 145, 31, 42, 136, 172, 0, 0, 0, 0, 2, + // 0, 225, 245, 5, 0, 0, 0, 0, 2, 106, 0, 136, + // 19, 0, 0, 0, 0, 0, 0, 25, 118, 169, 20, 136, + // 217, 147, 30, 167, + // ... 58 more items + // ], + // output_index: 0 + // }, + // user_fee_increase: 0, + // signature: Uint8Array(65) [ + // 31, 234, 28, 94, 59, 12, 146, 200, 208, 47, 213, + // 44, 71, 254, 95, 33, 90, 130, 141, 5, 195, 23, + // 169, 151, 164, 163, 65, 154, 23, 185, 38, 11, 151, + // 23, 204, 238, 38, 3, 191, 90, 228, 17, 187, 161, + // 171, 142, 29, 11, 188, 49, 203, 215, 61, 125, 111, + // 239, 205, 180, 254, 179, 70, 87, 178, 229, 9 + // ], + // identity_id: Uint8Array(32) [ + // 61, 201, 8, 89, 158, 248, 165, 163, + // 197, 16, 196, 48, 162, 125, 66, 17, + // 200, 5, 85, 109, 153, 229, 192, 111, + // 252, 60, 168, 106, 95, 235, 85, 195 + // ] + // } + + let stateTransition = { + //protocolVersion: L2_VERSION_PLATFORM, + $version: "0", + type: ST_CREATE_IDENTITY, + // ecdsaSig(assetLockPrivateKey, CBOR(thisStateTransition)) + // "signature":"IBTTgge+/VDa/9+n2q3pb4tAqZYI48AX8X3H/uedRLH5dN8Ekh/sxRRQQS9LaOPwZSCVED6XIYD+vravF2dhYOE=", + asset_lock_proof: assetLockProof, + // publicKeys: stKeys, + public_keys: stKeys, + // [ + // { + // id: 0, + // type: 0, + // purpose: 0, + // securityLevel: 0, + // data: "AkWRfl3DJiyyy6YPUDQnNx5KERRnR8CoTiFUvfdaYSDS", + // readOnly: false, + // }, + // ], + user_fee_increase: 0, + }; + console.log(`stKeys:`); + console.log(stKeys); + + let bcAb = Bincode.encode(Bincode.StateTransition, stateTransition, { + signable: true, + }); + console.log(`bc (ready-to-sign) AB:`, bcAb); + let bc = new Uint8Array(bcAb); + console.log(`bc (ready-to-sign):`); + console.log(DashTx.utils.bytesToHex(bc)); + console.log(bytesToBase64(bc)); + + let sigBytes = new Uint8Array(65); + sigBytes[0] = 0x1f; + let p1363Bytes = sigBytes.subarray(1); + void (await KeyUtils.signP1363(assetLockPrivateKey, bc, p1363Bytes)); + // let sigHex = DashTx.utils.bytesToHex(sigBytes); + Object.assign(stateTransition, { + identity_id: identityId, + // signature: sigHex, + signature: sigBytes, + }); + for (let i = 0; i < identityKeys.length; i += 1) { + let key = identityKeys[i]; + let stPub = stateTransition.public_keys[i]; + let sigBytes = new Uint8Array(65); + let p1363Bytes = sigBytes.subarray(1); + // This isn't ASN.1, P1363, or SEC1. + // Not sure what it is (possibly bespoke), but 1f seems to be a magic byte + sigBytes[0] = 0x1f; + void (await KeyUtils.signP1363(key.privateKey, bc, p1363Bytes)); + // let sigHex = DashTx.utils.bytesToHex(sigBytes); + Object.assign(stPub, { + // signature: sigHex, + signature: sigBytes, + }); + } + + console.log(JSON.stringify(stateTransition, null, 2)); + + { + let bcAb = Bincode.encode(Bincode.StateTransition, stateTransition, { + signable: false, + }); + let bc = new Uint8Array(bcAb); + console.log(`bc (signed):`); + console.log(DashTx.utils.bytesToHex(bc)); + console.log(bytesToBase64(bc)); + } + + // let identityId = assetLockProof.createIdentifier(); + // let identity = Dpp.identity.create(identityId, dppKeys); + // let signedTransition = signTransition( + // identity, + // assetLockProof, + // assetLockPrivateKeyBuffer, + // ); + + console.log(""); + console.log("TODO"); + console.log(` - how to serialize and broadcast transition via grpc?`); +} + +/** + * @param {Hex} txSignedHex + * @param {Uint32} outputIndex + */ +async function getFundingOutPoint(txSignedHex, outputIndex) { + let txBytes = DashTx.utils.hexToBytes(txSignedHex); + let txidBytes = await DashTx.doubleSha256(txBytes); + let txidBE = DashTx.utils.bytesToHex(txidBytes); + let voutLE = DashTx.utils.toUint32LE(outputIndex); + + return { txid: txidBE, voutHex: voutLE, vout: outputIndex }; +} + +/** + * @param {Hex} fundingOutPointHex + */ +function createIdentityId(fundingOutPointHex) { + let fundingOutPointBytes = DashTx.utils.hexToBytes(fundingOutPointHex); + let identityHashBytes = DashTx.doubleSha256(fundingOutPointBytes); + // let identityId = b58.encode(identityHashBytes); + // return identityId; + return identityHashBytes; +} + +/** + * @param {Required>} masterKey + * @param {Required>} otherKey + * @returns {Promise>} + */ +async function getKnownIdentityKeys(masterKey, otherKey) { + if (!masterKey.privateKey) { + throw new Error("linter fail"); + } + if (!otherKey.privateKey) { + throw new Error("linter fail"); + } + let keyDescs = [ + // {"$version":"0","id":0,"purpose":0,"securityLevel":0,"contractBounds":null,"type":0,"readOnly":false,"data":[3,58,154,139,30,76,88,26,25,135,114,76,102,151,19,93,49,192,126,231,172,130,126,106,89,206,192,34,176,77,81,5,95],"disabledAt":null} + { + id: 0, + type: KEY_TYPES.ECDSA_SECP256K1, + purpose: KEY_PURPOSES.AUTHENTICATION, + securityLevel: KEY_LEVELS.MASTER, + readOnly: false, + publicKey: masterKey.publicKey, + privateKey: masterKey.privateKey, + data: "", + }, + // {"$version":"0","id":1,"purpose":0,"securityLevel":1,"contractBounds":null,"type":0,"readOnly":false,"data":[2,1,70,3,1,141,196,55,100,45,218,22,244,199,252,80,228,130,221,35,226,70,128,188,179,165,150,108,59,52,56,72,226],"disabledAt":null} + { + id: 1, + type: KEY_TYPES.ECDSA_SECP256K1, + purpose: KEY_PURPOSES.AUTHENTICATION, + securityLevel: KEY_LEVELS.CRITICAL, + readOnly: false, + privateKey: otherKey.privateKey, + publicKey: otherKey.publicKey, + data: "", + }, + ]; + return keyDescs; + + // let privKeyDescs = []; + // for (let keyDesc of keyDescs) { + // let key = await DashHd.deriveChild( + // identityKey, + // keyDesc.id, + // DashHd.HARDENED, + // ); + // let privKeyDesc = Object.assign(keyDesc, key); + // privKeyDescs.push(privKeyDesc); // for type info + + // let dppKey = new WasmDpp.IdentityPublicKey(L2_VERSION_PLATFORM); + // dppKey.setId(keyDesc.id); + // dppKey.setData(key.publicKey); + // if (keyDesc.purpose) { + // dppKey.setPurpose(keyDesc.purpose); + // } + // dppKey.setSecurityLevel(keyDesc.securityLevel); + // dppKeys.push(dppKey); + // } + + // return privKeyDescs; +} + +/** + * @typedef EvoKey + * @prop {Uint8} id + * @prop {Uint8} type - TODO constrain to members of KEY_TYPES + * @prop {Uint8} purpose - TODO constrain to members of KEY_PURPOSES + * @prop {Uint8} securityLevel - TODO constrain to members of KEY_LEVELS + * @prop {Boolean} readOnly + * @prop {Uint8Array} publicKey + * @prop {Uint8Array} privateKey + */ + +/** + * @typedef STKey + * @prop {Uint8} id + * @prop {Uint8} type - TODO constrain to members of KEY_TYPES + * @prop {Uint8} purpose - TODO constrain to members of KEY_PURPOSES + * @prop {Base64} data - base64-encoded publicKey (compact) + * @prop {Uint8} securityLevel - TODO constrain to members of KEY_LEVELS + * @prop {Boolean} readOnly + */ + +/** + * @param {Array} identityKeys - TODO + */ +function getIdentityTransitionKeys(identityKeys) { + let stKeys = []; + for (let key of identityKeys) { + // let data = bytesToBase64(key.publicKey); + let stKey = { + $version: "0", + id: key.id, + type: key.type, + purpose: key.purpose, + security_level: key.securityLevel, + contract_bounds: null, + // readOnly: key.readOnly, + read_only: key.readOnly || false, + // data: data, + data: key.publicKey, + // signature: "TODO", + }; + // if ("readOnly" in key) { + // Object.assign(stKey, { readOnly: key.readOnly }); + // } + stKeys.push(stKey); + } + return stKeys; +} + +/** + * @param {Uint8Array} bytes + */ +function bytesToBase64(bytes) { + let binstr = ""; + for (let i = 0; i < bytes.length; i += 1) { + binstr += String.fromCharCode(bytes[i]); + } + + return btoa(binstr); +} + +function signTransition(identity, assetLockProof, assetLockPrivateKey) { + // TODO is assetLockProof the same as txoutproof? + + // Create ST + const identityCreateTransition = + WasmDpp.identity.createIdentityCreateTransition(identity, assetLockProof); + + // Create key proofs + const [stMasterKey, stHighAuthKey, stCriticalAuthKey, stTransferKey] = + identityCreateTransition.getPublicKeys(); + + // Sign master key + + identityCreateTransition.signByPrivateKey( + identityMasterPrivateKey.toBuffer(), + Dpp.IdentityPublicKey.TYPES.ECDSA_SECP256K1, + ); + + stMasterKey.setSignature(identityCreateTransition.getSignature()); + + identityCreateTransition.setSignature(undefined); + + // Sign high auth key + + identityCreateTransition.signByPrivateKey( + identityHighAuthPrivateKey.toBuffer(), + Dpp.IdentityPublicKey.TYPES.ECDSA_SECP256K1, + ); + + stHighAuthKey.setSignature(identityCreateTransition.getSignature()); + + identityCreateTransition.setSignature(undefined); + + // Sign critical auth key + + identityCreateTransition.signByPrivateKey( + identityCriticalAuthPrivateKey.toBuffer(), + Dpp.IdentityPublicKey.TYPES.ECDSA_SECP256K1, + ); + + stCriticalAuthKey.setSignature(identityCreateTransition.getSignature()); + + identityCreateTransition.setSignature(undefined); + + // Sign transfer key + + identityCreateTransition.signByPrivateKey( + identityTransferPrivateKey.toBuffer(), + Dpp.IdentityPublicKey.TYPES.ECDSA_SECP256K1, + ); + + stTransferKey.setSignature(identityCreateTransition.getSignature()); + + identityCreateTransition.setSignature(undefined); + + // Set public keys back after updating their signatures + identityCreateTransition.setPublicKeys([ + stMasterKey, + stHighAuthKey, + stCriticalAuthKey, + stTransferKey, + ]); + + // Sign and validate state transition + + identityCreateTransition.signByPrivateKey( + assetLockPrivateKey, + Dpp.IdentityPublicKey.TYPES.ECDSA_SECP256K1, + ); + + // TODO(versioning): restore + // @ts-ignore + // const result = await Dpp.stateTransition.validateBasic( + // identityCreateTransition, + // // TODO(v0.24-backport): get rid of this once decided + // // whether we need execution context in wasm bindings + // new StateTransitionExecutionContext(), + // ); + + // if (!result.isValid()) { + // const messages = result.getErrors().map((error) => error.message); + // throw new Error(`StateTransition is invalid - ${JSON.stringify(messages)}`); + // } + + return identityCreateTransition; +} + +main(); + +/** @typedef {String} Base58 */ +/** @typedef {String} Base64 */ +/** @typedef {String} Hex */ +/** @typedef {Number} Uint53 */ +/** @typedef {Number} Uint32 */ +/** @typedef {Number} Uint8 */ diff --git a/demo.js b/demo.js index df83eea..e88517d 100644 --- a/demo.js +++ b/demo.js @@ -5,7 +5,7 @@ let DashHd = require("dashhd"); let DashKeys = require("dashkeys"); let DashTx = require("dashtx"); let DashPlatform = require("./dashplatform.js"); -let CBOR = require("cbor"); +let Bincode = require("./bincode.js"); let KeyUtils = require("./key-utils.js"); @@ -20,7 +20,7 @@ let rpcAuthUrl = "https://api:null@trpc.digitalcash.dev"; const L1_VERSION_PLATFORM = 3; const TYPE_ASSET_LOCK = 8; -const L2_VERSION_PLATFORM = 1; +// const L2_VERSION_PLATFORM = 1; // actually constant "0" ?? const ST_CREATE_IDENTITY = 2; let KEY_LEVELS = { @@ -93,19 +93,23 @@ async function main() { let accountIndex = 0; // pick the desired account for paying the fee let addressIndex = 0; // pick an address with funds - let accountKey; + /** @type {import('dashhd').HDAccount} */ //@ts-expect-error + let accountKey = null; + /** @type {Required} */ //@ts-expect-error + let addressKey = null; + let addr = ""; + let pkh = ""; + let wif = ""; for (let a = 0; a <= accountIndex; a += 1) { accountKey = await walletKey.deriveAccount(a); for (let usage of [DashHd.RECEIVE, DashHd.CHANGE]) { let xprvKey = await accountKey.deriveXKey(usage); - let addressKey; - let addr; - let pkh; - let wif; for (let i = 0; i <= addressIndex; i += 1) { - addressKey = await xprvKey.deriveAddress(i); + let _addressKey = await xprvKey.deriveAddress(i); + /** @type {import('dashhd').HDKey} */ //@ts-expect-error + addressKey = _addressKey; if (!addressKey.privateKey) { throw new Error("not an error, just a lint hack"); } @@ -127,11 +131,12 @@ async function main() { } } - process.exit(1); + // process.exit(1); KeyUtils.set(addr, { address: addr, publicKey: addressKey.publicKey, + //@ts-expect-error - it's not null privateKey: addressKey.privateKey, pubKeyHash: pkh, }); @@ -179,23 +184,22 @@ async function main() { // txSigned.transaction, // ); - const INSTANT_ALP = 0; - const CHAIN_ALP = 1; + // const INSTANT_ALP = 0; + // const CHAIN_ALP = 1; let blockchaininfo = await DashTx.utils.rpc(rpcAuthUrl, "getblockchaininfo"); let nextBlock = blockchaininfo.blocks + 1; - let fundingOutPointHex = await getFundingOutPointHex( - txSigned.transaction, - vout, - ); + // TODO - AJ is here + let outpoint = await getFundingOutPointHex(txSigned.transaction, vout); + let fundingOutPointHex = `${outpoint.txid}${outpoint.voutHex}`; let identityId = createIdentityId(fundingOutPointHex); /** @param {any} magicZmqEmitter */ async function getAssetLockInstantProof(magicZmqEmitter) { let assetLockInstantProof = { - type: INSTANT_ALP, - instantLock: await magicZmqEmitter.once( + // type: INSTANT_ALP, + instant_lock: await magicZmqEmitter.once( "zmqpubrawtxlocksig", /** @param {any} instantLock */ function (instantLock) { @@ -203,16 +207,20 @@ async function main() { }, ), transaction: txSigned.transaction, - outputIndex: vout, + output_index: vout, }; return assetLockInstantProof; } async function getAssetLockChainProof() { let assetLockChainProof = { - type: CHAIN_ALP, - coreChainLockedHeight: nextBlock, - outPoint: fundingOutPointHex, + // type: CHAIN_ALP, + core_chain_locked_height: nextBlock, + // out_point: fundingOutPointHex, + out_point: { + txid: outpoint.txid, + vout: vout, + }, }; return assetLockChainProof; } @@ -229,13 +237,85 @@ async function main() { let identityKeys = await getIdentityKeys(walletKey, idIndex); let stKeys = await getIdentityTransitionKeys(identityKeys); + // { + // '$version': '0', + // public_keys: [ + // { + // '$version': '0', + // id: 0, + // type: 0, + // purpose: 0, + // security_level: 0, + // contract_bounds: null, + // read_only: false, + // data: [Uint8Array], + // signature: [Uint8Array] + // }, + // { + // '$version': '0', + // id: 1, + // type: 0, + // purpose: 0, + // security_level: 1, + // contract_bounds: null, + // read_only: false, + // data: [Uint8Array], + // signature: [Uint8Array] + // } + // ], + // asset_lock_proof: { + // instant_lock: Uint8Array(198) [ + // 1, 1, 29, 187, 218, 88, 97, 177, 45, 117, 35, 242, + // 10, 165, 224, 212, 47, 82, 222, 61, 205, 45, 92, 47, + // 233, 25, 186, 103, 181, 159, 5, 13, 32, 110, 0, 0, + // 0, 0, 88, 196, 68, 221, 9, 87, 118, 125, 178, 192, + // 173, 234, 105, 253, 134, 23, 146, 191, 167, 92, 126, 54, + // 77, 131, 254, 133, 190, 190, 188, 42, 8, 180, 54, 165, + // 102, 23, 89, 26, 106, 137, 35, 123, 173, 166, 175, 31, + // 155, 70, 235, 164, 123, 93, 137, 168, 196, 228, 159, 242, + // 208, 35, 97, 130, + // ... 98 more items + // ], + // transaction: Uint8Array(158) [ + // 0, 0, 8, 0, 1, 88, 132, 229, 219, 157, 226, 24, + // 35, 134, 113, 87, 35, 64, 178, 7, 238, 133, 182, 40, + // 7, 78, 126, 70, 112, 150, 194, 103, 38, 107, 175, 119, + // 164, 0, 0, 0, 0, 25, 118, 169, 20, 136, 217, 147, + // 30, 167, 61, 96, 234, 247, 229, 103, 30, 252, 5, 82, + // 185, 18, 145, 31, 42, 136, 172, 0, 0, 0, 0, 2, + // 0, 225, 245, 5, 0, 0, 0, 0, 2, 106, 0, 136, + // 19, 0, 0, 0, 0, 0, 0, 25, 118, 169, 20, 136, + // 217, 147, 30, 167, + // ... 58 more items + // ], + // output_index: 0 + // }, + // user_fee_increase: 0, + // signature: Uint8Array(65) [ + // 31, 234, 28, 94, 59, 12, 146, 200, 208, 47, 213, + // 44, 71, 254, 95, 33, 90, 130, 141, 5, 195, 23, + // 169, 151, 164, 163, 65, 154, 23, 185, 38, 11, 151, + // 23, 204, 238, 38, 3, 191, 90, 228, 17, 187, 161, + // 171, 142, 29, 11, 188, 49, 203, 215, 61, 125, 111, + // 239, 205, 180, 254, 179, 70, 87, 178, 229, 9 + // ], + // identity_id: Uint8Array(32) [ + // 61, 201, 8, 89, 158, 248, 165, 163, + // 197, 16, 196, 48, 162, 125, 66, 17, + // 200, 5, 85, 109, 153, 229, 192, 111, + // 252, 60, 168, 106, 95, 235, 85, 195 + // ] + // } + let stateTransition = { - protocolVersion: L2_VERSION_PLATFORM, + //protocolVersion: L2_VERSION_PLATFORM, + $version: "0", type: ST_CREATE_IDENTITY, // ecdsaSig(assetLockPrivateKey, CBOR(thisStateTransition)) // "signature":"IBTTgge+/VDa/9+n2q3pb4tAqZYI48AX8X3H/uedRLH5dN8Ekh/sxRRQQS9LaOPwZSCVED6XIYD+vravF2dhYOE=", - assetLockProof: assetLockProof, - publicKeys: stKeys, + asset_lock_proof: assetLockProof, + // publicKeys: stKeys, + public_keys: stKeys, // [ // { // id: 0, @@ -246,22 +326,51 @@ async function main() { // readOnly: false, // }, // ], + user_fee_increase: 0, }; console.log(`stKeys:`); console.log(stKeys); - let cbor = CBOR.encodeCanonical(stateTransition); - console.log(`cbor:`); - console.log(DashTx.utils.bytesToHex(cbor)); - console.log(bytesToBase64(cbor)); - - let sigBytes = await KeyUtils.sign(addressKey.privateKey, cbor); - let sigHex = DashTx.utils.bytesToHex(sigBytes); + let bcAb = Bincode.encode(Bincode.StateTransition, stateTransition, { + signable: true, + }); + let bc = new Uint8Array(bcAb); + console.log(`bc (ready-to-sign):`); + console.log(DashTx.utils.bytesToHex(bc)); + console.log(bytesToBase64(bc)); + + /** @type {Uint8Array} */ //@ts-expect-error + let privBytes = addressKey.privateKey; + let sigBytes = await KeyUtils.sign(privBytes, bc); + // let sigHex = DashTx.utils.bytesToHex(sigBytes); Object.assign(stateTransition, { - signature: sigHex, + identity_id: identityId, + // signature: sigHex, + signature: sigBytes, }); + for (let i = 0; i < identityKeys.length; i += 1) { + let key = identityKeys[i]; + let stPub = stateTransition.public_keys[i]; + let sigBytes = await KeyUtils.sign(key.privateKey, bc); + // let sigHex = DashTx.utils.bytesToHex(sigBytes); + Object.assign(stPub, { + // signature: sigHex, + signature: sigBytes, + }); + } + console.log(JSON.stringify(stateTransition, null, 2)); + { + let bcAb = Bincode.encode(Bincode.StateTransition, stateTransition, { + signable: false, + }); + let bc = new Uint8Array(bcAb); + console.log(`bc (signed):`); + console.log(DashTx.utils.bytesToHex(bc)); + console.log(bytesToBase64(bc)); + } + // let identityId = assetLockProof.createIdentifier(); // let identity = Dpp.identity.create(identityId, dppKeys); // let signedTransition = signTransition( @@ -285,8 +394,7 @@ async function getFundingOutPointHex(txSignedHex, outputIndex) { let txidBE = DashTx.utils.bytesToHex(txidBytes); let voutLE = DashTx.utils.toUint32LE(outputIndex); - let fundingOutPointHex = `${txidBE}${voutLE}`; - return fundingOutPointHex; + return { txid: txidBE, voutHex: voutLE, vout: outputIndex }; } /** @@ -295,8 +403,9 @@ async function getFundingOutPointHex(txSignedHex, outputIndex) { function createIdentityId(fundingOutPointHex) { let fundingOutPointBytes = DashTx.utils.hexToBytes(fundingOutPointHex); let identityHashBytes = DashTx.doubleSha256(fundingOutPointBytes); - let identityId = b58.encode(identityHashBytes); - return identityId; + // let identityId = b58.encode(identityHashBytes); + // return identityId; + return identityHashBytes; } /** @@ -347,13 +456,15 @@ async function getIdentityKeys(walletKey, idIndex) { }, ]; + let privKeyDescs = []; for (let keyDesc of keyDescs) { let key = await DashHd.deriveChild( identityKey, keyDesc.id, DashHd.HARDENED, ); - Object.assign(keyDesc, key); + let privKeyDesc = Object.assign(keyDesc, key); + privKeyDescs.push(privKeyDesc); // for type info // let dppKey = new WasmDpp.IdentityPublicKey(L2_VERSION_PLATFORM); // dppKey.setId(keyDesc.id); @@ -365,7 +476,7 @@ async function getIdentityKeys(walletKey, idIndex) { // dppKeys.push(dppKey); } - return keyDescs; + return privKeyDescs; } /** @@ -397,16 +508,20 @@ function getIdentityTransitionKeys(identityKeys) { for (let key of identityKeys) { let data = bytesToBase64(key.publicKey); let stKey = { + $version: "0", id: key.id, type: key.type, purpose: key.purpose, - securityLevel: key.securityLevel, - data: data, + security_level: key.securityLevel, + contract_bounds: null, // readOnly: key.readOnly, + read_only: key.readOnly || false, + data: data, + // signature: "TODO", }; - if ("readOnly" in key) { - Object.assign(stKey, { readOnly: key.readOnly }); - } + // if ("readOnly" in key) { + // Object.assign(stKey, { readOnly: key.readOnly }); + // } stKeys.push(stKey); } return stKeys; diff --git a/hex.js b/hex.js new file mode 100644 index 0000000..7171e36 --- /dev/null +++ b/hex.js @@ -0,0 +1,34 @@ +/** + * @type {string[]} + */ +const byteToHex = []; + +for (let n = 0; n <= 0xff; ++n) +{ + const hexOctet = n.toString(16).padStart(2, "0"); + byteToHex.push(hexOctet); +} + +/** + * @param {ArrayBuffer} arrayBuffer + */ +export function toHex(arrayBuffer) +{ + const buff = new Uint8Array(arrayBuffer); + const hexOctets = []; // new Array(buff.length) is even faster (preallocates necessary array size), then use hexOctets[i] instead of .push() + + for (let i = 0; i < buff.length; ++i) + hexOctets.push(byteToHex[buff[i]]); + + return hexOctets.join(""); +} + +/** + * @param {string} string + */ +export function fromHex(string) { + const uint8array = new Uint8Array(Math.ceil(string.length / 2)); + for (let i = 0; i < string.length;) + uint8array[i / 2] = Number.parseInt(string.slice(i, i += 2), 16); + return uint8array; +} \ No newline at end of file diff --git a/key-utils.js b/key-utils.js index 996758d..c4d4035 100644 --- a/key-utils.js +++ b/key-utils.js @@ -6,15 +6,56 @@ let Secp256k1 = require("@dashincubator/secp256k1"); /** * @typedef KeyUtilsPartial * @prop {KeySet} set + * @prop {KeySignAsn1} signAsn1 + * @prop {KeySignMagic} magicSign + * @prop {DoubleSHA256} doubleSha256 + * @prop {KeySignP1363} signP1363 + * @prop {ASN1ToP1363Signature} asn1ToP1363Signature */ /** @typedef {TxKeyUtils & KeyUtilsPartial} KeyUtils */ /** * @callback KeySet - * @param {String} id + * @param {String} id - typically address * @param {KeyInfo} keyInfo */ +/** + * @callback KeySignAsn1 + * @param {Uint8Array} privateKey + * @param {Uint8Array} hashBytes + * @returns {Promise} + */ + +/** + * @callback DoubleSHA256 + * @param {Uint8Array} dataBytes + * @returns {Promise} + */ + +/** + * @callback KeySignMagic + * @param {Object} opts + * @param {Uint8Array} opts.privKeyBytes + * @param {Uint8Array} opts.doubleSha256Bytes + * @returns {Promise} + */ + +/** + * @callback KeySignP1363 + * @param {Uint8Array} privateKey + * @param {Uint8Array} hashBytes + * @param {Uint8Array} [sigBytes] - preallocated 64 bytes + * @returns {Promise} + */ + +/** + * @callback ASN1ToP1363Signature + * @param {Uint8Array} asn1Sig + * @param {Uint8Array} [sigBytes] + * @returns {Uint8Array} - p1363Sig + */ + /** @type {KeyUtils} */ let KeyUtils = module.exports; @@ -37,10 +78,112 @@ KeyUtils.set = function (id, keyInfo) { }; KeyUtils.sign = async function (privKeyBytes, hashBytes) { - let sigOpts = { canonical: true, extraEntropy: true }; + let asn1Bytes = await KeyUtils.signAsn1(privKeyBytes, hashBytes); + return asn1Bytes; +}; + +KeyUtils.signAsn1 = async function (privKeyBytes, hashBytes) { + let testing = true; + let sigOpts = { canonical: true }; + if (!testing) { + Object.assign({ extraEntropy: true }); + } let sigBytes = await Secp256k1.sign(hashBytes, privKeyBytes, sigOpts); return sigBytes; }; + +KeyUtils.doubleSha256 = async function (bytes) { + let firstHash = await sha256(bytes); + let secondHash = await sha256(firstHash); + return secondHash; +}; + +/** + * @param {Uint8Array} bytes + */ +async function sha256(bytes) { + let hashBuffer = await crypto.subtle.digest("SHA-256", bytes); + let hashBytes = new Uint8Array(hashBuffer); + return hashBytes; +} + +/** + * This is called "Simple Sign" by the Rust SDK. + */ +KeyUtils.magicSign = async function ({ privKeyBytes, doubleSha256Bytes }) { + if (doubleSha256Bytes?.length !== 32) { + throw new Error(`'doubleSha256Bytes' must be a 32-byte double sha256 hash`); + } + + let MAGIC_OFFSET = 27 + 4; // 27 because bitcoin, 4 because "compressed" key + let testing = true; + let sigOpts = { canonical: true, der: false, recovered: true }; + if (!testing) { + Object.assign({ extraEntropy: true }); + } + let recoverySig = await Secp256k1.sign( + doubleSha256Bytes, + privKeyBytes, + sigOpts, + ); + let magicSig = new Uint8Array(65); + // the magic byte is prepended (the signature is NOT reversed) + magicSig[0] = MAGIC_OFFSET + recoverySig[1]; + magicSig.set(recoverySig[0], 1); + return magicSig; +}; + +KeyUtils.signP1363 = async function (privKeyBytes, hashBytes, sigBytes) { + let asn1Bytes = await KeyUtils.signAsn1(privKeyBytes, hashBytes); + let p1363Bytes = KeyUtils.asn1ToP1363Signature(asn1Bytes, sigBytes); + // TODO DEBUG TESTING + // for (let i = 0; i < p1363Bytes.length; i += 1) { + // p1363Bytes[i] = 0xff; + // } + return p1363Bytes; +}; + +KeyUtils.asn1ToP1363Signature = function (asn1, p1363Signature) { + if (asn1[0] !== 0x30) { + throw new Error("Invalid DER signature format"); + } + + let offset = 0; + offset += 2; // skip SEQUENCE and length bytes + + offset += 1; // skip type byte + let rLength = asn1[offset]; + offset += 1; + let r = asn1.slice(offset, offset + rLength); + + offset += rLength; + offset += 1; // skip type byte + let sLength = asn1[offset]; + offset += 1; + let s = asn1.slice(offset, offset + sLength); + + if (!p1363Signature) { + p1363Signature = new Uint8Array(64); + } + + // remove ASN1 padding, or zero-pad the start of r and s, if needed + let rStart = 32 - r.length; + if (rStart === -1) { + r = r.subarray(1); + rStart = 0; + } + p1363Signature.set(r, rStart); + + let sStart = 64 - s.length; + if (sStart === 31) { + s = s.subarray(1); + sStart = 32; + } + p1363Signature.set(s, sStart); + + return p1363Signature; +}; + KeyUtils.getPrivateKey = async function (input) { if (!input.address) { //throw new Error('should put the address on the input there buddy...'); diff --git a/package-lock.json b/package-lock.json index 36e16ea..bd33ee0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,65 @@ "version": "0.1.0", "license": "SEE LICENSE IN LICENSE", "dependencies": { + "@dashevo/dapi-client": "^1.1.1", "@dashevo/dapi-grpc": "^1.1.1", "@dashevo/wasm-dpp": "^1.1.1", "@dashincubator/secp256k1": "^1.7.1-5", + "base-x": "^5.0.1", "cbor-web": "^9.0.2", "dashhd": "^3.3.3", "dashkeys": "^1.1.5", "dashphrase": "^1.4.0", - "dashtx": "^0.20.1" + "dashtx": "^0.20.3", + "dotenv": "^16.4.7", + "launchdarkly-eventsource": "^2.0.3", + "qrcode-svg": "^1.1.0" + }, + "devDependencies": { + "vitest": "^2.0.5" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "license": "MIT", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" } }, "node_modules/@dashevo/bls": { @@ -27,13 +78,34 @@ "binascii": "0.0.2" } }, + "node_modules/@dashevo/dapi-client": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@dashevo/dapi-client/-/dapi-client-1.8.0.tgz", + "integrity": "sha512-s8Xqo7Dz0aGQonO1mbqEPpZLuMkkp2TvB+Xp8zEjgn8OqQzdApmpOzyUJJkGtr2V1VN4js6ApxS9isgKJe8Jfg==", + "license": "MIT", + "dependencies": { + "@dashevo/dapi-grpc": "1.8.0", + "@dashevo/dash-spv": "2.8.0", + "@dashevo/dashcore-lib": "~0.22.0", + "@dashevo/grpc-common": "1.8.0", + "@dashevo/wasm-dpp": "1.8.0", + "bs58": "^4.0.1", + "cbor": "^8.0.0", + "google-protobuf": "^3.12.2", + "lodash": "^4.17.21", + "node-fetch": "^2.6.7", + "node-inspect-extracted": "^1.0.8", + "wasm-x11-hash": "~0.0.2", + "winston": "^3.2.1" + } + }, "node_modules/@dashevo/dapi-grpc": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dashevo/dapi-grpc/-/dapi-grpc-1.1.1.tgz", - "integrity": "sha512-edq4Y+WO74V+ojBKXpfNQCgiiSF4xdPQu7g7C2QwMZgCj/IiTFXPZftwIqOIT/jHvHCZnM87lbWZ59wZEpd04A==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@dashevo/dapi-grpc/-/dapi-grpc-1.8.0.tgz", + "integrity": "sha512-hP5Py7m+IZLKvAk21nsK0tyUpfUjZRFu2boiSByjYQwrMoyZHoJi63dTFUe6sikXvG7fr1JsJMiHsO4HAmgsZQ==", "license": "MIT", "dependencies": { - "@dashevo/grpc-common": "1.1.1", + "@dashevo/grpc-common": "1.8.0", "@dashevo/protobufjs": "6.10.5", "@grpc/grpc-js": "1.4.4", "@improbable-eng/grpc-web": "^0.15.0", @@ -41,10 +113,66 @@ "long": "^5.2.0" } }, - "node_modules/@dashevo/grpc-common": { + "node_modules/@dashevo/dark-gravity-wave": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-1.1.1.tgz", - "integrity": "sha512-lobOOitH+RWEkNxxh+Izd6N1bK9V0j0qbWHOreDFqIib4OEVVBuEGMuv19uVftpZ/XiQk1bC541XlE2YeSLDWA==", + "resolved": "https://registry.npmjs.org/@dashevo/dark-gravity-wave/-/dark-gravity-wave-1.1.1.tgz", + "integrity": "sha512-rt0PzGzqplqERWVIMLlBxm4mJqjFTYNUFRhIccbfaF/MDyd0/585krGOWIhe0Sis9XQNA/FJlxxRjtPXIcyyCg==", + "license": "MIT" + }, + "node_modules/@dashevo/dash-spv": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@dashevo/dash-spv/-/dash-spv-2.8.0.tgz", + "integrity": "sha512-9Eu6TQruEZJnGA8V6vAEu6ajfNkLSaEjbyr1TUQ0MazPDq6Vz+Q/zAYScwy3cAjhN8j6Ma2eN/LmPQE/VOglWw==", + "license": "MIT", + "dependencies": { + "@dashevo/dark-gravity-wave": "^1.1.1", + "@dashevo/dash-util": "^2.0.3", + "@dashevo/dashcore-lib": "~0.22.0", + "levelup": "^4.4.0", + "memdown": "^5.1.0", + "wasm-x11-hash": "~0.0.2" + } + }, + "node_modules/@dashevo/dash-util": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dashevo/dash-util/-/dash-util-2.0.3.tgz", + "integrity": "sha512-fnc76NYVBhuTLhuUVidnV9sKSsMxmkxkhUOjiD/ny6Ipyo+qxwKeFAn8SvdVzlEpflNA613B+hsxmTBBGazl4A==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.6.4", + "buffer-reverse": "^1.0.1" + } + }, + "node_modules/@dashevo/dashcore-lib": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@dashevo/dashcore-lib/-/dashcore-lib-0.22.0.tgz", + "integrity": "sha512-9zvTcr8eFE+aeA/SVN5jsDgB/Kg6ozmsOY4u3gJdFJ6kQSU+yVyFNsflaWhHwRakZ7CVlU88P7AuDKneukp3zQ==", + "license": "MIT", + "dependencies": { + "@dashevo/bls": "~1.2.9", + "@dashevo/x11-hash-js": "^1.0.2", + "@types/node": "^12.12.47", + "bloom-filter": "^0.2.0", + "bn.js": "^4.12.0", + "bs58": "=4.0.1", + "elliptic": "^6.5.4", + "inherits": "=2.0.1", + "lodash": "^4.17.20", + "ripemd160": "^2.0.2", + "tsd": "^0.28.1", + "unorm": "^1.6.0" + } + }, + "node_modules/@dashevo/dashcore-lib/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "license": "MIT" + }, + "node_modules/@dashevo/grpc-common": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@dashevo/grpc-common/-/grpc-common-1.8.0.tgz", + "integrity": "sha512-AAooX+SPaOE0XMNkaGw/rBft7c/RfPlpQcKaHnZhSyCtqO4wUWj7zoPn8JtIMaBMwsYkHw4bn8xooXGsVGLS4Q==", "license": "MIT", "dependencies": { "@dashevo/protobufjs": "6.10.5", @@ -82,6 +210,12 @@ "pbts": "bin/pbts" } }, + "node_modules/@dashevo/protobufjs/node_modules/@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", + "license": "MIT" + }, "node_modules/@dashevo/protobufjs/node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -89,9 +223,9 @@ "license": "Apache-2.0" }, "node_modules/@dashevo/wasm-dpp": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@dashevo/wasm-dpp/-/wasm-dpp-1.1.1.tgz", - "integrity": "sha512-8E4v2p2yt/PyxUqjNrSx7Kvjne6Wb3hz+0tm0f5i6ImfPEXmcksPiNtfLH5qDL/znDJjdIFC52xQoOgK+l+gXw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@dashevo/wasm-dpp/-/wasm-dpp-1.8.0.tgz", + "integrity": "sha512-qEIneunt5Tohxk6x/yXsKoqND4QWSYgq8XcwiCXd4QUm79/r0rW06MeEWqWrdXcMfPZ/ixVBoGPfmu8ner0Zlg==", "license": "MIT", "dependencies": { "@dashevo/bls": "~1.2.9", @@ -100,12 +234,409 @@ "varint": "^6.0.0" } }, + "node_modules/@dashevo/x11-hash-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@dashevo/x11-hash-js/-/x11-hash-js-1.0.2.tgz", + "integrity": "sha512-3vvnZweBca4URBXHF+FTrM4sdTpp3IMt73G1zUKQEdYm/kJkIKN94qpFai7YZDl87k64RCH+ckRZk6ruQPz5KQ==", + "license": "MIT" + }, "node_modules/@dashincubator/secp256k1": { "version": "1.7.1-5", "resolved": "https://registry.npmjs.org/@dashincubator/secp256k1/-/secp256k1-1.7.1-5.tgz", "integrity": "sha512-3iA+RDZrJsRFPpWhlYkp3EdoFAlKjdqkNFiRwajMrzcpA/G/IBX0AnC1pwRLkTrM+tUowcyGrkJfT03U4ETZeg==", "license": "MIT" }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@grpc/grpc-js": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.4.4.tgz", @@ -169,6 +700,60 @@ "google-protobuf": "^3.14.0" } }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -233,56 +818,602 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", - "license": "MIT" + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.6.tgz", + "integrity": "sha512-+GcCXtOQoWuC7hhX1P00LqjjIiS/iOouHXhMdiDSnq/1DGTox4SpUvO52Xm+div6+106r+TcvOeo/cxvyEyTgg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.6.tgz", + "integrity": "sha512-E8+2qCIjciYUnCa1AiVF1BkRgqIGW9KzJeesQqVfyRITGQN+dFuoivO0hnro1DjT74wXLRZ7QF8MIbz+luGaJA==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", - "engines": { - "node": ">=8" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.6.tgz", + "integrity": "sha512-z9Ib+OzqN3DZEjX7PDQMHEhtF+t6Mi2z/ueChQPLS/qUMKY7Ybn5A2ggFoKRNRh1q1T03YTQfBTQCJZiepESAg==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/base-x": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", - "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.6.tgz", + "integrity": "sha512-PShKVY4u0FDAR7jskyFIYVyHEPCPnIQY8s5OcXkdU8mz3Y7eXDJPdyM/ZWjkYdR2m0izD9HHWA8sGcXn+Qrsyg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.6.tgz", + "integrity": "sha512-YSwyOqlDAdKqs0iKuqvRHLN4SrD2TiswfoLfvYXseKbL47ht1grQpq46MSiQAx6rQEN8o8URtpXARCpqabqxGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.6.tgz", + "integrity": "sha512-HEP4CgPAY1RxXwwL5sPFv6BBM3tVeLnshF03HMhJYCNc6kvSqBgTMmsEjb72RkZBAWIqiPUyF1JpEBv5XT9wKQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.6.tgz", + "integrity": "sha512-88fSzjC5xeH9S2Vg3rPgXJULkHcLYMkh8faix8DX4h4TIAL65ekwuQMA/g2CXq8W+NJC43V6fUpYZNjaX3+IIg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.6.tgz", + "integrity": "sha512-wM4ztnutBqYFyvNeR7Av+reWI/enK9tDOTKNF+6Kk2Q96k9bwhDDOlnCUNRPvromlVXo04riSliMBs/Z7RteEg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.6.tgz", + "integrity": "sha512-9RyprECbRa9zEjXLtvvshhw4CMrRa3K+0wcp3KME0zmBe1ILmvcVHnypZ/aIDXpRyfhSYSuN4EPdCCj5Du8FIA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.6.tgz", + "integrity": "sha512-qTmklhCTyaJSB05S+iSovfo++EwnIEZxHkzv5dep4qoszUMX5Ca4WM4zAVUMbfdviLgCSQOu5oU8YoGk1s6M9Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.6.tgz", + "integrity": "sha512-4Qmkaps9yqmpjY5pvpkfOerYgKNUGzQpFxV6rnS7c/JfYbDSU0y6WpbbredB5cCpLFGJEqYX40WUmxMkwhWCjw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.6.tgz", + "integrity": "sha512-Zsrtux3PuaxuBTX/zHdLaFmcofWGzaWW1scwLU3ZbW/X+hSsFbz9wDIp6XvnT7pzYRl9MezWqEqKy7ssmDEnuQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.6.tgz", + "integrity": "sha512-aK+Zp+CRM55iPrlyKiU3/zyhgzWBxLVrw2mwiQSYJRobCURb781+XstzvA8Gkjg/hbdQFuDw44aUOxVQFycrAg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.6.tgz", + "integrity": "sha512-WoKLVrY9ogmaYPXwTH326+ErlCIgMmsoRSx6bO+l68YgJnlOXhygDYSZe/qbUJCSiCiZAQ+tKm88NcWuUXqOzw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.6.tgz", + "integrity": "sha512-Sht4aFvmA4ToHd2vFzwMFaQCiYm2lDFho5rPcvPBT5pCdC+GwHG6CMch4GQfmWTQ1SwRKS0dhDYb54khSrjDWw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.6.tgz", + "integrity": "sha512-zmmpOQh8vXc2QITsnCiODCDGXFC8LMi64+/oPpPx5qz3pqv0s6x46ps4xoycfUiVZps5PFn1gksZzo4RGTKT+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.6.tgz", + "integrity": "sha512-3/q1qUsO/tLqGBaD4uXsB6coVGB3usxw3qyeVb59aArCgedSF66MPdgRStUd7vbZOsko/CgVaY5fo2vkvPLWiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.6.tgz", + "integrity": "sha512-oLHxuyywc6efdKVTxvc0135zPrRdtYVjtVD5GUm55I3ODxhU/PwkQFD97z16Xzxa1Fz0AEe4W/2hzRtd+IfpOA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.6.tgz", + "integrity": "sha512-0PVwmgzZ8+TZ9oGBmdZoQVXflbvuwzN/HRclujpl4N/q3i+y0lqLw8n1bXA8ru3sApDjlmONaNAuYr38y1Kr9w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "license": "MIT" + }, + "node_modules/@tsd/typescript": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-YQi2lvZSI+xidKeUjlbv6b6Zw7qB3aXHw5oGJLs5OOGAEqKIOvz5UIAkWyg0bJbkSUWPBEtaOHpVxU4EYBO1Jg==", + "license": "MIT" + }, + "node_modules/@types/eslint": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", "license": "MIT", "dependencies": { - "safe-buffer": "^5.0.1" + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT" + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.13.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz", + "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "license": "MIT" + }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/base-x": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", + "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/binascii": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/binascii/-/binascii-0.0.2.tgz", "integrity": "sha512-rA2CrUl1+6yKrn+XgLs8Hdy18OER1UW146nM+ixzhQXDY+Bd3ySkyIJGwF2a4I45JwbvF1mDL/nWkqBwpOcdBA==" }, + "node_modules/bloom-filter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bloom-filter/-/bloom-filter-0.2.0.tgz", + "integrity": "sha512-RMG2RpnKczVzRsEYSPaT5rKsyj0w5/wpQRjaW4vOMe1WyUDQpoqxjNc10uROEjdhu63ytRt6aFRPXFePi/Rd7A==" + }, + "node_modules/bn.js": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "license": "MIT" + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "license": "MIT" + }, "node_modules/browser-headers": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/browser-headers/-/browser-headers-0.4.1.tgz", @@ -298,254 +1429,2439 @@ "base-x": "^3.0.2" } }, - "node_modules/cbor": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", - "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", + "node_modules/bs58/node_modules/base-x": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-reverse": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-reverse/-/buffer-reverse-1.0.1.tgz", + "integrity": "sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg==", + "license": "MIT" + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "license": "MIT", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cbor": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", + "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", + "license": "MIT", + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/cbor-web": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cbor-web/-/cbor-web-9.0.2.tgz", + "integrity": "sha512-N6gU2GsJS8RR5gy1d9wQcSPgn9FGJFY7KNvdDRlwHfz6kCxrQr2TDnrjXHmr6TFSl6Fd0FC4zRnityEldjRGvQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/chai": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "license": "MIT", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/dashhd": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/dashhd/-/dashhd-3.3.3.tgz", + "integrity": "sha512-sbhLV8EtmebnlIdx/d1hcbnxdfka/0rcLx+UO5y44kZdu5tyJ5ftBFbhhIb38vd+T+Xfcwpeo0z+0ZDznRkfaw==", + "license": "SEE LICENSE IN LICENSE" + }, + "node_modules/dashkeys": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/dashkeys/-/dashkeys-1.1.5.tgz", + "integrity": "sha512-ohHoe3bNeWZPsVxmOrWFaqZrJP3GeuSk6AtAawUCx0ZXVkTraeDQyMMp7ewhy3OEHkvs5yy6woMAQnwhmooX8w==", + "license": "SEE LICENSE IN LICENSE" + }, + "node_modules/dashphrase": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dashphrase/-/dashphrase-1.4.0.tgz", + "integrity": "sha512-o+LdiPkiYmg07kXBE+2bbcJzBmeTQVPn1GS2XlQeo8lene+KknAprSyiYi5XtqV/QVgNjvzOV7qBst2MijSPAA==", + "license": "SEE LICENSE IN LICENSE" + }, + "node_modules/dashtx": { + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/dashtx/-/dashtx-0.20.3.tgz", + "integrity": "sha512-2/coe9Gz8di2EwQvH5pfuuAP+yPVoZXIODpB8vGdNKyxwpGdihceunBBPv8xN1OK7TfQf6WZKlgNpKih9qD2dQ==", + "license": "SEE LICENSE IN LICENSE", + "bin": { + "dashtx-inspect": "bin/inspect.js" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "license": "MIT", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", + "license": "MIT", + "dependencies": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deferred-leveldown/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "license": "MIT" + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "license": "MIT", + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-formatter-pretty": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-formatter-pretty/-/eslint-formatter-pretty-4.1.0.tgz", + "integrity": "sha512-IsUTtGxF1hrH6lMWiSl1WbGaiP01eT6kzywdY1U+zLc0MP+nwEnUiS9UI8IaOTUhTeQJLlCEWIbXINBH4YJbBQ==", + "license": "MIT", + "dependencies": { + "@types/eslint": "^7.2.13", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "eslint-rule-docs": "^1.1.5", + "log-symbols": "^4.0.0", + "plur": "^4.0.0", + "string-width": "^4.2.0", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-rule-docs": { + "version": "1.1.235", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", + "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", + "license": "MIT" + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", + "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/google-protobuf": { + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", + "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", + "license": "(BSD-3-Clause AND Apache-2.0)" + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash-base/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hash.js/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "license": "MIT" + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", + "license": "ISC" + }, + "node_modules/irregular-plurals": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", + "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "license": "MIT" + }, + "node_modules/launchdarkly-eventsource": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/launchdarkly-eventsource/-/launchdarkly-eventsource-2.0.3.tgz", + "integrity": "sha512-VhFjppK7jXlcEKaS7bxdoibB5j01NKyeDR7a8XfssdDGNWCTsbF0/5IExSmPi44eDncPhkoPNxlSZhEZvrbD5w==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", + "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", + "license": "MIT", + "dependencies": { + "errno": "~0.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-iterator-stream/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "deprecated": "Superseded by abstract-level (https://github.com/Level/community#faq)", + "license": "MIT", + "dependencies": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/logform": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", + "license": "MIT", + "dependencies": { + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/long": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.0.tgz", + "integrity": "sha512-5vvY5yF1zF/kXk+L94FRiTDa1Znom46UjPCH6/XbSvS8zBKMFBHTJk8KDMqJ+2J6QezQFi7k1k8v21ClJYHPaw==", + "license": "Apache-2.0" + }, + "node_modules/loupe": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", + "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/memdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", + "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "deprecated": "Superseded by memory-level (https://github.com/Level/community#faq)", + "license": "MIT", + "dependencies": { + "abstract-leveldown": "~6.2.1", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/memdown/node_modules/immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==", + "license": "MIT" + }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "license": "MIT", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "license": "MIT" + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "license": "MIT", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-inspect-extracted": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/node-inspect-extracted/-/node-inspect-extracted-1.1.0.tgz", + "integrity": "sha512-GtmPYJiHqmkt4sd7oYqUIzFepBDY6aotmD7nuF9QV9lolH+Sru5FZCholI5QuuyM+NvgAq/BaQB6OgXv+ZT8lA==", + "license": "MIT", + "engines": { + "node": ">=10.18.0" + } + }, + "node_modules/nofilter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", + "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "license": "MIT", + "engines": { + "node": ">=12.19" + } + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "license": "MIT", + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/plur": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", + "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "license": "MIT", + "dependencies": { + "irregular-plurals": "^3.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/postcss": { + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.2.tgz", + "integrity": "sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/protobufjs/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "license": "MIT" + }, + "node_modules/qrcode-svg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/qrcode-svg/-/qrcode-svg-1.1.0.tgz", + "integrity": "sha512-XyQCIXux1zEIA3NPb0AeR8UMYvXZzWEhgdBgBjH9gO7M48H9uoHzviNz8pXw3UzrAcxRRRn9gxHewAVK7bn9qw==", + "license": "MIT", + "bin": { + "qrcode-svg": "bin/qrcode-svg.js" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readable-stream/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rollup": { + "version": "4.34.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.6.tgz", + "integrity": "sha512-wc2cBWqJgkU3Iz5oztRkQbfVkbxoz5EhnCGOrnJvnLnQ7O0WhQUYyv18qQI79O8L7DdHrrlJNeCHd4VGpnaXKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.34.6", + "@rollup/rollup-android-arm64": "4.34.6", + "@rollup/rollup-darwin-arm64": "4.34.6", + "@rollup/rollup-darwin-x64": "4.34.6", + "@rollup/rollup-freebsd-arm64": "4.34.6", + "@rollup/rollup-freebsd-x64": "4.34.6", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.6", + "@rollup/rollup-linux-arm-musleabihf": "4.34.6", + "@rollup/rollup-linux-arm64-gnu": "4.34.6", + "@rollup/rollup-linux-arm64-musl": "4.34.6", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.6", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.6", + "@rollup/rollup-linux-riscv64-gnu": "4.34.6", + "@rollup/rollup-linux-s390x-gnu": "4.34.6", + "@rollup/rollup-linux-x64-gnu": "4.34.6", + "@rollup/rollup-linux-x64-musl": "4.34.6", + "@rollup/rollup-win32-arm64-msvc": "4.34.6", + "@rollup/rollup-win32-ia32-msvc": "4.34.6", + "@rollup/rollup-win32-x64-msvc": "4.34.6", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", + "license": "CC0-1.0" + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", + "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==", + "dev": true, "license": "MIT", - "dependencies": { - "nofilter": "^3.1.0" - }, "engines": { - "node": ">=12.19" + "node": "^18.0.0 || >=20.0.0" } }, - "node_modules/cbor-web": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cbor-web/-/cbor-web-9.0.2.tgz", - "integrity": "sha512-N6gU2GsJS8RR5gy1d9wQcSPgn9FGJFY7KNvdDRlwHfz6kCxrQr2TDnrjXHmr6TFSl6Fd0FC4zRnityEldjRGvQ==", + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, "license": "MIT", "engines": { - "node": ">=16" + "node": ">=14.0.0" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "is-number": "^7.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=8.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, - "node_modules/dashhd": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/dashhd/-/dashhd-3.3.3.tgz", - "integrity": "sha512-sbhLV8EtmebnlIdx/d1hcbnxdfka/0rcLx+UO5y44kZdu5tyJ5ftBFbhhIb38vd+T+Xfcwpeo0z+0ZDznRkfaw==", - "license": "SEE LICENSE IN LICENSE" - }, - "node_modules/dashkeys": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/dashkeys/-/dashkeys-1.1.5.tgz", - "integrity": "sha512-ohHoe3bNeWZPsVxmOrWFaqZrJP3GeuSk6AtAawUCx0ZXVkTraeDQyMMp7ewhy3OEHkvs5yy6woMAQnwhmooX8w==", - "license": "SEE LICENSE IN LICENSE" - }, - "node_modules/dashphrase": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dashphrase/-/dashphrase-1.4.0.tgz", - "integrity": "sha512-o+LdiPkiYmg07kXBE+2bbcJzBmeTQVPn1GS2XlQeo8lene+KknAprSyiYi5XtqV/QVgNjvzOV7qBst2MijSPAA==", - "license": "SEE LICENSE IN LICENSE" - }, - "node_modules/dashtx": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/dashtx/-/dashtx-0.20.1.tgz", - "integrity": "sha512-+Y0vxmkCzZ2+qrWgrHDxYust6io/jeMaNkcaPFI3ZjWcwVQEBnARyqWDTvHvfISUeROkPEUwEJ2GSOXY9Tnprg==", - "license": "SEE LICENSE IN LICENSE", - "bin": { - "dashtx-inspect": "bin/inspect.js" + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" + "node_modules/triple-beam": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "node_modules/tsd": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.28.1.tgz", + "integrity": "sha512-FeYrfJ05QgEMW/qOukNCr4fAJHww4SaKnivAXRv4g5kj4FeLpNV7zH4dorzB9zAfVX4wmA7zWu/wQf7kkcvfbw==", "license": "MIT", + "dependencies": { + "@tsd/typescript": "~5.0.2", + "eslint-formatter-pretty": "^4.1.0", + "globby": "^11.0.1", + "jest-diff": "^29.0.3", + "meow": "^9.0.0", + "path-exists": "^4.0.0", + "read-pkg-up": "^7.0.0" + }, + "bin": { + "tsd": "dist/cli.js" + }, "engines": { - "node": ">=6" + "node": ">=14.16" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "license": "ISC", + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/google-protobuf": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.4.tgz", - "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", - "license": "(BSD-3-Clause AND Apache-2.0)" + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "license": "MIT" }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "license": "MIT", + "node_modules/unorm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", + "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", + "license": "MIT or GPL-2.0", "engines": { - "node": ">=8" + "node": ">= 0.4.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT" + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } }, - "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "license": "Apache-2.0" + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==", + "license": "MIT" }, - "node_modules/nofilter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "node_modules/vite": { + "version": "5.4.14", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.14.tgz", + "integrity": "sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==", + "dev": true, "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, "engines": { - "node": ">=12.19" + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } } }, - "node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "hasInstallScript": true, - "license": "BSD-3-Clause", + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" }, "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/protobufjs/node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "license": "Apache-2.0" - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" + "@types/node": { + "optional": true }, - { - "type": "consulting", - "url": "https://feross.org/support" + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true } - ], + } + }, + "node_modules/wasm-x11-hash": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wasm-x11-hash/-/wasm-x11-hash-0.0.2.tgz", + "integrity": "sha512-NOw8gd8J45FvNI/TunWKdPB1UG+/WDVckP4lP36Ffp1JY5Oo1nGq7K+0gdE75kzmhadEihBkIpchV3E0RESDwA==", "license": "MIT" }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "license": "ISC", + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, "bin": { - "semver": "bin/semver.js" + "why-is-node-running": "cli.js" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/winston": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.7.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.9.0" }, "engines": { - "node": ">=8" + "node": ">= 12.0.0" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/winston-transport": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "logform": "^2.7.0", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" }, "engines": { - "node": ">=8" + "node": ">= 12.0.0" } }, - "node_modules/varint": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", - "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==", - "license": "MIT" - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -563,6 +3879,15 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -572,6 +3897,12 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index 82d3666..be1f4d2 100644 --- a/package.json +++ b/package.json @@ -4,27 +4,35 @@ "description": "A lightweight library Dash Platform identities, data contracts, and documents", "main": "dashplatform.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "vitest", "jshint": "npx -p jshint@2.x -- jshint -c ./.jshintrc ./*.js", "lint": "npm run jshint && npm run tsc", "prettier": "npx -p prettier@3.x -- prettier -w '**/*.{js,md}'", "fmt": "npm run prettier", "bump": "npm version -m \"chore(release): bump to v%s\"", "tsc": "npx -p typescript@5.x -- tsc -p ./jsconfig.json", - "reexport-types": "npx -p jswt@1.x -- reexport", + "reexport-types": "npx -p jswt@2.x -- reexport", "prepublish": "npm run reexport-types" }, "keywords": [], "author": "AJ ONeal (https://therootcompany.com/)", "license": "SEE LICENSE IN LICENSE", "dependencies": { + "@dashevo/dapi-client": "^1.1.1", "@dashevo/dapi-grpc": "^1.1.1", "@dashevo/wasm-dpp": "^1.1.1", "@dashincubator/secp256k1": "^1.7.1-5", + "base-x": "^5.0.1", "cbor-web": "^9.0.2", "dashhd": "^3.3.3", "dashkeys": "^1.1.5", "dashphrase": "^1.4.0", - "dashtx": "^0.20.1" + "dashtx": "^0.20.3", + "dotenv": "^16.4.7", + "launchdarkly-eventsource": "^2.0.3", + "qrcode-svg": "^1.1.0" + }, + "devDependencies": { + "vitest": "^2.0.5" } }