diff --git a/.jshintrc b/.jshintrc index 589cec4..1f46c2c 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,7 @@ { + "globals": { + "crypto": false + }, "browser": true, "node": true, "esversion": 11, @@ -16,7 +19,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..76ec11e --- /dev/null +++ b/1-create-asset-lock.js @@ -0,0 +1,476 @@ +"use strict"; + +let Fs = require("node:fs/promises"); + +// let DashPhrase = require("dashphrase"); +let DashHd = require("dashhd"); +let DashKeys = require("dashkeys"); +let DashTx = require("dashtx"); +let DashPlatform = require("./dashplatform.js"); +let Bincode = require("./bincode.js"); + +let KeyUtils = require("./key-utils.js"); + +// 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"; + +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 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() { + // void (await WasmDpp.default()); + + let dashTx = DashTx.create(KeyUtils); + + let fundingWif = await readWif("./funding.wif"); + let fundingInfo = await wifToInfo(fundingWif, "testnet"); + + KeyUtils.set(fundingInfo.address, { + address: fundingInfo.address, + privateKey: fundingInfo.privateKey, + publicKey: fundingInfo.publicKey, + pubKeyHash: fundingInfo.pubKeyHashHex, + }); + + let changeWif = await readWif("./change.wif"); + let changeInfo = await wifToInfo(changeWif, "testnet"); + + let assetWif = await readWif("./asset.wif"); + let assetInfo = await wifToInfo(assetWif, "testnet"); + + // let masterWif = await readWif("./master.wif"); + // let masterInfo = await wifToInfo(masterWif, "testnet"); + + // let otherWif = await readWif("./other.wif"); + // let otherInfo = await wifToInfo(otherWif, "testnet"); + + let fundingUtxos = await DashTx.utils.rpc(rpcAuthUrl, "getaddressutxos", { + addresses: [fundingInfo.address], + }); + fundingUtxos[0].squence = "00000000"; // ?? + + 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; + if (changeSats < 10000) { + throw new Error( + `too few sats for test: ${fundingTotal} (needs at least 100000000 + 250 + 10000)`, + ); + } + + let burnOutput = { memo: "", satoshis: transferSats }; + let changeOutput = { + satoshis: changeSats, + pubKeyHash: changeInfo.pubKeyHashHex, + }; + 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: [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(); + 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(); + //@ts-expect-error - null sigHashType + 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); + + console.log(); + console.log( + `IMPORTANT: before broadcast, listen to 'rawtxlocksig' on https://tzmq.digitalcash.dev`, + ); + + console.log(); + console.log(`Funding Outpoint Info`); + let outpoint = await getFundingOutPoint(txSigned.transaction, vout); + console.log(outpoint); + + console.log(); + console.log(`Funding Outpoint Hex`); + let fundingOutPointHex = `${outpoint.txid}${outpoint.voutHex}`; + console.log(fundingOutPointHex); + + console.log(); + console.log(`Identity Id Hex`); + let identityId = await createIdentityId(fundingOutPointHex); + let identityIdHex = DashTx.utils.bytesToHex(identityId); + console.log(identityIdHex); +} + +/** + * @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); + + return { + wif, + privateKey, + privateKeyHex, + publicKey, + publicKeyHex, + pubKeyHash, + pubKeyHashHex, + address, + }; +} + +/** + * @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/2-create-identity-transition.js b/2-create-identity-transition.js new file mode 100644 index 0000000..3233730 --- /dev/null +++ b/2-create-identity-transition.js @@ -0,0 +1,424 @@ +let Fs = require("node:fs/promises"); + +let DashKeys = require("dashkeys"); +let DashTx = require("dashtx"); +let Bincode = require("./bincode.js"); + +let KeyUtils = require("./key-utils.js"); + +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, +}; + +async function main() { + // let fundingWif = await readWif("./funding.wif"); + // let fundingInfo = await wifToInfo(fundingWif, "testnet"); + + // KeyUtils.set(fundingInfo.address, { + // address: fundingInfo.address, + // privateKey: fundingInfo.privateKey, + // publicKey: fundingInfo.publicKey, + // pubKeyHash: fundingInfo.pubKeyHashHex, + // }); + + // let changeWif = await readWif("./change.wif"); + // let changeInfo = await wifToInfo(changeWif, "testnet"); + + let assetWif = await readWif("./asset.wif"); + let assetInfo = await wifToInfo(assetWif, "testnet"); + + let masterWif = await readWif("./master.wif"); + let masterInfo = await wifToInfo(masterWif, "testnet"); + + let otherWif = await readWif("./other.wif"); + let otherInfo = await wifToInfo(otherWif, "testnet"); + + let identityIdHex = await readHex("./identity-id.hex"); + let txidHex = await readHex("./txid.hex"); + + let txlocksigHex = await readHex("./rawtxlocksig.hex"); + + // 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; + + let assetLockProof; + let weEvenKnowHowToGetIsdlock = true; + if (weEvenKnowHowToGetIsdlock) { + assetLockProof = await getAssetLockInstantProof(txlocksigHex); + } else { + assetLockProof = await getAssetLockChainProof(txidHex); + } + + let identityKeys = await getKnownIdentityKeys( + { privateKey: masterInfo.privateKey, publicKey: masterInfo.publicKey }, + { privateKey: otherInfo.privateKey, publicKey: otherInfo.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, + 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); + + { + let magicSigBytes = await KeyUtils.magicSign({ + privKeyBytes: assetInfo.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 fullSigTransitionAb = Bincode.encode( + Bincode.StateTransition, + stateTransition, + { + signable: false, + }, + ); + let fullSigTransition = new Uint8Array(fullSigTransitionAb); + console.log(); + console.log(`transition (fully signed):`); + console.log(DashTx.utils.bytesToHex(fullSigTransition)); + grpcTransition = bytesToBase64(fullSigTransition); + } + + console.log(""); + console.log(`grpcurl -plaintext -d '{ + "stateTransition": "${grpcTransition}" +}' seed-1.testnet.networks.dash.org:1443 org.dash.platform.dapi.v0.Platform.broadcastStateTransition`); +} + +/** @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 + */ +async function getAssetLockChainProof(txidHex) { + let rpcAuthUrl = "https://api:null@trpc.digitalcash.dev"; + let getJson = true; + + let txInfo = await DashTx.utils.rpc( + rpcAuthUrl, + "getrawtransaction", + txidHex, + getJson, + ); + //@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; +} + +/** + * @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); + + return { + wif, + privateKey, + privateKeyHex, + publicKey, + publicKeyHex, + pubKeyHash, + pubKeyHashHex, + address, + }; +} + +main(); + +/** @typedef {String} Base58 */ +/** @typedef {String} Base64 */ +/** @typedef {String} HexString */ +/** @typedef {Number} Uint53 */ +/** @typedef {Number} Uint32 */ +/** @typedef {Number} Uint8 */ 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 index 700a9bf..56f8c31 100644 --- a/bincode.js +++ b/bincode.js @@ -1,4 +1,4 @@ -import { toHex } from "./hex" +import { toHex } from "./hex.js"; /** * @template T @@ -8,13 +8,21 @@ import { toHex } from "./hex" * @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={}) { - const bc = new BinCode(new DataView(new ArrayBuffer(16)), 0, options); +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(); } @@ -24,20 +32,19 @@ export function encode(_type, value, options={}) { * @param {BinCodeable} _type * @param {ArrayBuffer} value */ -export function decode(_type, value, options={}) { +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 + * + * @param {DataView} dataview + * @param {number} idx + * @param {any} options */ - constructor(dataview, idx=0, options={}) { + constructor(dataview, idx = 0, options = {}) { this.dataview = dataview; this.idx = idx; this.options = options; @@ -70,7 +77,7 @@ export class BinCode { 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); + 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); @@ -82,7 +89,14 @@ export class BinCode { * @param {any} msg */ _debug(msg) { - console.log('DEBUG: ' + msg + ' at ' + this.idx + ': ' + toHex(this.dataview.buffer.slice(this.idx))); + console.log( + "DEBUG: " + + msg + + " at " + + this.idx + + ": " + + toHex(this.dataview.buffer.slice(this.idx)), + ); } } @@ -93,7 +107,7 @@ export class BinCode { */ export function Vec(inner) { return { - name: 'Vec<' + inner.name + '>', + name: "Vec<" + inner.name + ">", encode(bc, val) { VarUint.encode(bc, val.length); for (let i = 0; i < val.length; i++) { @@ -108,10 +122,10 @@ export function Vec(inner) { val[i] = inner.decode(bc); } return val; - } - } + }, + }; } - + /** * @template {{}} T * @param {string} name @@ -123,6 +137,7 @@ export function Struct(name, inner) { 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))); @@ -137,16 +152,16 @@ export function Struct(name, inner) { // 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 */ @@ -169,10 +184,12 @@ export function Enum(name, toDiscriminant, definitions) { decode(bc) { const discriminant = Number(VarUint.decode(bc)); if (!(discriminant in definitions)) - throw new Error("Enum " + name + " decode failed, bad discriminant: " + discriminant); + throw new Error( + "Enum " + name + " decode failed, bad discriminant: " + discriminant, + ); return definitions[discriminant].decode(bc); - } - } + }, + }; } /** @@ -180,10 +197,21 @@ export function Enum(name, toDiscriminant, definitions) { * @param {BinCodeable} inner */ export function Option(inner) { - return Enum('Option<' + inner.name + '>', x => x == null? 0 : 1, { + 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); } /** @@ -206,36 +234,38 @@ export function Lazy(makeBincodeable) { decode(bc) { if (!bincodeable) bincodeable = makeBincodeable(); return bincodeable.decode(bc); - } - } + }, + }; } /** @type {BinCodeable} */ export const TODO = { - name: 'TODO', + name: "TODO", encode(bc, num) { throw new Error("TODO"); }, decode(bc) { throw new Error("TODO"); - } -} + }, +}; /** @type {BinCodeable} */ export const Nothing = { - name: 'Nothing', + name: "Nothing", encode(bc, num) {}, - decode(bc) {} -} + decode(bc) {}, +}; /** @type {BinCodeable} */ export const Null = { - name: 'Null', + name: "Null", encode(bc, num) {}, - decode(bc) { return null; } -} + 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 @@ -243,62 +273,64 @@ export const Null = { */ export function Constant(value) { return { - name: 'Constant<'+value+'>', + name: "Constant<" + value + ">", encode(bc, num) {}, - decode(bc) { return value; } - } + decode(bc) { + return value; + }, + }; } /** @type {BinCodeable} */ export const Uint8 = { - name: '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', + 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', + 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', + 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', + name: "Uint128", encode(bc, num) { let a = BigInt.asUintN(64, num); - let b = BigInt.asUintN(64, num>>64n); + let b = BigInt.asUintN(64, num >> 64n); bc.dataview.setBigUint64(bc._idxThenAddExtend(8), a, true); bc.dataview.setBigUint64(bc._idxThenAddExtend(8), b, true); }, @@ -306,8 +338,8 @@ export const Uint128 = { let a = Uint64.decode(bc); let b = Uint64.decode(bc); return BigInt(a.toString() + b.toString()); - } -} + }, +}; /** * @param {bigint} u @@ -328,16 +360,16 @@ function _zigzag(u) { */ function _unzigzag(u) { if (u % 2n == 0n) { - // positive number - return u >> 1n + // 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 + // 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; } } @@ -345,35 +377,32 @@ function _unzigzag(u) { * @param {bigint} value */ function _fitsInNumber(value) { - return value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER + return value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER; } /** @type {BinCodeable} */ export const VarUint = { - name: 'VarUint', + name: "VarUint", encode(bc, num) { - if (typeof num === 'number' && (num|0) !== 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); + 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) { + else if (251 <= num && num < 2 ** 16) { Uint8.encode(bc, 251); Uint16.encode(bc, Number(num)); - } - else if (2**16 <= num && num < 2**32) { + } 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) { + 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) { + } else if (2 ** 64 <= num && num < 2 ** 128) { Uint8.encode(bc, 254); Uint128.encode(bc, BigInt(num)); } else { @@ -383,48 +412,41 @@ export const VarUint = { 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)); + 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); + 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', + name: "VarInt", encode(bc, num) { - if (typeof num === 'number' && (num|0) !== num) + if (typeof num === "number" && (num | 0) !== num) throw new Error("VarInt.encode: not an integer:" + num); - let bnum = BigInt(num) + let bnum = BigInt(num); bnum = _zigzag(bnum); if (bnum < 251) Uint8.encode(bc, Number(bnum)); - else if (251 <= bnum && bnum < 2**16) { + else if (251 <= bnum && bnum < 2 ** 16) { Uint8.encode(bc, 251); Uint16.encode(bc, Number(bnum)); - } - else if (2**16 <= bnum && bnum < 2**32) { + } 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) { + else if (2 ** 32 <= bnum && bnum < 2 ** 64) { Uint8.encode(bc, 253); Uint64.encode(bc, bnum); - } - else if (2**64 <= bnum && bnum < 2**128) { + } else if (2 ** 64 <= bnum && bnum < 2 ** 128) { Uint8.encode(bc, 254); Uint128.encode(bc, bnum); } else { @@ -434,41 +456,36 @@ export const VarInt = { 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)); + 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); + 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', + 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) + if (val !== 0 && val !== 1) throw new Error("Bool decode error: " + val); return !!val; - } -} + }, +}; /** @type {BinCodeable} */ export const Bytes = { - name: 'Bytes', + name: "Bytes", encode(bc, val) { // console.log('Bytes.encode', val, val.length); // bc._debug('Bytes.encode length') @@ -481,12 +498,12 @@ export const Bytes = { 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', + name: "String", encode(bc, val) { const bytes = new TextEncoder().encode(val); Bytes.encode(bc, bytes); @@ -494,8 +511,8 @@ export const String = { decode(bc) { const bytes = Bytes.decode(bc); return new TextDecoder().decode(bytes); - } -} + }, +}; /** * @param {number} length @@ -503,16 +520,18 @@ export const String = { */ export function FixedBytes(length) { return { - name: 'FixedBytes<'+length+'>', + name: "FixedBytes<" + length + ">", encode(bc, val) { let idx = bc._idxThenAddExtend(length); - new Uint8Array(bc.dataview.buffer).set(val, idx); + 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); - } - } + }, + }; } /** @@ -522,22 +541,25 @@ export function FixedBytes(length) { */ export function NotSignable(inner) { return { - name: 'NotSignable<' + inner.name + '>', + name: "NotSignable<" + inner.name + ">", encode(bc, value) { - if (!bc.options.signable) + console.log(`DEBUG NotSignable<${inner.name}>`, bc, value); + if (!bc.options.signable) { inner.encode(bc, value); + } }, decode(bc) { - if (!bc.options.signable) + if (!bc.options.signable) { return inner.decode(bc); - } - } + } + }, + }; } -export const IdentityCreateTransition = Lazy(() => - Enum('IdentityCreateTransition', x => 0, { - 0: Struct('IdentityCreateTransitionV0', { - $version: Constant('0'), +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), @@ -548,9 +570,9 @@ export const IdentityCreateTransition = Lazy(() => // #[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); @@ -560,137 +582,154 @@ 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', + "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', + "AUTHENTICATION", + "ENCRYPTION", + "DECRYPTION", + "TRANSFER", + "SYSTEM", + "VOTING", ]; export const SecurityLevel = VarUint; // enum -export const SecurityLevel_values = [ - 'MASTER', - 'CRITICAL', - 'HIGH', - 'MEDIUM', -]; +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', { +export const ContractBounds = Lazy(() => + Enum("ContractBounds", (x) => ("document_type_name" in x ? 1 : 0), { + 0: Struct("ContractBounds0", { id: Identifier, }), - 1: Struct('ContractBounds1', { + 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 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 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 InstantLock = Struct("InstantLock", { + version: Uint8, + inputs: Vec(OutPoint), + txid: Txid, + cyclehash: CycleHash, + signature: BLSSignature, +}); -export const Witness = Struct('Witness', { +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 TxIn = Struct("TxIn", { + previous_output: OutPoint, + script_sig: ScriptBuf, + sequence: Uint32, + witness: Witness, +}); -export const TxOut = Struct('TxOut', { +export const TxOut = Struct("TxOut", { value: Uint64, script_pubkey: ScriptBuf, -}) +}); -export const TransactionPayload = Enum('TransactionPayload', x => -1, { - // TODO -}) +export const TransactionPayload = Enum("TransactionPayload", (x) => -1, { + // TODO - we have the normal layer 1 payload already +}); -export const Transaction = Struct('Transaction', { +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 InstantAssetLockProof = Struct("InstantAssetLockProof", { + instant_lock: InstantLock, + transaction: Transaction, + output_index: Uint32, +}); -export const RawInstantLockProof = Struct('RawInstantLockProof', { +export const RawInstantLockProof = Struct("RawInstantLockProof", { instant_lock: BinaryData, transaction: BinaryData, output_index: VarUint, //Uint32, -}) +}); -export const ChainAssetLockProof = Struct('ChainAssetLockProof', { +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, + }, +); -export const AssetLockProof = Enum('AssetLockProof', x => 0, { - 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 => 0, { - 0: RawInstantLockProof, - 1: ChainAssetLockProof, -}) +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'), +export const IdentityPublicKey = Enum("IdentityPublicKey", (x) => 0, { + 0: Struct("IdentityPublicKeyV0", { + $version: Constant("0"), id: KeyID, purpose: Purpose, security_level: SecurityLevel, @@ -700,7 +739,7 @@ export const IdentityPublicKey = Enum('IdentityPublicKey', x => 0, { data: BinaryData, disabled_at: Option(TimestampMillis), }), -}) +}); /** * This is a JSON.stringify replacer that converts keys to camelCase @@ -710,13 +749,13 @@ export const IdentityPublicKey = Enum('IdentityPublicKey', x => 0, { */ function jsonCamelCaseReplacer(key, value) { if (value instanceof Uint8Array) { - return Array.from(value) + return Array.from(value); } - if (value && typeof value === 'object') { + 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()) + let newkey = k.replace(/_[a-z]/g, (val) => val[1].toUpperCase()); replacement[newkey] = value[k]; } return replacement; @@ -727,11 +766,11 @@ function jsonCamelCaseReplacer(key, value) { * @param {any} value */ export function toJsonCamelCase(value) { - return JSON.stringify(value, jsonCamelCaseReplacer) + return JSON.stringify(value, jsonCamelCaseReplacer); } // TODO: Implement all the other transitions -export const StateTransition = Enum('StateTransition', x => 3, { +export const StateTransition = Enum("StateTransition", (x) => 3, { // 0: DataContractCreateTransition, //DataContractCreate(DataContractCreateTransition), // 1: DataContractUpdateTransition, //DataContractUpdate(DataContractUpdateTransition), // 2: DocumentsBatchTransition, //DocumentsBatch(DocumentsBatchTransition), @@ -741,4 +780,4 @@ export const StateTransition = Enum('StateTransition', x => 3, { // 6: IdentityUpdateTransition, //IdentityUpdate(IdentityUpdateTransition), // 7: IdentityCreditTransferTransition, //IdentityCreditTransfer(IdentityCreditTransferTransition), // 8: MasternodeVoteTransition, //MasternodeVote(MasternodeVoteTransition), -}) +}); diff --git a/bincode.test.js b/bincode.test.js index 617d812..fa2d918 100644 --- a/bincode.test.js +++ b/bincode.test.js @@ -1,142 +1,204 @@ -import { it, expect } from 'vitest' -import { fromHex } from './hex' -import { decode, encode, Identifier, IdentityPublicKey, StateTransition, StateTransitionSignable, toJsonCamelCase } from './bincode' +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) +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_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 master_private_key = fromHex( + "6c554775029f960891e3edf2d36b26a30d9a4b10034bb49f3a6c4617f557f7bc", + ); - const other_key_bytes = fromHex('000100010000002102014603018dc437642dda16f4c7fc50e482dd23e24680bcb3a5966c3b343848e200') - const other_key = decode(IdentityPublicKey, other_key_bytes.buffer) + 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_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') + const other_private_key = fromHex( + "426ae4838204206cacdfc7a2e04ac6a2d9e3c2e94df935878581c552f22b0096", + ); }); -it('should encode/decode Identifier', () => { - const identifier_bytes = fromHex('3dc908599ef8a5a3c510c430a27d4211c805556d99e5c06ffc3ca86a5feb55c3') - const identifier = decode(Identifier, identifier_bytes.buffer) +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))) -}) + // 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", + ); -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 }), + ), + ); - 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}) - expect(state_transition_bytes).toEqual(new Uint8Array(encode(StateTransition, state_transition, {signable: false}))) - - /* - IdentityCreate(V0(IdentityCreateTransitionV0 { + // 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) + 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, + ], + asset_lock_proof: Instant(InstantAssetLockProof { + instant_lock: InstantLock { + version: 1, inputs: [ - OutPoint { - txid: 0x6e200d059fb567ba19e92f5c2dcd3dde522fd4e0a50af223752db16158dabb1d, - vout: 0 + 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, + ], + 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, + 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, + }, + 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 } + 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, + 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) + }, + 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, + ], + 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) + 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])) + }), + 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])) })) */ }); @@ -149,12 +211,12 @@ it('should encode/decode StateTransition', () => { // { // "$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], +// "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", @@ -164,18 +226,18 @@ it('should encode/decode StateTransition', () => { // "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], +// "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 @@ -189,4 +251,4 @@ it('should encode/decode StateTransition', () => { // // Ok::<(), ProtocolError>(()) // // })?; // // ``` -// }) \ No newline at end of file +// }) diff --git a/demo-static.js b/demo-static.js new file mode 100644 index 0000000..8cd4fca --- /dev/null +++ b/demo-static.js @@ -0,0 +1,691 @@ +"use strict"; + +// let DashPhrase = require("dashphrase"); +let DashHd = require("dashhd"); +let DashKeys = require("dashkeys"); +let DashTx = require("dashtx"); +let DashPlatform = require("./dashplatform.js"); +let Bincode = require("./bincode.js"); + +let KeyUtils = require("./key-utils.js"); + +// 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"; + +// 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 main() { + // void (await WasmDpp.default()); + + let dashTx = DashTx.create(KeyUtils); + + let fundingPkhHex = "88d9931ea73d60eaf7e5671efc0552b912911f2a"; + let fundingPkh = DashKeys.utils.hexToBytes(fundingPkhHex); + // yYo3PeSBv2rMnJeyLUCCzx4Y8VhPppZKkC + let fundingAddr = await DashKeys.pkhToAddr(fundingPkh, { + version: "testnet", + }); + console.log(`DEBUG funding address: ${fundingAddr} (${fundingPkhHex})`); + + let fundingUtxos = [ + { + address: fundingAddr, + satoshis: 100000000 + 5000 + 200, // TODO + txidHex: + "5884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4", + txid: "a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458", + txId: "a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458", + outputIndexHex: "00000000", + outputIndex: 0, + scriptSizeHex: "19", + scriptSize: 25, + script: "76a91488d9931ea73d60eaf7e5671efc0552b912911f2a88ac", + sequence: "00000000", + sigHashType: DashTx.SIGHASH_ALL, + }, + ]; + + let assetLockPrivateKeyHex = + "33a9f0603ba69b97dff83e08b4ee36cebbc987739e9749615e1727754f2bf2d2"; + let assetLockPrivateKey = DashKeys.utils.hexToBytes(assetLockPrivateKeyHex); + 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 address: ${assetLockAddr} (${assetLockPkhHex})`, + ); + + // 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 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 address: ${masterAddr} (${masterPkhHex})`); + + let otherPrivateKeyHex = + "426ae4838204206cacdfc7a2e04ac6a2d9e3c2e94df935878581c552f22b0096"; + let otherPrivateKey = DashKeys.utils.hexToBytes(otherPrivateKeyHex); + 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 address: ${otherAddr} (${otherPkhHex})`); + + // 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/key-utils.js b/key-utils.js index 996758d..5cb03ae 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,109 @@ 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; +} + +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 ffb6205..95fa30d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "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", @@ -16,21 +17,53 @@ "dashhd": "^3.3.3", "dashkeys": "^1.1.5", "dashphrase": "^1.4.0", - "dashtx": "^0.20.1", + "dashtx": "^0.20.3" + }, + "devDependencies": { "vitest": "^2.0.5" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "license": "Apache-2.0", + "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": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "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": { @@ -41,13 +74,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", @@ -55,10 +109,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", @@ -109,9 +219,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", @@ -120,6 +230,12 @@ "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", @@ -133,6 +249,7 @@ "cpu": [ "ppc64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -149,6 +266,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -165,6 +283,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -181,6 +300,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -197,6 +317,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -213,6 +334,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -229,6 +351,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -245,6 +368,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -261,6 +385,7 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -277,6 +402,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -293,6 +419,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -309,6 +436,7 @@ "cpu": [ "loong64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -325,6 +453,7 @@ "cpu": [ "mips64el" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -341,6 +470,7 @@ "cpu": [ "ppc64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -357,6 +487,7 @@ "cpu": [ "riscv64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -373,6 +504,7 @@ "cpu": [ "s390x" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -389,6 +521,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -405,6 +538,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -421,6 +555,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -437,6 +572,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -453,6 +589,7 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -469,6 +606,7 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -485,6 +623,7 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ @@ -557,52 +696,58 @@ "google-protobuf": "^3.14.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "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": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": ">=6.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "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": ">=6.0.0" + "node": ">= 8" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "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": ">=6.0.0" + "node": ">= 8" } }, - "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==", - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "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": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" } }, "node_modules/@protobufjs/aspromise": { @@ -670,12 +815,13 @@ "license": "BSD-3-Clause" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", - "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", + "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": [ @@ -683,12 +829,13 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", - "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", + "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", "optional": true, "os": [ @@ -696,12 +843,13 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", - "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", + "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", "optional": true, "os": [ @@ -709,25 +857,55 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", - "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", + "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.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", - "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", + "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": [ @@ -735,12 +913,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", - "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", + "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": [ @@ -748,12 +927,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", - "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", + "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": [ @@ -761,12 +941,27 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", - "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", + "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": [ @@ -774,12 +969,13 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", - "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", + "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": [ @@ -787,12 +983,13 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", - "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", + "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": [ @@ -800,12 +997,13 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", - "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", + "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": [ @@ -813,12 +1011,13 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", - "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", + "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": [ @@ -826,12 +1025,13 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", - "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", + "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": [ @@ -839,12 +1039,13 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", - "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", + "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": [ @@ -852,12 +1053,13 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", - "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", + "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": [ @@ -865,22 +1067,51 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", - "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", + "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": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "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": { @@ -889,34 +1120,81 @@ "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.5.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", - "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "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.19.2" + "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.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", - "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", + "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.0.5", - "@vitest/utils": "2.0.5", - "chai": "^5.1.1", + "@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.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", - "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", + "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" @@ -926,12 +1204,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.0.5.tgz", - "integrity": "sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==", + "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.0.5", + "@vitest/utils": "2.1.9", "pathe": "^1.1.2" }, "funding": { @@ -939,13 +1218,14 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.0.5.tgz", - "integrity": "sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==", + "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.0.5", - "magic-string": "^0.30.10", + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", "pathe": "^1.1.2" }, "funding": { @@ -953,32 +1233,65 @@ } }, "node_modules/@vitest/spy": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.5.tgz", - "integrity": "sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==", + "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.0" + "tinyspy": "^3.0.2" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.5.tgz", - "integrity": "sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==", + "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.0.5", - "estree-walker": "^3.0.3", - "loupe": "^3.1.1", + "@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", @@ -1003,15 +1316,40 @@ "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": "3.0.10", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", @@ -1021,11 +1359,60 @@ "safe-buffer": "^5.0.1" } }, + "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", @@ -1041,13 +1428,70 @@ "base-x": "^3.0.2" } }, + "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": { @@ -1072,9 +1516,10 @@ } }, "node_modules/chai": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", - "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", + "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", @@ -1087,10 +1532,27 @@ "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" @@ -1107,6 +1569,16 @@ "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", @@ -1125,28 +1597,49 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "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": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" } }, - "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/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/dashkeys": { - "version": "1.1.5", + "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" @@ -1158,18 +1651,19 @@ "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==", + "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.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "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" @@ -1183,25 +1677,157 @@ } } }, + "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/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": { @@ -1237,50 +1863,129 @@ } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "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/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "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": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=16.17" + "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" }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "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, @@ -1291,6 +1996,21 @@ "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", @@ -1300,22 +2020,33 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "license": "MIT", + "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": "*" + "node": ">= 6" } }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "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": ">=16" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1327,175 +2058,765 @@ "integrity": "sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ==", "license": "(BSD-3-Clause AND Apache-2.0)" }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "license": "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": ">=16.17.0" + "node": ">=6" } }, - "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==", + "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/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "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", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=4" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "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/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/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/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/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/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "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": { - "get-func-name": "^2.0.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "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": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "license": "MIT" - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "license": "MIT", - "engines": { - "node": ">=12" + "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" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=10" } }, - "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.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "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/ai" + "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", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">= 4" } }, - "node_modules/nofilter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "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": ">=12.19" + "node": ">=8" } }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "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": { - "path-key": "^4.0.0" + "hasown": "^2.0.2" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "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": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "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": { - "mimic-fn": "^4.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=12" + "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/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "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/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" @@ -1505,99 +2826,347 @@ "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/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": ">= 14.16" + "node": ">= 6" } }, - "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "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/postcss": { - "version": "8.4.45", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", - "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", - "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" - } - ], + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" }, "engines": { - "node": "^10 || ^12 || >=14" + "node": ">=8" } }, - "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/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": { - "@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" + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "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/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.21.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", - "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", + "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.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -1607,25 +3176,51 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.2", - "@rollup/rollup-android-arm64": "4.21.2", - "@rollup/rollup-darwin-arm64": "4.21.2", - "@rollup/rollup-darwin-x64": "4.21.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", - "@rollup/rollup-linux-arm-musleabihf": "4.21.2", - "@rollup/rollup-linux-arm64-gnu": "4.21.2", - "@rollup/rollup-linux-arm64-musl": "4.21.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", - "@rollup/rollup-linux-riscv64-gnu": "4.21.2", - "@rollup/rollup-linux-s390x-gnu": "4.21.2", - "@rollup/rollup-linux-x64-gnu": "4.21.2", - "@rollup/rollup-linux-x64-musl": "4.21.2", - "@rollup/rollup-win32-arm64-msvc": "4.21.2", - "@rollup/rollup-win32-ia32-msvc": "4.21.2", - "@rollup/rollup-win32-x64-msvc": "4.21.2", + "@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", @@ -1646,10 +3241,19 @@ ], "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.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "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" @@ -1658,66 +3262,111 @@ "node": ">=10" } }, - "node_modules/shebang-command": { + "node_modules/siginfo": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "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": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" + "is-arrayish": "^0.3.1" } }, - "node_modules/shebang-regex": { + "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/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "license": "ISC" - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "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.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "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", @@ -1744,28 +3393,80 @@ "node": ">=8" } }, - "node_modules/strip-final-newline": { + "node_modules/strip-indent": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "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": ">=12" + "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/sindresorhus" + "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.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz", - "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==", + "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", "engines": { "node": "^18.0.0 || >=20.0.0" @@ -1775,26 +3476,122 @@ "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": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.0.tgz", - "integrity": "sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==", + "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/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": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "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/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/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/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": ">=14.16" + } + }, + "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": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "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/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": ">= 0.4.0" + } + }, + "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/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/varint": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", @@ -1802,9 +3599,10 @@ "license": "MIT" }, "node_modules/vite": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.3.tgz", - "integrity": "sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q==", + "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", @@ -1861,15 +3659,16 @@ } }, "node_modules/vite-node": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.0.5.tgz", - "integrity": "sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==", + "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": { "cac": "^6.7.14", - "debug": "^4.3.5", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", "pathe": "^1.1.2", - "tinyrainbow": "^1.2.0", "vite": "^5.0.0" }, "bin": { @@ -1883,29 +3682,31 @@ } }, "node_modules/vitest": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.0.5.tgz", - "integrity": "sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==", - "license": "MIT", - "dependencies": { - "@ampproject/remapping": "^2.3.0", - "@vitest/expect": "2.0.5", - "@vitest/pretty-format": "^2.0.5", - "@vitest/runner": "2.0.5", - "@vitest/snapshot": "2.0.5", - "@vitest/spy": "2.0.5", - "@vitest/utils": "2.0.5", - "chai": "^5.1.1", - "debug": "^4.3.5", - "execa": "^8.0.1", - "magic-string": "^0.30.10", + "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.7.0", - "tinybench": "^2.8.0", - "tinypool": "^1.0.0", + "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.0.5", + "vite-node": "2.1.9", "why-is-node-running": "^2.3.0" }, "bin": { @@ -1920,8 +3721,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.0.5", - "@vitest/ui": "2.0.5", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", "happy-dom": "*", "jsdom": "*" }, @@ -1946,25 +3747,33 @@ } } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "license": "ISC", + "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/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": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" + "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", @@ -1977,6 +3786,42 @@ "node": ">=8" } }, + "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": { + "@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": ">= 12.0.0" + } + }, + "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": { + "logform": "^2.7.0", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -1994,6 +3839,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", @@ -2003,6 +3857,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 ccd9a07..7e43b40 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,14 @@ "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", @@ -25,7 +26,9 @@ "dashhd": "^3.3.3", "dashkeys": "^1.1.5", "dashphrase": "^1.4.0", - "dashtx": "^0.20.1", + "dashtx": "^0.20.3" + }, + "devDependencies": { "vitest": "^2.0.5" } }