@aptos-labs/ts-sdk 5.1.4 → 5.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +68 -201
- package/dist/common/chunk-HO5ESTN4.js.map +1 -1
- package/dist/common/cli/index.js.map +1 -1
- package/dist/common/index.js +2 -2
- package/dist/common/index.js.map +1 -1
- package/dist/esm/account/AbstractKeylessAccount.mjs +1 -1
- package/dist/esm/account/AbstractedAccount.mjs +1 -1
- package/dist/esm/account/Account.mjs +1 -1
- package/dist/esm/account/AccountUtils.mjs +1 -1
- package/dist/esm/account/DerivableAbstractedAccount.mjs +1 -1
- package/dist/esm/account/Ed25519Account.mjs +1 -1
- package/dist/esm/account/EphemeralKeyPair.mjs +1 -1
- package/dist/esm/account/FederatedKeylessAccount.mjs +1 -1
- package/dist/esm/account/KeylessAccount.mjs +1 -1
- package/dist/esm/account/MultiEd25519Account.mjs +1 -1
- package/dist/esm/account/MultiKeyAccount.mjs +1 -1
- package/dist/esm/account/SingleKeyAccount.mjs +1 -1
- package/dist/esm/account/index.mjs +1 -1
- package/dist/esm/account/utils.mjs +1 -1
- package/dist/esm/api/account/abstraction.mjs +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/keyless.mjs +1 -1
- package/dist/esm/api/object.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/table.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-BIQOJ3OK.mjs → chunk-3Q4MUGFR.mjs} +2 -2
- package/dist/esm/{chunk-WOEH45Q2.mjs → chunk-EM7NAPDX.mjs} +2 -2
- package/dist/esm/{chunk-7WIDI4FZ.mjs → chunk-I7UCQWRH.mjs} +2 -2
- package/dist/esm/chunk-JYXE7MWR.mjs +2 -0
- package/dist/esm/{chunk-WGRSKMNQ.mjs.map → chunk-JYXE7MWR.mjs.map} +1 -1
- package/dist/esm/{chunk-IXRGCQQU.mjs → chunk-KNVQ5OJ7.mjs} +2 -2
- package/dist/esm/{chunk-AVOTC5EI.mjs → chunk-L5EMB6TN.mjs} +2 -2
- package/dist/esm/{chunk-X5BUBEJH.mjs → chunk-M2R4ECLZ.mjs} +2 -2
- package/dist/esm/{chunk-IQPLJ32K.mjs → chunk-NV35GUIY.mjs} +3 -3
- package/dist/esm/{chunk-IQPLJ32K.mjs.map → chunk-NV35GUIY.mjs.map} +1 -1
- package/dist/esm/{chunk-GTRHYHQK.mjs → chunk-SQW3MYZL.mjs} +2 -2
- package/dist/esm/{chunk-JYDVO4K3.mjs → chunk-UQT4B7EQ.mjs} +2 -2
- package/dist/esm/{chunk-VV6OTOMS.mjs → chunk-XP66F4IY.mjs} +2 -2
- package/dist/esm/{chunk-SGZPRMLE.mjs → chunk-YDWD2GVM.mjs} +2 -2
- package/dist/esm/{chunk-IKTH33UN.mjs → chunk-Z7NBE6RR.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/crypto/abstraction.mjs +1 -1
- package/dist/esm/core/crypto/deserializationUtils.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/ephemeral.mjs +1 -1
- package/dist/esm/core/crypto/federatedKeyless.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/keyless.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/proof.mjs +1 -1
- package/dist/esm/core/crypto/publicKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/crypto/secp256r1.mjs +1 -1
- package/dist/esm/core/crypto/signature.mjs +1 -1
- package/dist/esm/core/crypto/singleKey.mjs +1 -1
- package/dist/esm/core/crypto/utils.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/abstraction.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/keyless.mjs +1 -1
- package/dist/esm/internal/object.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/table.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/internal/utils/index.mjs +1 -1
- package/dist/esm/internal/utils/utils.mjs +1 -1
- package/dist/esm/internal/view.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/multiAgentTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/simpleTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/signingMessage.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +2 -2
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/normalizeBundle.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/src/internal/account.ts +13 -10
- package/src/version.ts +1 -1
- package/dist/esm/chunk-WGRSKMNQ.mjs +0 -2
- /package/dist/esm/{chunk-BIQOJ3OK.mjs.map → chunk-3Q4MUGFR.mjs.map} +0 -0
- /package/dist/esm/{chunk-WOEH45Q2.mjs.map → chunk-EM7NAPDX.mjs.map} +0 -0
- /package/dist/esm/{chunk-7WIDI4FZ.mjs.map → chunk-I7UCQWRH.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXRGCQQU.mjs.map → chunk-KNVQ5OJ7.mjs.map} +0 -0
- /package/dist/esm/{chunk-AVOTC5EI.mjs.map → chunk-L5EMB6TN.mjs.map} +0 -0
- /package/dist/esm/{chunk-X5BUBEJH.mjs.map → chunk-M2R4ECLZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-GTRHYHQK.mjs.map → chunk-SQW3MYZL.mjs.map} +0 -0
- /package/dist/esm/{chunk-JYDVO4K3.mjs.map → chunk-UQT4B7EQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-VV6OTOMS.mjs.map → chunk-XP66F4IY.mjs.map} +0 -0
- /package/dist/esm/{chunk-SGZPRMLE.mjs.map → chunk-YDWD2GVM.mjs.map} +0 -0
- /package/dist/esm/{chunk-IKTH33UN.mjs.map → chunk-Z7NBE6RR.mjs.map} +0 -0
package/dist/common/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } function _optionalChainDelete(ops) { const result = _optionalChain(ops); return result == null ? true : result; }var _chunkHO5ESTN4js = require('./chunk-HO5ESTN4.js');var C=class n{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}static fromHex(e){let t=_chunkHO5ESTN4js.v.hexInputToUint8Array(e);return new n(t)}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}remaining(){return this.buffer.byteLength-this.offset}assertFinished(){if(this.remaining()!==0)throw new Error("Buffer has remaining bytes")}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){return this.deserializeOption("string")}deserializeOption(e,t){if(this.deserializeBool()){if(e==="string")return this.deserializeStr();if(e==="bytes")return this.deserializeBytes();if(e==="fixedBytes"){if(t===void 0)throw new Error("Fixed bytes length not provided");return this.deserializeFixedBytes(t)}return this.deserialize(e)}}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),t=this.deserializeU32();return BigInt(BigInt(t)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),t=this.deserializeU64();return BigInt(t<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),t=this.deserializeU128();return BigInt(t<<BigInt(128)|e)}deserializeI8(){return new DataView(this.read(1)).getInt8(0)}deserializeI16(){return new DataView(this.read(2)).getInt16(0,!0)}deserializeI32(){return new DataView(this.read(4)).getInt32(0,!0)}deserializeI64(){let e=this.deserializeU32(),t=this.deserializeU32(),r=BigInt(BigInt(t)<<BigInt(32)|BigInt(e)),i=BigInt(1)<<BigInt(63);return r>=i?r-(BigInt(1)<<BigInt(64)):r}deserializeI128(){let e=this.deserializeU64(),t=this.deserializeU64(),r=BigInt(t<<BigInt(64)|e),i=BigInt(1)<<BigInt(127);return r>=i?r-(BigInt(1)<<BigInt(128)):r}deserializeI256(){let e=this.deserializeU128(),t=this.deserializeU128(),r=BigInt(t<<BigInt(128)|e),i=BigInt(1)<<BigInt(255);return r>=i?r-(BigInt(1)<<BigInt(256)):r}deserializeUleb128AsU32(){let e=BigInt(0),t=0;for(;e<_chunkHO5ESTN4js.d;){let r=this.deserializeU8();if(e|=BigInt(r&127)<<BigInt(t),(r&128)===0)break;t+=7}if(e>_chunkHO5ESTN4js.d)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let t=this.deserializeUleb128AsU32(),r=new Array;for(let i=0;i<t;i+=1)r.push(this.deserialize(e));return r}};var Re=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,t){let r=e.deserializeFixedBytes(t);return new n(r)}};var gr=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=new Re(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,t){let r=Re.deserialize(e,t);return new n(r.value)}};var F=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.z.call(void 0, e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new Se(e.deserializeU256())}static deserialize(e){return new n(e.deserializeBool())}},Z= exports.U8 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.b),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new n(e.deserializeU8())}},Ue= exports.U16 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.c),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new n(e.deserializeU16())}},ze= exports.U32 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.d),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new n(e.deserializeU32())}},$= exports.U64 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.e),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new n(e.deserializeU64())}},ke= exports.U128 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.f),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new n(e.deserializeU128())}},Se= exports.U256 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.g),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new n(e.deserializeU256())}},Jo= exports.I8 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.h,_chunkHO5ESTN4js.i),this.value=e}serialize(e){e.serializeI8(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI8())}},Xo= exports.I16 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.j,_chunkHO5ESTN4js.k),this.value=e}serialize(e){e.serializeI16(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI16())}},Yo= exports.I32 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.l,_chunkHO5ESTN4js.m),this.value=e}serialize(e){e.serializeI32(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI32())}},Zo= exports.I64 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.n,_chunkHO5ESTN4js.o),this.value=BigInt(e)}serialize(e){e.serializeI64(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI64())}},es= exports.I128 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.p,_chunkHO5ESTN4js.q),this.value=BigInt(e)}serialize(e){e.serializeI128(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI128())}},ts= exports.I256 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.r,_chunkHO5ESTN4js.s),this.value=BigInt(e)}serialize(e){e.serializeI256(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI256())}};var S=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof Z)){new Rn(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let t;if(Array.isArray(e)&&e.length===0)t=[];else if(Array.isArray(e)&&typeof e[0]=="number")t=e;else if(typeof e=="string"){let r=_chunkHO5ESTN4js.v.fromHexInput(e);t=Array.from(r.toUint8Array())}else if(e instanceof Uint8Array)t=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new n(t.map(r=>new Z(r)))}static U16(e){return new n(e.map(t=>new Ue(t)))}static U32(e){return new n(e.map(t=>new ze(t)))}static U64(e){return new n(e.map(t=>new $(t)))}static U128(e){return new n(e.map(t=>new ke(t)))}static U256(e){return new n(e.map(t=>new Se(t)))}static Bool(e){return new n(e.map(t=>new F(t)))}static MoveString(e){return new n(e.map(t=>new v(t)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,t){let r=e.deserializeUleb128AsU32(),i=new Array;for(let o=0;o<r;o+=1)i.push(t.deserialize(e));return new n(i)}},Rn= exports.Serialized =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new n(e.deserializeBytes())}toMoveVector(e){let t=new C(this.bcsToBytes());t.deserializeUleb128AsU32();let r=t.deserializeVector(e);return new S(r)}},v= exports.MoveString =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let r=new TextEncoder().encode(this.value);S.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},ne= exports.MoveOption =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new S([e]):this.vec=new S([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new Z(e):void 0)}static U16(e){return new n(e!=null?new Ue(e):void 0)}static U32(e){return new n(e!=null?new ze(e):void 0)}static U64(e){return new n(e!=null?new $(e):void 0)}static U128(e){return new n(e!=null?new ke(e):void 0)}static U256(e){return new n(e!=null?new Se(e):void 0)}static Bool(e){return new n(e!=null?new F(e):void 0)}static MoveString(e){return new n(e!=null?new v(e):void 0)}static deserialize(e,t){let r=S.deserialize(e,t);return new n(r.values[0])}};var _sha3 = require('@noble/hashes/sha3');var bt=class bt extends _chunkHO5ESTN4js.x{constructor(e){super();let{data:t}=e,r=_chunkHO5ESTN4js.v.fromHexInput(t);if(r.toUint8Array().length!==bt.LENGTH)throw new Error(`Authentication Key length should be ${bt.LENGTH}`);this.data=r}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeFixedBytes(bt.LENGTH);return new bt({data:t})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(e){let{scheme:t,input:r}=e,i=_chunkHO5ESTN4js.v.fromHexInput(r).toUint8Array(),o=new Uint8Array([...i,t]),s=_sha3.sha3_256.create();s.update(o);let a=s.digest();return new bt({data:a})}static fromPublicKeyAndScheme(e){let{publicKey:t}=e;return t.authKey()}static fromPublicKey(e){let{publicKey:t}=e;return t.authKey()}derivedAddress(){return new (0, _chunkHO5ESTN4js.na)(this.data.toUint8Array())}};bt.LENGTH=32;var V=bt;var et=class extends _chunkHO5ESTN4js.x{async verifySignatureAsync(e){return this.verifySignature(e)}toUint8Array(){return this.bcsToBytes()}toString(){let e=this.toUint8Array();return _chunkHO5ESTN4js.v.fromHexInput(e).toString()}},ae= exports.AccountPublicKey =class extends et{};var O=class extends _chunkHO5ESTN4js.x{toUint8Array(){return this.bcsToBytes()}toString(){let e=this.toUint8Array();return _chunkHO5ESTN4js.v.fromHexInput(e).toString()}};var Un=class n extends O{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}static deserialize(e){return new n(e.deserializeBytes())}},yr= exports.AbstractPublicKey =class extends ae{constructor(e){super(),this.accountAddress=e}authKey(){return new V({data:this.accountAddress.toUint8Array()})}verifySignature(e){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(e){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(e){throw new Error("This function is not implemented for AbstractPublicKey.")}};var _ed25519 = require('@noble/curves/ed25519');var _hmac = require('@noble/hashes/hmac');var _sha512 = require('@noble/hashes/sha512');var _bip39 = require('@scure/bip39'); var ns = _interopRequireWildcard(_bip39);var au=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,cu= exports.APTOS_BIP44_REGEX =/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,uu= exports.KeyType =(e=>(e.ED25519="ed25519 seed",e))(uu||{}),rs= exports.HARDENED_OFFSET =2147483648;function is(n){return cu.test(n)}function os(n){return au.test(n)}var bi=(n,e)=>{let t=_hmac.hmac.create(_sha512.sha512,n).update(e).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},ss= exports.CKDPriv =({key:n,chainCode:e},t)=>{let r=new ArrayBuffer(4);new DataView(r).setUint32(0,t);let i=new Uint8Array(r),o=new Uint8Array([0]),s=new Uint8Array([...o,...n,...i]);return bi(e,s)},du=n=>n.replace(/'/g,""),as= exports.splitPath =n=>n.split("/").slice(1).map(du),mr= exports.mnemonicToSeed =n=>{let e=n.trim().split(/\s+/).map(t=>t.toLowerCase()).join(" ");return ns.mnemonicToSeedSync(e)};var zn=class zn{static formatPrivateKey(e,t){let r=zn.AIP80_PREFIXES[t],i=e;return typeof i=="string"&&i.startsWith(r)&&(i=i.split("-")[2]),`${r}${_chunkHO5ESTN4js.v.fromHexInput(i).toString()}`}static parseHexInput(e,t,r){let i,o=zn.AIP80_PREFIXES[t];if(typeof e=="string")if(!r&&!e.startsWith(o))i=_chunkHO5ESTN4js.v.fromHexInput(e),r!==!1&&console.warn("[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.");else if(e.startsWith(o))i=_chunkHO5ESTN4js.v.fromHexString(e.split("-")[2]);else throw r?new Error("Invalid HexString input while parsing private key. Must AIP-80 compliant string."):new Error("Invalid HexString input while parsing private key.");else i=_chunkHO5ESTN4js.v.fromHexInput(e);return i}};zn.AIP80_PREFIXES={ed25519:"ed25519-priv-",secp256k1:"secp256k1-priv-",secp256r1:"secp256r1-priv-"};var Pe=zn;var _jwtdecode = require('jwt-decode');var Tt=class n extends et{constructor(e){super();let t=e.constructor.name;switch(t){case E.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${t}`)}}verifySignature(e){let{message:t,signature:r}=e;return this.publicKey.verifySignature({message:t,signature:r.signature})}async verifySignatureAsync(e){return this.verifySignature(e)}serialize(e){if(this.publicKey instanceof E)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(E.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${t}`)}}static isPublicKey(e){return e instanceof n}},Le= exports.EphemeralSignature =class n extends O{constructor(e){super();let t=e.constructor.name;switch(t){case R.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${t}`)}}static fromHex(e){let t=_chunkHO5ESTN4js.v.fromHexInput(e),r=new C(t.toUint8Array());return n.deserialize(r)}serialize(e){if(this.signature instanceof R)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(R.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${t}`)}}};var _poseidonlite = require('poseidon-lite');var Ti=[_poseidonlite.poseidon1,_poseidonlite.poseidon2,_poseidonlite.poseidon3,_poseidonlite.poseidon4,_poseidonlite.poseidon5,_poseidonlite.poseidon6,_poseidonlite.poseidon7,_poseidonlite.poseidon8,_poseidonlite.poseidon9,_poseidonlite.poseidon10,_poseidonlite.poseidon11,_poseidonlite.poseidon12,_poseidonlite.poseidon13,_poseidonlite.poseidon14,_poseidonlite.poseidon15,_poseidonlite.poseidon16],us=31,xu=16,cs=(xu-1)*us;function qe(n,e){let r=new TextEncoder().encode(n);return vu(r,e)}function vu(n,e){if(n.length>e)throw new Error(`Inputted bytes of length ${n} is longer than ${e}`);let t=kn(n,e);return Kt(t)}function Cu(n,e){if(n.length>e)throw new Error(`Input bytes of length ${n} is longer than ${e}`);let t=Uu(n,e);return Ku(t)}function kn(n,e){if(n.length>e)throw new Error(`Input bytes of length ${n} is longer than ${e}`);return Cu(n,e).concat([BigInt(n.length)])}function Ku(n){if(n.length>cs)throw new Error(`Can't pack more than ${cs}. Was given ${n.length} bytes`);return Ru(n,us).map(e=>Ct(e))}function Ru(n,e){let t=[];for(let r=0;r<n.length;r+=e)t.push(n.subarray(r,r+e));return t}function Ct(n){let e=BigInt(0);for(let t=n.length-1;t>=0;t-=1)e=e<<BigInt(8)|BigInt(n[t]);return e}function wi(n,e){let t=BigInt(n),r=new Uint8Array(e);for(let i=0;i<e;i+=1)r[i]=Number(t&BigInt(255)),t>>=BigInt(8);return r}function Uu(n,e){if(e<n.length)throw new Error("Padded size must be greater than or equal to the input array size.");let t=new Uint8Array(e);t.set(n);for(let r=n.length;r<e;r+=1)t[r]=0;return t}function Kt(n){if(n.length>Ti.length)throw new Error(`Unable to hash input of length ${n.length}. Max input length is ${Ti.length}`);return Ti[n.length-1](n)}var fr=class extends _chunkHO5ESTN4js.x{};var ds="5.1.4";var ps={mainnet:"https://api.mainnet.aptoslabs.com/v1/graphql",testnet:"https://api.testnet.aptoslabs.com/v1/graphql",devnet:"https://api.devnet.aptoslabs.com/v1/graphql",shelbynet:"https://api.shelbynet.shelby.xyz/v1/graphql",netna:"https://api.netna.staging.aptoslabs.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ls= exports.NetworkToNodeAPI ={mainnet:"https://api.mainnet.aptoslabs.com/v1",testnet:"https://api.testnet.aptoslabs.com/v1",devnet:"https://api.devnet.aptoslabs.com/v1",shelbynet:"https://api.shelbynet.shelby.xyz/v1",netna:"https://api.netna.staging.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},gs= exports.NetworkToFaucetAPI ={devnet:"https://faucet.devnet.aptoslabs.com",shelbynet:"https://faucet.shelbynet.shelby.xyz",netna:"https://faucet-dev-netna-us-central1-410192433417.us-central1.run.app",local:"http://127.0.0.1:8081"},Si= exports.NetworkToPepperAPI ={mainnet:"https://api.mainnet.aptoslabs.com/keyless/pepper/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/pepper/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",shelbynet:"https://api.shelbynet.aptoslabs.com/keyless/pepper/v0",netna:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",local:"https://api.devnet.aptoslabs.com/keyless/pepper/v0"},Pi= exports.NetworkToProverAPI ={mainnet:"https://api.mainnet.aptoslabs.com/keyless/prover/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/prover/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/prover/v0",shelbynet:"https://api.shelbynet.aptoslabs.com/keyless/prover/v0",netna:"https://api.devnet.aptoslabs.com/keyless/prover/v0",local:"https://api.devnet.aptoslabs.com/keyless/prover/v0"},Ei= exports.Network =(a=>(a.MAINNET="mainnet",a.TESTNET="testnet",a.DEVNET="devnet",a.SHELBYNET="shelbynet",a.NETNA="netna",a.LOCAL="local",a.CUSTOM="custom",a))(Ei||{}),_i= exports.NetworkToChainId ={mainnet:1,testnet:2,local:4},lg= exports.NetworkToNetworkName ={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",shelbynet:"shelbynet",netna:"netna",local:"local",custom:"custom"};var en=(o=>(o.FULLNODE="Fullnode",o.INDEXER="Indexer",o.FAUCET="Faucet",o.PEPPER="Pepper",o.PROVER="Prover",o))(en||{}),ys= exports.DEFAULT_MAX_GAS_AMOUNT =2e5,ms= exports.DEFAULT_TXN_EXP_SEC_FROM_NOW =20,Ar= exports.DEFAULT_TXN_TIMEOUT_SEC =20,Rt= exports.APTOS_COIN ="0x1::aptos_coin::AptosCoin",fs= exports.APTOS_FA ="0x000000000000000000000000000000000000000000000000000000000000000a",As= exports.RAW_TRANSACTION_SALT ="APTOS::RawTransaction",Ii= exports.RAW_TRANSACTION_WITH_DATA_SALT ="APTOS::RawTransactionWithData",hs= exports.ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT ="APTOS::AASigningData",wt= exports.ProcessorType =(d=>(d.ACCOUNT_RESTORATION_PROCESSOR="account_restoration_processor",d.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",d.DEFAULT="default_processor",d.EVENTS_PROCESSOR="events_processor",d.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",d.STAKE_PROCESSOR="stake_processor",d.TOKEN_V2_PROCESSOR="token_v2_processor",d.USER_TRANSACTION_PROCESSOR="user_transaction_processor",d.OBJECT_PROCESSOR="objects_processor",d))(wt||{}),bs= exports.FIREBASE_AUTH_ISS_PATTERN =/^https:\/\/securetoken\.google\.com\/[a-zA-Z0-9-_]+$/;function Ts(n,e){let t=e.bcsToBytes(),r=new C(t);return n.deserialize(r)}var zu=(s=>(s[s.API_ERROR=0]="API_ERROR",s[s.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",s[s.SESSION_EXPIRED=2]="SESSION_EXPIRED",s[s.INVALID_STATE=3]="INVALID_STATE",s[s.INVALID_SIGNATURE=4]="INVALID_SIGNATURE",s[s.UNKNOWN=5]="UNKNOWN",s))(zu||{}),ku= exports.KeylessErrorResolutionTip =(d=>(d.REAUTHENTICATE="Re-authentiate to continue using your keyless account",d.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",d.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",d.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",d.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",d.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",d.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d))(ku||{}),hr= exports.KeylessErrorType =(f=>(f[f.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",f[f.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",f[f.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",f[f.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",f[f.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",f[f.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",f[f.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",f[f.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",f[f.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",f[f.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",f[f.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",f[f.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",f[f.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",f[f.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",f[f.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",f[f.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",f[f.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",f[f.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",f[f.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",f[f.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",f[f.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",f[f.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",f[f.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",f[f.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",f[f.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",f[f.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",f[f.SIGNATURE_TYPE_INVALID=26]="SIGNATURE_TYPE_INVALID",f[f.SIGNATURE_EXPIRED=27]="SIGNATURE_EXPIRED",f[f.MAX_EXPIRY_HORIZON_EXCEEDED=28]="MAX_EXPIRY_HORIZON_EXCEEDED",f[f.EPHEMERAL_SIGNATURE_VERIFICATION_FAILED=29]="EPHEMERAL_SIGNATURE_VERIFICATION_FAILED",f[f.TRAINING_WHEELS_SIGNATURE_MISSING=30]="TRAINING_WHEELS_SIGNATURE_MISSING",f[f.TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED=31]="TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED",f[f.PROOF_VERIFICATION_FAILED=32]="PROOF_VERIFICATION_FAILED",f[f.UNKNOWN=33]="UNKNOWN",f))(hr||{}),ws={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["The signature is not a valid Keyless signature.",4,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],27:["The ephemeral key pair used to sign the message has expired.",4,"Re-authentiate to continue using your keyless account"],28:["The expiry horizon on the signature exceeds the maximum allowed value.",4,"Re-authentiate to continue using your keyless account"],29:["Failed to verify the ephemeral signature with the ephemeral public key.",4,"Re-authentiate to continue using your keyless account"],30:["The training wheels signature is missing but is required by the Keyless configuration.",4,"Re-authentiate to continue using your keyless account"],31:["Failed to verify the training wheels signature with the training wheels public key.",4,"Re-authentiate to continue using your keyless account"],32:["The proof verification failed.",4,"Re-authentiate to continue using your keyless account"],33:["An unknown error has occurred.",5,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},_= exports.KeylessError =class n extends Error{constructor(e){let{innerError:t,category:r,resolutionTip:i,type:o,message:s=ws[o][0],details:a}=e;super(s),this.name="KeylessError",this.innerError=t,this.category=r,this.resolutionTip=i,this.type=o,this.details=a,this.message=n.constructMessage(s,i,t,a)}static constructMessage(e,t,r,i){let o=`
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } function _optionalChainDelete(ops) { const result = _optionalChain(ops); return result == null ? true : result; }var _chunkHO5ESTN4js = require('./chunk-HO5ESTN4.js');var C=class n{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}static fromHex(e){let t=_chunkHO5ESTN4js.v.hexInputToUint8Array(e);return new n(t)}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}remaining(){return this.buffer.byteLength-this.offset}assertFinished(){if(this.remaining()!==0)throw new Error("Buffer has remaining bytes")}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){return this.deserializeOption("string")}deserializeOption(e,t){if(this.deserializeBool()){if(e==="string")return this.deserializeStr();if(e==="bytes")return this.deserializeBytes();if(e==="fixedBytes"){if(t===void 0)throw new Error("Fixed bytes length not provided");return this.deserializeFixedBytes(t)}return this.deserialize(e)}}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),t=this.deserializeU32();return BigInt(BigInt(t)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),t=this.deserializeU64();return BigInt(t<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),t=this.deserializeU128();return BigInt(t<<BigInt(128)|e)}deserializeI8(){return new DataView(this.read(1)).getInt8(0)}deserializeI16(){return new DataView(this.read(2)).getInt16(0,!0)}deserializeI32(){return new DataView(this.read(4)).getInt32(0,!0)}deserializeI64(){let e=this.deserializeU32(),t=this.deserializeU32(),r=BigInt(BigInt(t)<<BigInt(32)|BigInt(e)),i=BigInt(1)<<BigInt(63);return r>=i?r-(BigInt(1)<<BigInt(64)):r}deserializeI128(){let e=this.deserializeU64(),t=this.deserializeU64(),r=BigInt(t<<BigInt(64)|e),i=BigInt(1)<<BigInt(127);return r>=i?r-(BigInt(1)<<BigInt(128)):r}deserializeI256(){let e=this.deserializeU128(),t=this.deserializeU128(),r=BigInt(t<<BigInt(128)|e),i=BigInt(1)<<BigInt(255);return r>=i?r-(BigInt(1)<<BigInt(256)):r}deserializeUleb128AsU32(){let e=BigInt(0),t=0;for(;e<_chunkHO5ESTN4js.d;){let r=this.deserializeU8();if(e|=BigInt(r&127)<<BigInt(t),(r&128)===0)break;t+=7}if(e>_chunkHO5ESTN4js.d)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let t=this.deserializeUleb128AsU32(),r=new Array;for(let i=0;i<t;i+=1)r.push(this.deserialize(e));return r}};var Re=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,t){let r=e.deserializeFixedBytes(t);return new n(r)}};var gr=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=new Re(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,t){let r=Re.deserialize(e,t);return new n(r.value)}};var F=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.z.call(void 0, e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new Se(e.deserializeU256())}static deserialize(e){return new n(e.deserializeBool())}},Z= exports.U8 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.b),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new n(e.deserializeU8())}},Ue= exports.U16 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.c),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new n(e.deserializeU16())}},ze= exports.U32 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,0,_chunkHO5ESTN4js.d),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new n(e.deserializeU32())}},$= exports.U64 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.e),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new n(e.deserializeU64())}},ke= exports.U128 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.f),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new n(e.deserializeU128())}},Se= exports.U256 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,BigInt(0),_chunkHO5ESTN4js.g),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new n(e.deserializeU256())}},Jo= exports.I8 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.h,_chunkHO5ESTN4js.i),this.value=e}serialize(e){e.serializeI8(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI8())}},Xo= exports.I16 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.j,_chunkHO5ESTN4js.k),this.value=e}serialize(e){e.serializeI16(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI16())}},Yo= exports.I32 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.l,_chunkHO5ESTN4js.m),this.value=e}serialize(e){e.serializeI32(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI32())}},Zo= exports.I64 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.n,_chunkHO5ESTN4js.o),this.value=BigInt(e)}serialize(e){e.serializeI64(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI64())}},es= exports.I128 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.p,_chunkHO5ESTN4js.q),this.value=BigInt(e)}serialize(e){e.serializeI128(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI128())}},ts= exports.I256 =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),_chunkHO5ESTN4js.B.call(void 0, e,_chunkHO5ESTN4js.r,_chunkHO5ESTN4js.s),this.value=BigInt(e)}serialize(e){e.serializeI256(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}static deserialize(e){return new n(e.deserializeI256())}};var S=class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof Z)){new Rn(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let t;if(Array.isArray(e)&&e.length===0)t=[];else if(Array.isArray(e)&&typeof e[0]=="number")t=e;else if(typeof e=="string"){let r=_chunkHO5ESTN4js.v.fromHexInput(e);t=Array.from(r.toUint8Array())}else if(e instanceof Uint8Array)t=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new n(t.map(r=>new Z(r)))}static U16(e){return new n(e.map(t=>new Ue(t)))}static U32(e){return new n(e.map(t=>new ze(t)))}static U64(e){return new n(e.map(t=>new $(t)))}static U128(e){return new n(e.map(t=>new ke(t)))}static U256(e){return new n(e.map(t=>new Se(t)))}static Bool(e){return new n(e.map(t=>new F(t)))}static MoveString(e){return new n(e.map(t=>new v(t)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,t){let r=e.deserializeUleb128AsU32(),i=new Array;for(let o=0;o<r;o+=1)i.push(t.deserialize(e));return new n(i)}},Rn= exports.Serialized =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new n(e.deserializeBytes())}toMoveVector(e){let t=new C(this.bcsToBytes());t.deserializeUleb128AsU32();let r=t.deserializeVector(e);return new S(r)}},v= exports.MoveString =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}serializeForScriptFunction(e){let r=new TextEncoder().encode(this.value);S.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new n(e.deserializeStr())}},ne= exports.MoveOption =class n extends _chunkHO5ESTN4js.x{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new S([e]):this.vec=new S([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let t=this.bcsToBytes();e.serializeBytes(t)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new n(e!=null?new Z(e):void 0)}static U16(e){return new n(e!=null?new Ue(e):void 0)}static U32(e){return new n(e!=null?new ze(e):void 0)}static U64(e){return new n(e!=null?new $(e):void 0)}static U128(e){return new n(e!=null?new ke(e):void 0)}static U256(e){return new n(e!=null?new Se(e):void 0)}static Bool(e){return new n(e!=null?new F(e):void 0)}static MoveString(e){return new n(e!=null?new v(e):void 0)}static deserialize(e,t){let r=S.deserialize(e,t);return new n(r.values[0])}};var _sha3 = require('@noble/hashes/sha3');var bt=class bt extends _chunkHO5ESTN4js.x{constructor(e){super();let{data:t}=e,r=_chunkHO5ESTN4js.v.fromHexInput(t);if(r.toUint8Array().length!==bt.LENGTH)throw new Error(`Authentication Key length should be ${bt.LENGTH}`);this.data=r}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let t=e.deserializeFixedBytes(bt.LENGTH);return new bt({data:t})}toUint8Array(){return this.data.toUint8Array()}static fromSchemeAndBytes(e){let{scheme:t,input:r}=e,i=_chunkHO5ESTN4js.v.fromHexInput(r).toUint8Array(),o=new Uint8Array([...i,t]),s=_sha3.sha3_256.create();s.update(o);let a=s.digest();return new bt({data:a})}static fromPublicKeyAndScheme(e){let{publicKey:t}=e;return t.authKey()}static fromPublicKey(e){let{publicKey:t}=e;return t.authKey()}derivedAddress(){return new (0, _chunkHO5ESTN4js.na)(this.data.toUint8Array())}};bt.LENGTH=32;var V=bt;var et=class extends _chunkHO5ESTN4js.x{async verifySignatureAsync(e){return this.verifySignature(e)}toUint8Array(){return this.bcsToBytes()}toString(){let e=this.toUint8Array();return _chunkHO5ESTN4js.v.fromHexInput(e).toString()}},ae= exports.AccountPublicKey =class extends et{};var O=class extends _chunkHO5ESTN4js.x{toUint8Array(){return this.bcsToBytes()}toString(){let e=this.toUint8Array();return _chunkHO5ESTN4js.v.fromHexInput(e).toString()}};var Un=class n extends O{constructor(e){super(),this.value=_chunkHO5ESTN4js.v.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}static deserialize(e){return new n(e.deserializeBytes())}},yr= exports.AbstractPublicKey =class extends ae{constructor(e){super(),this.accountAddress=e}authKey(){return new V({data:this.accountAddress.toUint8Array()})}verifySignature(e){throw new Error("This function is not implemented for AbstractPublicKey.")}async verifySignatureAsync(e){throw new Error("This function is not implemented for AbstractPublicKey.")}serialize(e){throw new Error("This function is not implemented for AbstractPublicKey.")}};var _ed25519 = require('@noble/curves/ed25519');var _hmac = require('@noble/hashes/hmac');var _sha512 = require('@noble/hashes/sha512');var _bip39 = require('@scure/bip39'); var ns = _interopRequireWildcard(_bip39);var au=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,cu= exports.APTOS_BIP44_REGEX =/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,uu= exports.KeyType =(e=>(e.ED25519="ed25519 seed",e))(uu||{}),rs= exports.HARDENED_OFFSET =2147483648;function is(n){return cu.test(n)}function os(n){return au.test(n)}var bi=(n,e)=>{let t=_hmac.hmac.create(_sha512.sha512,n).update(e).digest();return{key:t.slice(0,32),chainCode:t.slice(32)}},ss= exports.CKDPriv =({key:n,chainCode:e},t)=>{let r=new ArrayBuffer(4);new DataView(r).setUint32(0,t);let i=new Uint8Array(r),o=new Uint8Array([0]),s=new Uint8Array([...o,...n,...i]);return bi(e,s)},du=n=>n.replace(/'/g,""),as= exports.splitPath =n=>n.split("/").slice(1).map(du),mr= exports.mnemonicToSeed =n=>{let e=n.trim().split(/\s+/).map(t=>t.toLowerCase()).join(" ");return ns.mnemonicToSeedSync(e)};var zn=class zn{static formatPrivateKey(e,t){let r=zn.AIP80_PREFIXES[t],i=e;return typeof i=="string"&&i.startsWith(r)&&(i=i.split("-")[2]),`${r}${_chunkHO5ESTN4js.v.fromHexInput(i).toString()}`}static parseHexInput(e,t,r){let i,o=zn.AIP80_PREFIXES[t];if(typeof e=="string")if(!r&&!e.startsWith(o))i=_chunkHO5ESTN4js.v.fromHexInput(e),r!==!1&&console.warn("[Aptos SDK] It is recommended that private keys are AIP-80 compliant (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md). You can fix the private key by formatting it with `PrivateKey.formatPrivateKey(privateKey: string, type: 'ed25519' | 'secp256k1'): string`.");else if(e.startsWith(o))i=_chunkHO5ESTN4js.v.fromHexString(e.split("-")[2]);else throw r?new Error("Invalid HexString input while parsing private key. Must AIP-80 compliant string."):new Error("Invalid HexString input while parsing private key.");else i=_chunkHO5ESTN4js.v.fromHexInput(e);return i}};zn.AIP80_PREFIXES={ed25519:"ed25519-priv-",secp256k1:"secp256k1-priv-",secp256r1:"secp256r1-priv-"};var Pe=zn;var _jwtdecode = require('jwt-decode');var Tt=class n extends et{constructor(e){super();let t=e.constructor.name;switch(t){case E.name:this.publicKey=e,this.variant=0;break;default:throw new Error(`Unsupported key for EphemeralPublicKey - ${t}`)}}verifySignature(e){let{message:t,signature:r}=e;return this.publicKey.verifySignature({message:t,signature:r.signature})}async verifySignatureAsync(e){return this.verifySignature(e)}serialize(e){if(this.publicKey instanceof E)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(E.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralPublicKey: ${t}`)}}static isPublicKey(e){return e instanceof n}},Le= exports.EphemeralSignature =class n extends O{constructor(e){super();let t=e.constructor.name;switch(t){case R.name:this.signature=e;break;default:throw new Error(`Unsupported signature for EphemeralSignature - ${t}`)}}static fromHex(e){let t=_chunkHO5ESTN4js.v.fromHexInput(e),r=new C(t.toUint8Array());return n.deserialize(r)}serialize(e){if(this.signature instanceof R)e.serializeU32AsUleb128(0),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return new n(R.deserialize(e));default:throw new Error(`Unknown variant index for EphemeralSignature: ${t}`)}}};var _poseidonlite = require('poseidon-lite');var Ti=[_poseidonlite.poseidon1,_poseidonlite.poseidon2,_poseidonlite.poseidon3,_poseidonlite.poseidon4,_poseidonlite.poseidon5,_poseidonlite.poseidon6,_poseidonlite.poseidon7,_poseidonlite.poseidon8,_poseidonlite.poseidon9,_poseidonlite.poseidon10,_poseidonlite.poseidon11,_poseidonlite.poseidon12,_poseidonlite.poseidon13,_poseidonlite.poseidon14,_poseidonlite.poseidon15,_poseidonlite.poseidon16],us=31,xu=16,cs=(xu-1)*us;function qe(n,e){let r=new TextEncoder().encode(n);return vu(r,e)}function vu(n,e){if(n.length>e)throw new Error(`Inputted bytes of length ${n} is longer than ${e}`);let t=kn(n,e);return Kt(t)}function Cu(n,e){if(n.length>e)throw new Error(`Input bytes of length ${n} is longer than ${e}`);let t=Uu(n,e);return Ku(t)}function kn(n,e){if(n.length>e)throw new Error(`Input bytes of length ${n} is longer than ${e}`);return Cu(n,e).concat([BigInt(n.length)])}function Ku(n){if(n.length>cs)throw new Error(`Can't pack more than ${cs}. Was given ${n.length} bytes`);return Ru(n,us).map(e=>Ct(e))}function Ru(n,e){let t=[];for(let r=0;r<n.length;r+=e)t.push(n.subarray(r,r+e));return t}function Ct(n){let e=BigInt(0);for(let t=n.length-1;t>=0;t-=1)e=e<<BigInt(8)|BigInt(n[t]);return e}function wi(n,e){let t=BigInt(n),r=new Uint8Array(e);for(let i=0;i<e;i+=1)r[i]=Number(t&BigInt(255)),t>>=BigInt(8);return r}function Uu(n,e){if(e<n.length)throw new Error("Padded size must be greater than or equal to the input array size.");let t=new Uint8Array(e);t.set(n);for(let r=n.length;r<e;r+=1)t[r]=0;return t}function Kt(n){if(n.length>Ti.length)throw new Error(`Unable to hash input of length ${n.length}. Max input length is ${Ti.length}`);return Ti[n.length-1](n)}var fr=class extends _chunkHO5ESTN4js.x{};var ds="5.1.5";var ps={mainnet:"https://api.mainnet.aptoslabs.com/v1/graphql",testnet:"https://api.testnet.aptoslabs.com/v1/graphql",devnet:"https://api.devnet.aptoslabs.com/v1/graphql",shelbynet:"https://api.shelbynet.shelby.xyz/v1/graphql",netna:"https://api.netna.staging.aptoslabs.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ls= exports.NetworkToNodeAPI ={mainnet:"https://api.mainnet.aptoslabs.com/v1",testnet:"https://api.testnet.aptoslabs.com/v1",devnet:"https://api.devnet.aptoslabs.com/v1",shelbynet:"https://api.shelbynet.shelby.xyz/v1",netna:"https://api.netna.staging.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},gs= exports.NetworkToFaucetAPI ={devnet:"https://faucet.devnet.aptoslabs.com",shelbynet:"https://faucet.shelbynet.shelby.xyz",netna:"https://faucet-dev-netna-us-central1-410192433417.us-central1.run.app",local:"http://127.0.0.1:8081"},Si= exports.NetworkToPepperAPI ={mainnet:"https://api.mainnet.aptoslabs.com/keyless/pepper/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/pepper/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",shelbynet:"https://api.shelbynet.aptoslabs.com/keyless/pepper/v0",netna:"https://api.devnet.aptoslabs.com/keyless/pepper/v0",local:"https://api.devnet.aptoslabs.com/keyless/pepper/v0"},Pi= exports.NetworkToProverAPI ={mainnet:"https://api.mainnet.aptoslabs.com/keyless/prover/v0",testnet:"https://api.testnet.aptoslabs.com/keyless/prover/v0",devnet:"https://api.devnet.aptoslabs.com/keyless/prover/v0",shelbynet:"https://api.shelbynet.aptoslabs.com/keyless/prover/v0",netna:"https://api.devnet.aptoslabs.com/keyless/prover/v0",local:"https://api.devnet.aptoslabs.com/keyless/prover/v0"},Ei= exports.Network =(a=>(a.MAINNET="mainnet",a.TESTNET="testnet",a.DEVNET="devnet",a.SHELBYNET="shelbynet",a.NETNA="netna",a.LOCAL="local",a.CUSTOM="custom",a))(Ei||{}),_i= exports.NetworkToChainId ={mainnet:1,testnet:2,local:4},lg= exports.NetworkToNetworkName ={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",shelbynet:"shelbynet",netna:"netna",local:"local",custom:"custom"};var en=(o=>(o.FULLNODE="Fullnode",o.INDEXER="Indexer",o.FAUCET="Faucet",o.PEPPER="Pepper",o.PROVER="Prover",o))(en||{}),ys= exports.DEFAULT_MAX_GAS_AMOUNT =2e5,ms= exports.DEFAULT_TXN_EXP_SEC_FROM_NOW =20,Ar= exports.DEFAULT_TXN_TIMEOUT_SEC =20,Rt= exports.APTOS_COIN ="0x1::aptos_coin::AptosCoin",fs= exports.APTOS_FA ="0x000000000000000000000000000000000000000000000000000000000000000a",As= exports.RAW_TRANSACTION_SALT ="APTOS::RawTransaction",Ii= exports.RAW_TRANSACTION_WITH_DATA_SALT ="APTOS::RawTransactionWithData",hs= exports.ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT ="APTOS::AASigningData",wt= exports.ProcessorType =(d=>(d.ACCOUNT_RESTORATION_PROCESSOR="account_restoration_processor",d.ACCOUNT_TRANSACTION_PROCESSOR="account_transactions_processor",d.DEFAULT="default_processor",d.EVENTS_PROCESSOR="events_processor",d.FUNGIBLE_ASSET_PROCESSOR="fungible_asset_processor",d.STAKE_PROCESSOR="stake_processor",d.TOKEN_V2_PROCESSOR="token_v2_processor",d.USER_TRANSACTION_PROCESSOR="user_transaction_processor",d.OBJECT_PROCESSOR="objects_processor",d))(wt||{}),bs= exports.FIREBASE_AUTH_ISS_PATTERN =/^https:\/\/securetoken\.google\.com\/[a-zA-Z0-9-_]+$/;function Ts(n,e){let t=e.bcsToBytes(),r=new C(t);return n.deserialize(r)}var zu=(s=>(s[s.API_ERROR=0]="API_ERROR",s[s.EXTERNAL_API_ERROR=1]="EXTERNAL_API_ERROR",s[s.SESSION_EXPIRED=2]="SESSION_EXPIRED",s[s.INVALID_STATE=3]="INVALID_STATE",s[s.INVALID_SIGNATURE=4]="INVALID_SIGNATURE",s[s.UNKNOWN=5]="UNKNOWN",s))(zu||{}),ku= exports.KeylessErrorResolutionTip =(d=>(d.REAUTHENTICATE="Re-authentiate to continue using your keyless account",d.REAUTHENTICATE_UNSURE="Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support",d.UPDATE_REQUEST_PARAMS="Update the invalid request parameters and reauthenticate.",d.RATE_LIMIT_EXCEEDED="Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest.",d.SERVER_ERROR="Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d.CALL_PRECHECK="Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing.",d.REINSTANTIATE="Try instantiating the account again. Avoid manipulating the account object directly",d.JOIN_SUPPORT_GROUP="For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d.UNKNOWN="Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx",d))(ku||{}),hr= exports.KeylessErrorType =(f=>(f[f.EPHEMERAL_KEY_PAIR_EXPIRED=0]="EPHEMERAL_KEY_PAIR_EXPIRED",f[f.PROOF_NOT_FOUND=1]="PROOF_NOT_FOUND",f[f.ASYNC_PROOF_FETCH_FAILED=2]="ASYNC_PROOF_FETCH_FAILED",f[f.INVALID_PROOF_VERIFICATION_FAILED=3]="INVALID_PROOF_VERIFICATION_FAILED",f[f.INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND=4]="INVALID_PROOF_VERIFICATION_KEY_NOT_FOUND",f[f.INVALID_JWT_SIG=5]="INVALID_JWT_SIG",f[f.INVALID_JWT_JWK_NOT_FOUND=6]="INVALID_JWT_JWK_NOT_FOUND",f[f.INVALID_JWT_ISS_NOT_RECOGNIZED=7]="INVALID_JWT_ISS_NOT_RECOGNIZED",f[f.INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED=8]="INVALID_JWT_FEDERATED_ISS_NOT_SUPPORTED",f[f.INVALID_TW_SIG_VERIFICATION_FAILED=9]="INVALID_TW_SIG_VERIFICATION_FAILED",f[f.INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND=10]="INVALID_TW_SIG_PUBLIC_KEY_NOT_FOUND",f[f.INVALID_EXPIRY_HORIZON=11]="INVALID_EXPIRY_HORIZON",f[f.JWT_PARSING_ERROR=12]="JWT_PARSING_ERROR",f[f.JWK_FETCH_FAILED=13]="JWK_FETCH_FAILED",f[f.JWK_FETCH_FAILED_FEDERATED=14]="JWK_FETCH_FAILED_FEDERATED",f[f.RATE_LIMIT_EXCEEDED=15]="RATE_LIMIT_EXCEEDED",f[f.PEPPER_SERVICE_INTERNAL_ERROR=16]="PEPPER_SERVICE_INTERNAL_ERROR",f[f.PEPPER_SERVICE_BAD_REQUEST=17]="PEPPER_SERVICE_BAD_REQUEST",f[f.PEPPER_SERVICE_OTHER=18]="PEPPER_SERVICE_OTHER",f[f.PROVER_SERVICE_INTERNAL_ERROR=19]="PROVER_SERVICE_INTERNAL_ERROR",f[f.PROVER_SERVICE_BAD_REQUEST=20]="PROVER_SERVICE_BAD_REQUEST",f[f.PROVER_SERVICE_OTHER=21]="PROVER_SERVICE_OTHER",f[f.FULL_NODE_CONFIG_LOOKUP_ERROR=22]="FULL_NODE_CONFIG_LOOKUP_ERROR",f[f.FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR=23]="FULL_NODE_VERIFICATION_KEY_LOOKUP_ERROR",f[f.FULL_NODE_JWKS_LOOKUP_ERROR=24]="FULL_NODE_JWKS_LOOKUP_ERROR",f[f.FULL_NODE_OTHER=25]="FULL_NODE_OTHER",f[f.SIGNATURE_TYPE_INVALID=26]="SIGNATURE_TYPE_INVALID",f[f.SIGNATURE_EXPIRED=27]="SIGNATURE_EXPIRED",f[f.MAX_EXPIRY_HORIZON_EXCEEDED=28]="MAX_EXPIRY_HORIZON_EXCEEDED",f[f.EPHEMERAL_SIGNATURE_VERIFICATION_FAILED=29]="EPHEMERAL_SIGNATURE_VERIFICATION_FAILED",f[f.TRAINING_WHEELS_SIGNATURE_MISSING=30]="TRAINING_WHEELS_SIGNATURE_MISSING",f[f.TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED=31]="TRAINING_WHEELS_SIGNATURE_VERIFICATION_FAILED",f[f.PROOF_VERIFICATION_FAILED=32]="PROOF_VERIFICATION_FAILED",f[f.UNKNOWN=33]="UNKNOWN",f))(hr||{}),ws={0:["The ephemeral keypair has expired.",2,"Re-authentiate to continue using your keyless account"],1:["The required proof could not be found.",3,"Call `await account.checkKeylessAccountValidity()` to wait for asyncronous changes and check for account validity before signing or serializing."],2:["The required proof failed to fetch.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],3:["The provided proof is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],4:["The verification key used to authenticate was updated.",2,"Re-authentiate to continue using your keyless account"],5:["The JWK was found, but JWT failed verification",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],6:["The JWK required to verify the JWT could not be found. The JWK may have been rotated out.",2,"Re-authentiate to continue using your keyless account"],7:["The JWT issuer is not recognized.",3,"Update the invalid request parameters and reauthenticate."],8:["The JWT issuer is not supported by the Federated Keyless ",0,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],9:["The training wheels signature is invalid.",3,"Try re-authentiating. If the error persists join the telegram group at https://t.me/+h5CN-W35yUFiYzkx for further support"],10:["The public key used to verify the training wheels signature was not found.",2,"Re-authentiate to continue using your keyless account"],11:["The expiry horizon is invalid.",2,"Re-authentiate to continue using your keyless account"],13:["Failed to fetch JWKS.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],14:["Failed to fetch JWKS for Federated Keyless provider.",1,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],15:["Rate limit exceeded. Too many requests in a short period.",0,"Cache the keyless account and reuse it to avoid making too many requests. Keyless accounts are valid until either the EphemeralKeyPair expires, when the JWK is rotated, or when the proof verifying key is changed, whichever comes soonest."],16:["Internal error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],17:["Bad request sent to Pepper service.",0,"Update the invalid request parameters and reauthenticate."],18:["Unknown error from Pepper service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],19:["Internal error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],20:["Bad request sent to Prover service.",0,"Update the invalid request parameters and reauthenticate."],21:["Unknown error from Prover service.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],12:["Error when parsing JWT. This should never happen. Join https://t.me/+h5CN-W35yUFiYzkx for support",3,"Try instantiating the account again. Avoid manipulating the account object directly"],22:["Error when looking up on-chain keyless configuration.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],23:["Error when looking up on-chain verification key.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],24:["Error when looking up on-chain JWKS.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],25:["Unknown error from full node.",0,"Try again later. See aptosApiError error for more context. For additional support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],26:["The signature is not a valid Keyless signature.",4,"For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"],27:["The ephemeral key pair used to sign the message has expired.",4,"Re-authentiate to continue using your keyless account"],28:["The expiry horizon on the signature exceeds the maximum allowed value.",4,"Re-authentiate to continue using your keyless account"],29:["Failed to verify the ephemeral signature with the ephemeral public key.",4,"Re-authentiate to continue using your keyless account"],30:["The training wheels signature is missing but is required by the Keyless configuration.",4,"Re-authentiate to continue using your keyless account"],31:["Failed to verify the training wheels signature with the training wheels public key.",4,"Re-authentiate to continue using your keyless account"],32:["The proof verification failed.",4,"Re-authentiate to continue using your keyless account"],33:["An unknown error has occurred.",5,"Error unknown. For support join the telegram group at https://t.me/+h5CN-W35yUFiYzkx"]},_= exports.KeylessError =class n extends Error{constructor(e){let{innerError:t,category:r,resolutionTip:i,type:o,message:s=ws[o][0],details:a}=e;super(s),this.name="KeylessError",this.innerError=t,this.category=r,this.resolutionTip=i,this.type=o,this.details=a,this.message=n.constructMessage(s,i,t,a)}static constructMessage(e,t,r,i){let o=`
|
|
2
2
|
Message: ${e}`;return i&&(o+=`
|
|
3
3
|
Details: ${i}`),r instanceof Ee?o+=`
|
|
4
4
|
AptosApiError: ${r.message}`:r!==void 0&&(o+=`
|
|
@@ -478,5 +478,5 @@ KeylessErrorResolutionTip: ${t}`,o}static fromErrorType(e){let{error:t,type:r,de
|
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
`;async function Mr(n){let{aptosConfig:e}=n,{data:t}=await H({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return t}async function ra(n){let{aptosConfig:e,limit:t}=n;return(await w({aptosConfig:e,query:{query:Ws,variables:{limit:t}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function w(n){let{aptosConfig:e,query:t,originMethod:r}=n,{data:i}=await Ss({aptosConfig:e,originMethod:_nullishCoalesce(r, () => ("queryIndexer")),path:"",body:t,overrides:{WITH_CREDENTIALS:!1}});return i}async function ld(n){let{aptosConfig:e}=n;return(await w({aptosConfig:e,query:{query:Li},originMethod:"getProcessorStatuses"})).processor_status}async function Vr(n){let e=await ld({aptosConfig:n.aptosConfig});return BigInt(e[0].last_success_version)}async function Hr(n){let{aptosConfig:e,processorType:t}=n;return(await w({aptosConfig:e,query:{query:Li,variables:{where_condition:{processor:{_eq:t}}}},originMethod:"getProcessorStatus"})).processor_status[0]}async function Lr(n){let{aptosConfig:e,accountAddress:t}=n,{data:r}=await H({aptosConfig:e,originMethod:"getInfo",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}`});return r}async function oa(n){return _optionalChain([n, 'access', _64 => _64.options, 'optionalAccess', _65 => _65.ledgerVersion])!==void 0?ia(n):$e(async()=>ia(n),`module-${n.accountAddress}-${n.moduleName}`,1e3*60*5)()}async function ia(n){let{aptosConfig:e,accountAddress:t,moduleName:r,options:i}=n,{data:o}=await H({aptosConfig:e,originMethod:"getModule",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/module/${r}`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _66 => _66.ledgerVersion])}});return o}async function qr(n){let{aptosConfig:e,handle:t,data:r,options:i}=n;return(await St({aptosConfig:e,originMethod:"getTableItem",path:`tables/${t}/item`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _67 => _67.ledgerVersion])},body:r})).data}async function sa(n){let{aptosConfig:e,options:t}=n,r={query:Zs,variables:{where_condition:_optionalChain([t, 'optionalAccess', _68 => _68.where]),offset:_optionalChain([t, 'optionalAccess', _69 => _69.offset]),limit:_optionalChain([t, 'optionalAccess', _70 => _70.limit]),order_by:_optionalChain([t, 'optionalAccess', _71 => _71.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getTableItemsData"})).table_items}async function aa(n){let{aptosConfig:e,options:t}=n,r={query:ea,variables:{where_condition:_optionalChain([t, 'optionalAccess', _72 => _72.where]),offset:_optionalChain([t, 'optionalAccess', _73 => _73.offset]),limit:_optionalChain([t, 'optionalAccess', _74 => _74.limit]),order_by:_optionalChain([t, 'optionalAccess', _75 => _75.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getTableItemsMetadata"})).table_metadatas}async function Wi(n){let{aptosConfig:e,options:t}=n;return wr({aptosConfig:e,originMethod:"getTransactions",path:"transactions",params:{start:_optionalChain([t, 'optionalAccess', _76 => _76.offset]),limit:_optionalChain([t, 'optionalAccess', _77 => _77.limit])}})}async function Wr(n){let{aptosConfig:e}=n;return $e(async()=>{let{data:t}=await H({aptosConfig:e,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${e.network}`,1e3*60*5)()}async function ca(n){let{aptosConfig:e,ledgerVersion:t}=n,{data:r}=await H({aptosConfig:e,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return r}async function Wn(n){let{aptosConfig:e,transactionHash:t}=n,{data:r}=await H({aptosConfig:e,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return r}async function ua(n){let{aptosConfig:e,transactionHash:t}=n;try{return(await Wn({aptosConfig:e,transactionHash:t})).type==="pending_transaction"}catch(r){if(_optionalChain([r, 'optionalAccess', _78 => _78.status])===404)return!0;throw r}}async function gd(n){let{aptosConfig:e,transactionHash:t}=n,{data:r}=await H({aptosConfig:e,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return r}async function Pn(n){let{aptosConfig:e,transactionHash:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _79 => _79.timeoutSecs]), () => (20)),o=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _80 => _80.checkSuccess]), () => (!0)),s=!0,a=0,c,d,m=200,A=1.5;function p(g){if(!(g instanceof Ee)||(d=g,g.status!==404&&g.status>=400&&g.status<500))throw g}try{c=await Wn({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction"}catch(g){p(g)}if(s){let g=Date.now();try{c=await gd({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction"}catch(b){p(b)}a=(Date.now()-g)/1e3}for(;s&&!(a>=i);){try{if(c=await Wn({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction",!s)break}catch(g){p(g)}await _chunkHO5ESTN4js.sa.call(void 0, m),a+=m/1e3,m*=A}if(c===void 0)throw d||new $r(`Fetching transaction ${t} failed and timed out after ${i} seconds`,c);if(c.type==="pending_transaction")throw new $r(`Transaction ${t} timed out in pending state after ${i} seconds`,c);if(!o)return c;if(!c.success)throw new $i(`Transaction ${t} failed with an error: ${c.vm_status}`,c);return c}async function Qr(n){let{aptosConfig:e,processorType:t}=n,r=BigInt(n.minimumLedgerVersion),i=3e3,o=new Date().getTime(),s=BigInt(-1);for(;s<r;){if(new Date().getTime()-o>i)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?s=await Vr({aptosConfig:e}):s=(await Hr({aptosConfig:e,processorType:t})).last_success_version,s>=r)break;await _chunkHO5ESTN4js.sa.call(void 0, 200)}}var $r=class extends Error{constructor(e,t){super(e),this.lastSubmittedTransaction=t}},$i=class extends Error{constructor(e,t){super(e),this.transaction=t}};async function da(n){let{aptosConfig:e,ledgerVersion:t,options:r}=n,{data:i}=await H({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:_optionalChain([r, 'optionalAccess', _81 => _81.withTransactions])}});return la({block:i,...n})}async function pa(n){let{aptosConfig:e,blockHeight:t,options:r}=n,{data:i}=await H({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:_optionalChain([r, 'optionalAccess', _82 => _82.withTransactions])}});return la({block:i,...n})}async function la(n){let{aptosConfig:e,block:t,options:r}=n;if(_optionalChain([r, 'optionalAccess', _83 => _83.withTransactions])){t.transactions=_nullishCoalesce(t.transactions, () => ([]));let i=t.transactions[t.transactions.length-1],o=BigInt(t.first_version),s=BigInt(t.last_version),a=_optionalChain([i, 'optionalAccess', _84 => _84.version]),c;if(a===void 0?c=o-1n:c=BigInt(a),c===s)return t;let d=[],m=100n;for(let p=c+1n;p<s;p+=BigInt(100))d.push(Wi({aptosConfig:e,options:{offset:p,limit:Math.min(Number(m),Number(s-p+1n))}}));let A=await Promise.all(d);for(let p of A)t.transactions.push(...p)}return t}function ga(n){return!!n.match(/^[_a-zA-Z0-9]+$/)}function ya(n){return!!n.match(/\s/)}function yd(n){return!!n.match(/^T[0-9]+$/)}function md(n){return!!n.match(/^&.+$/)}function fd(n){switch(n){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":case"i8":case"i16":case"i32":case"i64":case"i128":case"i256":return!0;default:return!1}}function Ad(n,e){let t=e;for(;t<n.length;t+=1){let r=n[t];if(!ya(r))break}return t}var hd=(b=>(b.InvalidTypeTag="unknown type",b.UnexpectedGenericType="unexpected generic type",b.UnexpectedTypeArgumentClose="unexpected '>'",b.UnexpectedWhitespaceCharacter="unexpected whitespace character",b.UnexpectedComma="unexpected ','",b.TypeArgumentCountMismatch="type argument count doesn't match expected amount",b.MissingTypeArgumentClose="no matching '>' for '<'",b.MissingTypeArgument="no type argument before ','",b.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",b.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",b.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",b.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",b.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",b.InvalidAddress="struct address must be valid",b))(hd||{}),X= exports.TypeTagParserError =class extends Error{constructor(e,t){super(`Failed to parse typeTag '${e}', ${t}`)}};function He(n,e){let t=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _85 => _85.allowGenerics]), () => (!1)),r=[],i=[],o=[],s=0,a="",c=1;for(;s<n.length;){let d=n[s];if(d==="<")r.push({savedExpectedTypes:c,savedStr:a,savedTypes:o}),a="",o=[],c=1;else if(d===">"){if(a!==""){let b=Qn(a,i,t);o.push(b)}let m=r.pop();if(m===void 0)throw new X(n,"unexpected '>'");if(c!==o.length)throw new X(n,"type argument count doesn't match expected amount");let{savedStr:A,savedTypes:p,savedExpectedTypes:g}=m;i=o,o=p,a=A,c=g}else if(d===","){if(r.length===0)throw new X(n,"unexpected ','");if(a.length===0)throw new X(n,"no type argument before ','");let m=Qn(a,i,t);i=[],o.push(m),a="",c+=1}else if(ya(d)){let m=!1;if(a.length!==0){let p=Qn(a,i,t);i=[],o.push(p),a="",m=!0}s=Ad(n,s);let A=n[s];if(s<n.length&&m&&A!==","&&A!==">")throw new X(n,"unexpected whitespace character");continue}else a+=d;s+=1}if(r.length>0)throw new X(n,"no matching '>' for '<'");switch(o.length){case 0:return Qn(a,i,t);case 1:if(a==="")return o[0];throw new X(n,"unexpected ','");default:throw new X(n,"unexpected whitespace character")}}function Qn(n,e,t){let r=n.trim(),i=r.toLowerCase();if(fd(i)&&e.length>0)throw new X(n,"primitive types not expected to have type arguments");switch(r.toLowerCase()){case"signer":return new Mt;case"bool":return new Q;case"address":return new G;case"u8":return new de;case"u16":return new st;case"u32":return new at;case"u64":return new te;case"u128":return new ct;case"u256":return new ut;case"i8":return new Nt;case"i16":return new Dt;case"i32":return new Ft;case"i64":return new Ot;case"i128":return new Bt;case"i256":return new Gt;case"vector":if(e.length!==1)throw new X(n,"vector type expected to have exactly one type argument");return new z(e[0]);default:if(md(r)){let a=r.substring(1);return new vr(Qn(a,e,t))}if(yd(r)){if(t)return new M(Number(r.split("T")[1]));throw new X(n,"unexpected generic type")}if(!r.match(/:/))throw new X(n,"unknown type");let o=r.split("::");if(o.length!==3)throw new X(n,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let s;try{s=_chunkHO5ESTN4js.na.fromString(o[0])}catch (e4){throw new X(n,"struct address must be valid")}if(!ga(o[1]))throw new X(n,"module name must only contain alphanumeric or '_' characters");if(!ga(o[2]))throw new X(n,"struct name must only contain alphanumeric or '_' characters");return new h(new Xe(s,new k(o[1]),new k(o[2]),e))}}function ma(n){return typeof n=="boolean"}function mt(n){return typeof n=="string"}function bd(n){return typeof n=="number"}function jr(n){if(bd(n))return n;if(mt(n)&&n!=="")return Number.parseInt(n,10)}function Jr(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function fa(n){return n==null}function Aa(n){return Qi(n)||Ji(n)||Xi(n)||Yi(n)||Zi(n)||eo(n)||to(n)||Xr(n)||ji(n)||Td(n)||n instanceof S||n instanceof ne}function Qi(n){return n instanceof F}function Xr(n){return n instanceof _chunkHO5ESTN4js.na}function ji(n){return n instanceof v}function Td(n){return n instanceof Re}function Ji(n){return n instanceof Z}function Xi(n){return n instanceof Ue}function Yi(n){return n instanceof ze}function Zi(n){return n instanceof $}function eo(n){return n instanceof ke}function to(n){return n instanceof Se}function ha(n){return"bytecode"in n}function N(n,e){throw new Error(`Type mismatch for argument ${e}, expected '${n}'`)}function ba(n){let e=n.params.findIndex(t=>t!=="signer"&&t!=="&signer");return e<0?n.params.length:e}var wd=new TextEncoder;function Yr(n){return _nullishCoalesce(_optionalChain([n, 'optionalAccess', _86 => _86.map, 'call', _87 => _87(e=>mt(e)?He(e):e)]), () => ([]))}async function Sd(n,e,t){return(await Zr({aptosConfig:t,accountAddress:n,moduleName:e})).abi}async function ro(n,e,t,r){let i=await Sd(n,e,r);if(!i)throw new Error(`Could not find module ABI for '${n}::${e}'`);return i.exposed_functions.find(o=>o.name===t)}async function IS(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let o=[];for(let s=0;s<i.params.length;s+=1)o.push(He(i.params[s],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o}}async function Ta(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!i.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let o=ba(i),s=[];for(let a=o;a<i.params.length;a+=1)s.push(He(i.params[a],{allowGenerics:!0}));return{signers:o,typeParameters:i.generic_type_params,parameters:s}}async function wa(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!i.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let o=[];for(let a=0;a<i.params.length;a+=1)o.push(He(i.params[a],{allowGenerics:!0}));let s=[];for(let a=0;a<i.return.length;a+=1)s.push(He(i.return[a],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o,returnTypes:s}}function io(n,e,t,r,i,o){let s;if("exposed_functions"in e){let a=e.exposed_functions.find(c=>c.name===n);if(!a)throw new Error(`Could not find function ABI for '${e.address}::${e.name}::${n}'`);if(r>=a.params.length)throw new Error(`Too many arguments for '${n}', expected ${a.params.length}`);s=He(a.params[r],{allowGenerics:!0})}else{if(r>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);s=e.parameters[r]}return Jt(t,s,r,i,"exposed_functions"in e?e:void 0,o)}function Jt(n,e,t,r,i,o){return Aa(n)?(no(e,n,t),n):Pd(n,e,t,r,i,o)}function Pd(n,e,t,r,i,o){if(e.isBool()){if(ma(n))return new F(n);if(mt(n)){if(n==="true")return new F(!0);if(n==="false")return new F(!1)}N("boolean",t)}if(e.isAddress()){if(mt(n))return _chunkHO5ESTN4js.na.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new (0, _chunkHO5ESTN4js.na)(n.data);N("string | AccountAddress",t)}if(e.isU8()){let s=jr(n);if(s!==void 0)return new Z(s);N("number | string",t)}if(e.isU16()){let s=jr(n);if(s!==void 0)return new Ue(s);N("number | string",t)}if(e.isU32()){let s=jr(n);if(s!==void 0)return new ze(s);N("number | string",t)}if(e.isU64()){if(Jr(n))return new $(BigInt(n));N("bigint | number | string",t)}if(e.isU128()){if(Jr(n))return new ke(BigInt(n));N("bigint | number | string",t)}if(e.isU256()){if(Jr(n))return new Se(BigInt(n));N("bigint | number | string",t)}if(e.isGeneric()){let s=e.value;if(s<0||s>=r.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return Jt(n,r[s],t,r,i)}if(e.isVector()){if(e.value.isU8()){if(mt(n))return S.U8(wd.encode(n));if(n instanceof Uint8Array)return S.U8(n);if(n instanceof ArrayBuffer)return S.U8(new Uint8Array(n))}if(mt(n)&&n.startsWith("["))return Jt(JSON.parse(n),e,t,r);if(Array.isArray(n))return new S(n.map(s=>Jt(s,e.value,t,r,i)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(mt(n))return new v(n);N("string",t)}if(e.isObject()){if(mt(n))return _chunkHO5ESTN4js.na.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new (0, _chunkHO5ESTN4js.na)(n.data);N("string | AccountAddress",t)}if(e.isDelegationKey()||e.isRateLimiter()){if(n instanceof Uint8Array)return new Re(n);N("Uint8Array",t)}if(e.isOption()){if(fa(n)){let a=e.value.typeArgs[0];return a instanceof Q?new ne(null):a instanceof G?new ne(null):a instanceof de?new ne(null):a instanceof st?new ne(null):a instanceof at?new ne(null):a instanceof te?new ne(null):a instanceof ct?new ne(null):a instanceof ut?new ne(null):new ne(null)}return new ne(Jt(n,e.value.typeArgs[0],t,r,i))}if(_optionalChain([i, 'optionalAccess', _88 => _88.structs, 'access', _89 => _89.find, 'call', _90 => _90(a=>a.name===e.value.name.identifier), 'optionalAccess', _91 => _91.fields, 'access', _92 => _92.length])===0&&n instanceof Uint8Array)return new Re(n);if(n instanceof Uint8Array&&_optionalChain([o, 'optionalAccess', _93 => _93.allowUnknownStructs]))return console.warn(`Unsupported struct input type for argument ${t}. Continuing since 'allowUnknownStructs' is enabled.`),new Re(n);throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function no(n,e,t){if(n.isBool()){if(Qi(e))return;N("Bool",t)}if(n.isAddress()){if(Xr(e))return;N("AccountAddress",t)}if(n.isU8()){if(Ji(e))return;N("U8",t)}if(n.isU16()){if(Xi(e))return;N("U16",t)}if(n.isU32()){if(Yi(e))return;N("U32",t)}if(n.isU64()){if(Zi(e))return;N("U64",t)}if(n.isU128()){if(eo(e))return;N("U128",t)}if(n.isU256()){if(to(e))return;N("U256",t)}if(n.isVector()){if(e instanceof S){e.values.length>0&&no(n.value,e.values[0],t);return}N("MoveVector",t)}if(n instanceof h){if(n.isString()){if(ji(e))return;N("MoveString",t)}if(n.isObject()){if(Xr(e))return;N("AccountAddress",t)}if(n.isOption()){if(e instanceof ne){e.value!==void 0&&no(n.value.typeArgs[0],e.value,t);return}N("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}async function ei(n){if(ha(n))return xd(n);let{moduleAddress:e,moduleName:t,functionName:r}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),i=await _a({key:"entry-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Ta});return _d({...n,abi:i})}function _d(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),o=Yr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=n.functionArguments.map((c,d)=>io(n.function,e,c,d,o));if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);let a=dt.build(`${t}::${r}`,i,o,s);if("multisigAddress"in n){let c=_chunkHO5ESTN4js.na.from(n.multisigAddress);return new mn(new Mn(c,new Vn(a)))}return new yn(a)}async function Sa(n){let{moduleAddress:e,moduleName:t,functionName:r}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),i=await _a({key:"view-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:wa});return Id({abi:i,...n})}function Id(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),o=Yr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _94 => _94.functionArguments, 'optionalAccess', _95 => _95.map, 'call', _96 => _96((a,c)=>io(n.function,e,a,c,o))]), () => ([]));if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);return dt.build(`${t}::${r}`,i,o,s)}function xd(n){return new gn(new fn(_chunkHO5ESTN4js.v.fromHexInput(n.bytecode).toUint8Array(),Yr(n.typeArguments),n.functionArguments))}async function vd(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n;if(_optionalChain([i, 'optionalAccess', _97 => _97.replayProtectionNonce])!==void 0&&_optionalChain([i, 'optionalAccess', _98 => _98.accountSequenceNumber])!==void 0)throw new Error("Cannot specify both replayProtectionNonce and accountSequenceNumber in options.");let s=async()=>_i[e.network]?{chainId:_i[e.network]}:{chainId:(await Mr({aptosConfig:e})).chain_id},a=async()=>_optionalChain([i, 'optionalAccess', _99 => _99.gasUnitPrice])?{gasEstimate:i.gasUnitPrice}:{gasEstimate:(await Wr({aptosConfig:e})).gas_estimate},c=async()=>{let se=async()=>_optionalChain([i, 'optionalAccess', _100 => _100.accountSequenceNumber])!==void 0?i.accountSequenceNumber:_optionalChain([i, 'optionalAccess', _101 => _101.replayProtectionNonce])!==void 0?0xdeadbeefn:(await Lr({aptosConfig:e,accountAddress:t})).sequence_number;if(o&&_chunkHO5ESTN4js.na.from(o).equals(_chunkHO5ESTN4js.na.ZERO))try{return await se()}catch (e5){return 0}else return se()},[{chainId:d},{gasEstimate:m},A]=await Promise.all([s(),a(),c()]),{maxGasAmount:p,gasUnitPrice:g,expireTimestamp:b,replayProtectionNonce:D}={maxGasAmount:_optionalChain([i, 'optionalAccess', _102 => _102.maxGasAmount])?BigInt(i.maxGasAmount):BigInt(e.getDefaultMaxGasAmount()),gasUnitPrice:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _103 => _103.gasUnitPrice]), () => (BigInt(m))),expireTimestamp:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _104 => _104.expireTimestamp]), () => (BigInt(Math.floor(Date.now()/1e3)+e.getDefaultTxnExpirySecFromNow()))),replayProtectionNonce:_optionalChain([i, 'optionalAccess', _105 => _105.replayProtectionNonce])?BigInt(i.replayProtectionNonce):void 0},q=r;return D!==void 0&&(q=Cd(r,D)),new ve(_chunkHO5ESTN4js.na.from(t),BigInt(A),q,BigInt(p),BigInt(g),BigInt(b),new ln(d))}function Cd(n,e){if(n instanceof gn)return new Vt(new Hn(n.script),new Ht(void 0,e));if(n instanceof yn)return new Vt(new hn(n.entryFunction),new Ht(void 0,e));if(n instanceof mn){let t=n.multiSig.transaction_payload,r;if(t===void 0||_optionalChain([t, 'optionalAccess', _106 => _106.transaction_payload])===void 0)r=new Ln;else if(t.transaction_payload instanceof dt)r=new hn(t.transaction_payload);else throw new Error("Scripts are not supported in multi-sig transactions.");return new Vt(r,new Ht(n.multiSig.multisig_address,e))}else throw new Error(`Unsupported payload type: ${n}`)}async function oo(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n,s=await vd({aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o});if("secondarySignerAddresses"in n){let a=_nullishCoalesce(_optionalChain([n, 'access', _107 => _107.secondarySignerAddresses, 'optionalAccess', _108 => _108.map, 'call', _109 => _109(c=>_chunkHO5ESTN4js.na.from(c))]), () => ([]));return new kr(s,a,n.feePayerAddress?_chunkHO5ESTN4js.na.from(n.feePayerAddress):void 0)}return new zr(s,n.feePayerAddress?_chunkHO5ESTN4js.na.from(n.feePayerAddress):void 0)}function Pa(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:r,feePayerPublicKey:i}=n,o=En(e);if(t.feePayerAddress){let a=new qt(t.rawTransaction,_nullishCoalesce(t.secondarySignerAddresses, () => ([])),t.feePayerAddress),c=[];t.secondarySignerAddresses&&(r?c=r.map(A=>En(A)):c=Array.from({length:t.secondarySignerAddresses.length},()=>En(void 0)));let d=En(i),m=new Qt(o,_nullishCoalesce(t.secondarySignerAddresses, () => ([])),c,{address:t.feePayerAddress,authenticator:d});return new lt(a.raw_txn,m).bcsToBytes()}if(t.secondarySignerAddresses){let a=new Lt(t.rawTransaction,t.secondarySignerAddresses),c=[];r?c=r.map(m=>En(m)):c=Array.from({length:t.secondarySignerAddresses.length},()=>En(void 0));let d=new Wt(o,t.secondarySignerAddresses,c);return new lt(a.raw_txn,d).bcsToBytes()}let s;if(o instanceof Ge)s=new $t(o.public_key,o.signature);else if(o instanceof ue||o instanceof Je)s=new It(o);else if(o instanceof pn)s=new It(o);else throw new Error("Invalid public key");return new lt(t.rawTransaction,s).bcsToBytes()}function En(n){if(!n)return new pn;let t=K.isInstance(n)||L.isInstance(n)||Fe.isInstance(n)?new I(n):n,r=new R(new Uint8Array(64));if(E.isInstance(t))return new Ge(t,r);if(I.isInstance(t))return K.isInstance(t.publicKey)?new ue(t,new B(ce.getSimulationSignature())):new ue(t,new B(r));if(W.isInstance(t))return new Je(t,new Ie({signatures:t.publicKeys.map(i=>K.isInstance(i.publicKey)||L.isInstance(i.publicKey)?new B(ce.getSimulationSignature()):new B(r)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((i,o)=>o)})}));throw new Error("Unsupported PublicKey used for simulations")}function so(n){let{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:r}=n,i=Ts(ee,n.senderAuthenticator),o;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");o=new Qt(i,_nullishCoalesce(e.secondarySignerAddresses, () => ([])),_nullishCoalesce(r, () => ([])),{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!r)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");o=new Wt(i,e.secondarySignerAddresses,r)}else i instanceof Ge?o=new $t(i.public_key,i.signature):i instanceof ot?o=new bn(i.public_key,i.signature):o=new It(i);return new lt(e.rawTransaction,o).bcsToBytes()}function Ea(n){let e=_sha3.sha3_256.create();for(let t of n)e.update(t);return e.digest()}var Kd=Ea(["APTOS::Transaction"]);function ZS(n){let e=so(n);return new (0, _chunkHO5ESTN4js.v)(Ea([Kd,new Uint8Array([0]),e])).toString()}async function _a({key:n,moduleAddress:e,moduleName:t,functionName:r,aptosConfig:i,abi:o,fetch:s}){return o!==void 0?o:$e(async()=>s(e,t,r,i),`${n}-${i.network}-${e}-${t}-${r}`,1e3*60*5)()}async function T(n){let e=await Rd(n);return Ud(n,e)}async function Rd(n){let{aptosConfig:e,data:t}=n,r,i;return"bytecode"in t?i=await ei(t):"multisigAddress"in t?(r={aptosConfig:e,multisigAddress:t.multisigAddress,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await ei(r)):(r={aptosConfig:e,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await ei(r)),i}async function Ud(n,e){let{aptosConfig:t,sender:r,options:i}=n,o;if(zd(n)&&(o=_chunkHO5ESTN4js.na.ZERO.toString()),kd(n)){let{secondarySignerAddresses:s}=n;return oo({aptosConfig:t,sender:r,payload:e,options:i,secondarySignerAddresses:s,feePayerAddress:o})}return oo({aptosConfig:t,sender:r,payload:e,options:i,feePayerAddress:o})}function zd(n){return n.withFeePayer===!0}function kd(n){return"secondarySignerAddresses"in n}function Ia(n){let{transaction:e}=n;return Me(e)}function ti(n){let{signer:e,transaction:t}=n;return e.signTransactionWithAuthenticator(t)}function ni(n){let{signer:e,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=e.accountAddress,ti({signer:e,transaction:t})}async function ao(n){let{aptosConfig:e,transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}=n,a=Pa({transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}),{data:c}=await St({aptosConfig:e,body:a,path:"transactions/simulate",params:{estimate_gas_unit_price:_nullishCoalesce(_optionalChain([n, 'access', _110 => _110.options, 'optionalAccess', _111 => _111.estimateGasUnitPrice]), () => (!1)),estimate_max_gas_amount:_nullishCoalesce(_optionalChain([n, 'access', _112 => _112.options, 'optionalAccess', _113 => _113.estimateMaxGasAmount]), () => (!1)),estimate_prioritized_gas_unit_price:_nullishCoalesce(_optionalChain([n, 'access', _114 => _114.options, 'optionalAccess', _115 => _115.estimatePrioritizedGasUnitPrice]), () => (!1))},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return c}async function jn(n){let{aptosConfig:e,transactionSubmitter:t}=n,r=t===void 0?e.getTransactionSubmitter():t;if(r)return r.submitTransaction(n);let i=so({...n});try{let{data:o}=await St({aptosConfig:e,body:i,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return o}catch(o){let s=lt.deserialize(new C(i));throw s.authenticator.isSingleSender()&&s.authenticator.sender.isSingleKey()&&(s.authenticator.sender.public_key.publicKey instanceof K||s.authenticator.sender.public_key.publicKey instanceof L)&&await we.fetchJWK({aptosConfig:e,publicKey:s.authenticator.sender.public_key.publicKey,kid:s.authenticator.sender.signature.signature.getJwkKid()}),o}}async function ri(n){let{aptosConfig:e,signer:t,feePayer:r,transaction:i,...o}=n;Fr(t)&&await t.checkKeylessAccountValidity(e),Fr(r)&&await r.checkKeylessAccountValidity(e);let s=n.feePayerAuthenticator||r&&ni({signer:r,transaction:i}),a=ti({signer:t,transaction:i});return jn({aptosConfig:e,transaction:i,senderAuthenticator:a,feePayerAuthenticator:s,...o})}async function xa(n){let{aptosConfig:e,senderAuthenticator:t,feePayer:r,transaction:i,...o}=n;Fr(r)&&await r.checkKeylessAccountValidity(e);let s=ni({signer:r,transaction:i});return jn({aptosConfig:e,transaction:i,senderAuthenticator:t,feePayerAuthenticator:s,...o})}var Nd={typeParameters:[],parameters:[z.u8(),new z(z.u8())]};async function va(n){let{aptosConfig:e,account:t,metadataBytes:r,moduleBytecode:i,options:o}=n,s=i.map(a=>S.U8(a));return T({aptosConfig:e,sender:_chunkHO5ESTN4js.na.from(t),data:{function:"0x1::code::publish_package_txn",functionArguments:[S.U8(r),new S(s)],abi:Nd},options:o})}async function _n(n){return Lr(n)}async function Ca(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return vi({aptosConfig:e,originMethod:"getModules",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/modules`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _116 => _116.ledgerVersion]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _117 => _117.limit]), () => (1e3))}})}async function Ka(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await Sr({aptosConfig:e,originMethod:"getModulesPage",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/modules`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _118 => _118.ledgerVersion]),cursor:_optionalChain([r, 'optionalAccess', _119 => _119.cursor]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _120 => _120.limit]), () => (100))}});return{modules:i.data,cursor:o}}async function Zr(n){return oa(n)}async function uo(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return wr({aptosConfig:e,originMethod:"getTransactions",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/transactions`,params:{start:_optionalChain([r, 'optionalAccess', _121 => _121.offset]),limit:_optionalChain([r, 'optionalAccess', _122 => _122.limit])}})}async function po(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return vi({aptosConfig:e,originMethod:"getResources",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resources`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _123 => _123.ledgerVersion]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _124 => _124.limit]), () => (999))}})}async function Ra(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await Sr({aptosConfig:e,originMethod:"getResourcesPage",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resources`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _125 => _125.ledgerVersion]),cursor:_optionalChain([r, 'optionalAccess', _126 => _126.cursor]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _127 => _127.limit]), () => (100))}});return{resources:i.data,cursor:o}}async function lo(n){let{aptosConfig:e,accountAddress:t,resourceType:r,options:i}=n,{data:o}=await H({aptosConfig:e,originMethod:"getResource",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resource/${r}`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _128 => _128.ledgerVersion])}});return o.data}async function Jn(n){let{aptosConfig:e,authenticationKey:t,options:r}=n,i=await lo({aptosConfig:e,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:r}),{address_map:{handle:o}}=i,s=_chunkHO5ESTN4js.na.from(t);try{let a=await qr({aptosConfig:e,handle:o,data:{key:s.toString(),key_type:"address",value_type:"address"},options:r});return _chunkHO5ESTN4js.na.from(a)}catch(a){if(a instanceof Ee&&a.data.error_code==="table_item_not_found")return s;throw a}}async function Ua(n){let{aptosConfig:e,accountAddress:t}=n,i={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}},s=await w({aptosConfig:e,query:{query:Ls,variables:{where_condition:i}},originMethod:"getAccountTokensCount"});return s.current_token_ownerships_v2_aggregate.aggregate?s.current_token_ownerships_v2_aggregate.aggregate.count:0}async function za(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}};_optionalChain([r, 'optionalAccess', _129 => _129.tokenStandard])&&(o.token_standard={_eq:_optionalChain([r, 'optionalAccess', _130 => _130.tokenStandard])});let s={query:Vs,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _131 => _131.offset]),limit:_optionalChain([r, 'optionalAccess', _132 => _132.limit]),order_by:_optionalChain([r, 'optionalAccess', _133 => _133.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function ka(n){let{aptosConfig:e,accountAddress:t,collectionAddress:r,options:i}=n,o=_chunkHO5ESTN4js.na.from(t).toStringLong(),s=_chunkHO5ESTN4js.na.from(r).toStringLong(),a={owner_address:{_eq:o},current_token_data:{collection_id:{_eq:s}},amount:{_gt:0}};_optionalChain([i, 'optionalAccess', _134 => _134.tokenStandard])&&(a.token_standard={_eq:_optionalChain([i, 'optionalAccess', _135 => _135.tokenStandard])});let c={query:Hs,variables:{where_condition:a,offset:_optionalChain([i, 'optionalAccess', _136 => _136.offset]),limit:_optionalChain([i, 'optionalAccess', _137 => _137.limit]),order_by:_optionalChain([i, 'optionalAccess', _138 => _138.orderBy])}};return(await w({aptosConfig:e,query:c,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Na(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};_optionalChain([r, 'optionalAccess', _139 => _139.tokenStandard])&&(o.current_collection={token_standard:{_eq:_optionalChain([r, 'optionalAccess', _140 => _140.tokenStandard])}});let s={query:Ms,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _141 => _141.offset]),limit:_optionalChain([r, 'optionalAccess', _142 => _142.limit]),order_by:_optionalChain([r, 'optionalAccess', _143 => _143.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function Da(n){let{aptosConfig:e,accountAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:qs,variables:{address:r}},originMethod:"getAccountTransactionsCount"});return o.account_transactions_aggregate.aggregate?o.account_transactions_aggregate.aggregate.count:0}async function Fa(n){let{aptosConfig:e,accountAddress:t,options:r}=n,i=_chunkHO5ESTN4js.na.from(t).toStringLong(),o={..._optionalChain([r, 'optionalAccess', _144 => _144.where]),owner_address:{_eq:i}},s={query:Gs,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _145 => _145.offset]),limit:_optionalChain([r, 'optionalAccess', _146 => _146.limit]),order_by:_optionalChain([r, 'optionalAccess', _147 => _147.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Oa(n){let{aptosConfig:e,accountAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:Bs,variables:{address:r}},originMethod:"getAccountCoinsCount"});if(!o.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return o.current_fungible_asset_balances_aggregate.aggregate.count}async function Ba(n){let{aptosConfig:e,accountAddress:t,asset:r}=n,i=await H({aptosConfig:e,originMethod:"getBalance",path:`accounts/${t}/balance/${r}`,params:{accountAddress:t.toString(),asset:r instanceof Uint8Array?_chunkHO5ESTN4js.na.from(r).toString():r.toString()}});return parseInt(i.data.toString(),10)}async function go(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}},s={query:Gr,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _148 => _148.offset]),limit:_optionalChain([r, 'optionalAccess', _149 => _149.limit]),order_by:_optionalChain([r, 'optionalAccess', _150 => _150.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedObjects"})).current_objects}async function Ga(n){let{aptosConfig:e,privateKey:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _151 => _151.throwIfNoAccountFound]), () => (!1)),o=await ii({aptosConfig:e,privateKey:t});if(o.length===0){if(i)throw new Error("No existing account found for private key.");return gt.fromPrivateKey({privateKey:t})}return o[0]}async function Dd(n){let{aptosConfig:e,accountAddress:t,options:r}=n;try{let[i,o]=await Promise.all([po({aptosConfig:e,accountAddress:t}),go({aptosConfig:e,accountAddress:t,options:{limit:1}})]),s=i.find(c=>c.type==="0x1::account::Account");if(!s&&o.length===0)return!1;if(!_optionalChain([r, 'optionalAccess', _152 => _152.withAuthKey]))return!0;let a;return s?a=s.data.authentication_key:a=t.toStringLong(),a===r.withAuthKey.toString()}catch(i){throw new Error(`Error while checking if account exists at ${t.toString()}: ${i}`)}}var Fd={typeParameters:[],parameters:[new de,z.u8(),new de,z.u8(),z.u8(),z.u8()]};async function Ma(n){let{aptosConfig:e,fromAccount:t,options:r}=n;if("toNewPrivateKey"in n)return co({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toNewPrivateKey,options:r});if("toAccount"in n)return n.toAccount instanceof oe?co({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toAccount.privateKey,options:r}):co({aptosConfig:e,fromAccount:t,toAccount:n.toAccount,options:r});throw new Error("Invalid arguments")}async function co(n){let{aptosConfig:e,fromAccount:t,options:r}=n,i=await _n({aptosConfig:e,accountAddress:t.accountAddress}),o;"toNewPrivateKey"in n?o=gt.fromPrivateKey({privateKey:n.toNewPrivateKey,legacy:!0}):o=n.toAccount;let a=new Ur({sequenceNumber:BigInt(i.sequence_number),originator:t.accountAddress,currentAuthKey:_chunkHO5ESTN4js.na.from(i.authentication_key),newPublicKey:o.publicKey}).bcsToBytes(),c=t.sign(a),d=o.sign(a);return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new Z(t.signingScheme),S.U8(t.publicKey.toUint8Array()),new Z(o.signingScheme),S.U8(o.publicKey.toUint8Array()),S.U8(c.toUint8Array()),S.U8(d.toUint8Array())],abi:Fd},options:r})}var Od={typeParameters:[],parameters:[new de,z.u8()]};async function Va(n){let{aptosConfig:e,fromAccount:t,toNewPublicKey:r,options:i}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key_from_public_key",functionArguments:[new Z(Rs(r)),S.U8(Bi(r).toUint8Array())],abi:Od},options:i})}async function oi(n){let{aptosConfig:e,publicKey:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _153 => _153.noMultiKey]), () => (!1));if(i&&t instanceof Oe)throw new Error("Multi-key accounts are not supported when noMultiKey is true.");let o=[t];t instanceof I&&t.publicKey instanceof E?o.push(t.publicKey):t instanceof E&&o.push(new I(t));let[s,a]=await Promise.all([Promise.all(o.map(async A=>{let p=await Hd({aptosConfig:e,publicKey:A});if(p)return{...p,publicKey:A}})),!(t instanceof Oe)&&!i?Gd({aptosConfig:e,publicKey:t,options:r}):Promise.resolve([])]),c=[];for(let A of s)A&&c.push(A);o.push(...a);let d=new Map(o.map(A=>[A.authKey().toString(),A])),m=await Md({aptosConfig:e,authKeys:o.map(A=>A.authKey()),options:r});for(let A of m){if(c.find(g=>g.accountAddress===A.accountAddress))continue;let p=d.get(A.authKey.toString());if(!p)throw new Error(`No publicKey found for authentication key ${A.authKey}. This should never happen.`);c.push({accountAddress:A.accountAddress,publicKey:p,lastTransactionVersion:A.lastTransactionVersion})}return c.sort((A,p)=>p.lastTransactionVersion-A.lastTransactionVersion)}async function yo(n){let{aptosConfig:e,signer:t,options:r}=n;if(t instanceof J||t instanceof rt)return ii({aptosConfig:e,privateKey:t,options:r});if(t instanceof oe||t instanceof pe)return ii({aptosConfig:e,privateKey:t.privateKey,options:r});if(t instanceof Ce||t instanceof Ve)return Bd({aptosConfig:e,keylessAccount:t,options:r});if(t instanceof yt&&t.signers.length===1)return yo({aptosConfig:e,signer:t.signers[0],options:r});if(t instanceof qn&&t.signers.length===1)return ii({aptosConfig:e,privateKey:t.signers[0],options:r});throw new Error("Unknown signer type")}async function Bd(n){let{aptosConfig:e,keylessAccount:t,options:r}=n,i=await oi({aptosConfig:e,publicKey:t.getAnyPublicKey(),options:r}),o={proof:t.proofOrPromise,jwt:t.jwt,ephemeralKeyPair:t.ephemeralKeyPair,pepper:t.pepper,verificationKeyHash:t.verificationKeyHash},s=[];for(let{accountAddress:a,publicKey:c}of i)if(c instanceof Oe){if(c.getSignaturesRequired()>1)continue;if(c instanceof ie)throw new Error("Keyless authentication cannot be used for multi-ed25519 accounts. This should never happen.");c instanceof W&&s.push(new yt({multiKey:c,signers:[t],address:a}))}else t instanceof Ve?s.push(Ve.create({...o,address:a,jwkAddress:t.publicKey.jwkAddress})):s.push(Ce.create({...o,address:a}));return s}async function ii(n){let{aptosConfig:e,privateKey:t,options:r}=n,i=gt.fromPrivateKey({privateKey:t,legacy:!1}),o=await oi({aptosConfig:e,publicKey:new I(t.publicKey()),options:r}),s=[];for(let{accountAddress:a,publicKey:c}of o)if(c instanceof Oe){if(c.getSignaturesRequired()>1)continue;c instanceof ie?s.push(new qn({publicKey:c,signers:[t],address:a})):c instanceof W&&s.push(new yt({multiKey:c,signers:[i],address:a}))}else{let d=c instanceof E;s.push(gt.fromPrivateKey({privateKey:t,address:a,legacy:d}))}return s}async function Gd(n){let{aptosConfig:e,publicKey:t,options:r}=n;if(t instanceof Oe)throw new Error("Public key is a multi-key.");let i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _154 => _154.includeUnverified]), () => (!1)),o=t instanceof I?t:new I(t),s=o.publicKey,a=_chunkHO5ESTN4js.O.call(void 0, o.variant),c={public_key:{_eq:s.toString()},public_key_type:{_eq:a},...i?{}:{is_public_key_used:{_eq:!0}}},d={query:$s,variables:{where_condition:c}},{public_key_auth_keys:m}=await w({aptosConfig:e,query:d,originMethod:"getMultiKeysForPublicKey"});return m.map(p=>{switch(p.signature_type){case"multi_ed25519_signature":return ie.deserializeWithoutLength(C.fromHex(p.account_public_key));case"multi_key_signature":return W.deserialize(C.fromHex(p.account_public_key));default:throw new Error(`Unknown multi-signature type: ${p.signature_type}`)}})}async function Md(n){let{aptosConfig:e,authKeys:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _155 => _155.includeUnverified]), () => (!1));if(t.length===0)throw new Error("No authentication keys provided");let o={auth_key:{_in:t.map(c=>c.toString())},...i?{}:{is_auth_key_used:{_eq:!0}}},s={query:Os,variables:{where_condition:o,order_by:[{last_transaction_version:"desc"}]}},{auth_key_account_addresses:a}=await w({aptosConfig:e,query:s,originMethod:"getAccountAddressesForAuthKeys"});return a.map(c=>({authKey:new V({data:c.auth_key}),accountAddress:new (0, _chunkHO5ESTN4js.na)(_chunkHO5ESTN4js.v.hexInputToUint8Array(c.account_address)),lastTransactionVersion:Number(c.last_transaction_version)}))}async function Vd(n){let{aptosConfig:e,accountAddress:t}=n,r=await uo({aptosConfig:e,accountAddress:t,options:{limit:1}});return r.length===0?0:Number(r[0].version)}async function Hd(n){let{aptosConfig:e,publicKey:t}=n,r=t.authKey().derivedAddress(),[i,o]=await Promise.all([Vd({aptosConfig:e,accountAddress:r}),Dd({aptosConfig:e,accountAddress:r,options:{withAuthKey:t.authKey()}})]);if(o)return{accountAddress:r,lastTransactionVersion:i}}async function P(n){n.minimumLedgerVersion!==void 0&&await Qr({aptosConfig:n.config,minimumLedgerVersion:n.minimumLedgerVersion,processorType:n.processorType})}async function le(n){let{aptosConfig:e,payload:t,options:r}=n,i=await Sa({...t,aptosConfig:e}),o=new _chunkHO5ESTN4js.y;i.serialize(o);let s=o.toUint8Array(),{data:a}=await St({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:_optionalChain([r, 'optionalAccess', _156 => _156.ledgerVersion])},body:s});return a}async function Ha(n){let{aptosConfig:e,payload:t,options:r}=n,{data:i}=await St({aptosConfig:e,originMethod:"viewJson",path:"view",params:{ledger_version:_optionalChain([r, 'optionalAccess', _157 => _157.ledgerVersion])},body:{function:t.function,type_arguments:_nullishCoalesce(t.typeArguments, () => ([])),arguments:_nullishCoalesce(t.functionArguments, () => ([]))}});return i}async function La(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=_chunkHO5ESTN4js.Ca.call(void 0, r);return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::add_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new G,new h(x()),new h(x())]}},options:i})}async function qa(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=_chunkHO5ESTN4js.Ca.call(void 0, r);return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new G,new h(x()),new h(x())]}},options:i})}async function $a(n){let{aptosConfig:e,sender:t,options:r}=n;return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authenticator",typeArguments:[],functionArguments:[],abi:{typeParameters:[],parameters:[]}},options:r})}var Xt=class{constructor(e){this.config=e;this.isAccountAbstractionEnabled=async e=>{let t=await this.getAuthenticationFunction(e),{moduleAddress:r,moduleName:i,functionName:o}=_chunkHO5ESTN4js.Ca.call(void 0, e.authenticationFunction);return _nullishCoalesce(_optionalChain([t, 'optionalAccess', _158 => _158.some, 'call', _159 => _159(s=>_chunkHO5ESTN4js.na.fromString(r).equals(s.moduleAddress)&&i===s.moduleName&&o===s.functionName)]), () => (!1))};this.enableAccountAbstractionTransaction=this.addAuthenticationFunctionTransaction;this.disableAccountAbstractionTransaction=async e=>{let{accountAddress:t,authenticationFunction:r,options:i}=e;return r?this.removeAuthenticationFunctionTransaction({accountAddress:t,authenticationFunction:r,options:i}):this.removeDispatchableAuthenticatorTransaction({accountAddress:t,options:i})}}async addAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return La({aptosConfig:this.config,authenticationFunction:r,sender:t,options:i})}async removeAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return qa({aptosConfig:this.config,sender:t,authenticationFunction:r,options:i})}async removeDispatchableAuthenticatorTransaction(e){let{accountAddress:t,options:r}=e;return $a({aptosConfig:this.config,sender:t,options:r})}async getAuthenticationFunction(e){let{accountAddress:t}=e,[{vec:r}]=await le({aptosConfig:this.config,payload:{function:"0x1::account_abstraction::dispatchable_authenticator",functionArguments:[_chunkHO5ESTN4js.na.from(t)],abi:{typeParameters:[],parameters:[new G],returnTypes:[]}}});if(r.length!==0)return r[0].map(i=>({moduleAddress:_chunkHO5ESTN4js.na.fromString(i.module_address),moduleName:i.module_name,functionName:i.function_name}))}};var Xn=class{constructor(e){this.config=e;this.abstraction=new Xt(e)}async getAccountInfo(e){return _n({aptosConfig:this.config,...e})}async getAccountModules(e){return Ca({aptosConfig:this.config,...e})}async getAccountModulesPage(e){return Ka({aptosConfig:this.config,...e})}async getAccountModule(e){return Zr({aptosConfig:this.config,...e})}async getAccountTransactions(e){return uo({aptosConfig:this.config,...e})}async getAccountResources(e){return po({aptosConfig:this.config,...e})}async getAccountResourcesPage(e){return Ra({aptosConfig:this.config,...e})}async getAccountResource(e){return lo({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return Jn({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),Ua({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),za({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ka({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Na({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),Da({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),Fa({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),Oa({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:Rt,faMetadataAddress:fs,...e})}async getAccountCoinAmount(e){let{accountAddress:t,coinType:r,faMetadataAddress:i}=e,o=r;r===void 0&&i!==void 0&&(o=await $e(async()=>{try{let c=(await le({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[i]}}))[0];if(c.vec.length>0&&_chunkHO5ESTN4js.Ba.call(void 0, c.vec[0]))return _chunkHO5ESTN4js.Aa.call(void 0, c.vec[0])}catch (e6){}},`coin-mapping-${i.toString()}`,1e3*60*5)());let s;if(r!==void 0&&i!==void 0)s=_chunkHO5ESTN4js.na.from(i).toStringLong();else if(r!==void 0&&i===void 0)r===Rt?s=_chunkHO5ESTN4js.na.A.toStringLong():s=_chunkHO5ESTN4js.oa.call(void 0, _chunkHO5ESTN4js.na.A,r).toStringLong();else if(r===void 0&&i!==void 0){let c=_chunkHO5ESTN4js.na.from(i);s=c.toStringLong(),c===_chunkHO5ESTN4js.na.A&&(o=Rt)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(o!==void 0){let[c]=await le({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[o],functionArguments:[t]}});return parseInt(c,10)}let[a]=await le({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[t,s]}});return parseInt(a,10)}async getBalance(e){return Ba({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),go({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),Ga({aptosConfig:this.config,...e})}async deriveOwnedAccountsFromSigner(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),yo({aptosConfig:this.config,...e})}async getAccountsForPublicKey(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),oi({aptosConfig:this.config,...e})}};var _aptosclient = require('@aptos-labs/aptos-client'); var _aptosclient2 = _interopRequireDefault(_aptosclient);var si=class{constructor(e){if(_optionalChain([e, 'optionalAccess', _160 => _160.fullnode])||_optionalChain([e, 'optionalAccess', _161 => _161.indexer])||_optionalChain([e, 'optionalAccess', _162 => _162.faucet])||_optionalChain([e, 'optionalAccess', _163 => _163.pepper])||_optionalChain([e, 'optionalAccess', _164 => _164.prover])){if(_optionalChain([e, 'optionalAccess', _165 => _165.network])==="custom")console.info("Note: using CUSTOM network will require queries to lookup ChainId");else if(!_optionalChain([e, 'optionalAccess', _166 => _166.network]))throw new Error("Custom endpoints require a network to be specified")}this.network=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _167 => _167.network]), () => ("devnet")),this.fullnode=_optionalChain([e, 'optionalAccess', _168 => _168.fullnode]),this.faucet=_optionalChain([e, 'optionalAccess', _169 => _169.faucet]),this.pepper=_optionalChain([e, 'optionalAccess', _170 => _170.pepper]),this.prover=_optionalChain([e, 'optionalAccess', _171 => _171.prover]),this.indexer=_optionalChain([e, 'optionalAccess', _172 => _172.indexer]),this.client=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _173 => _173.client]), () => ({provider:_aptosclient2.default})),this.clientConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _174 => _174.clientConfig]), () => ({})),this.fullnodeConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _175 => _175.fullnodeConfig]), () => ({})),this.indexerConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _176 => _176.indexerConfig]), () => ({})),this.faucetConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _177 => _177.faucetConfig]), () => ({})),this.transactionGenerationConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _178 => _178.transactionGenerationConfig]), () => ({})),this.pluginConfig=_optionalChain([e, 'optionalAccess', _179 => _179.pluginSettings])?{...e.pluginSettings,IGNORE_TRANSACTION_SUBMITTER:!1}:void 0}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ls[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="testnet")throw new Error("There is no way to programmatically mint testnet APT, you must use the minting site at https://aptos.dev/network/faucet");if(this.network==="mainnet")throw new Error("There is no mainnet faucet");if(this.network==="custom")throw new Error("Please provide a custom faucet url");return gs[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return ps[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return Si[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return Pi[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return Si[this.network]===e}isProverServiceRequest(e){return Pi[this.network]===e}getDefaultMaxGasAmount(){return _nullishCoalesce(_optionalChain([this, 'access', _180 => _180.transactionGenerationConfig, 'optionalAccess', _181 => _181.defaultMaxGasAmount]), () => (2e5))}getDefaultTxnExpirySecFromNow(){return _nullishCoalesce(_optionalChain([this, 'access', _182 => _182.transactionGenerationConfig, 'optionalAccess', _183 => _183.defaultTxnExpirySecFromNow]), () => (20))}setIgnoreTransactionSubmitter(e){this.pluginConfig&&(this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER=e)}getTransactionSubmitter(){if(this.pluginConfig!==void 0&&this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER!==!0)return this.pluginConfig.TRANSACTION_SUBMITTER}};var qd={typeParameters:[{constraints:[]}],parameters:[new G,new te]};async function Wa(n){let{aptosConfig:e,sender:t,recipient:r,amount:i,coinType:o,options:s}=n;return T({aptosConfig:e,sender:t,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[_nullishCoalesce(o, () => (Rt))],functionArguments:[r,i],abi:qd},options:s})}var Yn=class{constructor(e){this.config=e}async transferCoinTransaction(e){return Wa({aptosConfig:this.config,...e})}};var xt={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},Ke="0x4::token::Token";async function Qa(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return(await w({aptosConfig:e,query:{query:na,variables:{where_condition:r}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function ja(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}};return(await w({aptosConfig:e,query:{query:qi,variables:{where_condition:r}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Ja(n){let{aptosConfig:e,ownerAddress:t,options:r}=n,i={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}},o={query:qi,variables:{where_condition:i,offset:_optionalChain([r, 'optionalAccess', _184 => _184.offset]),limit:_optionalChain([r, 'optionalAccess', _185 => _185.limit]),order_by:_optionalChain([r, 'optionalAccess', _186 => _186.orderBy])}};return(await w({aptosConfig:e,query:o,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function Xa(n){let{aptosConfig:e,digitalAssetAddress:t,options:r}=n,i={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}},o={query:ta,variables:{where_condition:i,offset:_optionalChain([r, 'optionalAccess', _187 => _187.offset]),limit:_optionalChain([r, 'optionalAccess', _188 => _188.limit]),order_by:_optionalChain([r, 'optionalAccess', _189 => _189.orderBy])}};return(await w({aptosConfig:e,query:o,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var $d={typeParameters:[],parameters:[new h(x()),new te,new h(x()),new h(x()),new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q,new te,new te]};async function Ya(n){let{aptosConfig:e,options:t,creator:r}=n;return T({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new v(n.description),new $(_nullishCoalesce(n.maxSupply, () => (_chunkHO5ESTN4js.e))),new v(n.name),new v(n.uri),new F(_nullishCoalesce(n.mutableDescription, () => (!0))),new F(_nullishCoalesce(n.mutableRoyalty, () => (!0))),new F(_nullishCoalesce(n.mutableURI, () => (!0))),new F(_nullishCoalesce(n.mutableTokenDescription, () => (!0))),new F(_nullishCoalesce(n.mutableTokenName, () => (!0))),new F(_nullishCoalesce(n.mutableTokenProperties, () => (!0))),new F(_nullishCoalesce(n.mutableTokenURI, () => (!0))),new F(_nullishCoalesce(n.tokensBurnableByCreator, () => (!0))),new F(_nullishCoalesce(n.tokensFreezableByCreator, () => (!0))),new $(_nullishCoalesce(n.royaltyNumerator, () => (0))),new $(_nullishCoalesce(n.royaltyDenominator, () => (1)))],abi:$d},options:t})}async function In(n){let{aptosConfig:e,options:t}=n,r=_optionalChain([t, 'optionalAccess', _190 => _190.where]);_optionalChain([t, 'optionalAccess', _191 => _191.tokenStandard])&&(r.token_standard={_eq:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _192 => _192.tokenStandard]), () => ("v2"))});let i={query:Qs,variables:{where_condition:r,offset:_optionalChain([t, 'optionalAccess', _193 => _193.offset]),limit:_optionalChain([t, 'optionalAccess', _194 => _194.limit])}};return(await w({aptosConfig:e,query:i,originMethod:"getCollectionData"})).current_collections_v2[0]}async function Za(n){let{aptosConfig:e,creatorAddress:t,collectionName:r,options:i}=n,o=_chunkHO5ESTN4js.na.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return _optionalChain([i, 'optionalAccess', _195 => _195.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _196 => _196.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...i,where:s}})}async function ec(n){let{aptosConfig:e,creatorAddress:t,options:r}=n,o={creator_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return _optionalChain([r, 'optionalAccess', _197 => _197.tokenStandard])&&(o.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _198 => _198.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...r,where:o}})}async function tc(n){let{aptosConfig:e,collectionId:t,options:r}=n,o={collection_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return _optionalChain([r, 'optionalAccess', _199 => _199.tokenStandard])&&(o.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _200 => _200.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...r,where:o}})}async function nc(n){let{creatorAddress:e,collectionName:t,options:r,aptosConfig:i}=n,o=_chunkHO5ESTN4js.na.from(e),s={collection_name:{_eq:t},creator_address:{_eq:o.toStringLong()}};return _optionalChain([r, 'optionalAccess', _201 => _201.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _202 => _202.tokenStandard]), () => ("v2"))}),(await In({aptosConfig:i,options:{where:s}})).collection_id}var Wd={typeParameters:[],parameters:[new h(x()),new h(x()),new h(x()),new h(x()),new z(new h(x())),new z(new h(x())),new z(z.u8())]};async function rc(n){let{aptosConfig:e,options:t,creator:r,collection:i,description:o,name:s,uri:a,propertyKeys:c,propertyTypes:d,propertyValues:m}=n,A=_optionalChain([d, 'optionalAccess', _203 => _203.map, 'call', _204 => _204(p=>xt[p])]);return T({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new v(i),new v(o),new v(s),new v(a),S.MoveString(_nullishCoalesce(c, () => ([]))),S.MoveString(_nullishCoalesce(A, () => ([]))),Ac(_nullishCoalesce(m, () => ([])),_nullishCoalesce(A, () => ([])))],abi:Wd},options:t})}var Qd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new G]};async function ic(n){let{aptosConfig:e,sender:t,digitalAssetAddress:r,recipient:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(r),_chunkHO5ESTN4js.na.from(i)],abi:Qd},options:s})}var jd={typeParameters:[],parameters:[new h(x()),new h(x()),new h(x()),new h(x()),new z(new h(x())),new z(new h(x())),new z(z.u8()),new G]};async function oc(n){let{aptosConfig:e,account:t,collection:r,description:i,name:o,uri:s,recipient:a,propertyKeys:c,propertyTypes:d,propertyValues:m,options:A}=n;if(_optionalChain([c, 'optionalAccess', _205 => _205.length])!==_optionalChain([m, 'optionalAccess', _206 => _206.length]))throw new Error("Property keys and property values counts do not match");if(_optionalChain([d, 'optionalAccess', _207 => _207.length])!==_optionalChain([m, 'optionalAccess', _208 => _208.length]))throw new Error("Property types and property values counts do not match");let p=_optionalChain([d, 'optionalAccess', _209 => _209.map, 'call', _210 => _210(g=>xt[g])]);return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[r,i,o,s,S.MoveString(_nullishCoalesce(c, () => ([]))),S.MoveString(_nullishCoalesce(p, () => ([]))),Ac(_nullishCoalesce(m, () => ([])),_nullishCoalesce(p, () => ([]))),a],abi:jd},options:A})}var Jd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function sc(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(r)],abi:Jd},options:o})}var Xd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function ac(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[r],abi:Xd},options:o})}var Yd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function cc(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[r],abi:Yd},options:o})}var Zd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function uc(n){let{aptosConfig:e,creator:t,description:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:Zd},options:s})}var ep={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function dc(n){let{aptosConfig:e,creator:t,name:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:ep},options:s})}var tp={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function pc(n){let{aptosConfig:e,creator:t,uri:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:tp},options:s})}var np={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x()),new h(x()),z.u8()]};async function lc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[_nullishCoalesce(a, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),new v(xt[i]),S.U8(mo(o,xt[i]))],abi:np},options:c})}var rp={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function gc(n){let{aptosConfig:e,creator:t,propertyKey:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:rp},options:s})}var ip={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x()),new h(x()),z.u8()]};async function yc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[_nullishCoalesce(a, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),new v(xt[i]),mo(o,xt[i])],abi:ip},options:c})}var op={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new h(Te(new M(0))),new h(x()),new M(1)]};async function mc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[_nullishCoalesce(a, () => (Ke)),xt[i]],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),o],abi:op},options:c})}var sp={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new h(Te(new M(0))),new h(x()),new M(1)]};async function fc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[_nullishCoalesce(a, () => (Ke)),xt[i]],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),o],abi:sp},options:c})}function Ac(n,e){let t=new Array;return e.forEach((r,i)=>{t.push(mo(n[i],r))}),t}function mo(n,e){let t=He(e);return Jt(n,t,0,[]).bcsToBytes()}var Zn=class{constructor(e){this.config=e}async getCollectionData(e){await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:t,collectionName:r,options:i}=e,o=_chunkHO5ESTN4js.na.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return _optionalChain([i, 'optionalAccess', _211 => _211.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _212 => _212.tokenStandard]), () => ("v2"))}),In({aptosConfig:this.config,options:{where:s}})}async getCollectionDataByCreatorAddressAndCollectionName(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Za({aptosConfig:this.config,...e})}async getCollectionDataByCreatorAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ec({aptosConfig:this.config,...e})}async getCollectionDataByCollectionId(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),tc({aptosConfig:this.config,...e})}async getCollectionId(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),nc({aptosConfig:this.config,...e})}async getDigitalAssetData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Qa({aptosConfig:this.config,...e})}async getCurrentDigitalAssetOwnership(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ja({aptosConfig:this.config,...e})}async getOwnedDigitalAssets(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Ja({aptosConfig:this.config,...e})}async getDigitalAssetActivity(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Xa({aptosConfig:this.config,...e})}async createCollectionTransaction(e){return Ya({aptosConfig:this.config,...e})}async mintDigitalAssetTransaction(e){return rc({aptosConfig:this.config,...e})}async transferDigitalAssetTransaction(e){return ic({aptosConfig:this.config,...e})}async mintSoulBoundTransaction(e){return oc({aptosConfig:this.config,...e})}async burnDigitalAssetTransaction(e){return sc({aptosConfig:this.config,...e})}async freezeDigitalAssetTransaferTransaction(e){return ac({aptosConfig:this.config,...e})}async unfreezeDigitalAssetTransaferTransaction(e){return cc({aptosConfig:this.config,...e})}async setDigitalAssetDescriptionTransaction(e){return uc({aptosConfig:this.config,...e})}async setDigitalAssetNameTransaction(e){return dc({aptosConfig:this.config,...e})}async setDigitalAssetURITransaction(e){return pc({aptosConfig:this.config,...e})}async addDigitalAssetPropertyTransaction(e){return lc({aptosConfig:this.config,...e})}async removeDigitalAssetPropertyTransaction(e){return gc({aptosConfig:this.config,...e})}async updateDigitalAssetPropertyTransaction(e){return yc({aptosConfig:this.config,...e})}async addDigitalAssetTypedPropertyTransaction(e){return mc({aptosConfig:this.config,...e})}async updateDigitalAssetTypedPropertyTransaction(e){return fc({aptosConfig:this.config,...e})}};async function hc(n){let{aptosConfig:e,accountAddress:t,amount:r,options:i}=n,o=_optionalChain([i, 'optionalAccess', _213 => _213.timeoutSecs])||20,{data:s}=await Ps({aptosConfig:e,path:"fund",body:{address:_chunkHO5ESTN4js.na.from(t).toString(),amount:r},originMethod:"fundAccount"}),a=s.txn_hashes[0],c=await Pn({aptosConfig:e,transactionHash:a,options:{timeoutSecs:o,checkSuccess:_optionalChain([i, 'optionalAccess', _214 => _214.checkSuccess])}});if(c.type==="user_transaction")return c;throw new Error(`Unexpected transaction received for fund account: ${c.type}`)}var er=class{constructor(e){this.config=e}async fundAccount(e){let t=await hc({aptosConfig:this.config,...e});return(_optionalChain([e, 'access', _215 => _215.options, 'optionalAccess', _216 => _216.waitForIndexer])===void 0||_optionalChain([e, 'access', _217 => _217.options, 'optionalAccess', _218 => _218.waitForIndexer]))&&await Qr({aptosConfig:this.config,minimumLedgerVersion:BigInt(t.version),processorType:"fungible_asset_processor"}),t}};async function ai(n){let{aptosConfig:e,options:t}=n,r={query:Ys,variables:{where_condition:_optionalChain([t, 'optionalAccess', _219 => _219.where]),limit:_optionalChain([t, 'optionalAccess', _220 => _220.limit]),offset:_optionalChain([t, 'optionalAccess', _221 => _221.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function bc(n){let{aptosConfig:e,options:t}=n,r={query:Xs,variables:{where_condition:_optionalChain([t, 'optionalAccess', _222 => _222.where]),limit:_optionalChain([t, 'optionalAccess', _223 => _223.limit]),offset:_optionalChain([t, 'optionalAccess', _224 => _224.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Tc(n){let{aptosConfig:e,options:t}=n,r={query:js,variables:{where_condition:_optionalChain([t, 'optionalAccess', _225 => _225.where]),limit:_optionalChain([t, 'optionalAccess', _226 => _226.limit]),offset:_optionalChain([t, 'optionalAccess', _227 => _227.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var wc={typeParameters:[{constraints:[]}],parameters:[He("0x1::object::Object"),new G,new te]};async function Sc(n){let{aptosConfig:e,sender:t,fungibleAssetMetadataAddress:r,recipient:i,amount:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[r,i,o],abi:wc},options:s})}async function Pc(n){let{aptosConfig:e,sender:t,fromStore:r,toStore:i,amount:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::dispatchable_fungible_asset::transfer",typeArguments:["0x1::fungible_asset::FungibleStore"],functionArguments:[r,i,o],abi:wc},options:s})}var tr=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _228 => _228.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),ai({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _229 => _229.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),(await ai({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _230 => _230.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),await ai({aptosConfig:this.config,options:{where:{creator_address:{_eq:_chunkHO5ESTN4js.na.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _231 => _231.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),bc({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _232 => _232.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),Tc({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return Sc({aptosConfig:this.config,...e})}async transferFungibleAssetBetweenStores(e){return Pc({aptosConfig:this.config,...e})}};var nr=class{constructor(e){this.config=e}async getLedgerInfo(){return Mr({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return da({aptosConfig:this.config,...e})}async getBlockByHeight(e){return pa({aptosConfig:this.config,...e})}async view(e){return le({aptosConfig:this.config,...e})}async viewJson(e){return Ha({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return ra({aptosConfig:this.config,...e})}async queryIndexer(e){return w({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return Vr({aptosConfig:this.config})}async getProcessorStatus(e){return Hr({aptosConfig:this.config,processorType:e})}};var Ec=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function _c(n){return!(!n||n.length<3||n.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(n))}function vt(n){let[e,t,...r]=n.replace(/\.apt$/,"").split(".");if(r.length>0)throw new Error(`${n} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!_c(e))throw new Error(`${e} is not valid. ${Ec}`);if(t&&!_c(t))throw new Error(`${t} is not valid. ${Ec}`);return{domainName:t||e,subdomainName:t?e:void 0}}function Ic(n){if(!n)return!1;let e=new Date(n.domain_expiration_timestamp).getTime()<Date.now(),t=new Date(n.expiration_timestamp).getTime()<Date.now();return n.subdomain&&e?!1:n.subdomain&&n.subdomain_expiration_policy===1?!0:!t}var ap="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",cp={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:ap,custom:null,devnet:null,shelbynet:null,netna:null};function ft(n){let e=cp[n.network];if(!e)throw new Error(`The ANS contract is not deployed to ${n.network}`);return e}var ci=n=>{if(n&&typeof n=="object"&&"vec"in n&&Array.isArray(n.vec))return n.vec[0]};async function xc(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t),s=await le({aptosConfig:e,payload:{function:`${r}::router::get_owner_addr`,functionArguments:[i,o]}}),a=ci(s[0]);return a?_chunkHO5ESTN4js.na.from(a):void 0}async function vc(n){let{aptosConfig:e,expiration:t,name:r,sender:i,targetAddress:o,toAddress:s,options:a,transferable:c}=n,d=ft(e),{domainName:m,subdomainName:A}=vt(r),p=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(A&&!p)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(p&&!A)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let q=_nullishCoalesce(t.years, () => (1));if(q!==1)throw new Error("For now, names can only be registered for 1 year at a time");let Ye=q*31536e3;return await T({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_domain`,functionArguments:[m,Ye,o,s]},options:a})}if(!A)throw new Error(`${t.policy} requires a subdomain to be provided.`);let g=await fo({aptosConfig:e,name:m});if(!g)throw new Error("The domain does not exist");let b=t.policy==="subdomain:independent"?t.expirationDate:g;if(b>g)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await T({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_subdomain`,functionArguments:[m,A,Math.round(b/1e3),t.policy==="subdomain:follow-domain"?1:0,!!c,o,s]},options:a})}async function fo(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t);try{let s=await le({aptosConfig:e,payload:{function:`${r}::router::get_expiration`,functionArguments:[i,o]}});return Number(s[0])*1e3}catch (e7){return}}async function Cc(n){let{aptosConfig:e,address:t}=n,r=ft(e),i=await le({aptosConfig:e,payload:{function:`${r}::router::get_primary_name`,functionArguments:[_chunkHO5ESTN4js.na.from(t).toString()]}}),o=ci(i[1]),s=ci(i[0]);if(o)return[s,o].filter(Boolean).join(".")}async function Kc(n){let{aptosConfig:e,sender:t,name:r,options:i}=n,o=ft(e);if(!r)return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::clear_primary_name`,functionArguments:[]},options:i});let{domainName:s,subdomainName:a}=vt(r);return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::set_primary_name`,functionArguments:[s,a]},options:i})}async function Rc(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t),s=await le({aptosConfig:e,payload:{function:`${r}::router::get_target_addr`,functionArguments:[i,o]}}),a=ci(s[0]);return a?_chunkHO5ESTN4js.na.from(a):void 0}async function Uc(n){let{aptosConfig:e,sender:t,name:r,address:i,options:o}=n,s=ft(e),{domainName:a,subdomainName:c}=vt(r);return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_target_addr`,functionArguments:[a,c,i]},options:o})}async function zc(n){let{aptosConfig:e,name:t}=n,{domainName:r,subdomainName:i=""}=vt(t),a=(await w({aptosConfig:e,query:{query:Sn,variables:{where_condition:{domain:{_eq:r},subdomain:{_eq:i}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=rr(a)),Ic(a)?a:void 0}async function kc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountNames",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _233 => _233.limit]),offset:_optionalChain([t, 'optionalAccess', _234 => _234.offset]),order_by:_optionalChain([t, 'optionalAccess', _235 => _235.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _236 => _236.options, 'optionalAccess', _237 => _237.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i}}}}})).current_aptos_names.map(rr)}async function Nc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountDomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _238 => _238.limit]),offset:_optionalChain([t, 'optionalAccess', _239 => _239.offset]),order_by:_optionalChain([t, 'optionalAccess', _240 => _240.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _241 => _241.options, 'optionalAccess', _242 => _242.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_eq:""}}}}})).current_aptos_names.map(rr)}async function Dc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountSubdomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _243 => _243.limit]),offset:_optionalChain([t, 'optionalAccess', _244 => _244.offset]),order_by:_optionalChain([t, 'optionalAccess', _245 => _245.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _246 => _246.options, 'optionalAccess', _247 => _247.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_neq:""}}}}})).current_aptos_names.map(rr)}async function Fc(n){let{aptosConfig:e,options:t,domain:r}=n;return(await w({aptosConfig:e,originMethod:"getDomainSubdomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _248 => _248.limit]),offset:_optionalChain([t, 'optionalAccess', _249 => _249.offset]),order_by:_optionalChain([t, 'optionalAccess', _250 => _250.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _251 => _251.options, 'optionalAccess', _252 => _252.where]), () => ({})),domain:{_eq:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(rr).filter(Ic)}async function Ao(n){let{aptosConfig:e}=n,t=ft(e),[r]=await le({aptosConfig:e,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),i=r/60/60/24,o=()=>new Date;return new Date(o().setDate(o().getDate()-i)).toISOString()}async function Oc(n){let{aptosConfig:e,sender:t,name:r,years:i=1,options:o}=n,s=ft(e),a=i*31536e3,{domainName:c,subdomainName:d}=vt(r);if(d)throw new Error("Subdomains cannot be renewed");if(i!==1)throw new Error("Currently, only 1 year renewals are supported");return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::renew_domain`,functionArguments:[c,a]},options:o})}function rr(n){return{...n,expiration_timestamp:new Date(n.expiration_timestamp).getTime()}}var ir=class{constructor(e){this.config=e}async getOwnerAddress(e){return xc({aptosConfig:this.config,...e})}async getExpiration(e){return fo({aptosConfig:this.config,...e})}async getTargetAddress(e){return Rc({aptosConfig:this.config,...e})}async setTargetAddress(e){return Uc({aptosConfig:this.config,...e})}async getPrimaryName(e){return Cc({aptosConfig:this.config,...e})}async setPrimaryName(e){return Kc({aptosConfig:this.config,...e})}async registerName(e){return vc({aptosConfig:this.config,...e})}async renewDomain(e){return Oc({aptosConfig:this.config,...e})}async getName(e){return zc({aptosConfig:this.config,...e})}async getAccountNames(e){return kc({aptosConfig:this.config,...e})}async getAccountDomains(e){return Nc({aptosConfig:this.config,...e})}async getAccountSubdomains(e){return Dc({aptosConfig:this.config,...e})}async getDomainSubdomains(e){return Fc({aptosConfig:this.config,...e})}};async function Bc(n){let{aptosConfig:e,poolAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:Hi,variables:{where_condition:{pool_address:{_eq:r}}}}});return o.num_active_delegator_per_pool[0]?o.num_active_delegator_per_pool[0].num_active_delegator:0}async function Gc(n){let{aptosConfig:e,options:t}=n,r={query:Hi,variables:{order_by:_optionalChain([t, 'optionalAccess', _253 => _253.orderBy])}};return(await w({aptosConfig:e,query:r})).num_active_delegator_per_pool}async function Mc(n){let{aptosConfig:e,delegatorAddress:t,poolAddress:r}=n,i={query:Js,variables:{delegatorAddress:_chunkHO5ESTN4js.na.from(t).toStringLong(),poolAddress:_chunkHO5ESTN4js.na.from(r).toStringLong()}};return(await w({aptosConfig:e,query:i})).delegated_staking_activities}var or=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _254 => _254.minimumLedgerVersion]),processorType:"stake_processor"}),Bc({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _255 => _255.minimumLedgerVersion]),processorType:"stake_processor"}),Gc({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _256 => _256.minimumLedgerVersion]),processorType:"stake_processor"}),Mc({aptosConfig:this.config,...e})}};var ui=class{constructor(e){this.config=e}async simple(e){return T({aptosConfig:this.config,...e})}async multiAgent(e){return T({aptosConfig:this.config,...e})}};function ho(n,e){if(!(n.getTransactionSubmitter()!==void 0||e.transactionSubmitter!==void 0)&&e.transaction.feePayerAddress&&!e.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator")}function bo(n,e,t){let r=t.value;return t.value=async function(...i){return r.apply(this,i)},t}var xn=class{constructor(e){this.config=e}async simple(e){return ao({aptosConfig:this.config,...e})}async multiAgent(e){return ao({aptosConfig:this.config,...e})}};_chunkHO5ESTN4js.a.call(void 0, [bo],xn.prototype,"simple",1),_chunkHO5ESTN4js.a.call(void 0, [bo],xn.prototype,"multiAgent",1);var di=class{constructor(e){this.config=e}async simple(e){return ho(this.config,e),jn({aptosConfig:this.config,...e})}async multiAgent(e){return ho(this.config,e),jn({aptosConfig:this.config,...e})}};var pi=class{constructor(e,t,r,i,o){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=e,this.account=t,this.maxWaitTime=r,this.maximumInFlight=i,this.sleepTime=o}async nextSequenceNumber(){for(;this.lock;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime);this.lock=!0;let e=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let t=_chunkHO5ESTN4js.ua.call(void 0, );for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime),_chunkHO5ESTN4js.ua.call(void 0, )-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}e=this.currentNumber,this.currentNumber+=BigInt(1)}catch(t){console.error("error in getting next sequence number for this account",t)}finally{this.lock=!1}return e}async initialize(){let{sequence_number:e}=await _n({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(e),this.lastUncommintedNumber=BigInt(e)}async update(){let{sequence_number:e}=await _n({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(e),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime);this.lock=!0;try{await this.update();let e=_chunkHO5ESTN4js.ua.call(void 0, );for(;this.lastUncommintedNumber!==this.currentNumber;)_chunkHO5ESTN4js.ua.call(void 0, )-e>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime),await this.update())}catch(e){console.error("error in synchronizing this account sequence number with the one on chain",e)}finally{this.lock=!1}}}};var vn=class{constructor(){this.queue=[];this.pendingDequeue=[];this.cancelled=!1}enqueue(e){if(this.cancelled=!1,this.pendingDequeue.length>0){_optionalChain([this, 'access', _257 => _257.pendingDequeue, 'access', _258 => _258.shift, 'call', _259 => _259(), 'optionalAccess', _260 => _260.resolve, 'call', _261 => _261(e)]);return}this.queue.push(e)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((e,t)=>{this.pendingDequeue.push({resolve:e,reject:t})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:e})=>{e(new Cn("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}},Cn=class extends Error{};var Vc="fulfilled",Hc= exports.TransactionWorkerEventsEnum =(o=>(o.TransactionSent="transactionSent",o.TransactionSendFailed="transactionSendFailed",o.TransactionExecuted="transactionExecuted",o.TransactionExecutionFailed="transactionExecutionFailed",o.ExecutionFinish="executionFinish",o))(Hc||{}),li= exports.TransactionWorker =class extends _eventemitter32.default{constructor(t,r,i=30,o=100,s=10){super();this.taskQueue=new vn;this.transactionsQueue=new vn;this.outstandingTransactions=new vn;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=r,this.started=!1,this.accountSequnceNumber=new pi(t,r,i,o,s)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let r=await this.generateNextTransaction(this.account,t);if(!r)return;let i=ri({aptosConfig:this.aptosConfig,transaction:r,signer:this.account});await this.outstandingTransactions.enqueue([i,t])}}catch(t){if(t instanceof Cn)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],r=[],[i,o]=await this.outstandingTransactions.dequeue();for(t.push(i),r.push(o);!this.outstandingTransactions.isEmpty();)[i,o]=await this.outstandingTransactions.dequeue(),t.push(i),r.push(o);let s=await Promise.allSettled(t);for(let a=0;a<s.length&&a<r.length;a+=1){let c=s[a];o=r[a],c.status===Vc?(this.sentTransactions.push([c.value.hash,o,null]),this.emit("transactionSent",{message:`transaction hash ${c.value.hash} has been committed to chain`,transactionHash:c.value.hash}),await this.checkTransaction(c,o)):(this.sentTransactions.push([c.status,o,c.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${c.reason}`,error:c.reason}))}this.emit("executionFinish",{message:`execute ${s.length} transactions finished`})}}catch(t){if(t instanceof Cn)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,r){try{let i=[];i.push(Pn({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let o=await Promise.allSettled(i);for(let s=0;s<o.length;s+=1){let a=o[s];a.status===Vc?(this.executedTransactions.push([a.value.hash,r,null]),this.emit("transactionExecuted",{message:`transaction hash ${a.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([a.status,r,a.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${a.reason}`,error:a.reason}))}}catch(i){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${i}`)}}async push(t,r){this.transactionsQueue.enqueue([t,r])}async generateNextTransaction(t,r){if(this.transactionsQueue.isEmpty())return;let[i,o]=await this.transactionsQueue.dequeue();return T({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:i,options:{...o,accountSequenceNumber:r,replayProtectionNonce:void 0}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};var gi=class extends _eventemitter32.default{constructor(e){super(),this.config=e}start(e){let{sender:t}=e;this.account=t,this.transactionWorker=new li(this.config,t),this.transactionWorker.start(),this.registerToEvents()}push(e){let{data:t,options:r}=e;for(let i of t)this.transactionWorker.push(i,r)}registerToEvents(){this.transactionWorker.on("transactionSent",async e=>{this.emit("transactionSent",e)}),this.transactionWorker.on("transactionSendFailed",async e=>{this.emit("transactionSendFailed",e)}),this.transactionWorker.on("transactionExecuted",async e=>{this.emit("transactionExecuted",e)}),this.transactionWorker.on("transactionExecutionFailed",async e=>{this.emit("transactionExecutionFailed",e)}),this.transactionWorker.on("executionFinish",async e=>{this.emit("executionFinish",e)})}forSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.start({sender:t}),this.push({data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}};var sr=class{constructor(e){this.config=e,this.build=new ui(this.config),this.simulate=new xn(this.config),this.submit=new di(this.config),this.batch=new gi(this.config)}async getTransactions(e){return Wi({aptosConfig:this.config,...e})}async getTransactionByVersion(e){return ca({aptosConfig:this.config,...e})}async getTransactionByHash(e){return Wn({aptosConfig:this.config,...e})}async isPendingTransaction(e){return ua({aptosConfig:this.config,...e})}async waitForTransaction(e){return Pn({aptosConfig:this.config,...e})}async getGasPriceEstimation(){return Wr({aptosConfig:this.config})}getSigningMessage(e){return Ia(e)}async publishPackageTransaction(e){return va({aptosConfig:this.config,...e})}async rotateAuthKey(e){return Ma({aptosConfig:this.config,...e})}async rotateAuthKeyUnverified(e){return Va({aptosConfig:this.config,...e})}sign(e){return ti({...e})}signAsFeePayer(e){return ni({...e})}async batchTransactionsForSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.batch.forSingleAccount({sender:t,data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(e){return ri({aptosConfig:this.config,...e})}async signAndSubmitAsFeePayer(e){return xa({aptosConfig:this.config,...e})}};var ar=class{constructor(e){this.config=e}async getTableItem(e){return qr({aptosConfig:this.config,...e})}async getTableItemsData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),sa({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),aa({aptosConfig:this.config,...e})}};async function yi(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,uidKey:i="sub",derivationPath:o}=n,s={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,epk_blinder:_chunkHO5ESTN4js.v.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:i,derivation_path:o},{data:a}=await Es({aptosConfig:e,path:"fetch",body:s,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return _chunkHO5ESTN4js.v.fromHexInput(a.pepper).toUint8Array()}async function To(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,pepper:i=await yi(n),uidKey:o="sub",maxExpHorizonSecs:s=(await rn({aptosConfig:e})).maxExpHorizonSecs}=n;if(_chunkHO5ESTN4js.v.fromHexInput(i).toUint8Array().length!==Ce.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${Ce.PEPPER_LENGTH} bytes`);let a=_jwtdecode.jwtDecode.call(void 0, t);if(typeof a.iat!="number")throw new Error("iat was not found");if(s<r.expiryDateSecs-a.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${s}`);let c={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:_chunkHO5ESTN4js.v.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,exp_horizon_secs:s,pepper:_chunkHO5ESTN4js.v.fromHexInput(i).toStringWithoutPrefix(),uid_key:o},{data:d}=await _s({aptosConfig:e,path:"prove",body:c,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),m=d.proof,A=new Pt({a:m.a,b:m.b,c:m.c});return new fe({proof:new nn(A,0),trainingWheelsSignature:Le.fromHex(d.training_wheels_signature),expHorizonSecs:s})}async function Lc(n){let{aptosConfig:e,jwt:t,jwkAddress:r,uidKey:i,proofFetchCallback:o,pepper:s=await yi(n)}=n,{verificationKey:a,maxExpHorizonSecs:c}=await rn({aptosConfig:e}),d=To({...n,pepper:s,maxExpHorizonSecs:c}),m=o?d:await d;if(r!==void 0){let g=L.fromJwtAndPepper({jwt:t,pepper:s,jwkAddress:r,uidKey:i}),b=await Jn({aptosConfig:e,authenticationKey:g.authKey().derivedAddress()});return Ve.create({...n,address:b,proof:m,pepper:s,proofFetchCallback:o,jwkAddress:r,verificationKey:a})}let A=K.fromJwtAndPepper({jwt:t,pepper:s,uidKey:i}),p=await Jn({aptosConfig:e,authenticationKey:A.authKey().derivedAddress()});return Ce.create({...n,address:p,proof:m,pepper:s,proofFetchCallback:o,verificationKey:a})}async function qc(n){let{aptosConfig:e,sender:t,iss:r,options:i}=n,{jwksUrl:o}=n;o===void 0&&(bs.test(r)?o="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":o=r.endsWith("/")?`${r}.well-known/jwks.json`:`${r}/.well-known/jwks.json`);let s;try{if(s=await fetch(o),!s.ok)throw new Error(`${s.status} ${s.statusText}`)}catch(c){let d;throw c instanceof Error?d=`${c.message}`:d=`error unknown - ${c}`,_.fromErrorType({type:14,details:`Failed to fetch JWKS at ${o}: ${d}`})}let a=await s.json();return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[r,S.MoveString(a.keys.map(c=>c.kid)),S.MoveString(a.keys.map(c=>c.alg)),S.MoveString(a.keys.map(c=>c.e)),S.MoveString(a.keys.map(c=>c.n))]},options:i})}var cr=class{constructor(e){this.config=e}async getPepper(e){return yi({aptosConfig:this.config,...e})}async getProof(e){return To({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return Lc({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return qc({aptosConfig:this.config,...e})}};async function lp(n){let{aptosConfig:e,options:t}=n,r={query:Gr,variables:{where_condition:_optionalChain([t, 'optionalAccess', _262 => _262.where]),offset:_optionalChain([t, 'optionalAccess', _263 => _263.offset]),limit:_optionalChain([t, 'optionalAccess', _264 => _264.limit]),order_by:_optionalChain([t, 'optionalAccess', _265 => _265.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getObjectData"})).current_objects}async function $c(n){let{aptosConfig:e,objectAddress:t,options:r}=n,o={object_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return(await lp({aptosConfig:e,options:{...r,where:o}}))[0]}var ur=class{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),$c({aptosConfig:this.config,...e})}};var re=class{constructor(e){this.config=_nullishCoalesce(e, () => (new si)),this.account=new Xn(this.config),this.abstraction=new Xt(this.config),this.ans=new ir(this.config),this.coin=new Yn(this.config),this.digitalAsset=new Zn(this.config),this.faucet=new er(this.config),this.fungibleAsset=new tr(this.config),this.general=new nr(this.config),this.staking=new or(this.config),this.transaction=new sr(this.config),this.table=new ar(this.config),this.keyless=new cr(this.config),this.object=new ur(this.config)}setIgnoreTransactionSubmitter(e){this.config.setIgnoreTransactionSubmitter(e)}};function ge(n,e,t){Object.getOwnPropertyNames(e.prototype).forEach(r=>{let i=Object.getOwnPropertyDescriptor(e.prototype,r);i&&Object.defineProperty(n.prototype,r,{value:function(...o){return this[t][r](...o)},writable:i.writable,configurable:i.configurable,enumerable:i.enumerable})})}ge(re,Xn,"account");ge(re,Xt,"abstraction");ge(re,ir,"ans");ge(re,Yn,"coin");ge(re,Zn,"digitalAsset");ge(re,Event,"event");ge(re,er,"faucet");ge(re,tr,"fungibleAsset");ge(re,nr,"general");ge(re,or,"staking");ge(re,sr,"transaction");ge(re,ar,"table");ge(re,cr,"keyless");ge(re,ur,"object");exports.ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT = hs; exports.APTOS_BIP44_REGEX = cu; exports.APTOS_COIN = Rt; exports.APTOS_FA = fs; exports.APTOS_HARDENED_REGEX = au; exports.AbstractKeylessAccount = we; exports.AbstractMultiKey = Oe; exports.AbstractPublicKey = yr; exports.AbstractSignature = Un; exports.AbstractedAccount = Or; exports.Account = gt; exports.AccountAbstractionMessage = xr; exports.AccountAddress = _chunkHO5ESTN4js.na; exports.AccountAuthenticator = ee; exports.AccountAuthenticatorAbstraction = kt; exports.AccountAuthenticatorEd25519 = Ge; exports.AccountAuthenticatorMultiEd25519 = ot; exports.AccountAuthenticatorMultiKey = Je; exports.AccountAuthenticatorNoAccountAuthenticator = pn; exports.AccountAuthenticatorSingleKey = ue; exports.AccountAuthenticatorVariant = _chunkHO5ESTN4js.L; exports.AccountPublicKey = ae; exports.AccountSequenceNumber = pi; exports.AccountUtils = Ns; exports.AddressInvalidReason = _chunkHO5ESTN4js.ma; exports.AnyPublicKey = I; exports.AnyPublicKeyVariant = _chunkHO5ESTN4js.N; exports.AnySignature = B; exports.AnySignatureVariant = _chunkHO5ESTN4js.P; exports.Aptos = re; exports.AptosApiError = Ee; exports.AptosApiType = en; exports.AptosConfig = si; exports.AuthenticationKey = V; exports.Bool = F; exports.CKDPriv = ss; exports.ChainId = ln; exports.DEFAULT_MAX_GAS_AMOUNT = ys; exports.DEFAULT_TXN_EXP_SEC_FROM_NOW = ms; exports.DEFAULT_TXN_TIMEOUT_SEC = Ar; exports.DerivableAbstractedAccount = Fs; exports.DeriveScheme = _chunkHO5ESTN4js.la; exports.Deserializer = C; exports.EPK_HORIZON_SECS = Mu; exports.Ed25519Account = oe; exports.Ed25519PrivateKey = J; exports.Ed25519PublicKey = E; exports.Ed25519Signature = R; exports.EntryFunction = dt; exports.EntryFunctionBytes = gr; exports.EphemeralCertificate = tn; exports.EphemeralCertificateVariant = _chunkHO5ESTN4js.S; exports.EphemeralKeyPair = jt; exports.EphemeralPublicKey = Tt; exports.EphemeralPublicKeyVariant = _chunkHO5ESTN4js.Q; exports.EphemeralSignature = Le; exports.EphemeralSignatureVariant = _chunkHO5ESTN4js.R; exports.FIREBASE_AUTH_ISS_PATTERN = bs; exports.FederatedKeylessAccount = Ve; exports.FederatedKeylessPublicKey = L; exports.FeePayerRawTransaction = qt; exports.FixedBytes = Re; exports.Groth16ProofAndStatement = Ui; exports.Groth16VerificationKey = ki; exports.Groth16Zkp = Pt; exports.HARDENED_OFFSET = rs; exports.Hex = _chunkHO5ESTN4js.v; exports.HexInvalidReason = _chunkHO5ESTN4js.u; exports.I128 = es; exports.I16 = Xo; exports.I256 = ts; exports.I32 = Yo; exports.I64 = Zo; exports.I8 = Jo; exports.Identifier = k; exports.KeyType = uu; exports.KeylessAccount = Ce; exports.KeylessConfiguration = zi; exports.KeylessError = _; exports.KeylessErrorCategory = zu; exports.KeylessErrorResolutionTip = ku; exports.KeylessErrorType = hr; exports.KeylessPublicKey = K; exports.KeylessSignature = ce; exports.MAX_AUD_VAL_BYTES = Ki; exports.MAX_COMMITED_EPK_BYTES = Wu; exports.MAX_EXTRA_FIELD_BYTES = qu; exports.MAX_ISS_VAL_BYTES = Lu; exports.MAX_JWT_HEADER_B64_BYTES = $u; exports.MAX_UID_KEY_BYTES = Vu; exports.MAX_UID_VAL_BYTES = Hu; exports.MimeType = _chunkHO5ESTN4js.C; exports.ModuleId = Gn; exports.MoveAbility = _chunkHO5ESTN4js.ha; exports.MoveFunctionVisibility = _chunkHO5ESTN4js.ga; exports.MoveJWK = Ni; exports.MoveOption = ne; exports.MoveString = v; exports.MoveVector = S; exports.MultiAgentRawTransaction = Lt; exports.MultiAgentTransaction = kr; exports.MultiEd25519Account = qn; exports.MultiEd25519PublicKey = ie; exports.MultiEd25519Signature = Be; exports.MultiKey = W; exports.MultiKeyAccount = yt; exports.MultiKeySignature = Ie; exports.MultiSig = Mn; exports.MultiSigTransactionPayload = Vn; exports.Network = Ei; exports.NetworkToChainId = _i; exports.NetworkToFaucetAPI = gs; exports.NetworkToIndexerAPI = ps; exports.NetworkToNetworkName = lg; exports.NetworkToNodeAPI = ls; exports.NetworkToPepperAPI = Si; exports.NetworkToProverAPI = Pi; exports.ParsingError = _chunkHO5ESTN4js.t; exports.PrivateKey = Pe; exports.PrivateKeyVariants = _chunkHO5ESTN4js.M; exports.ProcessorType = wt; exports.PublicKey = et; exports.RAW_TRANSACTION_SALT = As; exports.RAW_TRANSACTION_WITH_DATA_SALT = Ii; exports.RawTransaction = ve; exports.RawTransactionWithData = Rr; exports.RoleType = _chunkHO5ESTN4js.ia; exports.RotationProofChallenge = Ur; exports.Script = fn; exports.ScriptTransactionArgumentVariants = _chunkHO5ESTN4js.E; exports.Secp256k1PrivateKey = rt; exports.Secp256k1PublicKey = Fe; exports.Secp256k1Signature = it; exports.Secp256r1PrivateKey = Cs; exports.Secp256r1PublicKey = un; exports.Secp256r1Signature = Oi; exports.Serializable = _chunkHO5ESTN4js.x; exports.Serialized = Rn; exports.Serializer = _chunkHO5ESTN4js.y; exports.Signature = O; exports.SignedTransaction = lt; exports.SigningScheme = _chunkHO5ESTN4js.ja; exports.SigningSchemeInput = _chunkHO5ESTN4js.ka; exports.SimpleTransaction = zr; exports.SingleKeyAccount = pe; exports.StructTag = Xe; exports.TransactionAndProof = Dr; exports.TransactionAuthenticator = pt; exports.TransactionAuthenticatorEd25519 = $t; exports.TransactionAuthenticatorFeePayer = Qt; exports.TransactionAuthenticatorMultiAgent = Wt; exports.TransactionAuthenticatorMultiEd25519 = bn; exports.TransactionAuthenticatorSingleSender = It; exports.TransactionAuthenticatorVariant = _chunkHO5ESTN4js.K; exports.TransactionExecutable = An; exports.TransactionExecutableEmpty = Ln; exports.TransactionExecutableEntryFunction = hn; exports.TransactionExecutableScript = Hn; exports.TransactionExecutableVariants = _chunkHO5ESTN4js.H; exports.TransactionExtraConfig = Kr; exports.TransactionExtraConfigV1 = Ht; exports.TransactionExtraConfigVariants = _chunkHO5ESTN4js.I; exports.TransactionInnerPayload = Cr; exports.TransactionInnerPayloadV1 = Vt; exports.TransactionInnerPayloadVariants = _chunkHO5ESTN4js.G; exports.TransactionPayload = _t; exports.TransactionPayloadEntryFunction = yn; exports.TransactionPayloadMultiSig = mn; exports.TransactionPayloadScript = gn; exports.TransactionPayloadVariants = _chunkHO5ESTN4js.F; exports.TransactionResponseType = _chunkHO5ESTN4js.U; exports.TransactionVariants = _chunkHO5ESTN4js.J; exports.TransactionWorker = li; exports.TransactionWorkerEventsEnum = Hc; exports.TypeTag = U; exports.TypeTagAddress = G; exports.TypeTagBool = Q; exports.TypeTagGeneric = M; exports.TypeTagI128 = Bt; exports.TypeTagI16 = Dt; exports.TypeTagI256 = Gt; exports.TypeTagI32 = Ft; exports.TypeTagI64 = Ot; exports.TypeTagI8 = Nt; exports.TypeTagParserError = X; exports.TypeTagParserErrorType = hd; exports.TypeTagReference = vr; exports.TypeTagSigner = Mt; exports.TypeTagStruct = h; exports.TypeTagU128 = ct; exports.TypeTagU16 = st; exports.TypeTagU256 = ut; exports.TypeTagU32 = at; exports.TypeTagU64 = te; exports.TypeTagU8 = de; exports.TypeTagVariants = _chunkHO5ESTN4js.D; exports.TypeTagVector = z; exports.U128 = ke; exports.U16 = Ue; exports.U256 = Se; exports.U32 = ze; exports.U64 = $; exports.U8 = Z; exports.WebAuthnSignature = Bn; exports.ZeroKnowledgeSig = fe; exports.ZkProof = nn; exports.ZkpVariant = _chunkHO5ESTN4js.T; exports.anyPublicKeyVariantToString = _chunkHO5ESTN4js.O; exports.aptosCoinStructTag = KA; exports.aptosRequest = br; exports.base64UrlDecode = _chunkHO5ESTN4js.wa; exports.base64UrlToBytes = _chunkHO5ESTN4js.xa; exports.bigIntToBytesLE = wi; exports.buildTransaction = oo; exports.bytesToBigIntLE = Ct; exports.checkOrConvertArgument = Jt; exports.convertAmountFromHumanReadableToOnChain = _chunkHO5ESTN4js.ya; exports.convertAmountFromOnChainToHumanReadable = _chunkHO5ESTN4js.za; exports.convertArgument = io; exports.convertNumber = jr; exports.convertPayloadToInnerPayload = Cd; exports.createObjectAddress = _chunkHO5ESTN4js.oa; exports.createResourceAddress = _chunkHO5ESTN4js.pa; exports.createTokenAddress = _chunkHO5ESTN4js.ra; exports.createUserDerivedObjectAddress = _chunkHO5ESTN4js.qa; exports.deriveKey = bi; exports.deriveTransactionType = Nr; exports.deserializeFromScriptArgument = rd; exports.deserializePublicKey = Kf; exports.deserializeSignature = Rf; exports.ensureBoolean = _chunkHO5ESTN4js.z; exports.fetchEntryFunctionAbi = Ta; exports.fetchFunctionAbi = ro; exports.fetchJWK = Fi; exports.fetchModuleAbi = Sd; exports.fetchMoveFunctionAbi = IS; exports.fetchViewFunctionAbi = wa; exports.findFirstNonSignerArg = ba; exports.floorToWholeHour = _chunkHO5ESTN4js.va; exports.generateRawTransaction = vd; exports.generateSignedTransaction = so; exports.generateSignedTransactionForSimulation = Pa; exports.generateSigningMessage = Qe; exports.generateSigningMessageForSerializable = Lh; exports.generateSigningMessageForTransaction = Me; exports.generateTransactionPayload = ei; exports.generateTransactionPayloadWithABI = _d; exports.generateUserTransactionHash = ZS; exports.generateViewFunctionPayload = Sa; exports.generateViewFunctionPayloadWithABI = Id; exports.get = Tr; exports.getAptosFullNode = H; exports.getAptosPepperService = Bg; exports.getAuthenticatorForSimulation = En; exports.getErrorMessage = _chunkHO5ESTN4js.ta; exports.getFunctionParts = _chunkHO5ESTN4js.Ca; exports.getIssAudAndUidVal = nt; exports.getKeylessConfig = rn; exports.getKeylessJWKs = Xu; exports.getPageWithObfuscatedCursor = Sr; exports.hashStrToField = qe; exports.hashValues = Ea; exports.hexToAsciiString = _chunkHO5ESTN4js.w; exports.isBcsAddress = Xr; exports.isBcsBool = Qi; exports.isBcsFixedBytes = Td; exports.isBcsString = ji; exports.isBcsU128 = eo; exports.isBcsU16 = Xi; exports.isBcsU256 = to; exports.isBcsU32 = Yi; exports.isBcsU64 = Zi; exports.isBcsU8 = Ji; exports.isBlockEpilogueTransactionResponse = _chunkHO5ESTN4js.$; exports.isBlockMetadataTransactionResponse = _chunkHO5ESTN4js.Y; exports.isBool = ma; exports.isCanonicalEd25519Signature = nd; exports.isEd25519Signature = _chunkHO5ESTN4js.aa; exports.isEmptyOption = fa; exports.isEncodedEntryFunctionArgument = Aa; exports.isEncodedStruct = _chunkHO5ESTN4js.Ba; exports.isFeePayerSignature = _chunkHO5ESTN4js.da; exports.isGenesisTransactionResponse = _chunkHO5ESTN4js.X; exports.isKeylessSigner = Fr; exports.isLargeNumber = Jr; exports.isMultiAgentSignature = _chunkHO5ESTN4js.ca; exports.isMultiEd25519Signature = _chunkHO5ESTN4js.ea; exports.isNumber = bd; exports.isPendingTransactionResponse = _chunkHO5ESTN4js.V; exports.isScriptDataInput = ha; exports.isSecp256k1Signature = _chunkHO5ESTN4js.ba; exports.isSingleKeySigner = Mi; exports.isSingleSenderSignature = _chunkHO5ESTN4js.fa; exports.isStateCheckpointTransactionResponse = _chunkHO5ESTN4js.Z; exports.isString = mt; exports.isUserTransactionResponse = _chunkHO5ESTN4js.W; exports.isValidBIP44Path = is; exports.isValidFunctionInfo = _chunkHO5ESTN4js.Da; exports.isValidHardenedPath = os; exports.isValidatorTransactionResponse = _chunkHO5ESTN4js._; exports.mnemonicToSeed = mr; exports.normalizeBundle = Ts; exports.nowInSeconds = _chunkHO5ESTN4js.ua; exports.objectStructTag = Te; exports.optionStructTag = RA; exports.outOfRangeErrorMessage = _chunkHO5ESTN4js.A; exports.padAndPackBytesWithLen = kn; exports.paginateWithCursor = wr; exports.paginateWithObfuscatedCursor = vi; exports.pairedFaMetadataAddress = _chunkHO5ESTN4js.Fa; exports.parseEncodedStruct = _chunkHO5ESTN4js.Aa; exports.parseJwtHeader = Zu; exports.parseTypeTag = He; exports.poseidonHash = Kt; exports.post = Nn; exports.postAptosFaucet = Ps; exports.postAptosFullNode = St; exports.postAptosIndexer = Ss; exports.postAptosPepperService = Es; exports.postAptosProvingService = _s; exports.promiseFulfilledStatus = Vc; exports.request = Fu; exports.sleep = _chunkHO5ESTN4js.sa; exports.splitPath = as; exports.standardizeTypeTags = Yr; exports.stringStructTag = x; exports.throwTypeMismatch = N; exports.truncateAddress = _chunkHO5ESTN4js.Ea; exports.validateNumberInRange = _chunkHO5ESTN4js.B; exports.verifyKeylessSignature = Di; exports.verifyKeylessSignatureWithJwkAndConfig = Pr;
|
|
481
|
+
`;async function Mr(n){let{aptosConfig:e}=n,{data:t}=await H({aptosConfig:e,originMethod:"getLedgerInfo",path:""});return t}async function ra(n){let{aptosConfig:e,limit:t}=n;return(await w({aptosConfig:e,query:{query:Ws,variables:{limit:t}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function w(n){let{aptosConfig:e,query:t,originMethod:r}=n,{data:i}=await Ss({aptosConfig:e,originMethod:_nullishCoalesce(r, () => ("queryIndexer")),path:"",body:t,overrides:{WITH_CREDENTIALS:!1}});return i}async function ld(n){let{aptosConfig:e}=n;return(await w({aptosConfig:e,query:{query:Li},originMethod:"getProcessorStatuses"})).processor_status}async function Vr(n){let e=await ld({aptosConfig:n.aptosConfig});return BigInt(e[0].last_success_version)}async function Hr(n){let{aptosConfig:e,processorType:t}=n;return(await w({aptosConfig:e,query:{query:Li,variables:{where_condition:{processor:{_eq:t}}}},originMethod:"getProcessorStatus"})).processor_status[0]}async function Lr(n){let{aptosConfig:e,accountAddress:t}=n,{data:r}=await H({aptosConfig:e,originMethod:"getInfo",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}`});return r}async function oa(n){return _optionalChain([n, 'access', _64 => _64.options, 'optionalAccess', _65 => _65.ledgerVersion])!==void 0?ia(n):$e(async()=>ia(n),`module-${n.accountAddress}-${n.moduleName}`,1e3*60*5)()}async function ia(n){let{aptosConfig:e,accountAddress:t,moduleName:r,options:i}=n,{data:o}=await H({aptosConfig:e,originMethod:"getModule",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/module/${r}`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _66 => _66.ledgerVersion])}});return o}async function qr(n){let{aptosConfig:e,handle:t,data:r,options:i}=n;return(await St({aptosConfig:e,originMethod:"getTableItem",path:`tables/${t}/item`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _67 => _67.ledgerVersion])},body:r})).data}async function sa(n){let{aptosConfig:e,options:t}=n,r={query:Zs,variables:{where_condition:_optionalChain([t, 'optionalAccess', _68 => _68.where]),offset:_optionalChain([t, 'optionalAccess', _69 => _69.offset]),limit:_optionalChain([t, 'optionalAccess', _70 => _70.limit]),order_by:_optionalChain([t, 'optionalAccess', _71 => _71.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getTableItemsData"})).table_items}async function aa(n){let{aptosConfig:e,options:t}=n,r={query:ea,variables:{where_condition:_optionalChain([t, 'optionalAccess', _72 => _72.where]),offset:_optionalChain([t, 'optionalAccess', _73 => _73.offset]),limit:_optionalChain([t, 'optionalAccess', _74 => _74.limit]),order_by:_optionalChain([t, 'optionalAccess', _75 => _75.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getTableItemsMetadata"})).table_metadatas}async function Wi(n){let{aptosConfig:e,options:t}=n;return wr({aptosConfig:e,originMethod:"getTransactions",path:"transactions",params:{start:_optionalChain([t, 'optionalAccess', _76 => _76.offset]),limit:_optionalChain([t, 'optionalAccess', _77 => _77.limit])}})}async function Wr(n){let{aptosConfig:e}=n;return $e(async()=>{let{data:t}=await H({aptosConfig:e,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${e.network}`,1e3*60*5)()}async function ca(n){let{aptosConfig:e,ledgerVersion:t}=n,{data:r}=await H({aptosConfig:e,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return r}async function Wn(n){let{aptosConfig:e,transactionHash:t}=n,{data:r}=await H({aptosConfig:e,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return r}async function ua(n){let{aptosConfig:e,transactionHash:t}=n;try{return(await Wn({aptosConfig:e,transactionHash:t})).type==="pending_transaction"}catch(r){if(_optionalChain([r, 'optionalAccess', _78 => _78.status])===404)return!0;throw r}}async function gd(n){let{aptosConfig:e,transactionHash:t}=n,{data:r}=await H({aptosConfig:e,path:`transactions/wait_by_hash/${t}`,originMethod:"longWaitForTransaction"});return r}async function Pn(n){let{aptosConfig:e,transactionHash:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _79 => _79.timeoutSecs]), () => (20)),o=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _80 => _80.checkSuccess]), () => (!0)),s=!0,a=0,c,d,m=200,A=1.5;function p(g){if(!(g instanceof Ee)||(d=g,g.status!==404&&g.status>=400&&g.status<500))throw g}try{c=await Wn({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction"}catch(g){p(g)}if(s){let g=Date.now();try{c=await gd({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction"}catch(b){p(b)}a=(Date.now()-g)/1e3}for(;s&&!(a>=i);){try{if(c=await Wn({aptosConfig:e,transactionHash:t}),s=c.type==="pending_transaction",!s)break}catch(g){p(g)}await _chunkHO5ESTN4js.sa.call(void 0, m),a+=m/1e3,m*=A}if(c===void 0)throw d||new $r(`Fetching transaction ${t} failed and timed out after ${i} seconds`,c);if(c.type==="pending_transaction")throw new $r(`Transaction ${t} timed out in pending state after ${i} seconds`,c);if(!o)return c;if(!c.success)throw new $i(`Transaction ${t} failed with an error: ${c.vm_status}`,c);return c}async function Qr(n){let{aptosConfig:e,processorType:t}=n,r=BigInt(n.minimumLedgerVersion),i=3e3,o=new Date().getTime(),s=BigInt(-1);for(;s<r;){if(new Date().getTime()-o>i)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?s=await Vr({aptosConfig:e}):s=(await Hr({aptosConfig:e,processorType:t})).last_success_version,s>=r)break;await _chunkHO5ESTN4js.sa.call(void 0, 200)}}var $r=class extends Error{constructor(e,t){super(e),this.lastSubmittedTransaction=t}},$i=class extends Error{constructor(e,t){super(e),this.transaction=t}};async function da(n){let{aptosConfig:e,ledgerVersion:t,options:r}=n,{data:i}=await H({aptosConfig:e,originMethod:"getBlockByVersion",path:`blocks/by_version/${t}`,params:{with_transactions:_optionalChain([r, 'optionalAccess', _81 => _81.withTransactions])}});return la({block:i,...n})}async function pa(n){let{aptosConfig:e,blockHeight:t,options:r}=n,{data:i}=await H({aptosConfig:e,originMethod:"getBlockByHeight",path:`blocks/by_height/${t}`,params:{with_transactions:_optionalChain([r, 'optionalAccess', _82 => _82.withTransactions])}});return la({block:i,...n})}async function la(n){let{aptosConfig:e,block:t,options:r}=n;if(_optionalChain([r, 'optionalAccess', _83 => _83.withTransactions])){t.transactions=_nullishCoalesce(t.transactions, () => ([]));let i=t.transactions[t.transactions.length-1],o=BigInt(t.first_version),s=BigInt(t.last_version),a=_optionalChain([i, 'optionalAccess', _84 => _84.version]),c;if(a===void 0?c=o-1n:c=BigInt(a),c===s)return t;let d=[],m=100n;for(let p=c+1n;p<s;p+=BigInt(100))d.push(Wi({aptosConfig:e,options:{offset:p,limit:Math.min(Number(m),Number(s-p+1n))}}));let A=await Promise.all(d);for(let p of A)t.transactions.push(...p)}return t}function ga(n){return!!n.match(/^[_a-zA-Z0-9]+$/)}function ya(n){return!!n.match(/\s/)}function yd(n){return!!n.match(/^T[0-9]+$/)}function md(n){return!!n.match(/^&.+$/)}function fd(n){switch(n){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":case"i8":case"i16":case"i32":case"i64":case"i128":case"i256":return!0;default:return!1}}function Ad(n,e){let t=e;for(;t<n.length;t+=1){let r=n[t];if(!ya(r))break}return t}var hd=(b=>(b.InvalidTypeTag="unknown type",b.UnexpectedGenericType="unexpected generic type",b.UnexpectedTypeArgumentClose="unexpected '>'",b.UnexpectedWhitespaceCharacter="unexpected whitespace character",b.UnexpectedComma="unexpected ','",b.TypeArgumentCountMismatch="type argument count doesn't match expected amount",b.MissingTypeArgumentClose="no matching '>' for '<'",b.MissingTypeArgument="no type argument before ','",b.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",b.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",b.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",b.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",b.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",b.InvalidAddress="struct address must be valid",b))(hd||{}),X= exports.TypeTagParserError =class extends Error{constructor(e,t){super(`Failed to parse typeTag '${e}', ${t}`)}};function He(n,e){let t=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _85 => _85.allowGenerics]), () => (!1)),r=[],i=[],o=[],s=0,a="",c=1;for(;s<n.length;){let d=n[s];if(d==="<")r.push({savedExpectedTypes:c,savedStr:a,savedTypes:o}),a="",o=[],c=1;else if(d===">"){if(a!==""){let b=Qn(a,i,t);o.push(b)}let m=r.pop();if(m===void 0)throw new X(n,"unexpected '>'");if(c!==o.length)throw new X(n,"type argument count doesn't match expected amount");let{savedStr:A,savedTypes:p,savedExpectedTypes:g}=m;i=o,o=p,a=A,c=g}else if(d===","){if(r.length===0)throw new X(n,"unexpected ','");if(a.length===0)throw new X(n,"no type argument before ','");let m=Qn(a,i,t);i=[],o.push(m),a="",c+=1}else if(ya(d)){let m=!1;if(a.length!==0){let p=Qn(a,i,t);i=[],o.push(p),a="",m=!0}s=Ad(n,s);let A=n[s];if(s<n.length&&m&&A!==","&&A!==">")throw new X(n,"unexpected whitespace character");continue}else a+=d;s+=1}if(r.length>0)throw new X(n,"no matching '>' for '<'");switch(o.length){case 0:return Qn(a,i,t);case 1:if(a==="")return o[0];throw new X(n,"unexpected ','");default:throw new X(n,"unexpected whitespace character")}}function Qn(n,e,t){let r=n.trim(),i=r.toLowerCase();if(fd(i)&&e.length>0)throw new X(n,"primitive types not expected to have type arguments");switch(r.toLowerCase()){case"signer":return new Mt;case"bool":return new Q;case"address":return new G;case"u8":return new de;case"u16":return new st;case"u32":return new at;case"u64":return new te;case"u128":return new ct;case"u256":return new ut;case"i8":return new Nt;case"i16":return new Dt;case"i32":return new Ft;case"i64":return new Ot;case"i128":return new Bt;case"i256":return new Gt;case"vector":if(e.length!==1)throw new X(n,"vector type expected to have exactly one type argument");return new z(e[0]);default:if(md(r)){let a=r.substring(1);return new vr(Qn(a,e,t))}if(yd(r)){if(t)return new M(Number(r.split("T")[1]));throw new X(n,"unexpected generic type")}if(!r.match(/:/))throw new X(n,"unknown type");let o=r.split("::");if(o.length!==3)throw new X(n,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let s;try{s=_chunkHO5ESTN4js.na.fromString(o[0])}catch (e4){throw new X(n,"struct address must be valid")}if(!ga(o[1]))throw new X(n,"module name must only contain alphanumeric or '_' characters");if(!ga(o[2]))throw new X(n,"struct name must only contain alphanumeric or '_' characters");return new h(new Xe(s,new k(o[1]),new k(o[2]),e))}}function ma(n){return typeof n=="boolean"}function mt(n){return typeof n=="string"}function bd(n){return typeof n=="number"}function jr(n){if(bd(n))return n;if(mt(n)&&n!=="")return Number.parseInt(n,10)}function Jr(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function fa(n){return n==null}function Aa(n){return Qi(n)||Ji(n)||Xi(n)||Yi(n)||Zi(n)||eo(n)||to(n)||Xr(n)||ji(n)||Td(n)||n instanceof S||n instanceof ne}function Qi(n){return n instanceof F}function Xr(n){return n instanceof _chunkHO5ESTN4js.na}function ji(n){return n instanceof v}function Td(n){return n instanceof Re}function Ji(n){return n instanceof Z}function Xi(n){return n instanceof Ue}function Yi(n){return n instanceof ze}function Zi(n){return n instanceof $}function eo(n){return n instanceof ke}function to(n){return n instanceof Se}function ha(n){return"bytecode"in n}function N(n,e){throw new Error(`Type mismatch for argument ${e}, expected '${n}'`)}function ba(n){let e=n.params.findIndex(t=>t!=="signer"&&t!=="&signer");return e<0?n.params.length:e}var wd=new TextEncoder;function Yr(n){return _nullishCoalesce(_optionalChain([n, 'optionalAccess', _86 => _86.map, 'call', _87 => _87(e=>mt(e)?He(e):e)]), () => ([]))}async function Sd(n,e,t){return(await Zr({aptosConfig:t,accountAddress:n,moduleName:e})).abi}async function ro(n,e,t,r){let i=await Sd(n,e,r);if(!i)throw new Error(`Could not find module ABI for '${n}::${e}'`);return i.exposed_functions.find(o=>o.name===t)}async function IS(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find function ABI for '${n}::${e}::${t}'`);let o=[];for(let s=0;s<i.params.length;s+=1)o.push(He(i.params[s],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o}}async function Ta(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find entry function ABI for '${n}::${e}::${t}'`);if(!i.is_entry)throw new Error(`'${n}::${e}::${t}' is not an entry function`);let o=ba(i),s=[];for(let a=o;a<i.params.length;a+=1)s.push(He(i.params[a],{allowGenerics:!0}));return{signers:o,typeParameters:i.generic_type_params,parameters:s}}async function wa(n,e,t,r){let i=await ro(n,e,t,r);if(!i)throw new Error(`Could not find view function ABI for '${n}::${e}::${t}'`);if(!i.is_view)throw new Error(`'${n}::${e}::${t}' is not an view function`);let o=[];for(let a=0;a<i.params.length;a+=1)o.push(He(i.params[a],{allowGenerics:!0}));let s=[];for(let a=0;a<i.return.length;a+=1)s.push(He(i.return[a],{allowGenerics:!0}));return{typeParameters:i.generic_type_params,parameters:o,returnTypes:s}}function io(n,e,t,r,i,o){let s;if("exposed_functions"in e){let a=e.exposed_functions.find(c=>c.name===n);if(!a)throw new Error(`Could not find function ABI for '${e.address}::${e.name}::${n}'`);if(r>=a.params.length)throw new Error(`Too many arguments for '${n}', expected ${a.params.length}`);s=He(a.params[r],{allowGenerics:!0})}else{if(r>=e.parameters.length)throw new Error(`Too many arguments for '${n}', expected ${e.parameters.length}`);s=e.parameters[r]}return Jt(t,s,r,i,"exposed_functions"in e?e:void 0,o)}function Jt(n,e,t,r,i,o){return Aa(n)?(no(e,n,t),n):Pd(n,e,t,r,i,o)}function Pd(n,e,t,r,i,o){if(e.isBool()){if(ma(n))return new F(n);if(mt(n)){if(n==="true")return new F(!0);if(n==="false")return new F(!1)}N("boolean",t)}if(e.isAddress()){if(mt(n))return _chunkHO5ESTN4js.na.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new (0, _chunkHO5ESTN4js.na)(n.data);N("string | AccountAddress",t)}if(e.isU8()){let s=jr(n);if(s!==void 0)return new Z(s);N("number | string",t)}if(e.isU16()){let s=jr(n);if(s!==void 0)return new Ue(s);N("number | string",t)}if(e.isU32()){let s=jr(n);if(s!==void 0)return new ze(s);N("number | string",t)}if(e.isU64()){if(Jr(n))return new $(BigInt(n));N("bigint | number | string",t)}if(e.isU128()){if(Jr(n))return new ke(BigInt(n));N("bigint | number | string",t)}if(e.isU256()){if(Jr(n))return new Se(BigInt(n));N("bigint | number | string",t)}if(e.isGeneric()){let s=e.value;if(s<0||s>=r.length)throw new Error(`Generic argument ${e.toString()} is invalid for argument ${t}`);return Jt(n,r[s],t,r,i)}if(e.isVector()){if(e.value.isU8()){if(mt(n))return S.U8(wd.encode(n));if(n instanceof Uint8Array)return S.U8(n);if(n instanceof ArrayBuffer)return S.U8(new Uint8Array(n))}if(mt(n)&&n.startsWith("["))return Jt(JSON.parse(n),e,t,r);if(Array.isArray(n))return new S(n.map(s=>Jt(s,e.value,t,r,i)));throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}if(e.isStruct()){if(e.isString()){if(mt(n))return new v(n);N("string",t)}if(e.isObject()){if(mt(n))return _chunkHO5ESTN4js.na.fromString(n);if(n&&typeof n=="object"&&"data"in n&&n.data instanceof Uint8Array)return new (0, _chunkHO5ESTN4js.na)(n.data);N("string | AccountAddress",t)}if(e.isDelegationKey()||e.isRateLimiter()){if(n instanceof Uint8Array)return new Re(n);N("Uint8Array",t)}if(e.isOption()){if(fa(n)){let a=e.value.typeArgs[0];return a instanceof Q?new ne(null):a instanceof G?new ne(null):a instanceof de?new ne(null):a instanceof st?new ne(null):a instanceof at?new ne(null):a instanceof te?new ne(null):a instanceof ct?new ne(null):a instanceof ut?new ne(null):new ne(null)}return new ne(Jt(n,e.value.typeArgs[0],t,r,i))}if(_optionalChain([i, 'optionalAccess', _88 => _88.structs, 'access', _89 => _89.find, 'call', _90 => _90(a=>a.name===e.value.name.identifier), 'optionalAccess', _91 => _91.fields, 'access', _92 => _92.length])===0&&n instanceof Uint8Array)return new Re(n);if(n instanceof Uint8Array&&_optionalChain([o, 'optionalAccess', _93 => _93.allowUnknownStructs]))return console.warn(`Unsupported struct input type for argument ${t}. Continuing since 'allowUnknownStructs' is enabled.`),new Re(n);throw new Error(`Unsupported struct input type for argument ${t}, type '${e.toString()}'`)}throw new Error(`Type mismatch for argument ${t}, type '${e.toString()}'`)}function no(n,e,t){if(n.isBool()){if(Qi(e))return;N("Bool",t)}if(n.isAddress()){if(Xr(e))return;N("AccountAddress",t)}if(n.isU8()){if(Ji(e))return;N("U8",t)}if(n.isU16()){if(Xi(e))return;N("U16",t)}if(n.isU32()){if(Yi(e))return;N("U32",t)}if(n.isU64()){if(Zi(e))return;N("U64",t)}if(n.isU128()){if(eo(e))return;N("U128",t)}if(n.isU256()){if(to(e))return;N("U256",t)}if(n.isVector()){if(e instanceof S){e.values.length>0&&no(n.value,e.values[0],t);return}N("MoveVector",t)}if(n instanceof h){if(n.isString()){if(ji(e))return;N("MoveString",t)}if(n.isObject()){if(Xr(e))return;N("AccountAddress",t)}if(n.isOption()){if(e instanceof ne){e.value!==void 0&&no(n.value.typeArgs[0],e.value,t);return}N("MoveOption",t)}}throw new Error(`Type mismatch for argument ${t}, expected '${n.toString()}'`)}async function ei(n){if(ha(n))return xd(n);let{moduleAddress:e,moduleName:t,functionName:r}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),i=await _a({key:"entry-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:Ta});return _d({...n,abi:i})}function _d(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),o=Yr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=n.functionArguments.map((c,d)=>io(n.function,e,c,d,o));if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);let a=dt.build(`${t}::${r}`,i,o,s);if("multisigAddress"in n){let c=_chunkHO5ESTN4js.na.from(n.multisigAddress);return new mn(new Mn(c,new Vn(a)))}return new yn(a)}async function Sa(n){let{moduleAddress:e,moduleName:t,functionName:r}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),i=await _a({key:"view-function",moduleAddress:e,moduleName:t,functionName:r,aptosConfig:n.aptosConfig,abi:n.abi,fetch:wa});return Id({abi:i,...n})}function Id(n){let e=n.abi,{moduleAddress:t,moduleName:r,functionName:i}=_chunkHO5ESTN4js.Ca.call(void 0, n.function),o=Yr(n.typeArguments);if(o.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${o.length}`);let s=_nullishCoalesce(_optionalChain([n, 'optionalAccess', _94 => _94.functionArguments, 'optionalAccess', _95 => _95.map, 'call', _96 => _96((a,c)=>io(n.function,e,a,c,o))]), () => ([]));if(s.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${r}::${i}', expected ${e.parameters.length} but got ${s.length}`);return dt.build(`${t}::${r}`,i,o,s)}function xd(n){return new gn(new fn(_chunkHO5ESTN4js.v.fromHexInput(n.bytecode).toUint8Array(),Yr(n.typeArguments),n.functionArguments))}async function vd(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n;if(_optionalChain([i, 'optionalAccess', _97 => _97.replayProtectionNonce])!==void 0&&_optionalChain([i, 'optionalAccess', _98 => _98.accountSequenceNumber])!==void 0)throw new Error("Cannot specify both replayProtectionNonce and accountSequenceNumber in options.");let s=async()=>_i[e.network]?{chainId:_i[e.network]}:{chainId:(await Mr({aptosConfig:e})).chain_id},a=async()=>_optionalChain([i, 'optionalAccess', _99 => _99.gasUnitPrice])?{gasEstimate:i.gasUnitPrice}:{gasEstimate:(await Wr({aptosConfig:e})).gas_estimate},c=async()=>{let se=async()=>_optionalChain([i, 'optionalAccess', _100 => _100.accountSequenceNumber])!==void 0?i.accountSequenceNumber:_optionalChain([i, 'optionalAccess', _101 => _101.replayProtectionNonce])!==void 0?0xdeadbeefn:(await Lr({aptosConfig:e,accountAddress:t})).sequence_number;if(o&&_chunkHO5ESTN4js.na.from(o).equals(_chunkHO5ESTN4js.na.ZERO))try{return await se()}catch (e5){return 0}else return se()},[{chainId:d},{gasEstimate:m},A]=await Promise.all([s(),a(),c()]),{maxGasAmount:p,gasUnitPrice:g,expireTimestamp:b,replayProtectionNonce:D}={maxGasAmount:_optionalChain([i, 'optionalAccess', _102 => _102.maxGasAmount])?BigInt(i.maxGasAmount):BigInt(e.getDefaultMaxGasAmount()),gasUnitPrice:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _103 => _103.gasUnitPrice]), () => (BigInt(m))),expireTimestamp:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _104 => _104.expireTimestamp]), () => (BigInt(Math.floor(Date.now()/1e3)+e.getDefaultTxnExpirySecFromNow()))),replayProtectionNonce:_optionalChain([i, 'optionalAccess', _105 => _105.replayProtectionNonce])?BigInt(i.replayProtectionNonce):void 0},q=r;return D!==void 0&&(q=Cd(r,D)),new ve(_chunkHO5ESTN4js.na.from(t),BigInt(A),q,BigInt(p),BigInt(g),BigInt(b),new ln(d))}function Cd(n,e){if(n instanceof gn)return new Vt(new Hn(n.script),new Ht(void 0,e));if(n instanceof yn)return new Vt(new hn(n.entryFunction),new Ht(void 0,e));if(n instanceof mn){let t=n.multiSig.transaction_payload,r;if(t===void 0||_optionalChain([t, 'optionalAccess', _106 => _106.transaction_payload])===void 0)r=new Ln;else if(t.transaction_payload instanceof dt)r=new hn(t.transaction_payload);else throw new Error("Scripts are not supported in multi-sig transactions.");return new Vt(r,new Ht(n.multiSig.multisig_address,e))}else throw new Error(`Unsupported payload type: ${n}`)}async function oo(n){let{aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o}=n,s=await vd({aptosConfig:e,sender:t,payload:r,options:i,feePayerAddress:o});if("secondarySignerAddresses"in n){let a=_nullishCoalesce(_optionalChain([n, 'access', _107 => _107.secondarySignerAddresses, 'optionalAccess', _108 => _108.map, 'call', _109 => _109(c=>_chunkHO5ESTN4js.na.from(c))]), () => ([]));return new kr(s,a,n.feePayerAddress?_chunkHO5ESTN4js.na.from(n.feePayerAddress):void 0)}return new zr(s,n.feePayerAddress?_chunkHO5ESTN4js.na.from(n.feePayerAddress):void 0)}function Pa(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:r,feePayerPublicKey:i}=n,o=En(e);if(t.feePayerAddress){let a=new qt(t.rawTransaction,_nullishCoalesce(t.secondarySignerAddresses, () => ([])),t.feePayerAddress),c=[];t.secondarySignerAddresses&&(r?c=r.map(A=>En(A)):c=Array.from({length:t.secondarySignerAddresses.length},()=>En(void 0)));let d=En(i),m=new Qt(o,_nullishCoalesce(t.secondarySignerAddresses, () => ([])),c,{address:t.feePayerAddress,authenticator:d});return new lt(a.raw_txn,m).bcsToBytes()}if(t.secondarySignerAddresses){let a=new Lt(t.rawTransaction,t.secondarySignerAddresses),c=[];r?c=r.map(m=>En(m)):c=Array.from({length:t.secondarySignerAddresses.length},()=>En(void 0));let d=new Wt(o,t.secondarySignerAddresses,c);return new lt(a.raw_txn,d).bcsToBytes()}let s;if(o instanceof Ge)s=new $t(o.public_key,o.signature);else if(o instanceof ue||o instanceof Je)s=new It(o);else if(o instanceof pn)s=new It(o);else throw new Error("Invalid public key");return new lt(t.rawTransaction,s).bcsToBytes()}function En(n){if(!n)return new pn;let t=K.isInstance(n)||L.isInstance(n)||Fe.isInstance(n)?new I(n):n,r=new R(new Uint8Array(64));if(E.isInstance(t))return new Ge(t,r);if(I.isInstance(t))return K.isInstance(t.publicKey)?new ue(t,new B(ce.getSimulationSignature())):new ue(t,new B(r));if(W.isInstance(t))return new Je(t,new Ie({signatures:t.publicKeys.map(i=>K.isInstance(i.publicKey)||L.isInstance(i.publicKey)?new B(ce.getSimulationSignature()):new B(r)),bitmap:t.createBitmap({bits:Array(t.publicKeys.length).fill(0).map((i,o)=>o)})}));throw new Error("Unsupported PublicKey used for simulations")}function so(n){let{transaction:e,feePayerAuthenticator:t,additionalSignersAuthenticators:r}=n,i=Ts(ee,n.senderAuthenticator),o;if(e.feePayerAddress){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");o=new Qt(i,_nullishCoalesce(e.secondarySignerAddresses, () => ([])),_nullishCoalesce(r, () => ([])),{address:e.feePayerAddress,authenticator:t})}else if(e.secondarySignerAddresses){if(!r)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");o=new Wt(i,e.secondarySignerAddresses,r)}else i instanceof Ge?o=new $t(i.public_key,i.signature):i instanceof ot?o=new bn(i.public_key,i.signature):o=new It(i);return new lt(e.rawTransaction,o).bcsToBytes()}function Ea(n){let e=_sha3.sha3_256.create();for(let t of n)e.update(t);return e.digest()}var Kd=Ea(["APTOS::Transaction"]);function ZS(n){let e=so(n);return new (0, _chunkHO5ESTN4js.v)(Ea([Kd,new Uint8Array([0]),e])).toString()}async function _a({key:n,moduleAddress:e,moduleName:t,functionName:r,aptosConfig:i,abi:o,fetch:s}){return o!==void 0?o:$e(async()=>s(e,t,r,i),`${n}-${i.network}-${e}-${t}-${r}`,1e3*60*5)()}async function T(n){let e=await Rd(n);return Ud(n,e)}async function Rd(n){let{aptosConfig:e,data:t}=n,r,i;return"bytecode"in t?i=await ei(t):"multisigAddress"in t?(r={aptosConfig:e,multisigAddress:t.multisigAddress,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await ei(r)):(r={aptosConfig:e,function:t.function,functionArguments:t.functionArguments,typeArguments:t.typeArguments,abi:t.abi},i=await ei(r)),i}async function Ud(n,e){let{aptosConfig:t,sender:r,options:i}=n,o;if(zd(n)&&(o=_chunkHO5ESTN4js.na.ZERO.toString()),kd(n)){let{secondarySignerAddresses:s}=n;return oo({aptosConfig:t,sender:r,payload:e,options:i,secondarySignerAddresses:s,feePayerAddress:o})}return oo({aptosConfig:t,sender:r,payload:e,options:i,feePayerAddress:o})}function zd(n){return n.withFeePayer===!0}function kd(n){return"secondarySignerAddresses"in n}function Ia(n){let{transaction:e}=n;return Me(e)}function ti(n){let{signer:e,transaction:t}=n;return e.signTransactionWithAuthenticator(t)}function ni(n){let{signer:e,transaction:t}=n;if(!t.feePayerAddress)throw new Error(`Transaction ${t} is not a Fee Payer transaction`);return t.feePayerAddress=e.accountAddress,ti({signer:e,transaction:t})}async function ao(n){let{aptosConfig:e,transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}=n,a=Pa({transaction:t,signerPublicKey:r,secondarySignersPublicKeys:i,feePayerPublicKey:o,options:s}),{data:c}=await St({aptosConfig:e,body:a,path:"transactions/simulate",params:{estimate_gas_unit_price:_nullishCoalesce(_optionalChain([n, 'access', _110 => _110.options, 'optionalAccess', _111 => _111.estimateGasUnitPrice]), () => (!1)),estimate_max_gas_amount:_nullishCoalesce(_optionalChain([n, 'access', _112 => _112.options, 'optionalAccess', _113 => _113.estimateMaxGasAmount]), () => (!1)),estimate_prioritized_gas_unit_price:_nullishCoalesce(_optionalChain([n, 'access', _114 => _114.options, 'optionalAccess', _115 => _115.estimatePrioritizedGasUnitPrice]), () => (!1))},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return c}async function jn(n){let{aptosConfig:e,transactionSubmitter:t}=n,r=t===void 0?e.getTransactionSubmitter():t;if(r)return r.submitTransaction(n);let i=so({...n});try{let{data:o}=await St({aptosConfig:e,body:i,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return o}catch(o){let s=lt.deserialize(new C(i));throw s.authenticator.isSingleSender()&&s.authenticator.sender.isSingleKey()&&(s.authenticator.sender.public_key.publicKey instanceof K||s.authenticator.sender.public_key.publicKey instanceof L)&&await we.fetchJWK({aptosConfig:e,publicKey:s.authenticator.sender.public_key.publicKey,kid:s.authenticator.sender.signature.signature.getJwkKid()}),o}}async function ri(n){let{aptosConfig:e,signer:t,feePayer:r,transaction:i,...o}=n;Fr(t)&&await t.checkKeylessAccountValidity(e),Fr(r)&&await r.checkKeylessAccountValidity(e);let s=n.feePayerAuthenticator||r&&ni({signer:r,transaction:i}),a=ti({signer:t,transaction:i});return jn({aptosConfig:e,transaction:i,senderAuthenticator:a,feePayerAuthenticator:s,...o})}async function xa(n){let{aptosConfig:e,senderAuthenticator:t,feePayer:r,transaction:i,...o}=n;Fr(r)&&await r.checkKeylessAccountValidity(e);let s=ni({signer:r,transaction:i});return jn({aptosConfig:e,transaction:i,senderAuthenticator:t,feePayerAuthenticator:s,...o})}var Nd={typeParameters:[],parameters:[z.u8(),new z(z.u8())]};async function va(n){let{aptosConfig:e,account:t,metadataBytes:r,moduleBytecode:i,options:o}=n,s=i.map(a=>S.U8(a));return T({aptosConfig:e,sender:_chunkHO5ESTN4js.na.from(t),data:{function:"0x1::code::publish_package_txn",functionArguments:[S.U8(r),new S(s)],abi:Nd},options:o})}async function _n(n){return Lr(n)}async function Ca(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return vi({aptosConfig:e,originMethod:"getModules",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/modules`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _116 => _116.ledgerVersion]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _117 => _117.limit]), () => (1e3))}})}async function Ka(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await Sr({aptosConfig:e,originMethod:"getModulesPage",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/modules`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _118 => _118.ledgerVersion]),cursor:_optionalChain([r, 'optionalAccess', _119 => _119.cursor]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _120 => _120.limit]), () => (100))}});return{modules:i.data,cursor:o}}async function Zr(n){return oa(n)}async function uo(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return wr({aptosConfig:e,originMethod:"getTransactions",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/transactions`,params:{start:_optionalChain([r, 'optionalAccess', _121 => _121.offset]),limit:_optionalChain([r, 'optionalAccess', _122 => _122.limit])}})}async function po(n){let{aptosConfig:e,accountAddress:t,options:r}=n;return vi({aptosConfig:e,originMethod:"getResources",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resources`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _123 => _123.ledgerVersion]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _124 => _124.limit]), () => (999))}})}async function Ra(n){let{aptosConfig:e,accountAddress:t,options:r}=n,{response:i,cursor:o}=await Sr({aptosConfig:e,originMethod:"getResourcesPage",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resources`,params:{ledger_version:_optionalChain([r, 'optionalAccess', _125 => _125.ledgerVersion]),cursor:_optionalChain([r, 'optionalAccess', _126 => _126.cursor]),limit:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _127 => _127.limit]), () => (100))}});return{resources:i.data,cursor:o}}async function lo(n){let{aptosConfig:e,accountAddress:t,resourceType:r,options:i}=n,{data:o}=await H({aptosConfig:e,originMethod:"getResource",path:`accounts/${_chunkHO5ESTN4js.na.from(t).toString()}/resource/${r}`,params:{ledger_version:_optionalChain([i, 'optionalAccess', _128 => _128.ledgerVersion])}});return o.data}async function Jn(n){let{aptosConfig:e,authenticationKey:t,options:r}=n,i=await lo({aptosConfig:e,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:r}),{address_map:{handle:o}}=i,s=_chunkHO5ESTN4js.na.from(t);try{let a=await qr({aptosConfig:e,handle:o,data:{key:s.toString(),key_type:"address",value_type:"address"},options:r});return _chunkHO5ESTN4js.na.from(a)}catch(a){if(a instanceof Ee&&a.data.error_code==="table_item_not_found")return s;throw a}}async function Ua(n){let{aptosConfig:e,accountAddress:t}=n,i={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}},s=await w({aptosConfig:e,query:{query:Ls,variables:{where_condition:i}},originMethod:"getAccountTokensCount"});return s.current_token_ownerships_v2_aggregate.aggregate?s.current_token_ownerships_v2_aggregate.aggregate.count:0}async function za(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}};_optionalChain([r, 'optionalAccess', _129 => _129.tokenStandard])&&(o.token_standard={_eq:_optionalChain([r, 'optionalAccess', _130 => _130.tokenStandard])});let s={query:Vs,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _131 => _131.offset]),limit:_optionalChain([r, 'optionalAccess', _132 => _132.limit]),order_by:_optionalChain([r, 'optionalAccess', _133 => _133.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function ka(n){let{aptosConfig:e,accountAddress:t,collectionAddress:r,options:i}=n,o=_chunkHO5ESTN4js.na.from(t).toStringLong(),s=_chunkHO5ESTN4js.na.from(r).toStringLong(),a={owner_address:{_eq:o},current_token_data:{collection_id:{_eq:s}},amount:{_gt:0}};_optionalChain([i, 'optionalAccess', _134 => _134.tokenStandard])&&(a.token_standard={_eq:_optionalChain([i, 'optionalAccess', _135 => _135.tokenStandard])});let c={query:Hs,variables:{where_condition:a,offset:_optionalChain([i, 'optionalAccess', _136 => _136.offset]),limit:_optionalChain([i, 'optionalAccess', _137 => _137.limit]),order_by:_optionalChain([i, 'optionalAccess', _138 => _138.orderBy])}};return(await w({aptosConfig:e,query:c,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Na(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};_optionalChain([r, 'optionalAccess', _139 => _139.tokenStandard])&&(o.current_collection={token_standard:{_eq:_optionalChain([r, 'optionalAccess', _140 => _140.tokenStandard])}});let s={query:Ms,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _141 => _141.offset]),limit:_optionalChain([r, 'optionalAccess', _142 => _142.limit]),order_by:_optionalChain([r, 'optionalAccess', _143 => _143.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function Da(n){let{aptosConfig:e,accountAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:qs,variables:{address:r}},originMethod:"getAccountTransactionsCount"});return o.account_transactions_aggregate.aggregate?o.account_transactions_aggregate.aggregate.count:0}async function Fa(n){let{aptosConfig:e,accountAddress:t,options:r}=n,i=_chunkHO5ESTN4js.na.from(t).toStringLong(),o={..._optionalChain([r, 'optionalAccess', _144 => _144.where]),owner_address:{_eq:i}},s={query:Gs,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _145 => _145.offset]),limit:_optionalChain([r, 'optionalAccess', _146 => _146.limit]),order_by:_optionalChain([r, 'optionalAccess', _147 => _147.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Oa(n){let{aptosConfig:e,accountAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:Bs,variables:{address:r}},originMethod:"getAccountCoinsCount"});if(!o.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return o.current_fungible_asset_balances_aggregate.aggregate.count}async function Ba(n){let{aptosConfig:e,accountAddress:t,asset:r}=n,i=await H({aptosConfig:e,originMethod:"getBalance",path:`accounts/${t}/balance/${r}`,params:{accountAddress:t.toString(),asset:r instanceof Uint8Array?_chunkHO5ESTN4js.na.from(r).toString():r.toString()}});return parseInt(i.data.toString(),10)}async function go(n){let{aptosConfig:e,accountAddress:t,options:r}=n,o={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}},s={query:Gr,variables:{where_condition:o,offset:_optionalChain([r, 'optionalAccess', _148 => _148.offset]),limit:_optionalChain([r, 'optionalAccess', _149 => _149.limit]),order_by:_optionalChain([r, 'optionalAccess', _150 => _150.orderBy])}};return(await w({aptosConfig:e,query:s,originMethod:"getAccountOwnedObjects"})).current_objects}async function Ga(n){let{aptosConfig:e,privateKey:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _151 => _151.throwIfNoAccountFound]), () => (!1)),o=await ii({aptosConfig:e,privateKey:t});if(o.length===0){if(i)throw new Error("No existing account found for private key.");return gt.fromPrivateKey({privateKey:t})}return o[0]}async function Dd(n){let{aptosConfig:e,accountAddress:t,options:r}=n;try{let[i,o]=await Promise.all([po({aptosConfig:e,accountAddress:t}),go({aptosConfig:e,accountAddress:t,options:{limit:1}})]),s=i.find(c=>c.type==="0x1::account::Account");if(!s&&o.length===0)return!1;if(!_optionalChain([r, 'optionalAccess', _152 => _152.withAuthKey]))return!0;let a;return s?a=s.data.authentication_key:a=t.toStringLong(),a===r.withAuthKey.toString()}catch(i){throw new Error(`Error while checking if account exists at ${t.toString()}: ${i}`)}}var Fd={typeParameters:[],parameters:[new de,z.u8(),new de,z.u8(),z.u8(),z.u8()]};async function Ma(n){let{aptosConfig:e,fromAccount:t,options:r}=n;if("toNewPrivateKey"in n)return co({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toNewPrivateKey,options:r});if("toAccount"in n)return n.toAccount instanceof oe?co({aptosConfig:e,fromAccount:t,toNewPrivateKey:n.toAccount.privateKey,options:r}):co({aptosConfig:e,fromAccount:t,toAccount:n.toAccount,options:r});throw new Error("Invalid arguments")}async function co(n){let{aptosConfig:e,fromAccount:t,options:r}=n,i=await _n({aptosConfig:e,accountAddress:t.accountAddress}),o;"toNewPrivateKey"in n?o=gt.fromPrivateKey({privateKey:n.toNewPrivateKey,legacy:!0}):o=n.toAccount;let a=new Ur({sequenceNumber:BigInt(i.sequence_number),originator:t.accountAddress,currentAuthKey:_chunkHO5ESTN4js.na.from(i.authentication_key),newPublicKey:o.publicKey}).bcsToBytes(),c=t.sign(a),d=o.sign(a);return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new Z(t.signingScheme),S.U8(t.publicKey.toUint8Array()),new Z(o.signingScheme),S.U8(o.publicKey.toUint8Array()),S.U8(c.toUint8Array()),S.U8(d.toUint8Array())],abi:Fd},options:r})}var Od={typeParameters:[],parameters:[new de,z.u8()]};async function Va(n){let{aptosConfig:e,fromAccount:t,toNewPublicKey:r,options:i}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::account::rotate_authentication_key_from_public_key",functionArguments:[new Z(Rs(r)),S.U8(Bi(r).toUint8Array())],abi:Od},options:i})}async function oi(n){let{aptosConfig:e,publicKey:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _153 => _153.noMultiKey]), () => (!1));if(i&&t instanceof Oe)throw new Error("Multi-key accounts are not supported when noMultiKey is true.");let o=[t];t instanceof I&&t.publicKey instanceof E?o.push(t.publicKey):t instanceof E&&o.push(new I(t));let[s,a]=await Promise.all([Promise.all(o.map(async A=>{let p=await Hd({aptosConfig:e,publicKey:A});if(p)return{...p,publicKey:A}})),!(t instanceof Oe)&&!i?Gd({aptosConfig:e,publicKey:t,options:r}):Promise.resolve([])]),c=[];for(let A of s)A&&c.push(A);o.push(...a);let d=new Map(o.map(A=>[A.authKey().toString(),A])),m=await Md({aptosConfig:e,authKeys:o.map(A=>A.authKey()),options:r});for(let A of m){if(c.find(g=>g.accountAddress===A.accountAddress))continue;let p=d.get(A.authKey.toString());if(!p)throw new Error(`No publicKey found for authentication key ${A.authKey}. This should never happen.`);c.push({accountAddress:A.accountAddress,publicKey:p,lastTransactionVersion:A.lastTransactionVersion})}return c.sort((A,p)=>p.lastTransactionVersion-A.lastTransactionVersion)}async function yo(n){let{aptosConfig:e,signer:t,options:r}=n;if(t instanceof J||t instanceof rt)return ii({aptosConfig:e,privateKey:t,options:r});if(t instanceof oe||t instanceof pe)return ii({aptosConfig:e,privateKey:t.privateKey,options:r});if(t instanceof Ce||t instanceof Ve)return Bd({aptosConfig:e,keylessAccount:t,options:r});if(t instanceof yt&&t.signers.length===1)return yo({aptosConfig:e,signer:t.signers[0],options:r});if(t instanceof qn&&t.signers.length===1)return ii({aptosConfig:e,privateKey:t.signers[0],options:r});throw new Error("Unknown signer type")}async function Bd(n){let{aptosConfig:e,keylessAccount:t,options:r}=n,i=await oi({aptosConfig:e,publicKey:t.getAnyPublicKey(),options:r}),o={proof:t.proofOrPromise,jwt:t.jwt,ephemeralKeyPair:t.ephemeralKeyPair,pepper:t.pepper,verificationKeyHash:t.verificationKeyHash},s=[];for(let{accountAddress:a,publicKey:c}of i)if(c instanceof Oe){if(c.getSignaturesRequired()>1)continue;if(c instanceof ie)throw new Error("Keyless authentication cannot be used for multi-ed25519 accounts. This should never happen.");c instanceof W&&s.push(new yt({multiKey:c,signers:[t],address:a}))}else t instanceof Ve?s.push(Ve.create({...o,address:a,jwkAddress:t.publicKey.jwkAddress})):s.push(Ce.create({...o,address:a}));return s}async function ii(n){let{aptosConfig:e,privateKey:t,options:r}=n,i=gt.fromPrivateKey({privateKey:t,legacy:!1}),o=await oi({aptosConfig:e,publicKey:new I(t.publicKey()),options:r}),s=[];for(let{accountAddress:a,publicKey:c}of o)if(c instanceof Oe){if(c.getSignaturesRequired()>1)continue;c instanceof ie?s.push(new qn({publicKey:c,signers:[t],address:a})):c instanceof W&&s.push(new yt({multiKey:c,signers:[i],address:a}))}else{let d=c instanceof E;s.push(gt.fromPrivateKey({privateKey:t,address:a,legacy:d}))}return s}async function Gd(n){let{aptosConfig:e,publicKey:t,options:r}=n;if(t instanceof Oe)throw new Error("Public key is a multi-key.");let i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _154 => _154.includeUnverified]), () => (!1)),o=t instanceof I?t:new I(t),s=o.publicKey,a=_chunkHO5ESTN4js.O.call(void 0, o.variant),c={public_key:{_eq:s.toString()},public_key_type:{_eq:a},account_public_key:{_is_null:!1},...i?{}:{is_public_key_used:{_eq:!0}}},d={query:$s,variables:{where_condition:c}},{public_key_auth_keys:m}=await w({aptosConfig:e,query:d,originMethod:"getMultiKeysForPublicKey"});return m.filter(p=>p.account_public_key!==null).map(p=>{switch(p.signature_type){case"multi_ed25519_signature":return ie.deserializeWithoutLength(C.fromHex(p.account_public_key));case"multi_key_signature":return W.deserialize(C.fromHex(p.account_public_key));default:throw new Error(`Unknown multi-signature type: ${p.signature_type}`)}})}async function Md(n){let{aptosConfig:e,authKeys:t,options:r}=n,i=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _155 => _155.includeUnverified]), () => (!1));if(t.length===0)throw new Error("No authentication keys provided");let o={auth_key:{_in:t.map(c=>c.toString())},...i?{}:{is_auth_key_used:{_eq:!0}}},s={query:Os,variables:{where_condition:o,order_by:[{last_transaction_version:"desc"}]}},{auth_key_account_addresses:a}=await w({aptosConfig:e,query:s,originMethod:"getAccountAddressesForAuthKeys"});return a.map(c=>({authKey:new V({data:c.auth_key}),accountAddress:new (0, _chunkHO5ESTN4js.na)(_chunkHO5ESTN4js.v.hexInputToUint8Array(c.account_address)),lastTransactionVersion:Number(c.last_transaction_version)}))}async function Vd(n){let{aptosConfig:e,accountAddress:t}=n,r=await uo({aptosConfig:e,accountAddress:t,options:{limit:1}});return r.length===0?0:Number(r[0].version)}async function Hd(n){let{aptosConfig:e,publicKey:t}=n,r=t.authKey().derivedAddress(),[i,o]=await Promise.all([Vd({aptosConfig:e,accountAddress:r}),Dd({aptosConfig:e,accountAddress:r,options:{withAuthKey:t.authKey()}})]);if(o)return{accountAddress:r,lastTransactionVersion:i}}async function P(n){n.minimumLedgerVersion!==void 0&&await Qr({aptosConfig:n.config,minimumLedgerVersion:n.minimumLedgerVersion,processorType:n.processorType})}async function le(n){let{aptosConfig:e,payload:t,options:r}=n,i=await Sa({...t,aptosConfig:e}),o=new _chunkHO5ESTN4js.y;i.serialize(o);let s=o.toUint8Array(),{data:a}=await St({aptosConfig:e,path:"view",originMethod:"view",contentType:"application/x.aptos.view_function+bcs",params:{ledger_version:_optionalChain([r, 'optionalAccess', _156 => _156.ledgerVersion])},body:s});return a}async function Ha(n){let{aptosConfig:e,payload:t,options:r}=n,{data:i}=await St({aptosConfig:e,originMethod:"viewJson",path:"view",params:{ledger_version:_optionalChain([r, 'optionalAccess', _157 => _157.ledgerVersion])},body:{function:t.function,type_arguments:_nullishCoalesce(t.typeArguments, () => ([])),arguments:_nullishCoalesce(t.functionArguments, () => ([]))}});return i}async function La(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=_chunkHO5ESTN4js.Ca.call(void 0, r);return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::add_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new G,new h(x()),new h(x())]}},options:i})}async function qa(n){let{aptosConfig:e,sender:t,authenticationFunction:r,options:i}=n,{moduleAddress:o,moduleName:s,functionName:a}=_chunkHO5ESTN4js.Ca.call(void 0, r);return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authentication_function",typeArguments:[],functionArguments:[o,s,a],abi:{typeParameters:[],parameters:[new G,new h(x()),new h(x())]}},options:i})}async function $a(n){let{aptosConfig:e,sender:t,options:r}=n;return T({aptosConfig:e,sender:t,data:{function:"0x1::account_abstraction::remove_authenticator",typeArguments:[],functionArguments:[],abi:{typeParameters:[],parameters:[]}},options:r})}var Xt=class{constructor(e){this.config=e;this.isAccountAbstractionEnabled=async e=>{let t=await this.getAuthenticationFunction(e),{moduleAddress:r,moduleName:i,functionName:o}=_chunkHO5ESTN4js.Ca.call(void 0, e.authenticationFunction);return _nullishCoalesce(_optionalChain([t, 'optionalAccess', _158 => _158.some, 'call', _159 => _159(s=>_chunkHO5ESTN4js.na.fromString(r).equals(s.moduleAddress)&&i===s.moduleName&&o===s.functionName)]), () => (!1))};this.enableAccountAbstractionTransaction=this.addAuthenticationFunctionTransaction;this.disableAccountAbstractionTransaction=async e=>{let{accountAddress:t,authenticationFunction:r,options:i}=e;return r?this.removeAuthenticationFunctionTransaction({accountAddress:t,authenticationFunction:r,options:i}):this.removeDispatchableAuthenticatorTransaction({accountAddress:t,options:i})}}async addAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return La({aptosConfig:this.config,authenticationFunction:r,sender:t,options:i})}async removeAuthenticationFunctionTransaction(e){let{accountAddress:t,authenticationFunction:r,options:i}=e;return qa({aptosConfig:this.config,sender:t,authenticationFunction:r,options:i})}async removeDispatchableAuthenticatorTransaction(e){let{accountAddress:t,options:r}=e;return $a({aptosConfig:this.config,sender:t,options:r})}async getAuthenticationFunction(e){let{accountAddress:t}=e,[{vec:r}]=await le({aptosConfig:this.config,payload:{function:"0x1::account_abstraction::dispatchable_authenticator",functionArguments:[_chunkHO5ESTN4js.na.from(t)],abi:{typeParameters:[],parameters:[new G],returnTypes:[]}}});if(r.length!==0)return r[0].map(i=>({moduleAddress:_chunkHO5ESTN4js.na.fromString(i.module_address),moduleName:i.module_name,functionName:i.function_name}))}};var Xn=class{constructor(e){this.config=e;this.abstraction=new Xt(e)}async getAccountInfo(e){return _n({aptosConfig:this.config,...e})}async getAccountModules(e){return Ca({aptosConfig:this.config,...e})}async getAccountModulesPage(e){return Ka({aptosConfig:this.config,...e})}async getAccountModule(e){return Zr({aptosConfig:this.config,...e})}async getAccountTransactions(e){return uo({aptosConfig:this.config,...e})}async getAccountResources(e){return po({aptosConfig:this.config,...e})}async getAccountResourcesPage(e){return Ra({aptosConfig:this.config,...e})}async getAccountResource(e){return lo({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return Jn({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),Ua({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),za({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ka({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Na({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),Da({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),Fa({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),Oa({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:Rt,faMetadataAddress:fs,...e})}async getAccountCoinAmount(e){let{accountAddress:t,coinType:r,faMetadataAddress:i}=e,o=r;r===void 0&&i!==void 0&&(o=await $e(async()=>{try{let c=(await le({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[i]}}))[0];if(c.vec.length>0&&_chunkHO5ESTN4js.Ba.call(void 0, c.vec[0]))return _chunkHO5ESTN4js.Aa.call(void 0, c.vec[0])}catch (e6){}},`coin-mapping-${i.toString()}`,1e3*60*5)());let s;if(r!==void 0&&i!==void 0)s=_chunkHO5ESTN4js.na.from(i).toStringLong();else if(r!==void 0&&i===void 0)r===Rt?s=_chunkHO5ESTN4js.na.A.toStringLong():s=_chunkHO5ESTN4js.oa.call(void 0, _chunkHO5ESTN4js.na.A,r).toStringLong();else if(r===void 0&&i!==void 0){let c=_chunkHO5ESTN4js.na.from(i);s=c.toStringLong(),c===_chunkHO5ESTN4js.na.A&&(o=Rt)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(o!==void 0){let[c]=await le({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[o],functionArguments:[t]}});return parseInt(c,10)}let[a]=await le({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[t,s]}});return parseInt(a,10)}async getBalance(e){return Ba({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),go({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),Ga({aptosConfig:this.config,...e})}async deriveOwnedAccountsFromSigner(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),yo({aptosConfig:this.config,...e})}async getAccountsForPublicKey(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_restoration_processor"}),await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),oi({aptosConfig:this.config,...e})}};var _aptosclient = require('@aptos-labs/aptos-client'); var _aptosclient2 = _interopRequireDefault(_aptosclient);var si=class{constructor(e){if(_optionalChain([e, 'optionalAccess', _160 => _160.fullnode])||_optionalChain([e, 'optionalAccess', _161 => _161.indexer])||_optionalChain([e, 'optionalAccess', _162 => _162.faucet])||_optionalChain([e, 'optionalAccess', _163 => _163.pepper])||_optionalChain([e, 'optionalAccess', _164 => _164.prover])){if(_optionalChain([e, 'optionalAccess', _165 => _165.network])==="custom")console.info("Note: using CUSTOM network will require queries to lookup ChainId");else if(!_optionalChain([e, 'optionalAccess', _166 => _166.network]))throw new Error("Custom endpoints require a network to be specified")}this.network=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _167 => _167.network]), () => ("devnet")),this.fullnode=_optionalChain([e, 'optionalAccess', _168 => _168.fullnode]),this.faucet=_optionalChain([e, 'optionalAccess', _169 => _169.faucet]),this.pepper=_optionalChain([e, 'optionalAccess', _170 => _170.pepper]),this.prover=_optionalChain([e, 'optionalAccess', _171 => _171.prover]),this.indexer=_optionalChain([e, 'optionalAccess', _172 => _172.indexer]),this.client=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _173 => _173.client]), () => ({provider:_aptosclient2.default})),this.clientConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _174 => _174.clientConfig]), () => ({})),this.fullnodeConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _175 => _175.fullnodeConfig]), () => ({})),this.indexerConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _176 => _176.indexerConfig]), () => ({})),this.faucetConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _177 => _177.faucetConfig]), () => ({})),this.transactionGenerationConfig=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _178 => _178.transactionGenerationConfig]), () => ({})),this.pluginConfig=_optionalChain([e, 'optionalAccess', _179 => _179.pluginSettings])?{...e.pluginSettings,IGNORE_TRANSACTION_SUBMITTER:!1}:void 0}getRequestUrl(e){switch(e){case"Fullnode":if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ls[this.network];case"Faucet":if(this.faucet!==void 0)return this.faucet;if(this.network==="testnet")throw new Error("There is no way to programmatically mint testnet APT, you must use the minting site at https://aptos.dev/network/faucet");if(this.network==="mainnet")throw new Error("There is no mainnet faucet");if(this.network==="custom")throw new Error("Please provide a custom faucet url");return gs[this.network];case"Indexer":if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return ps[this.network];case"Pepper":if(this.pepper!==void 0)return this.pepper;if(this.network==="custom")throw new Error("Please provide a custom pepper service url");return Si[this.network];case"Prover":if(this.prover!==void 0)return this.prover;if(this.network==="custom")throw new Error("Please provide a custom prover service url");return Pi[this.network];default:throw Error(`apiType ${e} is not supported`)}}isPepperServiceRequest(e){return Si[this.network]===e}isProverServiceRequest(e){return Pi[this.network]===e}getDefaultMaxGasAmount(){return _nullishCoalesce(_optionalChain([this, 'access', _180 => _180.transactionGenerationConfig, 'optionalAccess', _181 => _181.defaultMaxGasAmount]), () => (2e5))}getDefaultTxnExpirySecFromNow(){return _nullishCoalesce(_optionalChain([this, 'access', _182 => _182.transactionGenerationConfig, 'optionalAccess', _183 => _183.defaultTxnExpirySecFromNow]), () => (20))}setIgnoreTransactionSubmitter(e){this.pluginConfig&&(this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER=e)}getTransactionSubmitter(){if(this.pluginConfig!==void 0&&this.pluginConfig.IGNORE_TRANSACTION_SUBMITTER!==!0)return this.pluginConfig.TRANSACTION_SUBMITTER}};var qd={typeParameters:[{constraints:[]}],parameters:[new G,new te]};async function Wa(n){let{aptosConfig:e,sender:t,recipient:r,amount:i,coinType:o,options:s}=n;return T({aptosConfig:e,sender:t,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[_nullishCoalesce(o, () => (Rt))],functionArguments:[r,i],abi:qd},options:s})}var Yn=class{constructor(e){this.config=e}async transferCoinTransaction(e){return Wa({aptosConfig:this.config,...e})}};var xt={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},Ke="0x4::token::Token";async function Qa(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return(await w({aptosConfig:e,query:{query:na,variables:{where_condition:r}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function ja(n){let{aptosConfig:e,digitalAssetAddress:t}=n,r={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}};return(await w({aptosConfig:e,query:{query:qi,variables:{where_condition:r}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function Ja(n){let{aptosConfig:e,ownerAddress:t,options:r}=n,i={owner_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()},amount:{_gt:0}},o={query:qi,variables:{where_condition:i,offset:_optionalChain([r, 'optionalAccess', _184 => _184.offset]),limit:_optionalChain([r, 'optionalAccess', _185 => _185.limit]),order_by:_optionalChain([r, 'optionalAccess', _186 => _186.orderBy])}};return(await w({aptosConfig:e,query:o,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function Xa(n){let{aptosConfig:e,digitalAssetAddress:t,options:r}=n,i={token_data_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}},o={query:ta,variables:{where_condition:i,offset:_optionalChain([r, 'optionalAccess', _187 => _187.offset]),limit:_optionalChain([r, 'optionalAccess', _188 => _188.limit]),order_by:_optionalChain([r, 'optionalAccess', _189 => _189.orderBy])}};return(await w({aptosConfig:e,query:o,originMethod:"getDigitalAssetActivity"})).token_activities_v2}var $d={typeParameters:[],parameters:[new h(x()),new te,new h(x()),new h(x()),new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q,new Q,new te,new te]};async function Ya(n){let{aptosConfig:e,options:t,creator:r}=n;return T({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new v(n.description),new $(_nullishCoalesce(n.maxSupply, () => (_chunkHO5ESTN4js.e))),new v(n.name),new v(n.uri),new F(_nullishCoalesce(n.mutableDescription, () => (!0))),new F(_nullishCoalesce(n.mutableRoyalty, () => (!0))),new F(_nullishCoalesce(n.mutableURI, () => (!0))),new F(_nullishCoalesce(n.mutableTokenDescription, () => (!0))),new F(_nullishCoalesce(n.mutableTokenName, () => (!0))),new F(_nullishCoalesce(n.mutableTokenProperties, () => (!0))),new F(_nullishCoalesce(n.mutableTokenURI, () => (!0))),new F(_nullishCoalesce(n.tokensBurnableByCreator, () => (!0))),new F(_nullishCoalesce(n.tokensFreezableByCreator, () => (!0))),new $(_nullishCoalesce(n.royaltyNumerator, () => (0))),new $(_nullishCoalesce(n.royaltyDenominator, () => (1)))],abi:$d},options:t})}async function In(n){let{aptosConfig:e,options:t}=n,r=_optionalChain([t, 'optionalAccess', _190 => _190.where]);_optionalChain([t, 'optionalAccess', _191 => _191.tokenStandard])&&(r.token_standard={_eq:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _192 => _192.tokenStandard]), () => ("v2"))});let i={query:Qs,variables:{where_condition:r,offset:_optionalChain([t, 'optionalAccess', _193 => _193.offset]),limit:_optionalChain([t, 'optionalAccess', _194 => _194.limit])}};return(await w({aptosConfig:e,query:i,originMethod:"getCollectionData"})).current_collections_v2[0]}async function Za(n){let{aptosConfig:e,creatorAddress:t,collectionName:r,options:i}=n,o=_chunkHO5ESTN4js.na.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return _optionalChain([i, 'optionalAccess', _195 => _195.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _196 => _196.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...i,where:s}})}async function ec(n){let{aptosConfig:e,creatorAddress:t,options:r}=n,o={creator_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return _optionalChain([r, 'optionalAccess', _197 => _197.tokenStandard])&&(o.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _198 => _198.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...r,where:o}})}async function tc(n){let{aptosConfig:e,collectionId:t,options:r}=n,o={collection_id:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return _optionalChain([r, 'optionalAccess', _199 => _199.tokenStandard])&&(o.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _200 => _200.tokenStandard]), () => ("v2"))}),In({aptosConfig:e,options:{...r,where:o}})}async function nc(n){let{creatorAddress:e,collectionName:t,options:r,aptosConfig:i}=n,o=_chunkHO5ESTN4js.na.from(e),s={collection_name:{_eq:t},creator_address:{_eq:o.toStringLong()}};return _optionalChain([r, 'optionalAccess', _201 => _201.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _202 => _202.tokenStandard]), () => ("v2"))}),(await In({aptosConfig:i,options:{where:s}})).collection_id}var Wd={typeParameters:[],parameters:[new h(x()),new h(x()),new h(x()),new h(x()),new z(new h(x())),new z(new h(x())),new z(z.u8())]};async function rc(n){let{aptosConfig:e,options:t,creator:r,collection:i,description:o,name:s,uri:a,propertyKeys:c,propertyTypes:d,propertyValues:m}=n,A=_optionalChain([d, 'optionalAccess', _203 => _203.map, 'call', _204 => _204(p=>xt[p])]);return T({aptosConfig:e,sender:r.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new v(i),new v(o),new v(s),new v(a),S.MoveString(_nullishCoalesce(c, () => ([]))),S.MoveString(_nullishCoalesce(A, () => ([]))),Ac(_nullishCoalesce(m, () => ([])),_nullishCoalesce(A, () => ([])))],abi:Wd},options:t})}var Qd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new G]};async function ic(n){let{aptosConfig:e,sender:t,digitalAssetAddress:r,recipient:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(r),_chunkHO5ESTN4js.na.from(i)],abi:Qd},options:s})}var jd={typeParameters:[],parameters:[new h(x()),new h(x()),new h(x()),new h(x()),new z(new h(x())),new z(new h(x())),new z(z.u8()),new G]};async function oc(n){let{aptosConfig:e,account:t,collection:r,description:i,name:o,uri:s,recipient:a,propertyKeys:c,propertyTypes:d,propertyValues:m,options:A}=n;if(_optionalChain([c, 'optionalAccess', _205 => _205.length])!==_optionalChain([m, 'optionalAccess', _206 => _206.length]))throw new Error("Property keys and property values counts do not match");if(_optionalChain([d, 'optionalAccess', _207 => _207.length])!==_optionalChain([m, 'optionalAccess', _208 => _208.length]))throw new Error("Property types and property values counts do not match");let p=_optionalChain([d, 'optionalAccess', _209 => _209.map, 'call', _210 => _210(g=>xt[g])]);return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[r,i,o,s,S.MoveString(_nullishCoalesce(c, () => ([]))),S.MoveString(_nullishCoalesce(p, () => ([]))),Ac(_nullishCoalesce(m, () => ([])),_nullishCoalesce(p, () => ([]))),a],abi:jd},options:A})}var Jd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function sc(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(r)],abi:Jd},options:o})}var Xd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function ac(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[r],abi:Xd},options:o})}var Yd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0)))]};async function cc(n){let{aptosConfig:e,creator:t,digitalAssetAddress:r,digitalAssetType:i,options:o}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[_nullishCoalesce(i, () => (Ke))],functionArguments:[r],abi:Yd},options:o})}var Zd={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function uc(n){let{aptosConfig:e,creator:t,description:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:Zd},options:s})}var ep={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function dc(n){let{aptosConfig:e,creator:t,name:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:ep},options:s})}var tp={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function pc(n){let{aptosConfig:e,creator:t,uri:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:tp},options:s})}var np={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x()),new h(x()),z.u8()]};async function lc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[_nullishCoalesce(a, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),new v(xt[i]),S.U8(mo(o,xt[i]))],abi:np},options:c})}var rp={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x())]};async function gc(n){let{aptosConfig:e,creator:t,propertyKey:r,digitalAssetAddress:i,digitalAssetType:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[_nullishCoalesce(o, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(i),new v(r)],abi:rp},options:s})}var ip={typeParameters:[{constraints:["key"]}],parameters:[new h(Te(new M(0))),new h(x()),new h(x()),z.u8()]};async function yc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[_nullishCoalesce(a, () => (Ke))],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),new v(xt[i]),mo(o,xt[i])],abi:ip},options:c})}var op={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new h(Te(new M(0))),new h(x()),new M(1)]};async function mc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[_nullishCoalesce(a, () => (Ke)),xt[i]],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),o],abi:op},options:c})}var sp={typeParameters:[{constraints:["key"]},{constraints:[]}],parameters:[new h(Te(new M(0))),new h(x()),new M(1)]};async function fc(n){let{aptosConfig:e,creator:t,propertyKey:r,propertyType:i,propertyValue:o,digitalAssetAddress:s,digitalAssetType:a,options:c}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[_nullishCoalesce(a, () => (Ke)),xt[i]],functionArguments:[_chunkHO5ESTN4js.na.from(s),new v(r),o],abi:sp},options:c})}function Ac(n,e){let t=new Array;return e.forEach((r,i)=>{t.push(mo(n[i],r))}),t}function mo(n,e){let t=He(e);return Jt(n,t,0,[]).bcsToBytes()}var Zn=class{constructor(e){this.config=e}async getCollectionData(e){await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"});let{creatorAddress:t,collectionName:r,options:i}=e,o=_chunkHO5ESTN4js.na.from(t),s={collection_name:{_eq:r},creator_address:{_eq:o.toStringLong()}};return _optionalChain([i, 'optionalAccess', _211 => _211.tokenStandard])&&(s.token_standard={_eq:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _212 => _212.tokenStandard]), () => ("v2"))}),In({aptosConfig:this.config,options:{where:s}})}async getCollectionDataByCreatorAddressAndCollectionName(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Za({aptosConfig:this.config,...e})}async getCollectionDataByCreatorAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ec({aptosConfig:this.config,...e})}async getCollectionDataByCollectionId(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),tc({aptosConfig:this.config,...e})}async getCollectionId(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),nc({aptosConfig:this.config,...e})}async getDigitalAssetData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Qa({aptosConfig:this.config,...e})}async getCurrentDigitalAssetOwnership(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),ja({aptosConfig:this.config,...e})}async getOwnedDigitalAssets(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Ja({aptosConfig:this.config,...e})}async getDigitalAssetActivity(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),Xa({aptosConfig:this.config,...e})}async createCollectionTransaction(e){return Ya({aptosConfig:this.config,...e})}async mintDigitalAssetTransaction(e){return rc({aptosConfig:this.config,...e})}async transferDigitalAssetTransaction(e){return ic({aptosConfig:this.config,...e})}async mintSoulBoundTransaction(e){return oc({aptosConfig:this.config,...e})}async burnDigitalAssetTransaction(e){return sc({aptosConfig:this.config,...e})}async freezeDigitalAssetTransaferTransaction(e){return ac({aptosConfig:this.config,...e})}async unfreezeDigitalAssetTransaferTransaction(e){return cc({aptosConfig:this.config,...e})}async setDigitalAssetDescriptionTransaction(e){return uc({aptosConfig:this.config,...e})}async setDigitalAssetNameTransaction(e){return dc({aptosConfig:this.config,...e})}async setDigitalAssetURITransaction(e){return pc({aptosConfig:this.config,...e})}async addDigitalAssetPropertyTransaction(e){return lc({aptosConfig:this.config,...e})}async removeDigitalAssetPropertyTransaction(e){return gc({aptosConfig:this.config,...e})}async updateDigitalAssetPropertyTransaction(e){return yc({aptosConfig:this.config,...e})}async addDigitalAssetTypedPropertyTransaction(e){return mc({aptosConfig:this.config,...e})}async updateDigitalAssetTypedPropertyTransaction(e){return fc({aptosConfig:this.config,...e})}};async function hc(n){let{aptosConfig:e,accountAddress:t,amount:r,options:i}=n,o=_optionalChain([i, 'optionalAccess', _213 => _213.timeoutSecs])||20,{data:s}=await Ps({aptosConfig:e,path:"fund",body:{address:_chunkHO5ESTN4js.na.from(t).toString(),amount:r},originMethod:"fundAccount"}),a=s.txn_hashes[0],c=await Pn({aptosConfig:e,transactionHash:a,options:{timeoutSecs:o,checkSuccess:_optionalChain([i, 'optionalAccess', _214 => _214.checkSuccess])}});if(c.type==="user_transaction")return c;throw new Error(`Unexpected transaction received for fund account: ${c.type}`)}var er=class{constructor(e){this.config=e}async fundAccount(e){let t=await hc({aptosConfig:this.config,...e});return(_optionalChain([e, 'access', _215 => _215.options, 'optionalAccess', _216 => _216.waitForIndexer])===void 0||_optionalChain([e, 'access', _217 => _217.options, 'optionalAccess', _218 => _218.waitForIndexer]))&&await Qr({aptosConfig:this.config,minimumLedgerVersion:BigInt(t.version),processorType:"fungible_asset_processor"}),t}};async function ai(n){let{aptosConfig:e,options:t}=n,r={query:Ys,variables:{where_condition:_optionalChain([t, 'optionalAccess', _219 => _219.where]),limit:_optionalChain([t, 'optionalAccess', _220 => _220.limit]),offset:_optionalChain([t, 'optionalAccess', _221 => _221.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function bc(n){let{aptosConfig:e,options:t}=n,r={query:Xs,variables:{where_condition:_optionalChain([t, 'optionalAccess', _222 => _222.where]),limit:_optionalChain([t, 'optionalAccess', _223 => _223.limit]),offset:_optionalChain([t, 'optionalAccess', _224 => _224.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Tc(n){let{aptosConfig:e,options:t}=n,r={query:js,variables:{where_condition:_optionalChain([t, 'optionalAccess', _225 => _225.where]),limit:_optionalChain([t, 'optionalAccess', _226 => _226.limit]),offset:_optionalChain([t, 'optionalAccess', _227 => _227.offset])}};return(await w({aptosConfig:e,query:r,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var wc={typeParameters:[{constraints:[]}],parameters:[He("0x1::object::Object"),new G,new te]};async function Sc(n){let{aptosConfig:e,sender:t,fungibleAssetMetadataAddress:r,recipient:i,amount:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[r,i,o],abi:wc},options:s})}async function Pc(n){let{aptosConfig:e,sender:t,fromStore:r,toStore:i,amount:o,options:s}=n;return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::dispatchable_fungible_asset::transfer",typeArguments:["0x1::fungible_asset::FungibleStore"],functionArguments:[r,i,o],abi:wc},options:s})}var tr=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _228 => _228.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),ai({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _229 => _229.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),(await ai({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetMetadataByCreatorAddress(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _230 => _230.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),await ai({aptosConfig:this.config,options:{where:{creator_address:{_eq:_chunkHO5ESTN4js.na.from(e.creatorAddress).toStringLong()}}}})}async getFungibleAssetActivities(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _231 => _231.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),bc({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _232 => _232.minimumLedgerVersion]),processorType:"fungible_asset_processor"}),Tc({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return Sc({aptosConfig:this.config,...e})}async transferFungibleAssetBetweenStores(e){return Pc({aptosConfig:this.config,...e})}};var nr=class{constructor(e){this.config=e}async getLedgerInfo(){return Mr({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return da({aptosConfig:this.config,...e})}async getBlockByHeight(e){return pa({aptosConfig:this.config,...e})}async view(e){return le({aptosConfig:this.config,...e})}async viewJson(e){return Ha({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return ra({aptosConfig:this.config,...e})}async queryIndexer(e){return w({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return Vr({aptosConfig:this.config})}async getProcessorStatus(e){return Hr({aptosConfig:this.config,processorType:e})}};var Ec=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function _c(n){return!(!n||n.length<3||n.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(n))}function vt(n){let[e,t,...r]=n.replace(/\.apt$/,"").split(".");if(r.length>0)throw new Error(`${n} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!_c(e))throw new Error(`${e} is not valid. ${Ec}`);if(t&&!_c(t))throw new Error(`${t} is not valid. ${Ec}`);return{domainName:t||e,subdomainName:t?e:void 0}}function Ic(n){if(!n)return!1;let e=new Date(n.domain_expiration_timestamp).getTime()<Date.now(),t=new Date(n.expiration_timestamp).getTime()<Date.now();return n.subdomain&&e?!1:n.subdomain&&n.subdomain_expiration_policy===1?!0:!t}var ap="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",cp={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:ap,custom:null,devnet:null,shelbynet:null,netna:null};function ft(n){let e=cp[n.network];if(!e)throw new Error(`The ANS contract is not deployed to ${n.network}`);return e}var ci=n=>{if(n&&typeof n=="object"&&"vec"in n&&Array.isArray(n.vec))return n.vec[0]};async function xc(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t),s=await le({aptosConfig:e,payload:{function:`${r}::router::get_owner_addr`,functionArguments:[i,o]}}),a=ci(s[0]);return a?_chunkHO5ESTN4js.na.from(a):void 0}async function vc(n){let{aptosConfig:e,expiration:t,name:r,sender:i,targetAddress:o,toAddress:s,options:a,transferable:c}=n,d=ft(e),{domainName:m,subdomainName:A}=vt(r),p=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(A&&!p)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(p&&!A)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let q=_nullishCoalesce(t.years, () => (1));if(q!==1)throw new Error("For now, names can only be registered for 1 year at a time");let Ye=q*31536e3;return await T({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_domain`,functionArguments:[m,Ye,o,s]},options:a})}if(!A)throw new Error(`${t.policy} requires a subdomain to be provided.`);let g=await fo({aptosConfig:e,name:m});if(!g)throw new Error("The domain does not exist");let b=t.policy==="subdomain:independent"?t.expirationDate:g;if(b>g)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await T({aptosConfig:e,sender:i.accountAddress.toString(),data:{function:`${d}::router::register_subdomain`,functionArguments:[m,A,Math.round(b/1e3),t.policy==="subdomain:follow-domain"?1:0,!!c,o,s]},options:a})}async function fo(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t);try{let s=await le({aptosConfig:e,payload:{function:`${r}::router::get_expiration`,functionArguments:[i,o]}});return Number(s[0])*1e3}catch (e7){return}}async function Cc(n){let{aptosConfig:e,address:t}=n,r=ft(e),i=await le({aptosConfig:e,payload:{function:`${r}::router::get_primary_name`,functionArguments:[_chunkHO5ESTN4js.na.from(t).toString()]}}),o=ci(i[1]),s=ci(i[0]);if(o)return[s,o].filter(Boolean).join(".")}async function Kc(n){let{aptosConfig:e,sender:t,name:r,options:i}=n,o=ft(e);if(!r)return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::clear_primary_name`,functionArguments:[]},options:i});let{domainName:s,subdomainName:a}=vt(r);return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${o}::router::set_primary_name`,functionArguments:[s,a]},options:i})}async function Rc(n){let{aptosConfig:e,name:t}=n,r=ft(e),{domainName:i,subdomainName:o}=vt(t),s=await le({aptosConfig:e,payload:{function:`${r}::router::get_target_addr`,functionArguments:[i,o]}}),a=ci(s[0]);return a?_chunkHO5ESTN4js.na.from(a):void 0}async function Uc(n){let{aptosConfig:e,sender:t,name:r,address:i,options:o}=n,s=ft(e),{domainName:a,subdomainName:c}=vt(r);return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_target_addr`,functionArguments:[a,c,i]},options:o})}async function zc(n){let{aptosConfig:e,name:t}=n,{domainName:r,subdomainName:i=""}=vt(t),a=(await w({aptosConfig:e,query:{query:Sn,variables:{where_condition:{domain:{_eq:r},subdomain:{_eq:i}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=rr(a)),Ic(a)?a:void 0}async function kc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountNames",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _233 => _233.limit]),offset:_optionalChain([t, 'optionalAccess', _234 => _234.offset]),order_by:_optionalChain([t, 'optionalAccess', _235 => _235.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _236 => _236.options, 'optionalAccess', _237 => _237.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i}}}}})).current_aptos_names.map(rr)}async function Nc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountDomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _238 => _238.limit]),offset:_optionalChain([t, 'optionalAccess', _239 => _239.offset]),order_by:_optionalChain([t, 'optionalAccess', _240 => _240.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _241 => _241.options, 'optionalAccess', _242 => _242.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_eq:""}}}}})).current_aptos_names.map(rr)}async function Dc(n){let{aptosConfig:e,options:t,accountAddress:r}=n,i=await Ao({aptosConfig:e});return(await w({aptosConfig:e,originMethod:"getAccountSubdomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _243 => _243.limit]),offset:_optionalChain([t, 'optionalAccess', _244 => _244.offset]),order_by:_optionalChain([t, 'optionalAccess', _245 => _245.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _246 => _246.options, 'optionalAccess', _247 => _247.where]), () => ({})),owner_address:{_eq:r.toString()},expiration_timestamp:{_gte:i},subdomain:{_neq:""}}}}})).current_aptos_names.map(rr)}async function Fc(n){let{aptosConfig:e,options:t,domain:r}=n;return(await w({aptosConfig:e,originMethod:"getDomainSubdomains",query:{query:Sn,variables:{limit:_optionalChain([t, 'optionalAccess', _248 => _248.limit]),offset:_optionalChain([t, 'optionalAccess', _249 => _249.offset]),order_by:_optionalChain([t, 'optionalAccess', _250 => _250.orderBy]),where_condition:{..._nullishCoalesce(_optionalChain([n, 'access', _251 => _251.options, 'optionalAccess', _252 => _252.where]), () => ({})),domain:{_eq:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(rr).filter(Ic)}async function Ao(n){let{aptosConfig:e}=n,t=ft(e),[r]=await le({aptosConfig:e,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),i=r/60/60/24,o=()=>new Date;return new Date(o().setDate(o().getDate()-i)).toISOString()}async function Oc(n){let{aptosConfig:e,sender:t,name:r,years:i=1,options:o}=n,s=ft(e),a=i*31536e3,{domainName:c,subdomainName:d}=vt(r);if(d)throw new Error("Subdomains cannot be renewed");if(i!==1)throw new Error("Currently, only 1 year renewals are supported");return await T({aptosConfig:e,sender:t.accountAddress.toString(),data:{function:`${s}::router::renew_domain`,functionArguments:[c,a]},options:o})}function rr(n){return{...n,expiration_timestamp:new Date(n.expiration_timestamp).getTime()}}var ir=class{constructor(e){this.config=e}async getOwnerAddress(e){return xc({aptosConfig:this.config,...e})}async getExpiration(e){return fo({aptosConfig:this.config,...e})}async getTargetAddress(e){return Rc({aptosConfig:this.config,...e})}async setTargetAddress(e){return Uc({aptosConfig:this.config,...e})}async getPrimaryName(e){return Cc({aptosConfig:this.config,...e})}async setPrimaryName(e){return Kc({aptosConfig:this.config,...e})}async registerName(e){return vc({aptosConfig:this.config,...e})}async renewDomain(e){return Oc({aptosConfig:this.config,...e})}async getName(e){return zc({aptosConfig:this.config,...e})}async getAccountNames(e){return kc({aptosConfig:this.config,...e})}async getAccountDomains(e){return Nc({aptosConfig:this.config,...e})}async getAccountSubdomains(e){return Dc({aptosConfig:this.config,...e})}async getDomainSubdomains(e){return Fc({aptosConfig:this.config,...e})}};async function Bc(n){let{aptosConfig:e,poolAddress:t}=n,r=_chunkHO5ESTN4js.na.from(t).toStringLong(),o=await w({aptosConfig:e,query:{query:Hi,variables:{where_condition:{pool_address:{_eq:r}}}}});return o.num_active_delegator_per_pool[0]?o.num_active_delegator_per_pool[0].num_active_delegator:0}async function Gc(n){let{aptosConfig:e,options:t}=n,r={query:Hi,variables:{order_by:_optionalChain([t, 'optionalAccess', _253 => _253.orderBy])}};return(await w({aptosConfig:e,query:r})).num_active_delegator_per_pool}async function Mc(n){let{aptosConfig:e,delegatorAddress:t,poolAddress:r}=n,i={query:Js,variables:{delegatorAddress:_chunkHO5ESTN4js.na.from(t).toStringLong(),poolAddress:_chunkHO5ESTN4js.na.from(r).toStringLong()}};return(await w({aptosConfig:e,query:i})).delegated_staking_activities}var or=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _254 => _254.minimumLedgerVersion]),processorType:"stake_processor"}),Bc({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _255 => _255.minimumLedgerVersion]),processorType:"stake_processor"}),Gc({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await P({config:this.config,minimumLedgerVersion:_optionalChain([e, 'optionalAccess', _256 => _256.minimumLedgerVersion]),processorType:"stake_processor"}),Mc({aptosConfig:this.config,...e})}};var ui=class{constructor(e){this.config=e}async simple(e){return T({aptosConfig:this.config,...e})}async multiAgent(e){return T({aptosConfig:this.config,...e})}};function ho(n,e){if(!(n.getTransactionSubmitter()!==void 0||e.transactionSubmitter!==void 0)&&e.transaction.feePayerAddress&&!e.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator")}function bo(n,e,t){let r=t.value;return t.value=async function(...i){return r.apply(this,i)},t}var xn=class{constructor(e){this.config=e}async simple(e){return ao({aptosConfig:this.config,...e})}async multiAgent(e){return ao({aptosConfig:this.config,...e})}};_chunkHO5ESTN4js.a.call(void 0, [bo],xn.prototype,"simple",1),_chunkHO5ESTN4js.a.call(void 0, [bo],xn.prototype,"multiAgent",1);var di=class{constructor(e){this.config=e}async simple(e){return ho(this.config,e),jn({aptosConfig:this.config,...e})}async multiAgent(e){return ho(this.config,e),jn({aptosConfig:this.config,...e})}};var pi=class{constructor(e,t,r,i,o){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=e,this.account=t,this.maxWaitTime=r,this.maximumInFlight=i,this.sleepTime=o}async nextSequenceNumber(){for(;this.lock;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime);this.lock=!0;let e=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let t=_chunkHO5ESTN4js.ua.call(void 0, );for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime),_chunkHO5ESTN4js.ua.call(void 0, )-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}e=this.currentNumber,this.currentNumber+=BigInt(1)}catch(t){console.error("error in getting next sequence number for this account",t)}finally{this.lock=!1}return e}async initialize(){let{sequence_number:e}=await _n({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(e),this.lastUncommintedNumber=BigInt(e)}async update(){let{sequence_number:e}=await _n({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(e),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime);this.lock=!0;try{await this.update();let e=_chunkHO5ESTN4js.ua.call(void 0, );for(;this.lastUncommintedNumber!==this.currentNumber;)_chunkHO5ESTN4js.ua.call(void 0, )-e>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, re-syncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await _chunkHO5ESTN4js.sa.call(void 0, this.sleepTime),await this.update())}catch(e){console.error("error in synchronizing this account sequence number with the one on chain",e)}finally{this.lock=!1}}}};var vn=class{constructor(){this.queue=[];this.pendingDequeue=[];this.cancelled=!1}enqueue(e){if(this.cancelled=!1,this.pendingDequeue.length>0){_optionalChain([this, 'access', _257 => _257.pendingDequeue, 'access', _258 => _258.shift, 'call', _259 => _259(), 'optionalAccess', _260 => _260.resolve, 'call', _261 => _261(e)]);return}this.queue.push(e)}async dequeue(){return this.queue.length>0?Promise.resolve(this.queue.shift()):new Promise((e,t)=>{this.pendingDequeue.push({resolve:e,reject:t})})}isEmpty(){return this.queue.length===0}cancel(){this.cancelled=!0,this.pendingDequeue.forEach(async({reject:e})=>{e(new Cn("Task cancelled"))}),this.pendingDequeue=[],this.queue.length=0}isCancelled(){return this.cancelled}pendingDequeueLength(){return this.pendingDequeue.length}},Cn=class extends Error{};var Vc="fulfilled",Hc= exports.TransactionWorkerEventsEnum =(o=>(o.TransactionSent="transactionSent",o.TransactionSendFailed="transactionSendFailed",o.TransactionExecuted="transactionExecuted",o.TransactionExecutionFailed="transactionExecutionFailed",o.ExecutionFinish="executionFinish",o))(Hc||{}),li= exports.TransactionWorker =class extends _eventemitter32.default{constructor(t,r,i=30,o=100,s=10){super();this.taskQueue=new vn;this.transactionsQueue=new vn;this.outstandingTransactions=new vn;this.sentTransactions=[];this.executedTransactions=[];this.aptosConfig=t,this.account=r,this.started=!1,this.accountSequnceNumber=new pi(t,r,i,o,s)}async submitNextTransaction(){try{for(;;){let t=await this.accountSequnceNumber.nextSequenceNumber();if(t===null)return;let r=await this.generateNextTransaction(this.account,t);if(!r)return;let i=ri({aptosConfig:this.aptosConfig,transaction:r,signer:this.account});await this.outstandingTransactions.enqueue([i,t])}}catch(t){if(t instanceof Cn)return;throw new Error(`Submit transaction failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async processTransactions(){try{for(;;){let t=[],r=[],[i,o]=await this.outstandingTransactions.dequeue();for(t.push(i),r.push(o);!this.outstandingTransactions.isEmpty();)[i,o]=await this.outstandingTransactions.dequeue(),t.push(i),r.push(o);let s=await Promise.allSettled(t);for(let a=0;a<s.length&&a<r.length;a+=1){let c=s[a];o=r[a],c.status===Vc?(this.sentTransactions.push([c.value.hash,o,null]),this.emit("transactionSent",{message:`transaction hash ${c.value.hash} has been committed to chain`,transactionHash:c.value.hash}),await this.checkTransaction(c,o)):(this.sentTransactions.push([c.status,o,c.reason]),this.emit("transactionSendFailed",{message:`failed to commit transaction ${this.sentTransactions.length} with error ${c.reason}`,error:c.reason}))}this.emit("executionFinish",{message:`execute ${s.length} transactions finished`})}}catch(t){if(t instanceof Cn)return;throw new Error(`Process execution failed for ${this.account.accountAddress.toString()} with error ${t}`)}}async checkTransaction(t,r){try{let i=[];i.push(Pn({aptosConfig:this.aptosConfig,transactionHash:t.value.hash}));let o=await Promise.allSettled(i);for(let s=0;s<o.length;s+=1){let a=o[s];a.status===Vc?(this.executedTransactions.push([a.value.hash,r,null]),this.emit("transactionExecuted",{message:`transaction hash ${a.value.hash} has been executed on chain`,transactionHash:t.value.hash})):(this.executedTransactions.push([a.status,r,a.reason]),this.emit("transactionExecutionFailed",{message:`failed to execute transaction ${this.executedTransactions.length} with error ${a.reason}`,error:a.reason}))}}catch(i){throw new Error(`Check transaction failed for ${this.account.accountAddress.toString()} with error ${i}`)}}async push(t,r){this.transactionsQueue.enqueue([t,r])}async generateNextTransaction(t,r){if(this.transactionsQueue.isEmpty())return;let[i,o]=await this.transactionsQueue.dequeue();return T({aptosConfig:this.aptosConfig,sender:t.accountAddress,data:i,options:{...o,accountSequenceNumber:r,replayProtectionNonce:void 0}})}async run(){try{for(;!this.taskQueue.isCancelled();)await(await this.taskQueue.dequeue())()}catch(t){throw new Error(`Unable to start transaction batching: ${t}`)}}start(){if(this.started)throw new Error("worker has already started");this.started=!0,this.taskQueue.enqueue(()=>this.submitNextTransaction()),this.taskQueue.enqueue(()=>this.processTransactions()),this.run()}stop(){if(this.taskQueue.isCancelled())throw new Error("worker has already stopped");this.started=!1,this.taskQueue.cancel()}};var gi=class extends _eventemitter32.default{constructor(e){super(),this.config=e}start(e){let{sender:t}=e;this.account=t,this.transactionWorker=new li(this.config,t),this.transactionWorker.start(),this.registerToEvents()}push(e){let{data:t,options:r}=e;for(let i of t)this.transactionWorker.push(i,r)}registerToEvents(){this.transactionWorker.on("transactionSent",async e=>{this.emit("transactionSent",e)}),this.transactionWorker.on("transactionSendFailed",async e=>{this.emit("transactionSendFailed",e)}),this.transactionWorker.on("transactionExecuted",async e=>{this.emit("transactionExecuted",e)}),this.transactionWorker.on("transactionExecutionFailed",async e=>{this.emit("transactionExecutionFailed",e)}),this.transactionWorker.on("executionFinish",async e=>{this.emit("executionFinish",e)})}forSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.start({sender:t}),this.push({data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}};var sr=class{constructor(e){this.config=e,this.build=new ui(this.config),this.simulate=new xn(this.config),this.submit=new di(this.config),this.batch=new gi(this.config)}async getTransactions(e){return Wi({aptosConfig:this.config,...e})}async getTransactionByVersion(e){return ca({aptosConfig:this.config,...e})}async getTransactionByHash(e){return Wn({aptosConfig:this.config,...e})}async isPendingTransaction(e){return ua({aptosConfig:this.config,...e})}async waitForTransaction(e){return Pn({aptosConfig:this.config,...e})}async getGasPriceEstimation(){return Wr({aptosConfig:this.config})}getSigningMessage(e){return Ia(e)}async publishPackageTransaction(e){return va({aptosConfig:this.config,...e})}async rotateAuthKey(e){return Ma({aptosConfig:this.config,...e})}async rotateAuthKeyUnverified(e){return Va({aptosConfig:this.config,...e})}sign(e){return ti({...e})}signAsFeePayer(e){return ni({...e})}async batchTransactionsForSingleAccount(e){try{let{sender:t,data:r,options:i}=e;this.batch.forSingleAccount({sender:t,data:r,options:i})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(e){return ri({aptosConfig:this.config,...e})}async signAndSubmitAsFeePayer(e){return xa({aptosConfig:this.config,...e})}};var ar=class{constructor(e){this.config=e}async getTableItem(e){return qr({aptosConfig:this.config,...e})}async getTableItemsData(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),sa({aptosConfig:this.config,...e})}async getTableItemsMetadata(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),aa({aptosConfig:this.config,...e})}};async function yi(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,uidKey:i="sub",derivationPath:o}=n,s={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,epk_blinder:_chunkHO5ESTN4js.v.fromHexInput(r.blinder).toStringWithoutPrefix(),uid_key:i,derivation_path:o},{data:a}=await Es({aptosConfig:e,path:"fetch",body:s,originMethod:"getPepper",overrides:{WITH_CREDENTIALS:!1}});return _chunkHO5ESTN4js.v.fromHexInput(a.pepper).toUint8Array()}async function To(n){let{aptosConfig:e,jwt:t,ephemeralKeyPair:r,pepper:i=await yi(n),uidKey:o="sub",maxExpHorizonSecs:s=(await rn({aptosConfig:e})).maxExpHorizonSecs}=n;if(_chunkHO5ESTN4js.v.fromHexInput(i).toUint8Array().length!==Ce.PEPPER_LENGTH)throw new Error(`Pepper needs to be ${Ce.PEPPER_LENGTH} bytes`);let a=_jwtdecode.jwtDecode.call(void 0, t);if(typeof a.iat!="number")throw new Error("iat was not found");if(s<r.expiryDateSecs-a.iat)throw Error(`The EphemeralKeyPair is too long lived. It's lifespan must be less than ${s}`);let c={jwt_b64:t,epk:r.getPublicKey().bcsToHex().toStringWithoutPrefix(),epk_blinder:_chunkHO5ESTN4js.v.fromHexInput(r.blinder).toStringWithoutPrefix(),exp_date_secs:r.expiryDateSecs,exp_horizon_secs:s,pepper:_chunkHO5ESTN4js.v.fromHexInput(i).toStringWithoutPrefix(),uid_key:o},{data:d}=await _s({aptosConfig:e,path:"prove",body:c,originMethod:"getProof",overrides:{WITH_CREDENTIALS:!1}}),m=d.proof,A=new Pt({a:m.a,b:m.b,c:m.c});return new fe({proof:new nn(A,0),trainingWheelsSignature:Le.fromHex(d.training_wheels_signature),expHorizonSecs:s})}async function Lc(n){let{aptosConfig:e,jwt:t,jwkAddress:r,uidKey:i,proofFetchCallback:o,pepper:s=await yi(n)}=n,{verificationKey:a,maxExpHorizonSecs:c}=await rn({aptosConfig:e}),d=To({...n,pepper:s,maxExpHorizonSecs:c}),m=o?d:await d;if(r!==void 0){let g=L.fromJwtAndPepper({jwt:t,pepper:s,jwkAddress:r,uidKey:i}),b=await Jn({aptosConfig:e,authenticationKey:g.authKey().derivedAddress()});return Ve.create({...n,address:b,proof:m,pepper:s,proofFetchCallback:o,jwkAddress:r,verificationKey:a})}let A=K.fromJwtAndPepper({jwt:t,pepper:s,uidKey:i}),p=await Jn({aptosConfig:e,authenticationKey:A.authKey().derivedAddress()});return Ce.create({...n,address:p,proof:m,pepper:s,proofFetchCallback:o,verificationKey:a})}async function qc(n){let{aptosConfig:e,sender:t,iss:r,options:i}=n,{jwksUrl:o}=n;o===void 0&&(bs.test(r)?o="https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com":o=r.endsWith("/")?`${r}.well-known/jwks.json`:`${r}/.well-known/jwks.json`);let s;try{if(s=await fetch(o),!s.ok)throw new Error(`${s.status} ${s.statusText}`)}catch(c){let d;throw c instanceof Error?d=`${c.message}`:d=`error unknown - ${c}`,_.fromErrorType({type:14,details:`Failed to fetch JWKS at ${o}: ${d}`})}let a=await s.json();return T({aptosConfig:e,sender:t.accountAddress,data:{function:"0x1::jwks::update_federated_jwk_set",functionArguments:[r,S.MoveString(a.keys.map(c=>c.kid)),S.MoveString(a.keys.map(c=>c.alg)),S.MoveString(a.keys.map(c=>c.e)),S.MoveString(a.keys.map(c=>c.n))]},options:i})}var cr=class{constructor(e){this.config=e}async getPepper(e){return yi({aptosConfig:this.config,...e})}async getProof(e){return To({aptosConfig:this.config,...e})}async deriveKeylessAccount(e){return Lc({aptosConfig:this.config,...e})}async updateFederatedKeylessJwkSetTransaction(e){return qc({aptosConfig:this.config,...e})}};async function lp(n){let{aptosConfig:e,options:t}=n,r={query:Gr,variables:{where_condition:_optionalChain([t, 'optionalAccess', _262 => _262.where]),offset:_optionalChain([t, 'optionalAccess', _263 => _263.offset]),limit:_optionalChain([t, 'optionalAccess', _264 => _264.limit]),order_by:_optionalChain([t, 'optionalAccess', _265 => _265.orderBy])}};return(await w({aptosConfig:e,query:r,originMethod:"getObjectData"})).current_objects}async function $c(n){let{aptosConfig:e,objectAddress:t,options:r}=n,o={object_address:{_eq:_chunkHO5ESTN4js.na.from(t).toStringLong()}};return(await lp({aptosConfig:e,options:{...r,where:o}}))[0]}var ur=class{constructor(e){this.config=e}async getObjectDataByObjectAddress(e){return await P({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"objects_processor"}),$c({aptosConfig:this.config,...e})}};var re=class{constructor(e){this.config=_nullishCoalesce(e, () => (new si)),this.account=new Xn(this.config),this.abstraction=new Xt(this.config),this.ans=new ir(this.config),this.coin=new Yn(this.config),this.digitalAsset=new Zn(this.config),this.faucet=new er(this.config),this.fungibleAsset=new tr(this.config),this.general=new nr(this.config),this.staking=new or(this.config),this.transaction=new sr(this.config),this.table=new ar(this.config),this.keyless=new cr(this.config),this.object=new ur(this.config)}setIgnoreTransactionSubmitter(e){this.config.setIgnoreTransactionSubmitter(e)}};function ge(n,e,t){Object.getOwnPropertyNames(e.prototype).forEach(r=>{let i=Object.getOwnPropertyDescriptor(e.prototype,r);i&&Object.defineProperty(n.prototype,r,{value:function(...o){return this[t][r](...o)},writable:i.writable,configurable:i.configurable,enumerable:i.enumerable})})}ge(re,Xn,"account");ge(re,Xt,"abstraction");ge(re,ir,"ans");ge(re,Yn,"coin");ge(re,Zn,"digitalAsset");ge(re,Event,"event");ge(re,er,"faucet");ge(re,tr,"fungibleAsset");ge(re,nr,"general");ge(re,or,"staking");ge(re,sr,"transaction");ge(re,ar,"table");ge(re,cr,"keyless");ge(re,ur,"object");exports.ACCOUNT_ABSTRACTION_SIGNING_DATA_SALT = hs; exports.APTOS_BIP44_REGEX = cu; exports.APTOS_COIN = Rt; exports.APTOS_FA = fs; exports.APTOS_HARDENED_REGEX = au; exports.AbstractKeylessAccount = we; exports.AbstractMultiKey = Oe; exports.AbstractPublicKey = yr; exports.AbstractSignature = Un; exports.AbstractedAccount = Or; exports.Account = gt; exports.AccountAbstractionMessage = xr; exports.AccountAddress = _chunkHO5ESTN4js.na; exports.AccountAuthenticator = ee; exports.AccountAuthenticatorAbstraction = kt; exports.AccountAuthenticatorEd25519 = Ge; exports.AccountAuthenticatorMultiEd25519 = ot; exports.AccountAuthenticatorMultiKey = Je; exports.AccountAuthenticatorNoAccountAuthenticator = pn; exports.AccountAuthenticatorSingleKey = ue; exports.AccountAuthenticatorVariant = _chunkHO5ESTN4js.L; exports.AccountPublicKey = ae; exports.AccountSequenceNumber = pi; exports.AccountUtils = Ns; exports.AddressInvalidReason = _chunkHO5ESTN4js.ma; exports.AnyPublicKey = I; exports.AnyPublicKeyVariant = _chunkHO5ESTN4js.N; exports.AnySignature = B; exports.AnySignatureVariant = _chunkHO5ESTN4js.P; exports.Aptos = re; exports.AptosApiError = Ee; exports.AptosApiType = en; exports.AptosConfig = si; exports.AuthenticationKey = V; exports.Bool = F; exports.CKDPriv = ss; exports.ChainId = ln; exports.DEFAULT_MAX_GAS_AMOUNT = ys; exports.DEFAULT_TXN_EXP_SEC_FROM_NOW = ms; exports.DEFAULT_TXN_TIMEOUT_SEC = Ar; exports.DerivableAbstractedAccount = Fs; exports.DeriveScheme = _chunkHO5ESTN4js.la; exports.Deserializer = C; exports.EPK_HORIZON_SECS = Mu; exports.Ed25519Account = oe; exports.Ed25519PrivateKey = J; exports.Ed25519PublicKey = E; exports.Ed25519Signature = R; exports.EntryFunction = dt; exports.EntryFunctionBytes = gr; exports.EphemeralCertificate = tn; exports.EphemeralCertificateVariant = _chunkHO5ESTN4js.S; exports.EphemeralKeyPair = jt; exports.EphemeralPublicKey = Tt; exports.EphemeralPublicKeyVariant = _chunkHO5ESTN4js.Q; exports.EphemeralSignature = Le; exports.EphemeralSignatureVariant = _chunkHO5ESTN4js.R; exports.FIREBASE_AUTH_ISS_PATTERN = bs; exports.FederatedKeylessAccount = Ve; exports.FederatedKeylessPublicKey = L; exports.FeePayerRawTransaction = qt; exports.FixedBytes = Re; exports.Groth16ProofAndStatement = Ui; exports.Groth16VerificationKey = ki; exports.Groth16Zkp = Pt; exports.HARDENED_OFFSET = rs; exports.Hex = _chunkHO5ESTN4js.v; exports.HexInvalidReason = _chunkHO5ESTN4js.u; exports.I128 = es; exports.I16 = Xo; exports.I256 = ts; exports.I32 = Yo; exports.I64 = Zo; exports.I8 = Jo; exports.Identifier = k; exports.KeyType = uu; exports.KeylessAccount = Ce; exports.KeylessConfiguration = zi; exports.KeylessError = _; exports.KeylessErrorCategory = zu; exports.KeylessErrorResolutionTip = ku; exports.KeylessErrorType = hr; exports.KeylessPublicKey = K; exports.KeylessSignature = ce; exports.MAX_AUD_VAL_BYTES = Ki; exports.MAX_COMMITED_EPK_BYTES = Wu; exports.MAX_EXTRA_FIELD_BYTES = qu; exports.MAX_ISS_VAL_BYTES = Lu; exports.MAX_JWT_HEADER_B64_BYTES = $u; exports.MAX_UID_KEY_BYTES = Vu; exports.MAX_UID_VAL_BYTES = Hu; exports.MimeType = _chunkHO5ESTN4js.C; exports.ModuleId = Gn; exports.MoveAbility = _chunkHO5ESTN4js.ha; exports.MoveFunctionVisibility = _chunkHO5ESTN4js.ga; exports.MoveJWK = Ni; exports.MoveOption = ne; exports.MoveString = v; exports.MoveVector = S; exports.MultiAgentRawTransaction = Lt; exports.MultiAgentTransaction = kr; exports.MultiEd25519Account = qn; exports.MultiEd25519PublicKey = ie; exports.MultiEd25519Signature = Be; exports.MultiKey = W; exports.MultiKeyAccount = yt; exports.MultiKeySignature = Ie; exports.MultiSig = Mn; exports.MultiSigTransactionPayload = Vn; exports.Network = Ei; exports.NetworkToChainId = _i; exports.NetworkToFaucetAPI = gs; exports.NetworkToIndexerAPI = ps; exports.NetworkToNetworkName = lg; exports.NetworkToNodeAPI = ls; exports.NetworkToPepperAPI = Si; exports.NetworkToProverAPI = Pi; exports.ParsingError = _chunkHO5ESTN4js.t; exports.PrivateKey = Pe; exports.PrivateKeyVariants = _chunkHO5ESTN4js.M; exports.ProcessorType = wt; exports.PublicKey = et; exports.RAW_TRANSACTION_SALT = As; exports.RAW_TRANSACTION_WITH_DATA_SALT = Ii; exports.RawTransaction = ve; exports.RawTransactionWithData = Rr; exports.RoleType = _chunkHO5ESTN4js.ia; exports.RotationProofChallenge = Ur; exports.Script = fn; exports.ScriptTransactionArgumentVariants = _chunkHO5ESTN4js.E; exports.Secp256k1PrivateKey = rt; exports.Secp256k1PublicKey = Fe; exports.Secp256k1Signature = it; exports.Secp256r1PrivateKey = Cs; exports.Secp256r1PublicKey = un; exports.Secp256r1Signature = Oi; exports.Serializable = _chunkHO5ESTN4js.x; exports.Serialized = Rn; exports.Serializer = _chunkHO5ESTN4js.y; exports.Signature = O; exports.SignedTransaction = lt; exports.SigningScheme = _chunkHO5ESTN4js.ja; exports.SigningSchemeInput = _chunkHO5ESTN4js.ka; exports.SimpleTransaction = zr; exports.SingleKeyAccount = pe; exports.StructTag = Xe; exports.TransactionAndProof = Dr; exports.TransactionAuthenticator = pt; exports.TransactionAuthenticatorEd25519 = $t; exports.TransactionAuthenticatorFeePayer = Qt; exports.TransactionAuthenticatorMultiAgent = Wt; exports.TransactionAuthenticatorMultiEd25519 = bn; exports.TransactionAuthenticatorSingleSender = It; exports.TransactionAuthenticatorVariant = _chunkHO5ESTN4js.K; exports.TransactionExecutable = An; exports.TransactionExecutableEmpty = Ln; exports.TransactionExecutableEntryFunction = hn; exports.TransactionExecutableScript = Hn; exports.TransactionExecutableVariants = _chunkHO5ESTN4js.H; exports.TransactionExtraConfig = Kr; exports.TransactionExtraConfigV1 = Ht; exports.TransactionExtraConfigVariants = _chunkHO5ESTN4js.I; exports.TransactionInnerPayload = Cr; exports.TransactionInnerPayloadV1 = Vt; exports.TransactionInnerPayloadVariants = _chunkHO5ESTN4js.G; exports.TransactionPayload = _t; exports.TransactionPayloadEntryFunction = yn; exports.TransactionPayloadMultiSig = mn; exports.TransactionPayloadScript = gn; exports.TransactionPayloadVariants = _chunkHO5ESTN4js.F; exports.TransactionResponseType = _chunkHO5ESTN4js.U; exports.TransactionVariants = _chunkHO5ESTN4js.J; exports.TransactionWorker = li; exports.TransactionWorkerEventsEnum = Hc; exports.TypeTag = U; exports.TypeTagAddress = G; exports.TypeTagBool = Q; exports.TypeTagGeneric = M; exports.TypeTagI128 = Bt; exports.TypeTagI16 = Dt; exports.TypeTagI256 = Gt; exports.TypeTagI32 = Ft; exports.TypeTagI64 = Ot; exports.TypeTagI8 = Nt; exports.TypeTagParserError = X; exports.TypeTagParserErrorType = hd; exports.TypeTagReference = vr; exports.TypeTagSigner = Mt; exports.TypeTagStruct = h; exports.TypeTagU128 = ct; exports.TypeTagU16 = st; exports.TypeTagU256 = ut; exports.TypeTagU32 = at; exports.TypeTagU64 = te; exports.TypeTagU8 = de; exports.TypeTagVariants = _chunkHO5ESTN4js.D; exports.TypeTagVector = z; exports.U128 = ke; exports.U16 = Ue; exports.U256 = Se; exports.U32 = ze; exports.U64 = $; exports.U8 = Z; exports.WebAuthnSignature = Bn; exports.ZeroKnowledgeSig = fe; exports.ZkProof = nn; exports.ZkpVariant = _chunkHO5ESTN4js.T; exports.anyPublicKeyVariantToString = _chunkHO5ESTN4js.O; exports.aptosCoinStructTag = KA; exports.aptosRequest = br; exports.base64UrlDecode = _chunkHO5ESTN4js.wa; exports.base64UrlToBytes = _chunkHO5ESTN4js.xa; exports.bigIntToBytesLE = wi; exports.buildTransaction = oo; exports.bytesToBigIntLE = Ct; exports.checkOrConvertArgument = Jt; exports.convertAmountFromHumanReadableToOnChain = _chunkHO5ESTN4js.ya; exports.convertAmountFromOnChainToHumanReadable = _chunkHO5ESTN4js.za; exports.convertArgument = io; exports.convertNumber = jr; exports.convertPayloadToInnerPayload = Cd; exports.createObjectAddress = _chunkHO5ESTN4js.oa; exports.createResourceAddress = _chunkHO5ESTN4js.pa; exports.createTokenAddress = _chunkHO5ESTN4js.ra; exports.createUserDerivedObjectAddress = _chunkHO5ESTN4js.qa; exports.deriveKey = bi; exports.deriveTransactionType = Nr; exports.deserializeFromScriptArgument = rd; exports.deserializePublicKey = Kf; exports.deserializeSignature = Rf; exports.ensureBoolean = _chunkHO5ESTN4js.z; exports.fetchEntryFunctionAbi = Ta; exports.fetchFunctionAbi = ro; exports.fetchJWK = Fi; exports.fetchModuleAbi = Sd; exports.fetchMoveFunctionAbi = IS; exports.fetchViewFunctionAbi = wa; exports.findFirstNonSignerArg = ba; exports.floorToWholeHour = _chunkHO5ESTN4js.va; exports.generateRawTransaction = vd; exports.generateSignedTransaction = so; exports.generateSignedTransactionForSimulation = Pa; exports.generateSigningMessage = Qe; exports.generateSigningMessageForSerializable = Lh; exports.generateSigningMessageForTransaction = Me; exports.generateTransactionPayload = ei; exports.generateTransactionPayloadWithABI = _d; exports.generateUserTransactionHash = ZS; exports.generateViewFunctionPayload = Sa; exports.generateViewFunctionPayloadWithABI = Id; exports.get = Tr; exports.getAptosFullNode = H; exports.getAptosPepperService = Bg; exports.getAuthenticatorForSimulation = En; exports.getErrorMessage = _chunkHO5ESTN4js.ta; exports.getFunctionParts = _chunkHO5ESTN4js.Ca; exports.getIssAudAndUidVal = nt; exports.getKeylessConfig = rn; exports.getKeylessJWKs = Xu; exports.getPageWithObfuscatedCursor = Sr; exports.hashStrToField = qe; exports.hashValues = Ea; exports.hexToAsciiString = _chunkHO5ESTN4js.w; exports.isBcsAddress = Xr; exports.isBcsBool = Qi; exports.isBcsFixedBytes = Td; exports.isBcsString = ji; exports.isBcsU128 = eo; exports.isBcsU16 = Xi; exports.isBcsU256 = to; exports.isBcsU32 = Yi; exports.isBcsU64 = Zi; exports.isBcsU8 = Ji; exports.isBlockEpilogueTransactionResponse = _chunkHO5ESTN4js.$; exports.isBlockMetadataTransactionResponse = _chunkHO5ESTN4js.Y; exports.isBool = ma; exports.isCanonicalEd25519Signature = nd; exports.isEd25519Signature = _chunkHO5ESTN4js.aa; exports.isEmptyOption = fa; exports.isEncodedEntryFunctionArgument = Aa; exports.isEncodedStruct = _chunkHO5ESTN4js.Ba; exports.isFeePayerSignature = _chunkHO5ESTN4js.da; exports.isGenesisTransactionResponse = _chunkHO5ESTN4js.X; exports.isKeylessSigner = Fr; exports.isLargeNumber = Jr; exports.isMultiAgentSignature = _chunkHO5ESTN4js.ca; exports.isMultiEd25519Signature = _chunkHO5ESTN4js.ea; exports.isNumber = bd; exports.isPendingTransactionResponse = _chunkHO5ESTN4js.V; exports.isScriptDataInput = ha; exports.isSecp256k1Signature = _chunkHO5ESTN4js.ba; exports.isSingleKeySigner = Mi; exports.isSingleSenderSignature = _chunkHO5ESTN4js.fa; exports.isStateCheckpointTransactionResponse = _chunkHO5ESTN4js.Z; exports.isString = mt; exports.isUserTransactionResponse = _chunkHO5ESTN4js.W; exports.isValidBIP44Path = is; exports.isValidFunctionInfo = _chunkHO5ESTN4js.Da; exports.isValidHardenedPath = os; exports.isValidatorTransactionResponse = _chunkHO5ESTN4js._; exports.mnemonicToSeed = mr; exports.normalizeBundle = Ts; exports.nowInSeconds = _chunkHO5ESTN4js.ua; exports.objectStructTag = Te; exports.optionStructTag = RA; exports.outOfRangeErrorMessage = _chunkHO5ESTN4js.A; exports.padAndPackBytesWithLen = kn; exports.paginateWithCursor = wr; exports.paginateWithObfuscatedCursor = vi; exports.pairedFaMetadataAddress = _chunkHO5ESTN4js.Fa; exports.parseEncodedStruct = _chunkHO5ESTN4js.Aa; exports.parseJwtHeader = Zu; exports.parseTypeTag = He; exports.poseidonHash = Kt; exports.post = Nn; exports.postAptosFaucet = Ps; exports.postAptosFullNode = St; exports.postAptosIndexer = Ss; exports.postAptosPepperService = Es; exports.postAptosProvingService = _s; exports.promiseFulfilledStatus = Vc; exports.request = Fu; exports.sleep = _chunkHO5ESTN4js.sa; exports.splitPath = as; exports.standardizeTypeTags = Yr; exports.stringStructTag = x; exports.throwTypeMismatch = N; exports.truncateAddress = _chunkHO5ESTN4js.Ea; exports.validateNumberInRange = _chunkHO5ESTN4js.B; exports.verifyKeylessSignature = Di; exports.verifyKeylessSignatureWithJwkAndConfig = Pr;
|
|
482
482
|
//# sourceMappingURL=index.js.map
|