@aptos-labs/ts-sdk 0.0.5 → 0.0.6
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/README.md +3 -3
- package/dist/browser/index.d.ts +340 -288
- package/dist/browser/index.global.js +54 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +340 -288
- package/dist/common/index.js +24 -24
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/{ans.d.ts → ans.d.mts} +33 -33
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +72 -0
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/{aptosConfig.d.ts → aptosConfig.d.mts} +6 -6
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.d.mts +59 -0
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/{digitalAsset.d.ts → digitalAsset.d.mts} +33 -33
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/{faucet.d.ts → faucet.d.mts} +13 -13
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +46 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/{transactionSubmission.d.ts → transactionSubmission.d.mts} +33 -33
- package/dist/esm/api/transactionSubmission.mjs +1 -1
- package/dist/esm/bcs/{consts.d.ts → consts.d.mts} +5 -5
- package/dist/esm/bcs/consts.mjs +1 -1
- package/dist/esm/bcs/{deserializer.d.ts → deserializer.d.mts} +5 -5
- package/dist/esm/bcs/deserializer.mjs +1 -1
- package/dist/esm/bcs/index.d.mts +14 -0
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/{entryFunctionBytes.d.ts → entryFunctionBytes.d.mts} +11 -11
- package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{fixedBytes.d.ts → fixedBytes.d.mts} +10 -10
- package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
- package/dist/esm/bcs/serializable/{movePrimitives.d.ts → movePrimitives.d.mts} +10 -10
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/{moveStructs.d.ts → moveStructs.d.mts} +11 -11
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/bcs/{serializer.d.ts → serializer.d.mts} +7 -7
- package/dist/esm/bcs/serializer.mjs +1 -1
- package/dist/esm/{chunk-WVMDCC4V.mjs → chunk-2W744GUN.mjs} +2 -2
- package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-2W744GUN.mjs.map} +1 -1
- package/dist/esm/chunk-3JVGSFHP.mjs +2 -0
- package/dist/esm/chunk-3JVGSFHP.mjs.map +1 -0
- package/dist/esm/chunk-44MGBJ73.mjs +2 -0
- package/dist/esm/{chunk-CZZJAR3B.mjs.map → chunk-44MGBJ73.mjs.map} +1 -1
- package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
- package/dist/esm/{chunk-7AQXAH6Q.mjs.map → chunk-4ADA5BE7.mjs.map} +1 -1
- package/dist/esm/{chunk-KYWYIK5P.mjs → chunk-4RVIA63I.mjs} +2 -2
- package/dist/esm/chunk-4RVIA63I.mjs.map +1 -0
- package/dist/esm/chunk-62SCW5NH.mjs +2 -0
- package/dist/esm/{chunk-YS2OX7AB.mjs.map → chunk-62SCW5NH.mjs.map} +1 -1
- package/dist/esm/{chunk-MIBLZSNS.mjs → chunk-7MNEEVXY.mjs} +2 -2
- package/dist/esm/chunk-7MNEEVXY.mjs.map +1 -0
- package/dist/esm/{chunk-KPESAXVI.mjs → chunk-AAIBCWZY.mjs} +2 -2
- package/dist/esm/{chunk-N6XWY4UT.mjs → chunk-ARVSIDVB.mjs} +1 -1
- package/dist/esm/{chunk-N6XWY4UT.mjs.map → chunk-ARVSIDVB.mjs.map} +1 -1
- package/dist/esm/{chunk-IXMH6AXJ.mjs → chunk-BFSEVKNA.mjs} +2 -2
- package/dist/esm/chunk-BP5ZO7NK.mjs +2 -0
- package/dist/esm/{chunk-FHJ7F7Z6.mjs.map → chunk-BP5ZO7NK.mjs.map} +1 -1
- package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
- package/dist/esm/{chunk-V6AAQLLJ.mjs.map → chunk-BPYLPPEQ.mjs.map} +1 -1
- package/dist/esm/{chunk-3OJN4I42.mjs → chunk-BV4OOU5Y.mjs} +2 -2
- package/dist/esm/{chunk-3OJN4I42.mjs.map → chunk-BV4OOU5Y.mjs.map} +1 -1
- package/dist/esm/{chunk-VAGYTPSI.mjs → chunk-BWMNPUTK.mjs} +2 -2
- package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
- package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
- package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-EGOYLZBU.mjs} +2 -2
- package/dist/esm/chunk-EGOYLZBU.mjs.map +1 -0
- package/dist/esm/chunk-EQ5BEDJ7.mjs +2 -0
- package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-EQ5BEDJ7.mjs.map} +1 -1
- package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
- package/dist/esm/{chunk-LAXIJRYU.mjs.map → chunk-EWTHPMEE.mjs.map} +1 -1
- package/dist/esm/chunk-EYXHVA6W.mjs +2 -0
- package/dist/esm/chunk-EYXHVA6W.mjs.map +1 -0
- package/dist/esm/chunk-GEFQFRL3.mjs +2 -0
- package/dist/esm/chunk-GEFQFRL3.mjs.map +1 -0
- package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
- package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
- package/dist/esm/{chunk-27P7PELS.mjs → chunk-HA6JD5R6.mjs} +2 -2
- package/dist/esm/{chunk-27P7PELS.mjs.map → chunk-HA6JD5R6.mjs.map} +1 -1
- package/dist/esm/chunk-HVADSXTB.mjs +2 -0
- package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
- package/dist/esm/{chunk-Z56AKXJ7.mjs → chunk-IG5CHHSI.mjs} +2 -2
- package/dist/esm/chunk-IXMB2GOK.mjs +2 -0
- package/dist/esm/chunk-IXMB2GOK.mjs.map +1 -0
- package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-J5ZFOJN2.mjs} +2 -2
- package/dist/esm/chunk-J5ZFOJN2.mjs.map +1 -0
- package/dist/esm/chunk-JDS7K2WI.mjs +2 -0
- package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-JDS7K2WI.mjs.map} +1 -1
- package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
- package/dist/esm/{chunk-WGXAIQ7K.mjs.map → chunk-JZNLZMUC.mjs.map} +1 -1
- package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
- package/dist/esm/{chunk-UQIOMAXE.mjs.map → chunk-KQXRH5FK.mjs.map} +1 -1
- package/dist/esm/{chunk-2B5QXKPU.mjs → chunk-NGCFPQ22.mjs} +2 -2
- package/dist/esm/chunk-NGCFPQ22.mjs.map +1 -0
- package/dist/esm/chunk-NTD3H2S4.mjs +2 -0
- package/dist/esm/chunk-NTD3H2S4.mjs.map +1 -0
- package/dist/esm/{chunk-KFP7MDSD.mjs → chunk-NYFVEKF6.mjs} +2 -2
- package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
- package/dist/esm/{chunk-HH5RSP2H.mjs.map → chunk-NZIJV4O2.mjs.map} +1 -1
- package/dist/esm/{chunk-TXUMB5ZO.mjs → chunk-P32MY5YF.mjs} +2 -2
- package/dist/esm/{chunk-TXUMB5ZO.mjs.map → chunk-P32MY5YF.mjs.map} +1 -1
- package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-Q6N6QACD.mjs} +2 -2
- package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-Q6N6QACD.mjs.map} +1 -1
- package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
- package/dist/esm/{chunk-IPJKGHQY.mjs.map → chunk-QWVR4RCV.mjs.map} +1 -1
- package/dist/esm/chunk-R26XML3D.mjs +2 -0
- package/dist/esm/chunk-R26XML3D.mjs.map +1 -0
- package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
- package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
- package/dist/esm/chunk-RYETO74W.mjs +2 -0
- package/dist/esm/{chunk-BIUGRAMO.mjs.map → chunk-RYETO74W.mjs.map} +1 -1
- package/dist/esm/chunk-S36IYY6K.mjs +2 -0
- package/dist/esm/{chunk-DXUIJ6KA.mjs.map → chunk-S36IYY6K.mjs.map} +1 -1
- package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
- package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
- package/dist/esm/{chunk-O243HOP3.mjs → chunk-TQD4IGUM.mjs} +2 -2
- package/dist/esm/chunk-TQD4IGUM.mjs.map +1 -0
- package/dist/esm/chunk-U25N2VWA.mjs +2 -0
- package/dist/esm/{chunk-FNB6CFQR.mjs.map → chunk-U25N2VWA.mjs.map} +1 -1
- package/dist/esm/chunk-U3LO2FSJ.mjs +2 -0
- package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-U3LO2FSJ.mjs.map} +1 -1
- package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
- package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
- package/dist/esm/{chunk-EKAOAGNQ.mjs → chunk-UAAI3NCA.mjs} +2 -2
- package/dist/esm/chunk-UNQNACJT.mjs +2 -0
- package/dist/esm/chunk-UPLWWSB4.mjs +2 -0
- package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-UPLWWSB4.mjs.map} +1 -1
- package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-V45RFKH7.mjs} +2 -2
- package/dist/esm/chunk-V45RFKH7.mjs.map +1 -0
- package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-VMQWW5UT.mjs} +2 -2
- package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-VMQWW5UT.mjs.map} +1 -1
- package/dist/esm/chunk-VOYW2TZW.mjs +2 -0
- package/dist/esm/{chunk-KJDY66XF.mjs.map → chunk-VOYW2TZW.mjs.map} +1 -1
- package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
- package/dist/esm/{chunk-BREUBEPM.mjs.map → chunk-VWVEDCBM.mjs.map} +1 -1
- package/dist/esm/{chunk-ZT2A5ABR.mjs → chunk-VYAVLUPJ.mjs} +2 -2
- package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-VYAVLUPJ.mjs.map} +1 -1
- package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-WKY5ENCK.mjs} +2 -2
- package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-WKY5ENCK.mjs.map} +1 -1
- package/dist/esm/{chunk-BTK34A5U.mjs → chunk-WX43AJTD.mjs} +10 -10
- package/dist/esm/chunk-WX43AJTD.mjs.map +1 -0
- package/dist/esm/chunk-X32O46IB.mjs +2 -0
- package/dist/esm/{chunk-PDLUCVJB.mjs.map → chunk-X32O46IB.mjs.map} +1 -1
- package/dist/esm/chunk-Y5DJPHJT.mjs +2 -0
- package/dist/esm/chunk-Y5DJPHJT.mjs.map +1 -0
- package/dist/esm/{chunk-GUT3G5CG.mjs → chunk-Y7VR7X5W.mjs} +2 -2
- package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
- package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
- package/dist/esm/{chunk-UVGCVCNG.mjs.map → chunk-YYRDFZE6.mjs.map} +1 -1
- package/dist/esm/chunk-Z2UDRTHA.mjs +2 -0
- package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-Z2UDRTHA.mjs.map} +1 -1
- package/dist/esm/{chunk-XNFEUXDS.mjs → chunk-ZWH2ESXT.mjs} +1 -1
- package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
- package/dist/esm/client/{core.d.ts → core.d.mts} +9 -9
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/{get.d.ts → get.d.mts} +12 -12
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.d.mts +11 -0
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/{post.d.ts → post.d.mts} +14 -14
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/client/{types.d.ts → types.d.mts} +5 -5
- package/dist/esm/client/types.mjs +1 -1
- package/dist/esm/core/{account.d.ts → account.d.mts} +13 -13
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/{accountAddress.d.ts → accountAddress.d.mts} +11 -11
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/{authenticationKey.d.ts → authenticationKey.d.mts} +12 -12
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/{common.d.ts → common.d.mts} +1 -1
- package/dist/esm/core/common.mjs +1 -1
- package/dist/esm/core/crypto/{anyPublicKey.d.ts → anyPublicKey.d.mts} +11 -11
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/{anySignature.d.ts → anySignature.d.mts} +10 -10
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/{asymmetricCrypto.d.ts → asymmetricCrypto.d.mts} +8 -8
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/{ed25519.d.ts → ed25519.d.mts} +10 -10
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/{hdKey.d.ts → hdKey.d.mts} +1 -1
- package/dist/esm/core/crypto/hdKey.mjs +1 -1
- package/dist/esm/core/crypto/index.d.mts +17 -0
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/{multiEd25519.d.ts → multiEd25519.d.mts} +11 -11
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/{multiKey.d.ts → multiKey.d.mts} +12 -12
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/{secp256k1.d.ts → secp256k1.d.mts} +10 -10
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/{hex.d.ts → hex.d.mts} +6 -6
- package/dist/esm/core/hex.mjs +1 -1
- package/dist/esm/core/index.d.mts +21 -0
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/{index.d.ts → index.d.mts} +60 -60
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/{account.d.ts → account.d.mts} +17 -17
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/{ans.d.ts → ans.d.mts} +32 -32
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.d.mts +43 -0
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/{digitalAsset.d.ts → digitalAsset.d.mts} +32 -32
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/{event.d.ts → event.d.mts} +14 -14
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.d.mts +29 -0
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/{general.d.ts → general.d.mts} +11 -11
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/{staking.d.ts → staking.d.mts} +13 -13
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/{transaction.d.ts → transaction.d.mts} +7 -7
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/{transactionSubmission.d.ts → transactionSubmission.d.mts} +32 -32
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/{account.d.ts → account.d.mts} +15 -15
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.d.mts +19 -0
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/{transaction.d.ts → transaction.d.mts} +18 -18
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/{index.d.ts → index.d.mts} +39 -39
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/chainId.d.mts +21 -0
- package/dist/esm/transactions/instances/chainId.mjs +1 -1
- package/dist/esm/transactions/instances/{identifier.d.ts → identifier.d.mts} +9 -9
- package/dist/esm/transactions/instances/identifier.mjs +1 -1
- package/dist/esm/transactions/instances/index.d.mts +29 -0
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/{moduleId.d.ts → moduleId.d.mts} +12 -12
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/{rawTransaction.d.ts → rawTransaction.d.mts} +16 -16
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{rotationProofChallenge.d.ts → rotationProofChallenge.d.mts} +14 -14
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/{signedTransaction.d.ts → signedTransaction.d.mts} +25 -25
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/{transactionArgument.d.ts → transactionArgument.d.mts} +8 -8
- package/dist/esm/transactions/instances/{transactionPayload.d.ts → transactionPayload.d.mts} +14 -14
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{helpers.d.ts → helpers.d.mts} +31 -31
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/{transactionBuilder.d.ts → transactionBuilder.d.mts} +33 -35
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/{index.d.ts → index.d.mts} +12 -12
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/{parser.d.ts → parser.d.mts} +14 -13
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/{types.d.ts → types.d.mts} +49 -60
- package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +78 -78
- package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +31 -31
- package/dist/esm/types/generated/queries.mjs +1 -1
- package/dist/esm/types/generated/{types.d.ts → types.d.mts} +3184 -3146
- package/dist/esm/types/generated/types.mjs +1 -1
- package/dist/esm/types/generated/types.mjs.map +1 -1
- package/dist/esm/types/{index.d.ts → index.d.mts} +94 -92
- package/dist/esm/types/index.mjs +1 -1
- package/dist/esm/types/indexer.d.mts +62 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/helpers.mjs +1 -1
- package/dist/esm/utils/index.d.mts +2 -0
- package/dist/esm/utils/index.mjs +2 -0
- package/dist/esm/utils/index.mjs.map +1 -0
- package/dist/esm/utils/memoize.mjs +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +30 -30
- package/src/api/account.ts +2 -2
- package/src/api/coin.ts +2 -2
- package/src/api/event.ts +2 -2
- package/src/api/general.ts +4 -4
- package/src/api/transactionSubmission.ts +7 -2
- package/src/client/core.ts +1 -1
- package/src/client/get.ts +6 -2
- package/src/client/post.ts +12 -4
- package/src/index.ts +1 -1
- package/src/internal/account.ts +2 -2
- package/src/internal/ans.ts +2 -2
- package/src/internal/coin.ts +2 -2
- package/src/internal/event.ts +2 -2
- package/src/internal/general.ts +7 -6
- package/src/internal/transactionSubmission.ts +41 -9
- package/src/transactions/transactionBuilder/helpers.ts +2 -2
- package/src/transactions/transactionBuilder/transactionBuilder.ts +15 -16
- package/src/transactions/typeTag/parser.ts +10 -2
- package/src/transactions/types.ts +3 -12
- package/src/types/generated/operations.ts +33 -33
- package/src/types/generated/queries.ts +22 -22
- package/src/types/generated/types.ts +2253 -2251
- package/src/types/index.ts +16 -10
- package/src/utils/index.ts +2 -0
- package/dist/esm/api/aptos.d.ts +0 -72
- package/dist/esm/api/coin.d.ts +0 -59
- package/dist/esm/api/index.d.ts +0 -46
- package/dist/esm/bcs/index.d.ts +0 -14
- package/dist/esm/chunk-2444YR3Y.mjs +0 -2
- package/dist/esm/chunk-2444YR3Y.mjs.map +0 -1
- package/dist/esm/chunk-2B5QXKPU.mjs.map +0 -1
- package/dist/esm/chunk-2MQZUGO6.mjs.map +0 -1
- package/dist/esm/chunk-3YOV42H5.mjs +0 -2
- package/dist/esm/chunk-3YOV42H5.mjs.map +0 -1
- package/dist/esm/chunk-7AIV5FEN.mjs +0 -2
- package/dist/esm/chunk-7AIV5FEN.mjs.map +0 -1
- package/dist/esm/chunk-7AQXAH6Q.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs +0 -2
- package/dist/esm/chunk-7TL2MY2B.mjs.map +0 -1
- package/dist/esm/chunk-ADR4XQPR.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs +0 -2
- package/dist/esm/chunk-AY2HWVDO.mjs.map +0 -1
- package/dist/esm/chunk-BIUGRAMO.mjs +0 -2
- package/dist/esm/chunk-BREUBEPM.mjs +0 -2
- package/dist/esm/chunk-BTK34A5U.mjs.map +0 -1
- package/dist/esm/chunk-CZZJAR3B.mjs +0 -2
- package/dist/esm/chunk-DXUIJ6KA.mjs +0 -2
- package/dist/esm/chunk-E72CFUU4.mjs +0 -2
- package/dist/esm/chunk-FHJ7F7Z6.mjs +0 -2
- package/dist/esm/chunk-FNB6CFQR.mjs +0 -2
- package/dist/esm/chunk-GUT3G5CG.mjs.map +0 -1
- package/dist/esm/chunk-HH5RSP2H.mjs +0 -2
- package/dist/esm/chunk-IPJKGHQY.mjs +0 -2
- package/dist/esm/chunk-IZHPCZE3.mjs +0 -2
- package/dist/esm/chunk-J3QOSJFP.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs +0 -2
- package/dist/esm/chunk-J5OKXARS.mjs.map +0 -1
- package/dist/esm/chunk-JTGGMXB7.mjs +0 -2
- package/dist/esm/chunk-KJDY66XF.mjs +0 -2
- package/dist/esm/chunk-KNLMUSIO.mjs +0 -2
- package/dist/esm/chunk-KWJ6XKNF.mjs +0 -2
- package/dist/esm/chunk-KYWYIK5P.mjs.map +0 -1
- package/dist/esm/chunk-LAXIJRYU.mjs +0 -2
- package/dist/esm/chunk-LU6VS7PJ.mjs +0 -2
- package/dist/esm/chunk-MIBLZSNS.mjs.map +0 -1
- package/dist/esm/chunk-NKTKHC3Z.mjs +0 -2
- package/dist/esm/chunk-NKTKHC3Z.mjs.map +0 -1
- package/dist/esm/chunk-O243HOP3.mjs.map +0 -1
- package/dist/esm/chunk-PDLUCVJB.mjs +0 -2
- package/dist/esm/chunk-SJLO3JIH.mjs +0 -2
- package/dist/esm/chunk-TYHBYRUA.mjs.map +0 -1
- package/dist/esm/chunk-UQIOMAXE.mjs +0 -2
- package/dist/esm/chunk-UVGCVCNG.mjs +0 -2
- package/dist/esm/chunk-V6AAQLLJ.mjs +0 -2
- package/dist/esm/chunk-WGXAIQ7K.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs +0 -2
- package/dist/esm/chunk-WNEZCERQ.mjs.map +0 -1
- package/dist/esm/chunk-XFSL7O6Q.mjs.map +0 -1
- package/dist/esm/chunk-YS2OX7AB.mjs +0 -2
- package/dist/esm/chunk-ZXJ5ZBTL.mjs +0 -2
- package/dist/esm/client/index.d.ts +0 -11
- package/dist/esm/core/crypto/index.d.ts +0 -17
- package/dist/esm/core/index.d.ts +0 -21
- package/dist/esm/internal/coin.d.ts +0 -43
- package/dist/esm/internal/faucet.d.ts +0 -29
- package/dist/esm/transactions/authenticator/index.d.ts +0 -19
- package/dist/esm/transactions/instances/chainId.d.ts +0 -21
- package/dist/esm/transactions/instances/index.d.ts +0 -29
- package/dist/esm/transactions/transactionBuilder/index.d.ts +0 -35
- package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +0 -54
- package/dist/esm/types/indexer.d.ts +0 -62
- /package/dist/esm/{chunk-KPESAXVI.mjs.map → chunk-AAIBCWZY.mjs.map} +0 -0
- /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-BFSEVKNA.mjs.map} +0 -0
- /package/dist/esm/{chunk-VAGYTPSI.mjs.map → chunk-BWMNPUTK.mjs.map} +0 -0
- /package/dist/esm/{chunk-XNFEUXDS.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
- /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
- /package/dist/esm/{chunk-Z56AKXJ7.mjs.map → chunk-IG5CHHSI.mjs.map} +0 -0
- /package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-NYFVEKF6.mjs.map} +0 -0
- /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
- /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-UNQNACJT.mjs.map} +0 -0
- /package/dist/esm/utils/{apiEndpoints.d.ts → apiEndpoints.d.mts} +0 -0
- /package/dist/esm/utils/{const.d.ts → const.d.mts} +0 -0
- /package/dist/esm/utils/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/utils/{memoize.d.ts → memoize.d.mts} +0 -0
- /package/dist/esm/{version.d.ts → version.d.mts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var aptosSDK=(()=>{var Wp=Object.create;var ko=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var Yp=Object.getPrototypeOf,Xp=Object.prototype.hasOwnProperty;var uu=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var fe=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),fu=(r,t)=>{for(var e in t)ko(r,e,{get:t[e],enumerable:!0})},du=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qp(t))!Xp.call(r,o)&&o!==e&&ko(r,o,{get:()=>t[o],enumerable:!(n=cu(t,o))||n.enumerable});return r};var Zi=(r,t,e)=>(e=r!=null?Wp(Yp(r)):{},du(t||!r||!r.__esModule?ko(e,"default",{value:r,enumerable:!0}):e,r)),Zp=r=>du(ko({},"__esModule",{value:!0}),r),Jr=(r,t,e,n)=>{for(var o=n>1?void 0:n?cu(t,e):t,s=r.length-1,a;s>=0;s--)(a=r[s])&&(o=(n?a(t,e,o):a(o))||o);return n&&o&&ko(t,e,o),o};var qu=fe(()=>{});var Lu=fe((Fx,Ds)=>{(function(r){"use strict";var t=function(u){var l,d=new Float64Array(16);if(u)for(l=0;l<u.length;l++)d[l]=u[l];return d},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),c=t([56129,1]),f=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function b(u,l,d,i){u[l]=d>>24&255,u[l+1]=d>>16&255,u[l+2]=d>>8&255,u[l+3]=d&255,u[l+4]=i>>24&255,u[l+5]=i>>16&255,u[l+6]=i>>8&255,u[l+7]=i&255}function I(u,l,d,i,p){var x,A=0;for(x=0;x<p;x++)A|=u[l+x]^d[i+x];return(1&A-1>>>8)-1}function T(u,l,d,i){return I(u,l,d,i,16)}function S(u,l,d,i){return I(u,l,d,i,32)}function R(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;j=j+p|0,X=X+x|0,H=H+A|0,W=W+B|0,Q=Q+N|0,q=q+Y|0,_=_+L|0,v=v+Be|0,P=P+$|0,U=U+re|0,C=C+se|0,k=k+ge|0,ee=ee+he|0,ye=ye+ie|0,xe=xe+ue|0,me=me+ae|0,u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=X>>>0&255,u[5]=X>>>8&255,u[6]=X>>>16&255,u[7]=X>>>24&255,u[8]=H>>>0&255,u[9]=H>>>8&255,u[10]=H>>>16&255,u[11]=H>>>24&255,u[12]=W>>>0&255,u[13]=W>>>8&255,u[14]=W>>>16&255,u[15]=W>>>24&255,u[16]=Q>>>0&255,u[17]=Q>>>8&255,u[18]=Q>>>16&255,u[19]=Q>>>24&255,u[20]=q>>>0&255,u[21]=q>>>8&255,u[22]=q>>>16&255,u[23]=q>>>24&255,u[24]=_>>>0&255,u[25]=_>>>8&255,u[26]=_>>>16&255,u[27]=_>>>24&255,u[28]=v>>>0&255,u[29]=v>>>8&255,u[30]=v>>>16&255,u[31]=v>>>24&255,u[32]=P>>>0&255,u[33]=P>>>8&255,u[34]=P>>>16&255,u[35]=P>>>24&255,u[36]=U>>>0&255,u[37]=U>>>8&255,u[38]=U>>>16&255,u[39]=U>>>24&255,u[40]=C>>>0&255,u[41]=C>>>8&255,u[42]=C>>>16&255,u[43]=C>>>24&255,u[44]=k>>>0&255,u[45]=k>>>8&255,u[46]=k>>>16&255,u[47]=k>>>24&255,u[48]=ee>>>0&255,u[49]=ee>>>8&255,u[50]=ee>>>16&255,u[51]=ee>>>24&255,u[52]=ye>>>0&255,u[53]=ye>>>8&255,u[54]=ye>>>16&255,u[55]=ye>>>24&255,u[56]=xe>>>0&255,u[57]=xe>>>8&255,u[58]=xe>>>16&255,u[59]=xe>>>24&255,u[60]=me>>>0&255,u[61]=me>>>8&255,u[62]=me>>>16&255,u[63]=me>>>24&255}function M(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=q>>>0&255,u[5]=q>>>8&255,u[6]=q>>>16&255,u[7]=q>>>24&255,u[8]=C>>>0&255,u[9]=C>>>8&255,u[10]=C>>>16&255,u[11]=C>>>24&255,u[12]=me>>>0&255,u[13]=me>>>8&255,u[14]=me>>>16&255,u[15]=me>>>24&255,u[16]=_>>>0&255,u[17]=_>>>8&255,u[18]=_>>>16&255,u[19]=_>>>24&255,u[20]=v>>>0&255,u[21]=v>>>8&255,u[22]=v>>>16&255,u[23]=v>>>24&255,u[24]=P>>>0&255,u[25]=P>>>8&255,u[26]=P>>>16&255,u[27]=P>>>24&255,u[28]=U>>>0&255,u[29]=U>>>8&255,u[30]=U>>>16&255,u[31]=U>>>24&255}function E(u,l,d,i){R(u,l,d,i)}function K(u,l,d,i){M(u,l,d,i)}var D=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function F(u,l,d,i,p,x,A){var B=new Uint8Array(16),N=new Uint8Array(64),Y,L;for(L=0;L<16;L++)B[L]=0;for(L=0;L<8;L++)B[L]=x[L];for(;p>=64;){for(E(N,B,A,D),L=0;L<64;L++)u[l+L]=d[i+L]^N[L];for(Y=1,L=8;L<16;L++)Y=Y+(B[L]&255)|0,B[L]=Y&255,Y>>>=8;p-=64,l+=64,i+=64}if(p>0)for(E(N,B,A,D),L=0;L<p;L++)u[l+L]=d[i+L]^N[L];return 0}function J(u,l,d,i,p){var x=new Uint8Array(16),A=new Uint8Array(64),B,N;for(N=0;N<16;N++)x[N]=0;for(N=0;N<8;N++)x[N]=i[N];for(;d>=64;){for(E(A,x,p,D),N=0;N<64;N++)u[l+N]=A[N];for(B=1,N=8;N<16;N++)B=B+(x[N]&255)|0,x[N]=B&255,B>>>=8;d-=64,l+=64}if(d>0)for(E(A,x,p,D),N=0;N<d;N++)u[l+N]=A[N];return 0}function G(u,l,d,i,p){var x=new Uint8Array(32);K(x,i,p,D);for(var A=new Uint8Array(8),B=0;B<8;B++)A[B]=i[B+16];return J(u,l,d,A,x)}function oe(u,l,d,i,p,x,A){var B=new Uint8Array(32);K(B,x,A,D);for(var N=new Uint8Array(8),Y=0;Y<8;Y++)N[Y]=x[Y+16];return F(u,l,d,i,p,N,B)}var de=function(u){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var l,d,i,p,x,A,B,N;l=u[0]&255|(u[1]&255)<<8,this.r[0]=l&8191,d=u[2]&255|(u[3]&255)<<8,this.r[1]=(l>>>13|d<<3)&8191,i=u[4]&255|(u[5]&255)<<8,this.r[2]=(d>>>10|i<<6)&7939,p=u[6]&255|(u[7]&255)<<8,this.r[3]=(i>>>7|p<<9)&8191,x=u[8]&255|(u[9]&255)<<8,this.r[4]=(p>>>4|x<<12)&255,this.r[5]=x>>>1&8190,A=u[10]&255|(u[11]&255)<<8,this.r[6]=(x>>>14|A<<2)&8191,B=u[12]&255|(u[13]&255)<<8,this.r[7]=(A>>>11|B<<5)&8065,N=u[14]&255|(u[15]&255)<<8,this.r[8]=(B>>>8|N<<8)&8191,this.r[9]=N>>>5&127,this.pad[0]=u[16]&255|(u[17]&255)<<8,this.pad[1]=u[18]&255|(u[19]&255)<<8,this.pad[2]=u[20]&255|(u[21]&255)<<8,this.pad[3]=u[22]&255|(u[23]&255)<<8,this.pad[4]=u[24]&255|(u[25]&255)<<8,this.pad[5]=u[26]&255|(u[27]&255)<<8,this.pad[6]=u[28]&255|(u[29]&255)<<8,this.pad[7]=u[30]&255|(u[31]&255)<<8};de.prototype.blocks=function(u,l,d){for(var i=this.fin?0:2048,p,x,A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W=this.h[0],Q=this.h[1],q=this.h[2],_=this.h[3],v=this.h[4],P=this.h[5],U=this.h[6],C=this.h[7],k=this.h[8],ee=this.h[9],ye=this.r[0],xe=this.r[1],me=this.r[2],m=this.r[3],_e=this.r[4],Ce=this.r[5],Ie=this.r[6],we=this.r[7],Se=this.r[8],Ue=this.r[9];d>=16;)p=u[l+0]&255|(u[l+1]&255)<<8,W+=p&8191,x=u[l+2]&255|(u[l+3]&255)<<8,Q+=(p>>>13|x<<3)&8191,A=u[l+4]&255|(u[l+5]&255)<<8,q+=(x>>>10|A<<6)&8191,B=u[l+6]&255|(u[l+7]&255)<<8,_+=(A>>>7|B<<9)&8191,N=u[l+8]&255|(u[l+9]&255)<<8,v+=(B>>>4|N<<12)&8191,P+=N>>>1&8191,Y=u[l+10]&255|(u[l+11]&255)<<8,U+=(N>>>14|Y<<2)&8191,L=u[l+12]&255|(u[l+13]&255)<<8,C+=(Y>>>11|L<<5)&8191,Be=u[l+14]&255|(u[l+15]&255)<<8,k+=(L>>>8|Be<<8)&8191,ee+=Be>>>5|i,$=0,re=$,re+=W*ye,re+=Q*(5*Ue),re+=q*(5*Se),re+=_*(5*we),re+=v*(5*Ie),$=re>>>13,re&=8191,re+=P*(5*Ce),re+=U*(5*_e),re+=C*(5*m),re+=k*(5*me),re+=ee*(5*xe),$+=re>>>13,re&=8191,se=$,se+=W*xe,se+=Q*ye,se+=q*(5*Ue),se+=_*(5*Se),se+=v*(5*we),$=se>>>13,se&=8191,se+=P*(5*Ie),se+=U*(5*Ce),se+=C*(5*_e),se+=k*(5*m),se+=ee*(5*me),$+=se>>>13,se&=8191,ge=$,ge+=W*me,ge+=Q*xe,ge+=q*ye,ge+=_*(5*Ue),ge+=v*(5*Se),$=ge>>>13,ge&=8191,ge+=P*(5*we),ge+=U*(5*Ie),ge+=C*(5*Ce),ge+=k*(5*_e),ge+=ee*(5*m),$+=ge>>>13,ge&=8191,he=$,he+=W*m,he+=Q*me,he+=q*xe,he+=_*ye,he+=v*(5*Ue),$=he>>>13,he&=8191,he+=P*(5*Se),he+=U*(5*we),he+=C*(5*Ie),he+=k*(5*Ce),he+=ee*(5*_e),$+=he>>>13,he&=8191,ie=$,ie+=W*_e,ie+=Q*m,ie+=q*me,ie+=_*xe,ie+=v*ye,$=ie>>>13,ie&=8191,ie+=P*(5*Ue),ie+=U*(5*Se),ie+=C*(5*we),ie+=k*(5*Ie),ie+=ee*(5*Ce),$+=ie>>>13,ie&=8191,ue=$,ue+=W*Ce,ue+=Q*_e,ue+=q*m,ue+=_*me,ue+=v*xe,$=ue>>>13,ue&=8191,ue+=P*ye,ue+=U*(5*Ue),ue+=C*(5*Se),ue+=k*(5*we),ue+=ee*(5*Ie),$+=ue>>>13,ue&=8191,ae=$,ae+=W*Ie,ae+=Q*Ce,ae+=q*_e,ae+=_*m,ae+=v*me,$=ae>>>13,ae&=8191,ae+=P*xe,ae+=U*ye,ae+=C*(5*Ue),ae+=k*(5*Se),ae+=ee*(5*we),$+=ae>>>13,ae&=8191,j=$,j+=W*we,j+=Q*Ie,j+=q*Ce,j+=_*_e,j+=v*m,$=j>>>13,j&=8191,j+=P*me,j+=U*xe,j+=C*ye,j+=k*(5*Ue),j+=ee*(5*Se),$+=j>>>13,j&=8191,X=$,X+=W*Se,X+=Q*we,X+=q*Ie,X+=_*Ce,X+=v*_e,$=X>>>13,X&=8191,X+=P*m,X+=U*me,X+=C*xe,X+=k*ye,X+=ee*(5*Ue),$+=X>>>13,X&=8191,H=$,H+=W*Ue,H+=Q*Se,H+=q*we,H+=_*Ie,H+=v*Ce,$=H>>>13,H&=8191,H+=P*_e,H+=U*m,H+=C*me,H+=k*xe,H+=ee*ye,$+=H>>>13,H&=8191,$=($<<2)+$|0,$=$+re|0,re=$&8191,$=$>>>13,se+=$,W=re,Q=se,q=ge,_=he,v=ie,P=ue,U=ae,C=j,k=X,ee=H,l+=16,d-=16;this.h[0]=W,this.h[1]=Q,this.h[2]=q,this.h[3]=_,this.h[4]=v,this.h[5]=P,this.h[6]=U,this.h[7]=C,this.h[8]=k,this.h[9]=ee},de.prototype.finish=function(u,l){var d=new Uint16Array(10),i,p,x,A;if(this.leftover){for(A=this.leftover,this.buffer[A++]=1;A<16;A++)this.buffer[A]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,A=2;A<10;A++)this.h[A]+=i,i=this.h[A]>>>13,this.h[A]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,d[0]=this.h[0]+5,i=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this.h[A]+i,i=d[A]>>>13,d[A]&=8191;for(d[9]-=1<<13,p=(i^1)-1,A=0;A<10;A++)d[A]&=p;for(p=~p,A=0;A<10;A++)this.h[A]=this.h[A]&p|d[A];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,A=1;A<8;A++)x=(this.h[A]+this.pad[A]|0)+(x>>>16)|0,this.h[A]=x&65535;u[l+0]=this.h[0]>>>0&255,u[l+1]=this.h[0]>>>8&255,u[l+2]=this.h[1]>>>0&255,u[l+3]=this.h[1]>>>8&255,u[l+4]=this.h[2]>>>0&255,u[l+5]=this.h[2]>>>8&255,u[l+6]=this.h[3]>>>0&255,u[l+7]=this.h[3]>>>8&255,u[l+8]=this.h[4]>>>0&255,u[l+9]=this.h[4]>>>8&255,u[l+10]=this.h[5]>>>0&255,u[l+11]=this.h[5]>>>8&255,u[l+12]=this.h[6]>>>0&255,u[l+13]=this.h[6]>>>8&255,u[l+14]=this.h[7]>>>0&255,u[l+15]=this.h[7]>>>8&255},de.prototype.update=function(u,l,d){var i,p;if(this.leftover){for(p=16-this.leftover,p>d&&(p=d),i=0;i<p;i++)this.buffer[this.leftover+i]=u[l+i];if(d-=p,l+=p,this.leftover+=p,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(d>=16&&(p=d-d%16,this.blocks(u,l,p),l+=p,d-=p),d){for(i=0;i<d;i++)this.buffer[this.leftover+i]=u[l+i];this.leftover+=d}};function ce(u,l,d,i,p,x){var A=new de(x);return A.update(d,i,p),A.finish(u,l),0}function Pe(u,l,d,i,p,x){var A=new Uint8Array(16);return ce(A,0,d,i,p,x),T(u,l,A,0)}function Oe(u,l,d,i,p){var x;if(d<32)return-1;for(oe(u,0,l,0,d,i,p),ce(u,16,u,32,d-32,u),x=0;x<16;x++)u[x]=0;return 0}function at(u,l,d,i,p){var x,A=new Uint8Array(32);if(d<32||(G(A,0,32,i,p),Pe(l,16,l,32,d-32,A)!==0))return-1;for(oe(u,0,l,0,d,i,p),x=0;x<32;x++)u[x]=0;return 0}function z(u,l){var d;for(d=0;d<16;d++)u[d]=l[d]|0}function V(u){var l,d,i=1;for(l=0;l<16;l++)d=u[l]+i+65535,i=Math.floor(d/65536),u[l]=d-i*65536;u[0]+=i-1+37*(i-1)}function le(u,l,d){for(var i,p=~(d-1),x=0;x<16;x++)i=p&(u[x]^l[x]),u[x]^=i,l[x]^=i}function Re(u,l){var d,i,p,x=t(),A=t();for(d=0;d<16;d++)A[d]=l[d];for(V(A),V(A),V(A),i=0;i<2;i++){for(x[0]=A[0]-65517,d=1;d<15;d++)x[d]=A[d]-65535-(x[d-1]>>16&1),x[d-1]&=65535;x[15]=A[15]-32767-(x[14]>>16&1),p=x[15]>>16&1,x[14]&=65535,le(A,x,1-p)}for(d=0;d<16;d++)u[2*d]=A[d]&255,u[2*d+1]=A[d]>>8}function ke(u,l){var d=new Uint8Array(32),i=new Uint8Array(32);return Re(d,u),Re(i,l),S(d,0,i,0)}function Ze(u){var l=new Uint8Array(32);return Re(l,u),l[0]&1}function dt(u,l){var d;for(d=0;d<16;d++)u[d]=l[2*d]+(l[2*d+1]<<8);u[15]&=32767}function Me(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]+d[i]}function rt(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]-d[i]}function pe(u,l,d){var i,p,x=0,A=0,B=0,N=0,Y=0,L=0,Be=0,$=0,re=0,se=0,ge=0,he=0,ie=0,ue=0,ae=0,j=0,X=0,H=0,W=0,Q=0,q=0,_=0,v=0,P=0,U=0,C=0,k=0,ee=0,ye=0,xe=0,me=0,m=d[0],_e=d[1],Ce=d[2],Ie=d[3],we=d[4],Se=d[5],Ue=d[6],Je=d[7],ze=d[8],Ve=d[9],We=d[10],Qe=d[11],ot=d[12],lt=d[13],pt=d[14],ht=d[15];i=l[0],x+=i*m,A+=i*_e,B+=i*Ce,N+=i*Ie,Y+=i*we,L+=i*Se,Be+=i*Ue,$+=i*Je,re+=i*ze,se+=i*Ve,ge+=i*We,he+=i*Qe,ie+=i*ot,ue+=i*lt,ae+=i*pt,j+=i*ht,i=l[1],A+=i*m,B+=i*_e,N+=i*Ce,Y+=i*Ie,L+=i*we,Be+=i*Se,$+=i*Ue,re+=i*Je,se+=i*ze,ge+=i*Ve,he+=i*We,ie+=i*Qe,ue+=i*ot,ae+=i*lt,j+=i*pt,X+=i*ht,i=l[2],B+=i*m,N+=i*_e,Y+=i*Ce,L+=i*Ie,Be+=i*we,$+=i*Se,re+=i*Ue,se+=i*Je,ge+=i*ze,he+=i*Ve,ie+=i*We,ue+=i*Qe,ae+=i*ot,j+=i*lt,X+=i*pt,H+=i*ht,i=l[3],N+=i*m,Y+=i*_e,L+=i*Ce,Be+=i*Ie,$+=i*we,re+=i*Se,se+=i*Ue,ge+=i*Je,he+=i*ze,ie+=i*Ve,ue+=i*We,ae+=i*Qe,j+=i*ot,X+=i*lt,H+=i*pt,W+=i*ht,i=l[4],Y+=i*m,L+=i*_e,Be+=i*Ce,$+=i*Ie,re+=i*we,se+=i*Se,ge+=i*Ue,he+=i*Je,ie+=i*ze,ue+=i*Ve,ae+=i*We,j+=i*Qe,X+=i*ot,H+=i*lt,W+=i*pt,Q+=i*ht,i=l[5],L+=i*m,Be+=i*_e,$+=i*Ce,re+=i*Ie,se+=i*we,ge+=i*Se,he+=i*Ue,ie+=i*Je,ue+=i*ze,ae+=i*Ve,j+=i*We,X+=i*Qe,H+=i*ot,W+=i*lt,Q+=i*pt,q+=i*ht,i=l[6],Be+=i*m,$+=i*_e,re+=i*Ce,se+=i*Ie,ge+=i*we,he+=i*Se,ie+=i*Ue,ue+=i*Je,ae+=i*ze,j+=i*Ve,X+=i*We,H+=i*Qe,W+=i*ot,Q+=i*lt,q+=i*pt,_+=i*ht,i=l[7],$+=i*m,re+=i*_e,se+=i*Ce,ge+=i*Ie,he+=i*we,ie+=i*Se,ue+=i*Ue,ae+=i*Je,j+=i*ze,X+=i*Ve,H+=i*We,W+=i*Qe,Q+=i*ot,q+=i*lt,_+=i*pt,v+=i*ht,i=l[8],re+=i*m,se+=i*_e,ge+=i*Ce,he+=i*Ie,ie+=i*we,ue+=i*Se,ae+=i*Ue,j+=i*Je,X+=i*ze,H+=i*Ve,W+=i*We,Q+=i*Qe,q+=i*ot,_+=i*lt,v+=i*pt,P+=i*ht,i=l[9],se+=i*m,ge+=i*_e,he+=i*Ce,ie+=i*Ie,ue+=i*we,ae+=i*Se,j+=i*Ue,X+=i*Je,H+=i*ze,W+=i*Ve,Q+=i*We,q+=i*Qe,_+=i*ot,v+=i*lt,P+=i*pt,U+=i*ht,i=l[10],ge+=i*m,he+=i*_e,ie+=i*Ce,ue+=i*Ie,ae+=i*we,j+=i*Se,X+=i*Ue,H+=i*Je,W+=i*ze,Q+=i*Ve,q+=i*We,_+=i*Qe,v+=i*ot,P+=i*lt,U+=i*pt,C+=i*ht,i=l[11],he+=i*m,ie+=i*_e,ue+=i*Ce,ae+=i*Ie,j+=i*we,X+=i*Se,H+=i*Ue,W+=i*Je,Q+=i*ze,q+=i*Ve,_+=i*We,v+=i*Qe,P+=i*ot,U+=i*lt,C+=i*pt,k+=i*ht,i=l[12],ie+=i*m,ue+=i*_e,ae+=i*Ce,j+=i*Ie,X+=i*we,H+=i*Se,W+=i*Ue,Q+=i*Je,q+=i*ze,_+=i*Ve,v+=i*We,P+=i*Qe,U+=i*ot,C+=i*lt,k+=i*pt,ee+=i*ht,i=l[13],ue+=i*m,ae+=i*_e,j+=i*Ce,X+=i*Ie,H+=i*we,W+=i*Se,Q+=i*Ue,q+=i*Je,_+=i*ze,v+=i*Ve,P+=i*We,U+=i*Qe,C+=i*ot,k+=i*lt,ee+=i*pt,ye+=i*ht,i=l[14],ae+=i*m,j+=i*_e,X+=i*Ce,H+=i*Ie,W+=i*we,Q+=i*Se,q+=i*Ue,_+=i*Je,v+=i*ze,P+=i*Ve,U+=i*We,C+=i*Qe,k+=i*ot,ee+=i*lt,ye+=i*pt,xe+=i*ht,i=l[15],j+=i*m,X+=i*_e,H+=i*Ce,W+=i*Ie,Q+=i*we,q+=i*Se,_+=i*Ue,v+=i*Je,P+=i*ze,U+=i*Ve,C+=i*We,k+=i*Qe,ee+=i*ot,ye+=i*lt,xe+=i*pt,me+=i*ht,x+=38*X,A+=38*H,B+=38*W,N+=38*Q,Y+=38*q,L+=38*_,Be+=38*v,$+=38*P,re+=38*U,se+=38*C,ge+=38*k,he+=38*ee,ie+=38*ye,ue+=38*xe,ae+=38*me,p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),u[0]=x,u[1]=A,u[2]=B,u[3]=N,u[4]=Y,u[5]=L,u[6]=Be,u[7]=$,u[8]=re,u[9]=se,u[10]=ge,u[11]=he,u[12]=ie,u[13]=ue,u[14]=ae,u[15]=j}function nt(u,l){pe(u,l,l)}function Yr(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=253;i>=0;i--)nt(d,d),i!==2&&i!==4&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Vt(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=250;i>=0;i--)nt(d,d),i!==1&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Xr(u,l,d){var i=new Uint8Array(32),p=new Float64Array(80),x,A,B=t(),N=t(),Y=t(),L=t(),Be=t(),$=t();for(A=0;A<31;A++)i[A]=l[A];for(i[31]=l[31]&127|64,i[0]&=248,dt(p,d),A=0;A<16;A++)N[A]=p[A],L[A]=B[A]=Y[A]=0;for(B[0]=L[0]=1,A=254;A>=0;--A)x=i[A>>>3]>>>(A&7)&1,le(B,N,x),le(Y,L,x),Me(Be,B,Y),rt(B,B,Y),Me(Y,N,L),rt(N,N,L),nt(L,Be),nt($,B),pe(B,Y,B),pe(Y,N,Be),Me(Be,B,Y),rt(B,B,Y),nt(N,B),rt(Y,L,$),pe(B,Y,c),Me(B,B,L),pe(Y,Y,B),pe(B,L,$),pe(L,N,p),nt(N,Be),le(B,N,x),le(Y,L,x);for(A=0;A<16;A++)p[A+16]=B[A],p[A+32]=Y[A],p[A+48]=N[A],p[A+64]=L[A];var re=p.subarray(32),se=p.subarray(16);return Yr(re,re),pe(se,se,re),Re(u,se),0}function Mt(u,l){return Xr(u,l,o)}function Tr(u,l){return e(l,32),Mt(u,l)}function Rn(u,l,d){var i=new Uint8Array(32);return Xr(i,d,l),K(u,n,i,D)}var It=Oe,Zr=at;function Jn(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),It(u,l,d,i,A)}function bs(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),Zr(u,l,d,i,A)}var Bo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ru(u,l,d,i){for(var p=new Int32Array(16),x=new Int32Array(16),A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W,Q,q,_,v,P,U,C,k,ee=u[0],ye=u[1],xe=u[2],me=u[3],m=u[4],_e=u[5],Ce=u[6],Ie=u[7],we=l[0],Se=l[1],Ue=l[2],Je=l[3],ze=l[4],Ve=l[5],We=l[6],Qe=l[7],ot=0;i>=128;){for(Q=0;Q<16;Q++)q=8*Q+ot,p[Q]=d[q+0]<<24|d[q+1]<<16|d[q+2]<<8|d[q+3],x[Q]=d[q+4]<<24|d[q+5]<<16|d[q+6]<<8|d[q+7];for(Q=0;Q<80;Q++)if(A=ee,B=ye,N=xe,Y=me,L=m,Be=_e,$=Ce,re=Ie,se=we,ge=Se,he=Ue,ie=Je,ue=ze,ae=Ve,j=We,X=Qe,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(m>>>14|ze<<32-14)^(m>>>18|ze<<32-18)^(ze>>>41-32|m<<32-(41-32)),v=(ze>>>14|m<<32-14)^(ze>>>18|m<<32-18)^(m>>>41-32|ze<<32-(41-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=m&_e^~m&Ce,v=ze&Ve^~ze&We,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=Bo[Q*2],v=Bo[Q*2+1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=p[Q%16],v=x[Q%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,H=C&65535|k<<16,W=P&65535|U<<16,_=H,v=W,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(ee>>>28|we<<32-28)^(we>>>34-32|ee<<32-(34-32))^(we>>>39-32|ee<<32-(39-32)),v=(we>>>28|ee<<32-28)^(ee>>>34-32|we<<32-(34-32))^(ee>>>39-32|we<<32-(39-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=ee&ye^ee&xe^ye&xe,v=we&Se^we&Ue^Se&Ue,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,re=C&65535|k<<16,X=P&65535|U<<16,_=Y,v=ie,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=H,v=W,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,Y=C&65535|k<<16,ie=P&65535|U<<16,ye=A,xe=B,me=N,m=Y,_e=L,Ce=Be,Ie=$,ee=re,Se=se,Ue=ge,Je=he,ze=ie,Ve=ue,We=ae,Qe=j,we=X,Q%16===15)for(q=0;q<16;q++)_=p[q],v=x[q],P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=p[(q+9)%16],v=x[(q+9)%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+1)%16],W=x[(q+1)%16],_=(H>>>1|W<<32-1)^(H>>>8|W<<32-8)^H>>>7,v=(W>>>1|H<<32-1)^(W>>>8|H<<32-8)^(W>>>7|H<<32-7),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+14)%16],W=x[(q+14)%16],_=(H>>>19|W<<32-19)^(W>>>61-32|H<<32-(61-32))^H>>>6,v=(W>>>19|H<<32-19)^(H>>>61-32|W<<32-(61-32))^(W>>>6|H<<32-6),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,p[q]=C&65535|k<<16,x[q]=P&65535|U<<16;_=ee,v=we,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[0],v=l[0],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[0]=ee=C&65535|k<<16,l[0]=we=P&65535|U<<16,_=ye,v=Se,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[1],v=l[1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[1]=ye=C&65535|k<<16,l[1]=Se=P&65535|U<<16,_=xe,v=Ue,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[2],v=l[2],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[2]=xe=C&65535|k<<16,l[2]=Ue=P&65535|U<<16,_=me,v=Je,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[3],v=l[3],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[3]=me=C&65535|k<<16,l[3]=Je=P&65535|U<<16,_=m,v=ze,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[4],v=l[4],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[4]=m=C&65535|k<<16,l[4]=ze=P&65535|U<<16,_=_e,v=Ve,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[5],v=l[5],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[5]=_e=C&65535|k<<16,l[5]=Ve=P&65535|U<<16,_=Ce,v=We,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[6],v=l[6],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[6]=Ce=C&65535|k<<16,l[6]=We=P&65535|U<<16,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[7],v=l[7],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[7]=Ie=C&65535|k<<16,l[7]=Qe=P&65535|U<<16,ot+=128,i-=128}return i}function Pn(u,l,d){var i=new Int32Array(8),p=new Int32Array(8),x=new Uint8Array(256),A,B=d;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,p[0]=4089235720,p[1]=2227873595,p[2]=4271175723,p[3]=1595750129,p[4]=2917565137,p[5]=725511199,p[6]=4215389547,p[7]=327033209,ru(i,p,l,d),d%=128,A=0;A<d;A++)x[A]=l[B-d+A];for(x[d]=128,d=256-128*(d<112?1:0),x[d-9]=0,b(x,d-8,B/536870912|0,B<<3),ru(i,p,x,d),A=0;A<8;A++)b(u,8*A,i[A],p[A]);return 0}function As(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t(),Y=t(),L=t();rt(d,u[1],u[0]),rt(L,l[1],l[0]),pe(d,d,L),Me(i,u[0],u[1]),Me(L,l[0],l[1]),pe(i,i,L),pe(p,u[3],l[3]),pe(p,p,h),pe(x,u[2],l[2]),Me(x,x,x),rt(A,i,d),rt(B,x,p),Me(N,x,p),Me(Y,i,d),pe(u[0],A,B),pe(u[1],Y,N),pe(u[2],N,B),pe(u[3],A,Y)}function nu(u,l,d){var i;for(i=0;i<4;i++)le(u[i],l[i],d)}function Gi(u,l){var d=t(),i=t(),p=t();Yr(p,l[2]),pe(d,l[0],p),pe(i,l[1],p),Re(u,i),u[31]^=Ze(d)<<7}function Fi(u,l,d){var i,p;for(z(u[0],s),z(u[1],a),z(u[2],a),z(u[3],s),p=255;p>=0;--p)i=d[p/8|0]>>(p&7)&1,nu(u,l,i),As(l,u),As(u,u),nu(u,l,i)}function ws(u,l){var d=[t(),t(),t(),t()];z(d[0],g),z(d[1],y),z(d[2],a),pe(d[3],g,y),Fi(u,d,l)}function $i(u,l,d){var i=new Uint8Array(64),p=[t(),t(),t(),t()],x;for(d||e(l,32),Pn(i,l,32),i[0]&=248,i[31]&=127,i[31]|=64,ws(p,i),Gi(u,p),x=0;x<32;x++)l[x+32]=u[x];return 0}var Ts=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ki(u,l){var d,i,p,x;for(i=63;i>=32;--i){for(d=0,p=i-32,x=i-12;p<x;++p)l[p]+=d-16*l[i]*Ts[p-(i-32)],d=Math.floor((l[p]+128)/256),l[p]-=d*256;l[p]+=d,l[i]=0}for(d=0,p=0;p<32;p++)l[p]+=d-(l[31]>>4)*Ts[p],d=l[p]>>8,l[p]&=255;for(p=0;p<32;p++)l[p]-=d*Ts[p];for(i=0;i<32;i++)l[i+1]+=l[i]>>8,u[i]=l[i]&255}function ji(u){var l=new Float64Array(64),d;for(d=0;d<64;d++)l[d]=u[d];for(d=0;d<64;d++)u[d]=0;Ki(u,l)}function ou(u,l,d,i){var p=new Uint8Array(64),x=new Uint8Array(64),A=new Uint8Array(64),B,N,Y=new Float64Array(64),L=[t(),t(),t(),t()];Pn(p,i,32),p[0]&=248,p[31]&=127,p[31]|=64;var Be=d+64;for(B=0;B<d;B++)u[64+B]=l[B];for(B=0;B<32;B++)u[32+B]=p[32+B];for(Pn(A,u.subarray(32),d+32),ji(A),ws(L,A),Gi(u,L),B=32;B<64;B++)u[B]=i[B];for(Pn(x,u,d+64),ji(x),B=0;B<64;B++)Y[B]=0;for(B=0;B<32;B++)Y[B]=A[B];for(B=0;B<32;B++)for(N=0;N<32;N++)Y[B+N]+=x[B]*p[N];return Ki(u.subarray(32),Y),Be}function $p(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t();return z(u[2],a),dt(u[1],l),nt(p,u[1]),pe(x,p,f),rt(p,p,u[2]),Me(x,u[2],x),nt(A,x),nt(B,A),pe(N,B,A),pe(d,N,p),pe(d,d,x),Vt(d,d),pe(d,d,p),pe(d,d,x),pe(d,d,x),pe(u[0],d,x),nt(i,u[0]),pe(i,i,x),ke(i,p)&&pe(u[0],u[0],w),nt(i,u[0]),pe(i,i,x),ke(i,p)?-1:(Ze(u[0])===l[31]>>7&&rt(u[0],s,u[0]),pe(u[3],u[0],u[1]),0)}function Vi(u,l,d,i){var p,x=new Uint8Array(32),A=new Uint8Array(64),B=[t(),t(),t(),t()],N=[t(),t(),t(),t()];if(d<64||$p(N,i))return-1;for(p=0;p<d;p++)u[p]=l[p];for(p=0;p<32;p++)u[p+32]=i[p];if(Pn(A,u,d),ji(A),Fi(B,N,A),ws(N,l.subarray(32)),As(B,N),Gi(x,B),d-=64,S(l,0,x,0)){for(p=0;p<d;p++)u[p]=0;return-1}for(p=0;p<d;p++)u[p]=l[p+64];return d}var Wi=32,_s=24,Co=32,eo=16,Io=32,vs=32,Ro=32,Po=32,Qi=32,su=_s,Kp=Co,jp=eo,_r=64,kn=32,to=64,Yi=32,Xi=64;r.lowlevel={crypto_core_hsalsa20:K,crypto_stream_xor:oe,crypto_stream:G,crypto_stream_salsa20_xor:F,crypto_stream_salsa20:J,crypto_onetimeauth:ce,crypto_onetimeauth_verify:Pe,crypto_verify_16:T,crypto_verify_32:S,crypto_secretbox:Oe,crypto_secretbox_open:at,crypto_scalarmult:Xr,crypto_scalarmult_base:Mt,crypto_box_beforenm:Rn,crypto_box_afternm:It,crypto_box:Jn,crypto_box_open:bs,crypto_box_keypair:Tr,crypto_hash:Pn,crypto_sign:ou,crypto_sign_keypair:$i,crypto_sign_open:Vi,crypto_secretbox_KEYBYTES:Wi,crypto_secretbox_NONCEBYTES:_s,crypto_secretbox_ZEROBYTES:Co,crypto_secretbox_BOXZEROBYTES:eo,crypto_scalarmult_BYTES:Io,crypto_scalarmult_SCALARBYTES:vs,crypto_box_PUBLICKEYBYTES:Ro,crypto_box_SECRETKEYBYTES:Po,crypto_box_BEFORENMBYTES:Qi,crypto_box_NONCEBYTES:su,crypto_box_ZEROBYTES:Kp,crypto_box_BOXZEROBYTES:jp,crypto_sign_BYTES:_r,crypto_sign_PUBLICKEYBYTES:kn,crypto_sign_SECRETKEYBYTES:to,crypto_sign_SEEDBYTES:Yi,crypto_hash_BYTES:Xi,gf:t,D:f,L:Ts,pack25519:Re,unpack25519:dt,M:pe,A:Me,S:nt,Z:rt,pow2523:Vt,add:As,set25519:z,modL:Ki,scalarmult:Fi,scalarbase:ws};function iu(u,l){if(u.length!==Wi)throw new Error("bad key size");if(l.length!==_s)throw new Error("bad nonce size")}function Vp(u,l){if(u.length!==Ro)throw new Error("bad public key size");if(l.length!==Po)throw new Error("bad secret key size")}function Rt(){for(var u=0;u<arguments.length;u++)if(!(arguments[u]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function au(u){for(var l=0;l<u.length;l++)u[l]=0}r.randomBytes=function(u){var l=new Uint8Array(u);return e(l,u),l},r.secretbox=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(Co+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+Co]=u[x];return Oe(p,i,i.length,l,d),p.subarray(eo)},r.secretbox.open=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(eo+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+eo]=u[x];return i.length<32||at(p,i,i.length,l,d)!==0?null:p.subarray(Co)},r.secretbox.keyLength=Wi,r.secretbox.nonceLength=_s,r.secretbox.overheadLength=eo,r.scalarMult=function(u,l){if(Rt(u,l),u.length!==vs)throw new Error("bad n size");if(l.length!==Io)throw new Error("bad p size");var d=new Uint8Array(Io);return Xr(d,u,l),d},r.scalarMult.base=function(u){if(Rt(u),u.length!==vs)throw new Error("bad n size");var l=new Uint8Array(Io);return Mt(l,u),l},r.scalarMult.scalarLength=vs,r.scalarMult.groupElementLength=Io,r.box=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox(u,l,p)},r.box.before=function(u,l){Rt(u,l),Vp(u,l);var d=new Uint8Array(Qi);return Rn(d,u,l),d},r.box.after=r.secretbox,r.box.open=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox.open(u,l,p)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var u=new Uint8Array(Ro),l=new Uint8Array(Po);return Tr(u,l),{publicKey:u,secretKey:l}},r.box.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==Po)throw new Error("bad secret key size");var l=new Uint8Array(Ro);return Mt(l,u),{publicKey:l,secretKey:new Uint8Array(u)}},r.box.publicKeyLength=Ro,r.box.secretKeyLength=Po,r.box.sharedKeyLength=Qi,r.box.nonceLength=su,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(u,l){if(Rt(u,l),l.length!==to)throw new Error("bad secret key size");var d=new Uint8Array(_r+u.length);return ou(d,u,u.length,l),d},r.sign.open=function(u,l){if(Rt(u,l),l.length!==kn)throw new Error("bad public key size");var d=new Uint8Array(u.length),i=Vi(d,u,u.length,l);if(i<0)return null;for(var p=new Uint8Array(i),x=0;x<p.length;x++)p[x]=d[x];return p},r.sign.detached=function(u,l){for(var d=r.sign(u,l),i=new Uint8Array(_r),p=0;p<i.length;p++)i[p]=d[p];return i},r.sign.detached.verify=function(u,l,d){if(Rt(u,l,d),l.length!==_r)throw new Error("bad signature size");if(d.length!==kn)throw new Error("bad public key size");var i=new Uint8Array(_r+u.length),p=new Uint8Array(_r+u.length),x;for(x=0;x<_r;x++)i[x]=l[x];for(x=0;x<u.length;x++)i[x+_r]=u[x];return Vi(p,i,i.length,d)>=0},r.sign.keyPair=function(){var u=new Uint8Array(kn),l=new Uint8Array(to);return $i(u,l),{publicKey:u,secretKey:l}},r.sign.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==to)throw new Error("bad secret key size");for(var l=new Uint8Array(kn),d=0;d<l.length;d++)l[d]=u[32+d];return{publicKey:l,secretKey:new Uint8Array(u)}},r.sign.keyPair.fromSeed=function(u){if(Rt(u),u.length!==Yi)throw new Error("bad seed size");for(var l=new Uint8Array(kn),d=new Uint8Array(to),i=0;i<32;i++)d[i]=u[i];return $i(l,d,!0),{publicKey:l,secretKey:d}},r.sign.publicKeyLength=kn,r.sign.secretKeyLength=to,r.sign.seedLength=Yi,r.sign.signatureLength=_r,r.hash=function(u){Rt(u);var l=new Uint8Array(Xi);return Pn(l,u,u.length),l},r.hash.hashLength=Xi,r.verify=function(u,l){return Rt(u,l),u.length===0||l.length===0||u.length!==l.length?!1:I(u,0,l,0,u.length)===0},r.setPRNG=function(u){e=u},function(){var u=typeof self<"u"?self.crypto||self.msCrypto:null;if(u&&u.getRandomValues){var l=65536;r.setPRNG(function(d,i){var p,x=new Uint8Array(i);for(p=0;p<i;p+=l)u.getRandomValues(x.subarray(p,p+Math.min(i-p,l)));for(p=0;p<i;p++)d[p]=x[p];au(x)})}else typeof uu<"u"&&(u=qu(),u&&u.randomBytes&&r.setPRNG(function(d,i){var p,x=u.randomBytes(i);for(p=0;p<i;p++)d[p]=x[p];au(x)}))}()})(typeof Ds<"u"&&Ds.exports?Ds.exports:self.nacl=self.nacl||{})});var Ho=fe(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.output=xt.exists=xt.hash=xt.bytes=xt.bool=xt.number=void 0;function Ls(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}xt.number=Ls;function Gu(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}xt.bool=Gu;function xa(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}xt.bytes=xa;function Fu(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ls(r.outputLen),Ls(r.blockLen)}xt.hash=Fu;function $u(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}xt.exists=$u;function Ku(r,t){xa(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}xt.output=Ku;var Gh={number:Ls,bool:Gu,bytes:xa,hash:Fu,exists:$u,output:Ku};xt.default=Gh});var ju=fe(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.crypto=void 0;Hs.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var Hn=fe(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.randomBytes=Ee.wrapConstructorWithOpts=Ee.wrapConstructor=Ee.checkOpts=Ee.Hash=Ee.concatBytes=Ee.toBytes=Ee.utf8ToBytes=Ee.asyncLoop=Ee.nextTick=Ee.hexToBytes=Ee.bytesToHex=Ee.isLE=Ee.rotr=Ee.createView=Ee.u32=Ee.u8=void 0;var Gs=ju(),Fh=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Ee.u8=Fh;var $h=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Ee.u32=$h;var Kh=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Ee.createView=Kh;var jh=(r,t)=>r<<32-t|r>>>t;Ee.rotr=jh;Ee.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ee.isLE)throw new Error("Non little-endian hardware is not supported");var Vh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Wh(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Vh[r[e]];return t}Ee.bytesToHex=Wh;function Qh(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}Ee.hexToBytes=Qh;var Yh=async()=>{};Ee.nextTick=Yh;async function Xh(r,t,e){let n=Date.now();for(let o=0;o<r;o++){e(o);let s=Date.now()-n;s>=0&&s<t||(await(0,Ee.nextTick)(),n+=s)}}Ee.asyncLoop=Xh;function Vu(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}Ee.utf8ToBytes=Vu;function Aa(r){if(typeof r=="string"&&(r=Vu(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}Ee.toBytes=Aa;function Zh(...r){if(!r.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(r.length===1)return r[0];let t=r.reduce((n,o)=>n+o.length,0),e=new Uint8Array(t);for(let n=0,o=0;n<r.length;n++){let s=r[n];e.set(s,o),o+=s.length}return e}Ee.concatBytes=Zh;var ba=class{clone(){return this._cloneInto()}};Ee.Hash=ba;var Jh=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function e0(r,t){if(t!==void 0&&(typeof t!="object"||!Jh(t)))throw new TypeError("Options should be object or undefined");return Object.assign(r,t)}Ee.checkOpts=e0;function t0(r){let t=n=>r().update(Aa(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}Ee.wrapConstructor=t0;function r0(r){let t=(n,o)=>r(o).update(Aa(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}Ee.wrapConstructorWithOpts=r0;function n0(r=32){if(Gs.crypto.web)return Gs.crypto.web.getRandomValues(new Uint8Array(r));if(Gs.crypto.node)return new Uint8Array(Gs.crypto.node.randomBytes(r).buffer);throw new Error("The environment doesn't have randomBytes function")}Ee.randomBytes=n0});var Qu=fe(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.hmac=void 0;var Fs=Ho(),Wu=Hn(),$s=class extends Wu.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Fs.default.hash(t);let n=(0,Wu.toBytes)(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return Fs.default.exists(this),this.iHash.update(t),this}digestInto(t){Fs.default.exists(this),Fs.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},o0=(r,t,e)=>new $s(r,t).update(e).digest();Go.hmac=o0;Go.hmac.create=(r,t)=>new $s(r,t)});var Zu=fe(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.pbkdf2Async=ao.pbkdf2=void 0;var Ks=Ho(),s0=Qu(),io=Hn();function Yu(r,t,e,n){Ks.default.hash(r);let o=(0,io.checkOpts)({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:c}=o;if(Ks.default.number(s),Ks.default.number(a),Ks.default.number(c),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let f=(0,io.toBytes)(t),h=(0,io.toBytes)(e),g=new Uint8Array(a),y=s0.hmac.create(r,f),w=y._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:c,DK:g,PRF:y,PRFSalt:w}}function Xu(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function i0(r,t,e,n){let{c:o,dkLen:s,DK:a,PRF:c,PRFSalt:f}=Yu(r,t,e,n),h,g=new Uint8Array(4),y=(0,io.createView)(g),w=new Uint8Array(c.outputLen);for(let b=1,I=0;I<s;b++,I+=c.outputLen){let T=a.subarray(I,I+c.outputLen);y.setInt32(0,b,!1),(h=f._cloneInto(h)).update(g).digestInto(w),T.set(w.subarray(0,T.length));for(let S=1;S<o;S++){c._cloneInto(h).update(w).digestInto(w);for(let R=0;R<T.length;R++)T[R]^=w[R]}}return Xu(c,f,a,h,w)}ao.pbkdf2=i0;async function a0(r,t,e,n){let{c:o,dkLen:s,asyncTick:a,DK:c,PRF:f,PRFSalt:h}=Yu(r,t,e,n),g,y=new Uint8Array(4),w=(0,io.createView)(y),b=new Uint8Array(f.outputLen);for(let I=1,T=0;T<s;I++,T+=f.outputLen){let S=c.subarray(T,T+f.outputLen);w.setInt32(0,I,!1),(g=h._cloneInto(g)).update(y).digestInto(b),S.set(b.subarray(0,S.length)),await(0,io.asyncLoop)(o-1,a,R=>{f._cloneInto(g).update(b).digestInto(b);for(let M=0;M<S.length;M++)S[M]^=b[M]})}return Xu(f,h,c,g,b)}ao.pbkdf2Async=a0});var _a=fe(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.SHA2=void 0;var wa=Ho(),Fo=Hn();function c0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var Ta=class extends Fo.Hash{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Fo.createView)(this.buffer)}update(t){wa.default.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=(0,Fo.toBytes)(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=(0,Fo.createView)(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){wa.default.exists(this),wa.default.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;c0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=(0,Fo.createView)(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};js.SHA2=Ta});var Ju=fe(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.sha256=void 0;var u0=_a(),Yt=Hn(),f0=(r,t,e)=>r&t^~r&e,d0=(r,t,e)=>r&t^r&e^t&e,l0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),sn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),an=new Uint32Array(64),va=class extends u0.SHA2{constructor(){super(64,32,8,!1),this.A=sn[0]|0,this.B=sn[1]|0,this.C=sn[2]|0,this.D=sn[3]|0,this.E=sn[4]|0,this.F=sn[5]|0,this.G=sn[6]|0,this.H=sn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)an[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=an[y-15],b=an[y-2],I=(0,Yt.rotr)(w,7)^(0,Yt.rotr)(w,18)^w>>>3,T=(0,Yt.rotr)(b,17)^(0,Yt.rotr)(b,19)^b>>>10;an[y]=T+an[y-7]+I+an[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=(0,Yt.rotr)(c,6)^(0,Yt.rotr)(c,11)^(0,Yt.rotr)(c,25),b=g+w+f0(c,f,h)+l0[y]+an[y]|0,T=((0,Yt.rotr)(n,2)^(0,Yt.rotr)(n,13)^(0,Yt.rotr)(n,22))+d0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){an.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};Vs.sha256=(0,Yt.wrapConstructor)(()=>new va)});var rf=fe(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.add=qt.toBig=qt.split=qt.fromBig=void 0;var Ws=BigInt(2**32-1),Ea=BigInt(32);function Sa(r,t=!1){return t?{h:Number(r&Ws),l:Number(r>>Ea&Ws)}:{h:Number(r>>Ea&Ws)|0,l:Number(r&Ws)|0}}qt.fromBig=Sa;function ef(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Sa(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}qt.split=ef;var p0=(r,t)=>BigInt(r>>>0)<<Ea|BigInt(t>>>0);qt.toBig=p0;var h0=(r,t,e)=>r>>>e,g0=(r,t,e)=>r<<32-e|t>>>e,y0=(r,t,e)=>r>>>e|t<<32-e,m0=(r,t,e)=>r<<32-e|t>>>e,x0=(r,t,e)=>r<<64-e|t>>>e-32,b0=(r,t,e)=>r>>>e-32|t<<64-e,A0=(r,t)=>t,w0=(r,t)=>r,T0=(r,t,e)=>r<<e|t>>>32-e,_0=(r,t,e)=>t<<e|r>>>32-e,v0=(r,t,e)=>t<<e-32|r>>>64-e,E0=(r,t,e)=>r<<e-32|t>>>64-e;function tf(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}qt.add=tf;var S0=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),U0=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,B0=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),C0=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,I0=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),R0=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,P0={fromBig:Sa,split:ef,toBig:qt.toBig,shrSH:h0,shrSL:g0,rotrSH:y0,rotrSL:m0,rotrBH:x0,rotrBL:b0,rotr32H:A0,rotr32L:w0,rotlSH:T0,rotlSL:_0,rotlBH:v0,rotlBL:E0,add:tf,add3L:S0,add3H:U0,add4L:B0,add4H:C0,add5H:R0,add5L:I0};qt.default=P0});var nf=fe(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.sha384=fr.sha512_256=fr.sha512=fr.SHA512=void 0;var k0=_a(),Te=rf(),Ca=Hn(),[O0,z0]=Te.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),cn=new Uint32Array(80),un=new Uint32Array(80),co=class extends k0.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)cn[E]=t.getUint32(e),un[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=cn[E-15]|0,D=un[E-15]|0,F=Te.default.rotrSH(K,D,1)^Te.default.rotrSH(K,D,8)^Te.default.shrSH(K,D,7),J=Te.default.rotrSL(K,D,1)^Te.default.rotrSL(K,D,8)^Te.default.shrSL(K,D,7),G=cn[E-2]|0,oe=un[E-2]|0,de=Te.default.rotrSH(G,oe,19)^Te.default.rotrBH(G,oe,61)^Te.default.shrSH(G,oe,6),ce=Te.default.rotrSL(G,oe,19)^Te.default.rotrBL(G,oe,61)^Te.default.shrSL(G,oe,6),Pe=Te.default.add4L(J,ce,un[E-7],un[E-16]),Oe=Te.default.add4H(Pe,F,de,cn[E-7],cn[E-16]);cn[E]=Oe|0,un[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Te.default.rotrSH(y,w,14)^Te.default.rotrSH(y,w,18)^Te.default.rotrBH(y,w,41),D=Te.default.rotrSL(y,w,14)^Te.default.rotrSL(y,w,18)^Te.default.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Te.default.add5L(M,D,J,z0[E],un[E]),oe=Te.default.add5H(G,R,K,F,O0[E],cn[E]),de=G|0,ce=Te.default.rotrSH(n,o,28)^Te.default.rotrBH(n,o,34)^Te.default.rotrBH(n,o,39),Pe=Te.default.rotrSL(n,o,28)^Te.default.rotrBL(n,o,34)^Te.default.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Te.default.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Te.default.add3L(de,Pe,at);n=Te.default.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Te.default.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Te.default.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Te.default.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Te.default.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Te.default.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Te.default.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Te.default.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Te.default.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){cn.fill(0),un.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};fr.SHA512=co;var Ua=class extends co{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Ba=class extends co{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};fr.sha512=(0,Ca.wrapConstructor)(()=>new co);fr.sha512_256=(0,Ca.wrapConstructor)(()=>new Ua);fr.sha384=(0,Ca.wrapConstructor)(()=>new Ba)});var yf=fe(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.bytes=Z.stringToBytes=Z.str=Z.bytesToString=Z.hex=Z.utf8=Z.bech32m=Z.bech32=Z.base58check=Z.base58xmr=Z.base58xrp=Z.base58flickr=Z.base58=Z.base64url=Z.base64=Z.base32crockford=Z.base32hex=Z.base32=Z.base16=Z.utils=Z.assertNumber=void 0;function fn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}Z.assertNumber=fn;function Xt(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function dr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(fn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function lr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function jo(r,t="="){if(fn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function ff(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function of(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(fn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=g%e,s[f]=Math.floor(g/e),!Number.isSafeInteger(s[f])||s[f]*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)s[f]?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var df=(r,t)=>t?df(t,r%t):r,Qs=(r,t)=>r+(t-df(r,t));function Ia(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(Qs(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${Qs(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(fn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function lf(r){return fn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return of(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(of(t,r,2**8))}}}function Sr(r,t=!1){if(fn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(Qs(8,r)>32||Qs(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Ia(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Ia(e,r,8,t))}}}function sf(r){if(typeof r!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return r.apply(null,t)}catch{}}}function pf(r,t){if(fn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}Z.utils={alphabet:dr,chain:Xt,checksum:pf,radix:lf,radix2:Sr,join:lr,padding:jo};Z.base16=Xt(Sr(4),dr("0123456789ABCDEF"),lr(""));Z.base32=Xt(Sr(5),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),jo(5),lr(""));Z.base32hex=Xt(Sr(5),dr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),jo(5),lr(""));Z.base32crockford=Xt(Sr(5),dr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),lr(""),ff(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));Z.base64=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),jo(6),lr(""));Z.base64url=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),jo(6),lr(""));var Pa=r=>Xt(lf(58),dr(r),lr(""));Z.base58=Pa("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Z.base58flickr=Pa("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");Z.base58xrp=Pa("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var af=[0,2,3,5,6,7,9,10,11];Z.base58xmr={encode(r){let t="";for(let e=0;e<r.length;e+=8){let n=r.subarray(e,e+8);t+=Z.base58.encode(n).padStart(af[n.length],"1")}return t},decode(r){let t=[];for(let e=0;e<r.length;e+=11){let n=r.slice(e,e+11),o=af.indexOf(n.length),s=Z.base58.decode(n);for(let a=0;a<s.length-o;a++)if(s[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(t)}};var N0=r=>Xt(pf(4,t=>r(r(t))),Z.base58);Z.base58check=N0;var Ra=Xt(dr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),lr("")),cf=[996825010,642813549,513874426,1027748829,705979059];function $o(r){let t=r>>25,e=(r&33554431)<<5;for(let n=0;n<cf.length;n++)(t>>n&1)===1&&(e^=cf[n]);return e}function uf(r,t,e=1){let n=r.length,o=1;for(let s=0;s<n;s++){let a=r.charCodeAt(s);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);o=$o(o)^a>>5}o=$o(o);for(let s=0;s<n;s++)o=$o(o)^r.charCodeAt(s)&31;for(let s of t)o=$o(o)^s;for(let s=0;s<6;s++)o=$o(o);return o^=e,Ra.encode(Ia([o%2**30],30,5,!1))}function hf(r){let t=r==="bech32"?1:734539939,e=Sr(5),n=e.decode,o=e.encode,s=sf(n);function a(g,y,w=90){if(typeof g!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof g}`);if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof y}`);let b=g.length+7+y.length;if(w!==!1&&b>w)throw new TypeError(`Length ${b} exceeds limit ${w}`);return g=g.toLowerCase(),`${g}1${Ra.encode(y)}${uf(g,y,t)}`}function c(g,y=90){if(typeof g!="string")throw new Error(`bech32.decode input should be string, not ${typeof g}`);if(g.length<8||y!==!1&&g.length>y)throw new TypeError(`Wrong string length: ${g.length} (${g}). Expected (8..${y})`);let w=g.toLowerCase();if(g!==w&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");g=w;let b=g.lastIndexOf("1");if(b===0||b===-1)throw new Error('Letter "1" must be present between prefix and data only');let I=g.slice(0,b),T=g.slice(b+1);if(T.length<6)throw new Error("Data must be at least 6 characters long");let S=Ra.decode(T).slice(0,-6),R=uf(I,S,t);if(!T.endsWith(R))throw new Error(`Invalid checksum in ${g}: expected "${R}"`);return{prefix:I,words:S}}let f=sf(c);function h(g){let{prefix:y,words:w}=c(g,!1);return{prefix:y,words:w,bytes:n(w)}}return{encode:a,decode:c,decodeToBytes:h,decodeUnsafe:f,fromWords:n,fromWordsUnsafe:s,toWords:o}}Z.bech32=hf("bech32");Z.bech32m=hf("bech32m");Z.utf8={encode:r=>new TextDecoder().decode(r),decode:r=>new TextEncoder().encode(r)};Z.hex=Xt(Sr(4),dr("0123456789abcdef"),lr(""),ff(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var Ko={utf8:Z.utf8,hex:Z.hex,base16:Z.base16,base32:Z.base32,base64:Z.base64,base64url:Z.base64url,base58:Z.base58,base58xmr:Z.base58xmr},gf=`Invalid encoding type. Available types: ${Object.keys(Ko).join(", ")}`,D0=(r,t)=>{if(typeof r!="string"||!Ko.hasOwnProperty(r))throw new TypeError(gf);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ko[r].encode(t)};Z.bytesToString=D0;Z.str=Z.bytesToString;var M0=(r,t)=>{if(!Ko.hasOwnProperty(r))throw new TypeError(gf);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Ko[r].decode(t)};Z.stringToBytes=M0;Z.bytes=Z.stringToBytes});var Sf=fe(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.mnemonicToSeedSync=vt.mnemonicToSeed=vt.validateMnemonic=vt.entropyToMnemonic=vt.mnemonicToEntropy=vt.generateMnemonic=void 0;var mf=Ho(),xf=Zu(),q0=Ju(),bf=nf(),L0=Hn(),Ys=yf(),H0=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function Af(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function ka(r){let t=Af(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}function wf(r){mf.default.bytes(r,16,20,24,28,32)}function G0(r,t=128){if(mf.default.number(t),t%32!==0||t>256)throw new TypeError("Invalid entropy");return vf((0,L0.randomBytes)(t/8),r)}vt.generateMnemonic=G0;var F0=r=>{let t=8-r.length/4;return new Uint8Array([(0,q0.sha256)(r)[0]>>t<<t])};function Tf(r){if(!Array.isArray(r)||r.length!==2**11||typeof r[0]!="string")throw new Error("Worlist: expected array of 2048 strings");return r.forEach(t=>{if(typeof t!="string")throw new Error(`Wordlist: non-string element: ${t}`)}),Ys.utils.chain(Ys.utils.checksum(1,F0),Ys.utils.radix2(11,!0),Ys.utils.alphabet(r))}function _f(r,t){let{words:e}=ka(r),n=Tf(t).decode(e);return wf(n),n}vt.mnemonicToEntropy=_f;function vf(r,t){return wf(r),Tf(t).encode(r).join(H0(t)?"\u3000":" ")}vt.entropyToMnemonic=vf;function $0(r,t){try{_f(r,t)}catch{return!1}return!0}vt.validateMnemonic=$0;var Ef=r=>Af(`mnemonic${r}`);function K0(r,t=""){return(0,xf.pbkdf2Async)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeed=K0;function j0(r,t=""){return(0,xf.pbkdf2)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeedSync=j0});var hc=fe((Qw,$d)=>{"use strict";$d.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var ut=fe((Yw,Vd)=>{"use strict";var hy=hc(),yc=Object.prototype.toString,mc=function(r){return function(t){var e=yc.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function Qn(r){return r=r.toLowerCase(),function(e){return mc(e)===r}}function xc(r){return Array.isArray(r)}function bi(r){return typeof r>"u"}function gy(r){return r!==null&&!bi(r)&&r.constructor!==null&&!bi(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Kd=Qn("ArrayBuffer");function yy(r){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Kd(r.buffer),t}function my(r){return typeof r=="string"}function xy(r){return typeof r=="number"}function jd(r){return r!==null&&typeof r=="object"}function xi(r){if(mc(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var by=Qn("Date"),Ay=Qn("File"),wy=Qn("Blob"),Ty=Qn("FileList");function bc(r){return yc.call(r)==="[object Function]"}function _y(r){return jd(r)&&bc(r.pipe)}function vy(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||yc.call(r)===t||bc(r.toString)&&r.toString()===t)}var Ey=Qn("URLSearchParams");function Sy(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Uy(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ac(r,t){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),xc(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function gc(){var r={};function t(o,s){xi(r[s])&&xi(o)?r[s]=gc(r[s],o):xi(o)?r[s]=gc({},o):xc(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)Ac(arguments[e],t);return r}function By(r,t,e){return Ac(t,function(o,s){e&&typeof o=="function"?r[s]=hy(o,e):r[s]=o}),r}function Cy(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Iy(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function Ry(r,t,e){var n,o,s,a={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],a[s]||(t[s]=r[s],a[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function Py(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function ky(r){if(!r)return null;var t=r.length;if(bi(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var Oy=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Vd.exports={isArray:xc,isArrayBuffer:Kd,isBuffer:gy,isFormData:vy,isArrayBufferView:yy,isString:my,isNumber:xy,isObject:jd,isPlainObject:xi,isUndefined:bi,isDate:by,isFile:Ay,isBlob:wy,isFunction:bc,isStream:_y,isURLSearchParams:Ey,isStandardBrowserEnv:Uy,forEach:Ac,merge:gc,extend:By,trim:Sy,stripBOM:Cy,inherits:Iy,toFlatObject:Ry,kindOf:mc,kindOfTest:Qn,endsWith:Py,toArray:ky,isTypedArray:Oy,isFileList:Ty}});var wc=fe((Xw,Qd)=>{"use strict";var Ao=ut();function Wd(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Qd.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(Ao.isURLSearchParams(e))o=e.toString();else{var s=[];Ao.forEach(e,function(f,h){f===null||typeof f>"u"||(Ao.isArray(f)?h=h+"[]":f=[f],Ao.forEach(f,function(y){Ao.isDate(y)?y=y.toISOString():Ao.isObject(y)&&(y=JSON.stringify(y)),s.push(Wd(h)+"="+Wd(y))}))}),o=s.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Xd=fe((Zw,Yd)=>{"use strict";var zy=ut();function Ai(){this.handlers=[]}Ai.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Ai.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Ai.prototype.forEach=function(t){zy.forEach(this.handlers,function(n){n!==null&&t(n)})};Yd.exports=Ai});var Jd=fe((Jw,Zd)=>{"use strict";var Ny=ut();Zd.exports=function(t,e){Ny.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var Yn=fe((e2,nl)=>{"use strict";var el=ut();function wo(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}el.inherits(wo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var tl=wo.prototype,rl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){rl[r]={value:r}});Object.defineProperties(wo,rl);Object.defineProperty(tl,"isAxiosError",{value:!0});wo.from=function(r,t,e,n,o,s){var a=Object.create(tl);return el.toFlatObject(r,a,function(f){return f!==Error.prototype}),wo.call(a,r.message,t,e,n,o),a.name=r.name,s&&Object.assign(a,s),a};nl.exports=wo});var Tc=fe((t2,ol)=>{"use strict";ol.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var _c=fe((r2,sl)=>{"use strict";var tr=ut();function Dy(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":tr.isDate(s)?s.toISOString():tr.isArrayBuffer(s)||tr.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,a){if(tr.isPlainObject(s)||tr.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);e.push(s),tr.forEach(s,function(f,h){if(!tr.isUndefined(f)){var g=a?a+"."+h:h,y;if(f&&!a&&typeof f=="object"){if(tr.endsWith(h,"{}"))f=JSON.stringify(f);else if(tr.endsWith(h,"[]")&&(y=tr.toArray(f))){y.forEach(function(w){!tr.isUndefined(w)&&t.append(g,n(w))});return}}o(f,g)}}),e.pop()}else t.append(a,n(s))}return o(r),t}sl.exports=Dy});var al=fe((n2,il)=>{"use strict";var vc=Yn();il.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new vc("Request failed with status code "+n.status,[vc.ERR_BAD_REQUEST,vc.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var ul=fe((o2,cl)=>{"use strict";var wi=ut();cl.exports=wi.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,a,c){var f=[];f.push(e+"="+encodeURIComponent(n)),wi.isNumber(o)&&f.push("expires="+new Date(o).toGMTString()),wi.isString(s)&&f.push("path="+s),wi.isString(a)&&f.push("domain="+a),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var dl=fe((s2,fl)=>{"use strict";fl.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var pl=fe((i2,ll)=>{"use strict";ll.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var Ec=fe((a2,hl)=>{"use strict";var My=dl(),qy=pl();hl.exports=function(t,e){return t&&!My(e)?qy(t,e):e}});var yl=fe((c2,gl)=>{"use strict";var Sc=ut(),Ly=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];gl.exports=function(t){var e={},n,o,s;return t&&Sc.forEach(t.split(`
|
|
2
|
-
`),function(c){if(s=c.indexOf(":"),n=Sc.trim(c.substr(0,s)).toLowerCase(),o=Sc.trim(c.substr(s+1)),n){if(e[n]&&Ly.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var bl=fe((u2,xl)=>{"use strict";var ml=ut();xl.exports=ml.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var a=s;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(a){var c=ml.isString(a)?o(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}()});var Jo=fe((f2,wl)=>{"use strict";var Uc=Yn(),Hy=ut();function Al(r){Uc.call(this,r??"canceled",Uc.ERR_CANCELED),this.name="CanceledError"}Hy.inherits(Al,Uc,{__CANCEL__:!0});wl.exports=Al});var _l=fe((d2,Tl)=>{"use strict";Tl.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var Bc=fe((l2,vl)=>{"use strict";var es=ut(),Gy=al(),Fy=ul(),$y=wc(),Ky=Ec(),jy=yl(),Vy=bl(),Wy=Tc(),kr=Yn(),Qy=Jo(),Yy=_l();vl.exports=function(t){return new Promise(function(n,o){var s=t.data,a=t.headers,c=t.responseType,f;function h(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}es.isFormData(s)&&es.isStandardBrowserEnv()&&delete a["Content-Type"];var g=new XMLHttpRequest;if(t.auth){var y=t.auth.username||"",w=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(y+":"+w)}var b=Ky(t.baseURL,t.url);g.open(t.method.toUpperCase(),$y(b,t.params,t.paramsSerializer),!0),g.timeout=t.timeout;function I(){if(!!g){var R="getAllResponseHeaders"in g?jy(g.getAllResponseHeaders()):null,M=!c||c==="text"||c==="json"?g.responseText:g.response,E={data:M,status:g.status,statusText:g.statusText,headers:R,config:t,request:g};Gy(function(D){n(D),h()},function(D){o(D),h()},E),g=null}}if("onloadend"in g?g.onloadend=I:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(I)},g.onabort=function(){!g||(o(new kr("Request aborted",kr.ECONNABORTED,t,g)),g=null)},g.onerror=function(){o(new kr("Network Error",kr.ERR_NETWORK,t,g,g)),g=null},g.ontimeout=function(){var M=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",E=t.transitional||Wy;t.timeoutErrorMessage&&(M=t.timeoutErrorMessage),o(new kr(M,E.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,t,g)),g=null},es.isStandardBrowserEnv()){var T=(t.withCredentials||Vy(b))&&t.xsrfCookieName?Fy.read(t.xsrfCookieName):void 0;T&&(a[t.xsrfHeaderName]=T)}"setRequestHeader"in g&&es.forEach(a,function(M,E){typeof s>"u"&&E.toLowerCase()==="content-type"?delete a[E]:g.setRequestHeader(E,M)}),es.isUndefined(t.withCredentials)||(g.withCredentials=!!t.withCredentials),c&&c!=="json"&&(g.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&g.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(R){!g||(o(!R||R&&R.type?new Qy:R),g.abort(),g=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),s||(s=null);var S=Yy(b);if(S&&["http","https","file"].indexOf(S)===-1){o(new kr("Unsupported protocol "+S+":",kr.ERR_BAD_REQUEST,t));return}g.send(s)})}});var Sl=fe((p2,El)=>{El.exports=null});var _i=fe((h2,Il)=>{"use strict";var ft=ut(),Ul=Jd(),Bl=Yn(),Xy=Tc(),Zy=_c(),Jy={"Content-Type":"application/x-www-form-urlencoded"};function Cl(r,t){!ft.isUndefined(r)&&ft.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function em(){var r;return typeof XMLHttpRequest<"u"?r=Bc():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=Bc()),r}function tm(r,t,e){if(ft.isString(r))try{return(t||JSON.parse)(r),ft.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Ti={transitional:Xy,adapter:em(),transformRequest:[function(t,e){if(Ul(e,"Accept"),Ul(e,"Content-Type"),ft.isFormData(t)||ft.isArrayBuffer(t)||ft.isBuffer(t)||ft.isStream(t)||ft.isFile(t)||ft.isBlob(t))return t;if(ft.isArrayBufferView(t))return t.buffer;if(ft.isURLSearchParams(t))return Cl(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=ft.isObject(t),o=e&&e["Content-Type"],s;if((s=ft.isFileList(t))||n&&o==="multipart/form-data"){var a=this.env&&this.env.FormData;return Zy(s?{"files[]":t}:t,a&&new a)}else if(n||o==="application/json")return Cl(e,"application/json"),tm(t);return t}],transformResponse:[function(t){var e=this.transitional||Ti.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&ft.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Bl.from(a,Bl.ERR_BAD_RESPONSE,this,null,this.response):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sl()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ft.forEach(["delete","get","head"],function(t){Ti.headers[t]={}});ft.forEach(["post","put","patch"],function(t){Ti.headers[t]=ft.merge(Jy)});Il.exports=Ti});var Pl=fe((g2,Rl)=>{"use strict";var rm=ut(),nm=_i();Rl.exports=function(t,e,n){var o=this||nm;return rm.forEach(n,function(a){t=a.call(o,t,e)}),t}});var Cc=fe((y2,kl)=>{"use strict";kl.exports=function(t){return!!(t&&t.__CANCEL__)}});var Nl=fe((m2,zl)=>{"use strict";var Ol=ut(),Ic=Pl(),om=Cc(),sm=_i(),im=Jo();function Rc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new im}zl.exports=function(t){Rc(t),t.headers=t.headers||{},t.data=Ic.call(t,t.data,t.headers,t.transformRequest),t.headers=Ol.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Ol.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||sm.adapter;return e(t).then(function(o){return Rc(t),o.data=Ic.call(t,o.data,o.headers,t.transformResponse),o},function(o){return om(o)||(Rc(t),o&&o.response&&(o.response.data=Ic.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Pc=fe((x2,Dl)=>{"use strict";var zt=ut();Dl.exports=function(t,e){e=e||{};var n={};function o(g,y){return zt.isPlainObject(g)&&zt.isPlainObject(y)?zt.merge(g,y):zt.isPlainObject(y)?zt.merge({},y):zt.isArray(y)?y.slice():y}function s(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(t[g],e[g])}function a(g){if(!zt.isUndefined(e[g]))return o(void 0,e[g])}function c(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(void 0,e[g])}function f(g){if(g in e)return o(t[g],e[g]);if(g in t)return o(void 0,t[g])}var h={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f};return zt.forEach(Object.keys(t).concat(Object.keys(e)),function(y){var w=h[y]||s,b=w(y);zt.isUndefined(b)&&w!==f||(n[y]=b)}),n}});var kc=fe((b2,Ml)=>{Ml.exports={version:"0.27.2"}});var Hl=fe((A2,Ll)=>{"use strict";var am=kc().version,Tn=Yn(),Oc={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){Oc[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var ql={};Oc.transitional=function(t,e,n){function o(s,a){return"[Axios v"+am+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,c){if(t===!1)throw new Tn(o(a," has been removed"+(e?" in "+e:"")),Tn.ERR_DEPRECATED);return e&&!ql[a]&&(ql[a]=!0,console.warn(o(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,c):!0}};function cm(r,t,e){if(typeof r!="object")throw new Tn("options must be an object",Tn.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var c=r[s],f=c===void 0||a(c,s,r);if(f!==!0)throw new Tn("option "+s+" must be "+f,Tn.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Tn("Unknown option "+s,Tn.ERR_BAD_OPTION)}}Ll.exports={assertOptions:cm,validators:Oc}});var Vl=fe((w2,jl)=>{"use strict";var $l=ut(),um=wc(),Gl=Xd(),Fl=Nl(),vi=Pc(),fm=Ec(),Kl=Hl(),To=Kl.validators;function _o(r){this.defaults=r,this.interceptors={request:new Gl,response:new Gl}}_o.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=vi(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&Kl.assertOptions(n,{silentJSONParsing:To.transitional(To.boolean),forcedJSONParsing:To.transitional(To.boolean),clarifyTimeoutError:To.transitional(To.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(e)===!1||(s=s&&b.synchronous,o.unshift(b.fulfilled,b.rejected))});var a=[];this.interceptors.response.forEach(function(b){a.push(b.fulfilled,b.rejected)});var c;if(!s){var f=[Fl,void 0];for(Array.prototype.unshift.apply(f,o),f=f.concat(a),c=Promise.resolve(e);f.length;)c=c.then(f.shift(),f.shift());return c}for(var h=e;o.length;){var g=o.shift(),y=o.shift();try{h=g(h)}catch(w){y(w);break}}try{c=Fl(h)}catch(w){return Promise.reject(w)}for(;a.length;)c=c.then(a.shift(),a.shift());return c};_o.prototype.getUri=function(t){t=vi(this.defaults,t);var e=fm(t.baseURL,t.url);return um(e,t.params,t.paramsSerializer)};$l.forEach(["delete","get","head","options"],function(t){_o.prototype[t]=function(e,n){return this.request(vi(n||{},{method:t,url:e,data:(n||{}).data}))}});$l.forEach(["post","put","patch"],function(t){function e(n){return function(s,a,c){return this.request(vi(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}_o.prototype[t]=e(),_o.prototype[t+"Form"]=e(!0)});jl.exports=_o});var Ql=fe((T2,Wl)=>{"use strict";var dm=Jo();function vo(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(!!e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(a){e.subscribe(a),o=a}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new dm(o),t(e.reason))})}vo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};vo.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};vo.prototype.unsubscribe=function(t){if(!!this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};vo.source=function(){var t,e=new vo(function(o){t=o});return{token:e,cancel:t}};Wl.exports=vo});var Xl=fe((_2,Yl)=>{"use strict";Yl.exports=function(t){return function(n){return t.apply(null,n)}}});var Jl=fe((v2,Zl)=>{"use strict";var lm=ut();Zl.exports=function(t){return lm.isObject(t)&&t.isAxiosError===!0}});var rp=fe((E2,zc)=>{"use strict";var ep=ut(),pm=hc(),Ei=Vl(),hm=Pc(),gm=_i();function tp(r){var t=new Ei(r),e=pm(Ei.prototype.request,t);return ep.extend(e,Ei.prototype,t),ep.extend(e,t),e.create=function(o){return tp(hm(r,o))},e}var Ut=tp(gm);Ut.Axios=Ei;Ut.CanceledError=Jo();Ut.CancelToken=Ql();Ut.isCancel=Cc();Ut.VERSION=kc().version;Ut.toFormData=_c();Ut.AxiosError=Yn();Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=Xl();Ut.isAxiosError=Jl();zc.exports=Ut;zc.exports.default=Ut});var op=fe((S2,np)=>{np.exports=rp()});var Cm={};fu(Cm,{APTOS_BIP44_REGEX:()=>Cf,APTOS_HARDENED_REGEX:()=>Bf,Account:()=>St,AccountAddress:()=>O,AccountAuthenticator:()=>Bt,AccountAuthenticatorEd25519:()=>rr,AccountAuthenticatorMultiEd25519:()=>Eo,AccountAuthenticatorMultiKey:()=>_n,AccountAuthenticatorSingleKey:()=>Kt,AccountAuthenticatorVariant:()=>na,AddressInvalidReason:()=>Iu,AnyPublicKeyVariant:()=>oa,AnySignatureVariant:()=>sa,Aptos:()=>Ct,AptosApiError:()=>cr,AptosConfig:()=>ts,AuthenticationKey:()=>Ft,Bool:()=>Le,CKDPriv:()=>Da,ChainId:()=>Mr,DeriveScheme:()=>yu,Deserializer:()=>qo,Ed25519PrivateKey:()=>Zt,Ed25519PublicKey:()=>De,Ed25519Signature:()=>je,EntryFunction:()=>wr,EntryFunctionBytes:()=>qn,FeePayerRawTransaction:()=>sr,FixedBytes:()=>ur,HARDENED_OFFSET:()=>Oa,Hex:()=>be,HexInvalidReason:()=>Bu,Identifier:()=>qe,KeyType:()=>If,MimeType:()=>Es,ModuleId:()=>qr,MoveAbility:()=>hu,MoveFunctionVisibility:()=>pu,MoveOption:()=>tt,MoveString:()=>Ge,MoveVector:()=>ve,MultiAgentRawTransaction:()=>or,MultiEd25519PublicKey:()=>Et,MultiEd25519Signature:()=>Br,MultiKey:()=>Pr,MultiSig:()=>Cn,MultisigTransactionPayload:()=>In,Network:()=>zo,NetworkToChainId:()=>Us,NetworkToFaucetAPI:()=>ua,NetworkToIndexerAPI:()=>Ss,NetworkToNetworkName:()=>Jp,NetworkToNodeAPI:()=>ca,ParsingError:()=>mt,PrivateKey:()=>Ln,PublicKey:()=>Pt,RawTransaction:()=>Nt,RawTransactionWithData:()=>os,RoleType:()=>gu,RotationProofChallenge:()=>rs,Script:()=>Bn,ScriptTransactionArgumentVariants:()=>ro,Secp256k1PrivateKey:()=>mr,Secp256k1PublicKey:()=>Gt,Secp256k1Signature:()=>xr,Serializable:()=>te,Serializer:()=>Wt,Signature:()=>Qt,SignedTransaction:()=>Dt,SigningScheme:()=>no,SigningSchemeInput:()=>aa,StructTag:()=>jt,TransactionAuthenticator:()=>br,TransactionAuthenticatorEd25519:()=>Or,TransactionAuthenticatorFeePayer:()=>Nr,TransactionAuthenticatorMultiAgent:()=>zr,TransactionAuthenticatorMultiEd25519:()=>So,TransactionAuthenticatorSingleSender:()=>Dr,TransactionAuthenticatorVariant:()=>ra,TransactionPayload:()=>vn,TransactionPayloadEntryFunction:()=>Sn,TransactionPayloadMultisig:()=>Un,TransactionPayloadScript:()=>En,TransactionPayloadVariants:()=>ea,TransactionResponseType:()=>ia,TransactionVariants:()=>ta,TypeTag:()=>Xe,TypeTagAddress:()=>Vr,TypeTagBool:()=>Lr,TypeTagGeneric:()=>Wr,TypeTagParserError:()=>$e,TypeTagParserErrorType:()=>pp,TypeTagReference:()=>Xn,TypeTagSigner:()=>Ar,TypeTagStruct:()=>nr,TypeTagU128:()=>Kr,TypeTagU16:()=>Gr,TypeTagU256:()=>jr,TypeTagU32:()=>Fr,TypeTagU64:()=>$r,TypeTagU8:()=>Hr,TypeTagVariants:()=>Ji,TypeTagVector:()=>Qr,U128:()=>Tt,U16:()=>At,U256:()=>_t,U32:()=>wt,U64:()=>He,U8:()=>st,aptosCoinStructTag:()=>mm,aptosRequest:()=>Oo,buildTransaction:()=>jc,convertArgument:()=>$c,deriveKey:()=>Xs,deriveTransactionType:()=>Yc,deserializeFromScriptArgument:()=>fp,ensureBoolean:()=>zs,fetchEntryFunctionAbi:()=>Fc,findFirstNonSignerArg:()=>Hc,generateMultiSignersSignedTransaction:()=>mp,generateRawTransaction:()=>yp,generateSignedTransaction:()=>Qc,generateSignedTransactionForSimulation:()=>Vc,generateTransactionPayload:()=>Kc,generateTransactionPayloadWithABI:()=>hp,get:()=>Eu,getAptosFullNode:()=>bt,getAuthenticatorForSimulation:()=>cs,getFunctionParts:()=>qi,getSigningMessage:()=>xp,isBcsAddress:()=>as,isBcsBool:()=>Ii,isBcsFixedBytes:()=>Lc,isBcsString:()=>Ri,isBcsU128:()=>Ni,isBcsU16:()=>ki,isBcsU256:()=>Di,isBcsU32:()=>Oi,isBcsU64:()=>zi,isBcsU8:()=>Pi,isBool:()=>Mc,isLargeNumber:()=>is,isNull:()=>qc,isNumber:()=>ss,isScriptDataInput:()=>Mi,isString:()=>Zn,isValidBIP44Path:()=>za,isValidHardenedPath:()=>Na,mnemonicToSeed:()=>Vo,objectStructTag:()=>Am,optionStructTag:()=>bm,outOfRangeErrorMessage:()=>Cu,paginateWithCursor:()=>On,parseTypeTag:()=>Uo,post:()=>Cs,postAptosFaucet:()=>la,postAptosFullNode:()=>zn,postAptosIndexer:()=>da,request:()=>xu,sign:()=>Wc,splitPath:()=>Ma,standardizeTypeTags:()=>Gc,stringStructTag:()=>xm,throwTypeMismatch:()=>Ke,validateNumberInRange:()=>Er});var cr=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var lu="0.0.4";var Es=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(Es||{}),Ji=(b=>(b[b.Bool=0]="Bool",b[b.U8=1]="U8",b[b.U64=2]="U64",b[b.U128=3]="U128",b[b.Address=4]="Address",b[b.Signer=5]="Signer",b[b.Vector=6]="Vector",b[b.Struct=7]="Struct",b[b.U16=8]="U16",b[b.U32=9]="U32",b[b.U256=10]="U256",b[b.Reference=254]="Reference",b[b.Generic=255]="Generic",b))(Ji||{}),ro=(h=>(h[h.U8=0]="U8",h[h.U64=1]="U64",h[h.U128=2]="U128",h[h.Address=3]="Address",h[h.U8Vector=4]="U8Vector",h[h.Bool=5]="Bool",h[h.U16=6]="U16",h[h.U32=7]="U32",h[h.U256=8]="U256",h))(ro||{}),ea=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(ea||{}),ta=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(ta||{}),ra=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(ra||{}),na=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(na||{}),oa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(oa||{}),sa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(sa||{}),ia=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(ia||{}),pu=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(pu||{}),hu=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(hu||{}),gu=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(gu||{}),no=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(no||{}),aa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(aa||{}),yu=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(yu||{});var mu={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function xu(r,t){let{url:e,method:n,body:o,contentType:s,params:a,overrides:c}=r,f={...c?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${lu}`,"content-type":s??"application/json"};return c?.AUTH_TOKEN&&e.includes("faucet")&&(f.Authorization=`Bearer ${c?.AUTH_TOKEN}`),t.provider({url:e,method:n,body:o,params:a,headers:f,overrides:c})}async function Oo(r,t){let{url:e,path:n}=r,o=`${e}/${n??""}`,s=await xu({...r,url:o},t.client),a={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let f=a.data;if(f.errors)throw new cr(r,a,f.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);a.data=f.data}if(a.status>=200&&a.status<300)return a;let c;throw"message"in s.data&&"error_code"in s.data?c=JSON.stringify(s.data):a.status in mu?c=mu[a.status]:c=`Unhandled Error ${s.status} : ${s.statusText}`,new cr(r,a,c)}var Ss={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ca={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},ua={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},zo=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(zo||{}),Us={mainnet:1,testnet:2},Jp={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};var bu="devnet",Au=2e5,wu=20,Bs=20,Tu="0x1::aptos_coin::AptosCoin",_u="APTOS::RawTransaction",fa="APTOS::RawTransactionWithData";async function Eu(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:a,originMethod:c,type:f}=r,h=t.getRequestUrl(f);return Oo({url:h,method:"GET",originMethod:c,path:a,contentType:o?.valueOf(),acceptType:s?.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function bt(r){return Eu({...r,type:0})}async function On(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await bt({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function Cs(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:a,params:c,aptosConfig:f,overrides:h}=r,g=f.getRequestUrl(t);return Oo({url:g,method:"POST",originMethod:e,path:n,body:o,contentType:a?.valueOf(),acceptType:s?.valueOf(),params:c,overrides:{...f.clientConfig,...h}},f)}async function zn(r){return Cs({...r,type:0})}async function da(r){return Cs({...r,type:1})}async function la(r){return Cs({...r,type:2})}var eh={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0};var Su=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Is=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);var th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");var rh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function No(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=rh[r[e]];return t}function Rs(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}function nh(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}function tn(r){if(typeof r=="string"&&(r=nh(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}var en=class{clone(){return this._cloneInto()}};function oo(r){let t=n=>r().update(tn(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Uu(r){let t=(n,o)=>r(o).update(tn(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}var Ps=2**8-1,ks=2**16-1,vr=2**32-1,Nn=BigInt(2)**BigInt(64)-BigInt(1),Do=BigInt(2)**BigInt(128)-BigInt(1),Os=BigInt(2)**BigInt(256)-BigInt(1);var mt=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var Bu=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(Bu||{}),be=class{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return No(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new mt("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new mt("Hex string must be an even number of hex characters.","invalid_length");try{return new be(Rs(e))}catch(n){let o=n;throw new mt(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new be(t):be.fromString(t)}static isValid(t){try{return be.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var te=class{bcsToBytes(){let t=new Wt;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return be.fromHexInput(t)}},Wt=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){zs(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(vr),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&Nn,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&Do,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7!==0;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};Jr([Dn(0,Ps)],Wt.prototype,"serializeU8",1),Jr([Dn(0,ks)],Wt.prototype,"serializeU16",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32",1),Jr([Dn(BigInt(0),Nn)],Wt.prototype,"serializeU64",1),Jr([Dn(BigInt(0),Do)],Wt.prototype,"serializeU128",1),Jr([Dn(BigInt(0),Os)],Wt.prototype,"serializeU256",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32AsUleb128",1);function zs(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Cu=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function Er(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(Cu(r,t,e))}function Dn(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(c){return Er(c,r,t),s.apply(this,[c])},o}}var Iu=(c=>(c.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",c.INVALID_HEX_CHARS="invalid_hex_chars",c.TOO_SHORT="too_short",c.TOO_LONG="too_long",c.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",c.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",c.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",c))(Iu||{}),et=class extends te{constructor(e){super();if(e.length!==et.LENGTH)throw new mt("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=No(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return No(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(et.LENGTH);return new et(n)}static fromString(e){if(!e.startsWith("0x"))throw new mt("Hex string must start with a leading 0x.","leading_zero_x_required");let n=et.fromStringRelaxed(e);if(e.length!==et.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new mt(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new mt(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new mt("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new mt("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=Rs(n.padStart(64,"0"))}catch(s){let a=s;throw new mt(`Hex characters are invalid: ${a.message}`,"invalid_hex_chars")}return new et(o)}static fromRelaxed(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromStringRelaxed(e)}static from(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromString(e)}static isValid(e){try{return e.relaxed?et.fromRelaxed(e.input):et.from(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}},O=et;O.LENGTH=32,O.LONG_STRING_LENGTH=64,O.ZERO=et.from("0x0"),O.ONE=et.from("0x1"),O.TWO=et.from("0x2"),O.THREE=et.from("0x3"),O.FOUR=et.from("0x4");function pa(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function oh(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Ru(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function sh(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");pa(r.outputLen),pa(r.blockLen)}function ih(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function ah(r,t){Ru(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var ch={number:pa,bool:oh,bytes:Ru,hash:sh,exists:ih,output:ah},gt=ch;var Ns=BigInt(4294967295),ha=BigInt(32);function Pu(r,t=!1){return t?{h:Number(r&Ns),l:Number(r>>ha&Ns)}:{h:Number(r>>ha&Ns)|0,l:Number(r&Ns)|0}}function uh(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Pu(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var fh=(r,t)=>BigInt(r>>>0)<<ha|BigInt(t>>>0),dh=(r,t,e)=>r>>>e,lh=(r,t,e)=>r<<32-e|t>>>e,ph=(r,t,e)=>r>>>e|t<<32-e,hh=(r,t,e)=>r<<32-e|t>>>e,gh=(r,t,e)=>r<<64-e|t>>>e-32,yh=(r,t,e)=>r>>>e-32|t<<64-e,mh=(r,t)=>t,xh=(r,t)=>r,bh=(r,t,e)=>r<<e|t>>>32-e,Ah=(r,t,e)=>t<<e|r>>>32-e,wh=(r,t,e)=>t<<e-32|r>>>64-e,Th=(r,t,e)=>r<<e-32|t>>>64-e;function _h(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var vh=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Eh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Sh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Uh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Bh=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Ch=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,Ih={fromBig:Pu,split:uh,toBig:fh,shrSH:dh,shrSL:lh,rotrSH:ph,rotrSL:hh,rotrBH:gh,rotrBL:yh,rotr32H:mh,rotr32L:xh,rotlSH:bh,rotlSL:Ah,rotlBH:wh,rotlBL:Th,add:_h,add3L:vh,add3H:Eh,add4L:Sh,add4H:Uh,add5H:Ch,add5L:Bh},ne=Ih;var[zu,Nu,Du]=[[],[],[]],Rh=BigInt(0),Mo=BigInt(1),Ph=BigInt(2),kh=BigInt(7),Oh=BigInt(256),zh=BigInt(113);for(let r=0,t=Mo,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],zu.push(2*(5*n+e)),Nu.push((r+1)*(r+2)/2%64);let o=Rh;for(let s=0;s<7;s++)t=(t<<Mo^(t>>kh)*zh)%Oh,t&Ph&&(o^=Mo<<(Mo<<BigInt(s))-Mo);Du.push(o)}var[Nh,Dh]=ne.split(Du,!0),ku=(r,t,e)=>e>32?ne.rotlBH(r,t,e):ne.rotlSH(r,t,e),Ou=(r,t,e)=>e>32?ne.rotlBL(r,t,e):ne.rotlSL(r,t,e);function Mh(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)e[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let c=(a+8)%10,f=(a+2)%10,h=e[f],g=e[f+1],y=ku(h,g,1)^e[c],w=Ou(h,g,1)^e[c+1];for(let b=0;b<50;b+=10)r[a+b]^=y,r[a+b+1]^=w}let o=r[2],s=r[3];for(let a=0;a<24;a++){let c=Nu[a],f=ku(o,s,c),h=Ou(o,s,c),g=zu[a];o=r[g],s=r[g+1],r[g]=f,r[g+1]=h}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)e[c]=r[a+c];for(let c=0;c<10;c++)r[a+c]^=~e[(c+2)%10]&e[(c+4)%10]}r[0]^=Nh[n],r[1]^=Dh[n]}e.fill(0)}var so=class extends en{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,gt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Su(this.state)}keccak(){Mh(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){gt.exists(this);let{blockLen:e,state:n}=this;t=tn(t);let o=t.length;for(let s=0;s<o;){let a=Math.min(e-this.pos,o-s);for(let c=0;c<a;c++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,(e&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){gt.exists(this,!1),gt.bytes(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return gt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(gt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:a}=this;return t||(t=new so(e,n,o,a,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}},rn=(r,t,e)=>oo(()=>new so(t,r,e)),Rx=rn(6,144,224/8),Mn=rn(6,136,256/8),Px=rn(6,104,384/8),kx=rn(6,72,512/8),Ox=rn(1,144,224/8),zx=rn(1,136,256/8),Nx=rn(1,104,384/8),Dx=rn(1,72,512/8),Mu=(r,t,e)=>Uu((n={})=>new so(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Mx=Mu(31,168,128/8),qx=Mu(31,136,256/8);var Wo=Zi(Lu());var qo=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===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 t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<vr;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),(n&128)===0)break;e+=7}if(t>vr)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var ur=class extends te{constructor(e){super();this.value=be.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new ur(o)}};var qn=class extends te{constructor(e){super();this.value=new ur(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=ur.deserialize(e,n);return new qn(o.value)}};var Le=class extends te{constructor(e){super();zs(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new Le(e.deserializeBool())}},st=class extends te{constructor(e){super();Er(e,0,Ps),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new st(e.deserializeU8())}},At=class extends te{constructor(e){super();Er(e,0,ks),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new At(e.deserializeU16())}},wt=class extends te{constructor(e){super();Er(e,0,vr),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new wt(e.deserializeU32())}},He=class extends te{constructor(e){super();Er(e,BigInt(0),Nn),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new He(e.deserializeU64())}},Tt=class extends te{constructor(e){super();Er(e,BigInt(0),Do),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new Tt(e.deserializeU128())}},_t=class extends te{constructor(e){super();Er(e,BigInt(0),Os),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new _t(e.deserializeU256())}};var ve=class extends te{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof st)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=be.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new ve(n.map(o=>new st(o)))}static U16(e){return new ve(e.map(n=>new At(n)))}static U32(e){return new ve(e.map(n=>new wt(n)))}static U64(e){return new ve(e.map(n=>new He(n)))}static U128(e){return new ve(e.map(n=>new Tt(n)))}static U256(e){return new ve(e.map(n=>new _t(n)))}static Bool(e){return new ve(e.map(n=>new Le(n)))}static MoveString(e){return new ve(e.map(n=>new Ge(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1)s.push(n.deserialize(e));return new ve(s)}},Ge=class extends te{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){let n=this.bcsToBytes().slice(1);ve.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new Ge(e.deserializeStr())}},tt=class extends te{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new ve([e]):this.vec=new ve([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}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 tt(e!=null?new st(e):void 0)}static U16(e){return new tt(e!=null?new At(e):void 0)}static U32(e){return new tt(e!=null?new wt(e):void 0)}static U64(e){return new tt(e!=null?new He(e):void 0)}static U128(e){return new tt(e!=null?new Tt(e):void 0)}static U256(e){return new tt(e!=null?new _t(e):void 0)}static Bool(e){return new tt(e!=null?new Le(e):void 0)}static MoveString(e){return new tt(e!=null?new Ge(e):void 0)}static deserialize(e,n){let o=ve.deserialize(e,n);return new tt(o.values[0])}};var Pt=class extends te{},Ln=class extends te{},Qt=class extends te{};var Ms=class extends en{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,gt.hash(t);let n=tn(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return gt.exists(this),this.iHash.update(t),this}digestInto(t){gt.exists(this),gt.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ga=(r,t,e)=>new Ms(r,t).update(e).digest();ga.create=(r,t)=>new Ms(r,t);function qh(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var qs=class extends en{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Is(this.buffer)}update(t){gt.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=tn(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=Is(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){gt.exists(this),gt.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;qh(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=Is(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var[Lh,Hh]=ne.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),nn=new Uint32Array(80),on=new Uint32Array(80),Lo=class extends qs{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)nn[E]=t.getUint32(e),on[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=nn[E-15]|0,D=on[E-15]|0,F=ne.rotrSH(K,D,1)^ne.rotrSH(K,D,8)^ne.shrSH(K,D,7),J=ne.rotrSL(K,D,1)^ne.rotrSL(K,D,8)^ne.shrSL(K,D,7),G=nn[E-2]|0,oe=on[E-2]|0,de=ne.rotrSH(G,oe,19)^ne.rotrBH(G,oe,61)^ne.shrSH(G,oe,6),ce=ne.rotrSL(G,oe,19)^ne.rotrBL(G,oe,61)^ne.shrSL(G,oe,6),Pe=ne.add4L(J,ce,on[E-7],on[E-16]),Oe=ne.add4H(Pe,F,de,nn[E-7],nn[E-16]);nn[E]=Oe|0,on[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=ne.rotrSH(y,w,14)^ne.rotrSH(y,w,18)^ne.rotrBH(y,w,41),D=ne.rotrSL(y,w,14)^ne.rotrSL(y,w,18)^ne.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=ne.add5L(M,D,J,Hh[E],on[E]),oe=ne.add5H(G,R,K,F,Lh[E],nn[E]),de=G|0,ce=ne.rotrSH(n,o,28)^ne.rotrBH(n,o,34)^ne.rotrBH(n,o,39),Pe=ne.rotrSL(n,o,28)^ne.rotrBL(n,o,34)^ne.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=ne.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=ne.add3L(de,Pe,at);n=ne.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=ne.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=ne.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=ne.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=ne.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=ne.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=ne.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=ne.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=ne.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){nn.fill(0),on.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ya=class extends Lo{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},ma=class extends Lo{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Hu=oo(()=>new Lo),Db=oo(()=>new ya),Mb=oo(()=>new ma);var Uf=Zi(Sf()),Bf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,Cf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,If=(t=>(t.ED25519="ed25519 seed",t))(If||{}),Oa=2147483648;function za(r){return Cf.test(r)}function Na(r){return Bf.test(r)}var Xs=(r,t)=>{let e=ga.create(Hu,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},Da=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...r,...o]);return Xs(t,a)},V0=r=>r.replace("'",""),Ma=r=>r.split("/").slice(1).map(V0),Vo=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return Uf.mnemonicToSeedSync(t)};var uo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==uo.LENGTH)throw new Error(`PublicKey length should be ${uo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=o.toUint8Array();return Wo.default.sign.detached.verify(s,a,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new uo(n)}static load(e){let n=e.deserializeBytes();return new uo(n)}},De=uo;De.LENGTH=32;var Lt=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==Lt.LENGTH)throw new Error(`PrivateKey length should be ${Lt.LENGTH}`);this.signingKeyPair=Wo.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,Lt.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,Lt.LENGTH)}toString(){return be.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=be.fromHexInput(e),o=Wo.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new je(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Lt(n)}static generate(){let e=Wo.default.sign.keyPair();return new Lt(e.secretKey.slice(0,Lt.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new De(e)}static fromDerivationPath(e,n){if(!Na(e))throw new Error(`Invalid derivation path ${e}`);return Lt.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n,o=Oa){let{key:s,chainCode:a}=Xs(Lt.SLIP_0010_SEED,n),c=Ma(e).map(h=>parseInt(h,10)),{key:f}=c.reduce((h,g)=>Da(h,g+o),{key:s,chainCode:a});return new Lt(f)}},Zt=Lt;Zt.LENGTH=32,Zt.SLIP_0010_SEED="ed25519 seed";var fo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==fo.LENGTH)throw new Error(`Signature length should be ${fo.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new fo(n)}static load(e){let n=e.deserializeBytes();return new fo(n)}},je=fo;je.LENGTH=64;var Ur=class extends Pt{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>Ur.MAX_KEYS||n.length<Ur.MIN_KEYS)throw new Error(`Must have between ${Ur.MIN_KEYS} and ${Ur.MAX_KEYS} public keys, inclusive`);if(o<Ur.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${Ur.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*De.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*De.LENGTH)}),e[this.publicKeys.length*De.LENGTH]=this.threshold,e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let a=0;a<n.length-1;a+=De.LENGTH){let c=a;s.push(new De(n.subarray(c,c+De.LENGTH)))}return new Ur({publicKeys:s,threshold:o})}},Et=Ur;Et.MAX_KEYS=32,Et.MIN_KEYS=2,Et.MIN_THRESHOLD=1;var pr=class extends Qt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==pr.BITMAP_LEN)throw new Error(`"bitmap" length should be ${pr.BITMAP_LEN}`);if(n.length>pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${pr.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*je.LENGTH+pr.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*je.LENGTH)}),e.set(this.bitmap,this.signatures.length*je.LENGTH),e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach(c=>{if(c>=pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${pr.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(c))throw new Error("Duplicate bits detected.");a.add(c);let f=Math.floor(c/8),h=s[f];h|=o>>c%8,s[f]=h}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let a=0;a<n.length-o.length;a+=je.LENGTH){let c=a;s.push(new je(n.subarray(c,c+je.LENGTH)))}return new pr({signatures:s,bitmap:o})}},Br=pr;Br.MAX_SIGNATURES_SUPPORTED=32,Br.BITMAP_LEN=4;function Rf(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Cr(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Pf(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Rf(r.outputLen),Rf(r.blockLen)}function lo(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function kf(r,t){Cr(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var Zs=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var qa=r=>r instanceof Uint8Array;var dn=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Jt=(r,t)=>r<<32-t|r>>>t,W0=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!W0)throw new Error("Non little-endian hardware is not supported");var Q0=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Of(r){if(!qa(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Q0[r[e]];return t}function zf(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function La(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Qo(r){if(typeof r=="string"&&(r=La(r)),!qa(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Gn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!qa(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var po=class{clone(){return this._cloneInto()}},dA={}.toString;function ho(r){let t=n=>r().update(Qo(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Nf(r=32){if(Zs&&typeof Zs.getRandomValues=="function")return Zs.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Y0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var ln=class extends po{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dn(this.buffer)}update(t){lo(this);let{view:e,buffer:n,blockLen:o}=this;t=Qo(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=dn(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){lo(this),kf(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let y=a;y<o;y++)e[y]=0;Y0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=dn(t),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=f/4,g=this.get();if(h>g.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<h;y++)c.setUint32(4*y,g[y],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var X0=(r,t,e)=>r&t^~r&e,Z0=(r,t,e)=>r&t^r&e^t&e,J0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hn=new Uint32Array(64),Ha=class extends ln{constructor(){super(64,32,8,!1),this.A=pn[0]|0,this.B=pn[1]|0,this.C=pn[2]|0,this.D=pn[3]|0,this.E=pn[4]|0,this.F=pn[5]|0,this.G=pn[6]|0,this.H=pn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)hn[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=hn[y-15],b=hn[y-2],I=Jt(w,7)^Jt(w,18)^w>>>3,T=Jt(b,17)^Jt(b,19)^b>>>10;hn[y]=T+hn[y-7]+I+hn[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=Jt(c,6)^Jt(c,11)^Jt(c,25),b=g+w+X0(c,f,h)+J0[y]+hn[y]|0,T=(Jt(n,2)^Jt(n,13)^Jt(n,22))+Z0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){hn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Yo=ho(()=>new Ha);var Ka={};fu(Ka,{bitGet:()=>ig,bitLen:()=>sg,bitMask:()=>Xo,bitSet:()=>ag,bytesToHex:()=>Fn,bytesToNumberBE:()=>Ir,bytesToNumberLE:()=>ti,concatBytes:()=>go,createHmacDrbg:()=>$a,ensureBytes:()=>kt,equalBytes:()=>ng,hexToBytes:()=>$n,hexToNumber:()=>Fa,numberToBytesBE:()=>gn,numberToBytesLE:()=>ri,numberToHexUnpadded:()=>qf,numberToVarBytesBE:()=>rg,utf8ToBytes:()=>og,validateObject:()=>yn});var Mf=BigInt(0),Js=BigInt(1),eg=BigInt(2),ei=r=>r instanceof Uint8Array,tg=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Fn(r){if(!ei(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=tg[r[e]];return t}function qf(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function Fa(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function $n(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function Ir(r){return Fa(Fn(r))}function ti(r){if(!ei(r))throw new Error("Uint8Array expected");return Fa(Fn(Uint8Array.from(r).reverse()))}function gn(r,t){return $n(r.toString(16).padStart(t*2,"0"))}function ri(r,t){return gn(r,t).reverse()}function rg(r){return $n(qf(r))}function kt(r,t,e){let n;if(typeof t=="string")try{n=$n(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(ei(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function go(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!ei(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function ng(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function og(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function sg(r){let t;for(t=0;r>Mf;r>>=Js,t+=1);return t}function ig(r,t){return r>>BigInt(t)&Js}var ag=(r,t,e)=>r|(e?Js:Mf)<<BigInt(t),Xo=r=>(eg<<BigInt(r-1))-Js,Ga=r=>new Uint8Array(r),Df=r=>Uint8Array.from(r);function $a(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Ga(r),o=Ga(r),s=0,a=()=>{n.fill(1),o.fill(0),s=0},c=(...y)=>e(o,n,...y),f=(y=Ga())=>{o=c(Df([0]),y),n=c(),y.length!==0&&(o=c(Df([1]),y),n=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0,w=[];for(;y<t;){n=c();let b=n.slice();w.push(b),y+=n.length}return go(...w)};return(y,w)=>{a(),f(y);let b;for(;!(b=w(h()));)f();return a(),b}}var cg={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function yn(r,t,e={}){let n=(o,s,a)=>{let c=cg[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let f=r[o];if(!(a&&f===void 0)&&!c(f,r))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var it=BigInt(0),Ye=BigInt(1),Kn=BigInt(2),ug=BigInt(3),ja=BigInt(4),Lf=BigInt(5),Hf=BigInt(8),fg=BigInt(9),dg=BigInt(16);function ct(r,t){let e=r%t;return e>=it?e:t+e}function lg(r,t,e){if(e<=it||t<it)throw new Error("Expected power/modulo > 0");if(e===Ye)return it;let n=Ye;for(;t>it;)t&Ye&&(n=n*r%e),r=r*r%e,t>>=Ye;return n}function Ot(r,t,e){let n=r;for(;t-- >it;)n*=n,n%=e;return n}function ni(r,t){if(r===it||t<=it)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=ct(r,t),n=t,o=it,s=Ye,a=Ye,c=it;for(;e!==it;){let h=n/e,g=n%e,y=o-a*h,w=s-c*h;n=e,e=g,o=a,s=c,a=y,c=w}if(n!==Ye)throw new Error("invert: does not exist");return ct(o,t)}function pg(r){let t=(r-Ye)/Kn,e,n,o;for(e=r-Ye,n=0;e%Kn===it;e/=Kn,n++);for(o=Kn;o<r&&lg(o,t,r)!==r-Ye;o++);if(n===1){let a=(r+Ye)/ja;return function(f,h){let g=f.pow(h,a);if(!f.eql(f.sqr(g),h))throw new Error("Cannot find square root");return g}}let s=(e+Ye)/Kn;return function(c,f){if(c.pow(f,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=n,g=c.pow(c.mul(c.ONE,o),e),y=c.pow(f,s),w=c.pow(f,e);for(;!c.eql(w,c.ONE);){if(c.eql(w,c.ZERO))return c.ZERO;let b=1;for(let T=c.sqr(w);b<h&&!c.eql(T,c.ONE);b++)T=c.sqr(T);let I=c.pow(g,Ye<<BigInt(h-b-1));g=c.sqr(I),y=c.mul(y,I),w=c.mul(w,g),h=b}return y}}function hg(r){if(r%ja===ug){let t=(r+Ye)/ja;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%Hf===Lf){let t=(r-Lf)/Hf;return function(n,o){let s=n.mul(o,Kn),a=n.pow(s,t),c=n.mul(o,a),f=n.mul(n.mul(c,Kn),a),h=n.mul(c,n.sub(f,n.ONE));if(!n.eql(n.sqr(h),o))throw new Error("Cannot find square root");return h}}return r%dg,pg(r)}var gg=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Va(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=gg.reduce((n,o)=>(n[o]="function",n),t);return yn(r,e)}function yg(r,t,e){if(e<it)throw new Error("Expected power > 0");if(e===it)return r.ONE;if(e===Ye)return t;let n=r.ONE,o=t;for(;e>it;)e&Ye&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Ye;return n}function mg(r,t){let e=new Array(t.length),n=t.reduce((s,a,c)=>r.is0(a)?s:(e[c]=s,r.mul(s,a)),r.ONE),o=r.inv(n);return t.reduceRight((s,a,c)=>r.is0(a)?s:(e[c]=r.mul(s,e[c]),r.mul(s,a)),o),e}function Wa(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function Gf(r,t,e=!1,n={}){if(r<=it)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Wa(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=hg(r),c=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Xo(o),ZERO:it,ONE:Ye,create:f=>ct(f,r),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return it<=f&&f<r},is0:f=>f===it,isOdd:f=>(f&Ye)===Ye,neg:f=>ct(-f,r),eql:(f,h)=>f===h,sqr:f=>ct(f*f,r),add:(f,h)=>ct(f+h,r),sub:(f,h)=>ct(f-h,r),mul:(f,h)=>ct(f*h,r),pow:(f,h)=>yg(c,f,h),div:(f,h)=>ct(f*ni(h,r),r),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>ni(f,r),sqrt:n.sqrt||(f=>a(c,f)),invertBatch:f=>mg(c,f),cmov:(f,h,g)=>g?h:f,toBytes:f=>e?ri(f,s):gn(f,s),fromBytes:f=>{if(f.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${f.length}`);return e?ti(f):Ir(f)}});return Object.freeze(c)}function Ff(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Qa(r){let t=Ff(r);return t+Math.ceil(t/2)}function $f(r,t,e=!1){let n=r.length,o=Ff(t),s=Qa(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let a=e?Ir(r):ti(r),c=ct(a,t-Ye)+Ye;return e?ri(c,o):gn(c,o)}var bg=BigInt(0),Ya=BigInt(1);function Kf(r,t){let e=(o,s)=>{let a=s.negate();return o?a:s},n=o=>{let s=Math.ceil(t/o)+1,a=2**(o-1);return{windows:s,windowSize:a}};return{constTimeNegate:e,unsafeLadder(o,s){let a=r.ZERO,c=o;for(;s>bg;)s&Ya&&(a=a.add(c)),c=c.double(),s>>=Ya;return a},precomputeWindow(o,s){let{windows:a,windowSize:c}=n(s),f=[],h=o,g=h;for(let y=0;y<a;y++){g=h,f.push(g);for(let w=1;w<c;w++)g=g.add(h),f.push(g);h=g.double()}return f},wNAF(o,s,a){let{windows:c,windowSize:f}=n(o),h=r.ZERO,g=r.BASE,y=BigInt(2**o-1),w=2**o,b=BigInt(o);for(let I=0;I<c;I++){let T=I*f,S=Number(a&y);a>>=b,S>f&&(S-=w,a+=Ya);let R=T,M=T+Math.abs(S)-1,E=I%2!==0,K=S<0;S===0?g=g.add(e(E,s[R])):h=h.add(e(K,s[M]))}return{p:h,f:g}},wNAFCached(o,s,a,c){let f=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,f),f!==1&&s.set(o,c(h))),this.wNAF(f,h,a)}}}function Xa(r){return Va(r.Fp),yn(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Wa(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Ag(r){let t=Xa(r);yn(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:wg,hexToBytes:Tg}=Ka,jn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=jn;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:wg(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=jn,e=typeof r=="string"?Tg(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=jn._parseInt(e.subarray(2)),{d:a,l:c}=jn._parseInt(s);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(r){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,e=h=>{let g=h.toString(16);return g.length&1?`0${g}`:g},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,a=o.length/2,c=e(s),f=e(a);return`30${e(a+s+4)}02${f}${o}02${c}${n}`}},Rr=BigInt(0),Ht=BigInt(1),SA=BigInt(2),jf=BigInt(3),UA=BigInt(4);function _g(r){let t=Ag(r),{Fp:e}=t,n=t.toBytes||((I,T,S)=>{let R=T.toAffine();return go(Uint8Array.from([4]),e.toBytes(R.x),e.toBytes(R.y))}),o=t.fromBytes||(I=>{let T=I.subarray(1),S=e.fromBytes(T.subarray(0,e.BYTES)),R=e.fromBytes(T.subarray(e.BYTES,2*e.BYTES));return{x:S,y:R}});function s(I){let{a:T,b:S}=t,R=e.sqr(I),M=e.mul(R,I);return e.add(e.add(M,e.mul(I,T)),S)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(I){return typeof I=="bigint"&&Rr<I&&I<t.n}function c(I){if(!a(I))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function f(I){let{allowedPrivateKeyLengths:T,nByteLength:S,wrapPrivateKey:R,n:M}=t;if(T&&typeof I!="bigint"){if(I instanceof Uint8Array&&(I=Fn(I)),typeof I!="string"||!T.includes(I.length))throw new Error("Invalid key");I=I.padStart(S*2,"0")}let E;try{E=typeof I=="bigint"?I:Ir(kt("private key",I,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof I}`)}return R&&(E=ct(E,M)),c(E),E}let h=new Map;function g(I){if(!(I instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(T,S,R){if(this.px=T,this.py=S,this.pz=R,T==null||!e.isValid(T))throw new Error("x required");if(S==null||!e.isValid(S))throw new Error("y required");if(R==null||!e.isValid(R))throw new Error("z required")}static fromAffine(T){let{x:S,y:R}=T||{};if(!T||!e.isValid(S)||!e.isValid(R))throw new Error("invalid affine point");if(T instanceof y)throw new Error("projective point not allowed");let M=E=>e.eql(E,e.ZERO);return M(S)&&M(R)?y.ZERO:new y(S,R,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(T){let S=e.invertBatch(T.map(R=>R.pz));return T.map((R,M)=>R.toAffine(S[M])).map(y.fromAffine)}static fromHex(T){let S=y.fromAffine(o(kt("pointHex",T)));return S.assertValidity(),S}static fromPrivateKey(T){return y.BASE.multiply(f(T))}_setWindowSize(T){this._WINDOW_SIZE=T,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:T,y:S}=this.toAffine();if(!e.isValid(T)||!e.isValid(S))throw new Error("bad point: x or y not FE");let R=e.sqr(S),M=s(T);if(!e.eql(R,M))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:T}=this.toAffine();if(e.isOdd)return!e.isOdd(T);throw new Error("Field doesn't support isOdd")}equals(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.eql(e.mul(S,D),e.mul(E,M)),J=e.eql(e.mul(R,D),e.mul(K,M));return F&&J}negate(){return new y(this.px,e.neg(this.py),this.pz)}double(){let{a:T,b:S}=t,R=e.mul(S,jf),{px:M,py:E,pz:K}=this,D=e.ZERO,F=e.ZERO,J=e.ZERO,G=e.mul(M,M),oe=e.mul(E,E),de=e.mul(K,K),ce=e.mul(M,E);return ce=e.add(ce,ce),J=e.mul(M,K),J=e.add(J,J),D=e.mul(T,J),F=e.mul(R,de),F=e.add(D,F),D=e.sub(oe,F),F=e.add(oe,F),F=e.mul(D,F),D=e.mul(ce,D),J=e.mul(R,J),de=e.mul(T,de),ce=e.sub(G,de),ce=e.mul(T,ce),ce=e.add(ce,J),J=e.add(G,G),G=e.add(J,G),G=e.add(G,de),G=e.mul(G,ce),F=e.add(F,G),de=e.mul(E,K),de=e.add(de,de),G=e.mul(de,ce),D=e.sub(D,G),J=e.mul(de,oe),J=e.add(J,J),J=e.add(J,J),new y(D,F,J)}add(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.ZERO,J=e.ZERO,G=e.ZERO,oe=t.a,de=e.mul(t.b,jf),ce=e.mul(S,E),Pe=e.mul(R,K),Oe=e.mul(M,D),at=e.add(S,R),z=e.add(E,K);at=e.mul(at,z),z=e.add(ce,Pe),at=e.sub(at,z),z=e.add(S,M);let V=e.add(E,D);return z=e.mul(z,V),V=e.add(ce,Oe),z=e.sub(z,V),V=e.add(R,M),F=e.add(K,D),V=e.mul(V,F),F=e.add(Pe,Oe),V=e.sub(V,F),G=e.mul(oe,z),F=e.mul(de,Oe),G=e.add(F,G),F=e.sub(Pe,G),G=e.add(Pe,G),J=e.mul(F,G),Pe=e.add(ce,ce),Pe=e.add(Pe,ce),Oe=e.mul(oe,Oe),z=e.mul(de,z),Pe=e.add(Pe,Oe),Oe=e.sub(ce,Oe),Oe=e.mul(oe,Oe),z=e.add(z,Oe),ce=e.mul(Pe,z),J=e.add(J,ce),ce=e.mul(V,z),F=e.mul(at,F),F=e.sub(F,ce),ce=e.mul(at,Pe),G=e.mul(V,G),G=e.add(G,ce),new y(F,J,G)}subtract(T){return this.add(T.negate())}is0(){return this.equals(y.ZERO)}wNAF(T){return b.wNAFCached(this,h,T,S=>{let R=e.invertBatch(S.map(M=>M.pz));return S.map((M,E)=>M.toAffine(R[E])).map(y.fromAffine)})}multiplyUnsafe(T){let S=y.ZERO;if(T===Rr)return S;if(c(T),T===Ht)return this;let{endo:R}=t;if(!R)return b.unsafeLadder(this,T);let{k1neg:M,k1:E,k2neg:K,k2:D}=R.splitScalar(T),F=S,J=S,G=this;for(;E>Rr||D>Rr;)E&Ht&&(F=F.add(G)),D&Ht&&(J=J.add(G)),G=G.double(),E>>=Ht,D>>=Ht;return M&&(F=F.negate()),K&&(J=J.negate()),J=new y(e.mul(J.px,R.beta),J.py,J.pz),F.add(J)}multiply(T){c(T);let S=T,R,M,{endo:E}=t;if(E){let{k1neg:K,k1:D,k2neg:F,k2:J}=E.splitScalar(S),{p:G,f:oe}=this.wNAF(D),{p:de,f:ce}=this.wNAF(J);G=b.constTimeNegate(K,G),de=b.constTimeNegate(F,de),de=new y(e.mul(de.px,E.beta),de.py,de.pz),R=G.add(de),M=oe.add(ce)}else{let{p:K,f:D}=this.wNAF(S);R=K,M=D}return y.normalizeZ([R,M])[0]}multiplyAndAddUnsafe(T,S,R){let M=y.BASE,E=(D,F)=>F===Rr||F===Ht||!D.equals(M)?D.multiplyUnsafe(F):D.multiply(F),K=E(this,S).add(E(T,R));return K.is0()?void 0:K}toAffine(T){let{px:S,py:R,pz:M}=this,E=this.is0();T==null&&(T=E?e.ONE:e.inv(M));let K=e.mul(S,T),D=e.mul(R,T),F=e.mul(M,T);if(E)return{x:e.ZERO,y:e.ZERO};if(!e.eql(F,e.ONE))throw new Error("invZ was invalid");return{x:K,y:D}}isTorsionFree(){let{h:T,isTorsionFree:S}=t;if(T===Ht)return!0;if(S)return S(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:T,clearCofactor:S}=t;return T===Ht?this:S?S(y,this):this.multiplyUnsafe(t.h)}toRawBytes(T=!0){return this.assertValidity(),n(y,this,T)}toHex(T=!0){return Fn(this.toRawBytes(T))}}y.BASE=new y(t.Gx,t.Gy,e.ONE),y.ZERO=new y(e.ZERO,e.ONE,e.ZERO);let w=t.nBitLength,b=Kf(y,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:a}}function vg(r){let t=Xa(r);return yn(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Vf(r){let t=vg(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function a(z){return Rr<z&&z<e.ORDER}function c(z){return ct(z,n)}function f(z){return ni(z,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:g,weierstrassEquation:y,isWithinCurveOrder:w}=_g({...t,toBytes(z,V,le){let Re=V.toAffine(),ke=e.toBytes(Re.x),Ze=go;return le?Ze(Uint8Array.from([V.hasEvenY()?2:3]),ke):Ze(Uint8Array.from([4]),ke,e.toBytes(Re.y))},fromBytes(z){let V=z.length,le=z[0],Re=z.subarray(1);if(V===o&&(le===2||le===3)){let ke=Ir(Re);if(!a(ke))throw new Error("Point is not on curve");let Ze=y(ke),dt=e.sqrt(Ze),Me=(dt&Ht)===Ht;return(le&1)===1!==Me&&(dt=e.neg(dt)),{x:ke,y:dt}}else if(V===s&&le===4){let ke=e.fromBytes(Re.subarray(0,e.BYTES)),Ze=e.fromBytes(Re.subarray(e.BYTES,2*e.BYTES));return{x:ke,y:Ze}}else throw new Error(`Point of length ${V} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),b=z=>Fn(gn(z,t.nByteLength));function I(z){let V=n>>Ht;return z>V}function T(z){return I(z)?c(-z):z}let S=(z,V,le)=>Ir(z.slice(V,le));class R{constructor(V,le,Re){this.r=V,this.s=le,this.recovery=Re,this.assertValidity()}static fromCompact(V){let le=t.nByteLength;return V=kt("compactSignature",V,le*2),new R(S(V,0,le),S(V,le,2*le))}static fromDER(V){let{r:le,s:Re}=jn.toSig(kt("DER",V));return new R(le,Re)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(V){return new R(this.r,this.s,V)}recoverPublicKey(V){let{r:le,s:Re,recovery:ke}=this,Ze=J(kt("msgHash",V));if(ke==null||![0,1,2,3].includes(ke))throw new Error("recovery id invalid");let dt=ke===2||ke===3?le+t.n:le;if(dt>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let Me=(ke&1)===0?"02":"03",rt=h.fromHex(Me+b(dt)),pe=f(dt),nt=c(-Ze*pe),Yr=c(Re*pe),Vt=h.BASE.multiplyAndAddUnsafe(rt,nt,Yr);if(!Vt)throw new Error("point at infinify");return Vt.assertValidity(),Vt}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return $n(this.toDERHex())}toDERHex(){return jn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $n(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}let M={isValidPrivateKey(z){try{return g(z),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{let z=Qa(t.n);return $f(t.randomBytes(z),t.n)},precompute(z=8,V=h.BASE){return V._setWindowSize(z),V.multiply(BigInt(3)),V}};function E(z,V=!0){return h.fromPrivateKey(z).toRawBytes(V)}function K(z){let V=z instanceof Uint8Array,le=typeof z=="string",Re=(V||le)&&z.length;return V?Re===o||Re===s:le?Re===2*o||Re===2*s:z instanceof h}function D(z,V,le=!0){if(K(z))throw new Error("first arg must be private key");if(!K(V))throw new Error("second arg must be public key");return h.fromHex(V).multiply(g(z)).toRawBytes(le)}let F=t.bits2int||function(z){let V=Ir(z),le=z.length*8-t.nBitLength;return le>0?V>>BigInt(le):V},J=t.bits2int_modN||function(z){return c(F(z))},G=Xo(t.nBitLength);function oe(z){if(typeof z!="bigint")throw new Error("bigint expected");if(!(Rr<=z&&z<G))throw new Error(`bigint expected < 2^${t.nBitLength}`);return gn(z,t.nByteLength)}function de(z,V,le=ce){if(["recovered","canonical"].some(Mt=>Mt in le))throw new Error("sign() legacy options not supported");let{hash:Re,randomBytes:ke}=t,{lowS:Ze,prehash:dt,extraEntropy:Me}=le;Ze==null&&(Ze=!0),z=kt("msgHash",z),dt&&(z=kt("prehashed msgHash",Re(z)));let rt=J(z),pe=g(V),nt=[oe(pe),oe(rt)];if(Me!=null){let Mt=Me===!0?ke(e.BYTES):Me;nt.push(kt("extraEntropy",Mt))}let Yr=go(...nt),Vt=rt;function Xr(Mt){let Tr=F(Mt);if(!w(Tr))return;let Rn=f(Tr),It=h.BASE.multiply(Tr).toAffine(),Zr=c(It.x);if(Zr===Rr)return;let Jn=c(Rn*c(Vt+Zr*pe));if(Jn===Rr)return;let bs=(It.x===Zr?0:2)|Number(It.y&Ht),Bo=Jn;return Ze&&I(Jn)&&(Bo=T(Jn),bs^=1),new R(Zr,Bo,bs)}return{seed:Yr,k2sig:Xr}}let ce={lowS:t.lowS,prehash:!1},Pe={lowS:t.lowS,prehash:!1};function Oe(z,V,le=ce){let{seed:Re,k2sig:ke}=de(z,V,le),Ze=t;return $a(Ze.hash.outputLen,Ze.nByteLength,Ze.hmac)(Re,ke)}h.BASE._setWindowSize(8);function at(z,V,le,Re=Pe){let ke=z;if(V=kt("msgHash",V),le=kt("publicKey",le),"strict"in Re)throw new Error("options.strict was renamed to lowS");let{lowS:Ze,prehash:dt}=Re,Me,rt;try{if(typeof ke=="string"||ke instanceof Uint8Array)try{Me=R.fromDER(ke)}catch(It){if(!(It instanceof jn.Err))throw It;Me=R.fromCompact(ke)}else if(typeof ke=="object"&&typeof ke.r=="bigint"&&typeof ke.s=="bigint"){let{r:It,s:Zr}=ke;Me=new R(It,Zr)}else throw new Error("PARSE");rt=h.fromHex(le)}catch(It){if(It.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ze&&Me.hasHighS())return!1;dt&&(V=t.hash(V));let{r:pe,s:nt}=Me,Yr=J(V),Vt=f(nt),Xr=c(Yr*Vt),Mt=c(pe*Vt),Tr=h.BASE.multiplyAndAddUnsafe(rt,Xr,Mt)?.toAffine();return Tr?c(Tr.x)===pe:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:D,sign:Oe,verify:at,ProjectivePoint:h,Signature:R,utils:M}}var oi=class extends po{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Pf(t);let n=Qo(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return lo(this),this.iHash.update(t),this}digestInto(t){lo(this),Cr(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},yo=(r,t,e)=>new oi(r,t).update(e).digest();yo.create=(r,t)=>new oi(r,t);function Eg(r){return{hash:r,hmac:(t,...e)=>yo(r,t,Gn(...e)),randomBytes:Nf}}function Wf(r,t){let e=n=>Vf({...r,...Eg(n)});return Object.freeze({...e(t),create:e})}var Xf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Qf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Sg=BigInt(1),Za=BigInt(2),Yf=(r,t)=>(r+t/Za)/t;function Ug(r){let t=Xf,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),f=BigInt(88),h=r*r*r%t,g=h*h*r%t,y=Ot(g,e,t)*g%t,w=Ot(y,e,t)*g%t,b=Ot(w,Za,t)*h%t,I=Ot(b,o,t)*b%t,T=Ot(I,s,t)*I%t,S=Ot(T,c,t)*T%t,R=Ot(S,f,t)*S%t,M=Ot(R,c,t)*T%t,E=Ot(M,e,t)*g%t,K=Ot(E,a,t)*I%t,D=Ot(K,n,t)*h%t,F=Ot(D,Za,t);if(!Ja.eql(Ja.sqr(F),r))throw new Error("Cannot find square root");return F}var Ja=Gf(Xf,void 0,void 0,{sqrt:Ug}),yt=Wf({a:BigInt(0),b:BigInt(7),Fp:Ja,n:Qf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=Qf,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Sg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,a=BigInt("0x100000000000000000000000000000000"),c=Yf(s*r,t),f=Yf(-n*r,t),h=ct(r-c*e-f*o,t),g=ct(-c*n-f*s,t),y=h>a,w=g>a;if(y&&(h=t-h),w&&(g=t-g),h>a||g>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:y,k1:h,k2neg:w,k2:g}}}},Yo),qA=BigInt(0);var LA=yt.ProjectivePoint;var Bg=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Jf=Uint8Array.from({length:16},(r,t)=>t),Cg=Jf.map(r=>(9*r+5)%16),tc=[Jf],rc=[Cg];for(let r=0;r<4;r++)for(let t of[tc,rc])t.push(t[r].map(e=>Bg[e]));var ed=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),Ig=tc.map((r,t)=>r.map(e=>ed[t][e])),Rg=rc.map((r,t)=>r.map(e=>ed[t][e])),Pg=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),kg=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),si=(r,t)=>r<<t|r>>>32-t;function Zf(r,t,e,n){return r===0?t^e^n:r===1?t&e|~t&n:r===2?(t|~e)^n:r===3?t&n|e&~n:t^(e|~n)}var ii=new Uint32Array(16),ec=class extends ln{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:n,h3:o,h4:s}=this;return[t,e,n,o,s]}set(t,e,n,o,s){this.h0=t|0,this.h1=e|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,e){for(let b=0;b<16;b++,e+=4)ii[b]=t.getUint32(e,!0);let n=this.h0|0,o=n,s=this.h1|0,a=s,c=this.h2|0,f=c,h=this.h3|0,g=h,y=this.h4|0,w=y;for(let b=0;b<5;b++){let I=4-b,T=Pg[b],S=kg[b],R=tc[b],M=rc[b],E=Ig[b],K=Rg[b];for(let D=0;D<16;D++){let F=si(n+Zf(b,s,c,h)+ii[R[D]]+T,E[D])+y|0;n=y,y=h,h=si(c,10)|0,c=s,s=F}for(let D=0;D<16;D++){let F=si(o+Zf(I,a,f,g)+ii[M[D]]+S,K[D])+w|0;o=w,w=g,g=si(f,10)|0,f=a,a=F}}this.set(this.h1+c+g|0,this.h2+h+w|0,this.h3+y+o|0,this.h4+n+a|0,this.h0+s+f|0)}roundClean(){ii.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},td=ho(()=>new ec);var ai=BigInt(4294967295),nc=BigInt(32);function rd(r,t=!1){return t?{h:Number(r&ai),l:Number(r>>nc&ai)}:{h:Number(r>>nc&ai)|0,l:Number(r&ai)|0}}function Og(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=rd(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var zg=(r,t)=>BigInt(r>>>0)<<nc|BigInt(t>>>0),Ng=(r,t,e)=>r>>>e,Dg=(r,t,e)=>r<<32-e|t>>>e,Mg=(r,t,e)=>r>>>e|t<<32-e,qg=(r,t,e)=>r<<32-e|t>>>e,Lg=(r,t,e)=>r<<64-e|t>>>e-32,Hg=(r,t,e)=>r>>>e-32|t<<64-e,Gg=(r,t)=>t,Fg=(r,t)=>r,$g=(r,t,e)=>r<<e|t>>>32-e,Kg=(r,t,e)=>t<<e|r>>>32-e,jg=(r,t,e)=>t<<e-32|r>>>64-e,Vg=(r,t,e)=>r<<e-32|t>>>64-e;function Wg(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Qg=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Yg=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Xg=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Zg=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Jg=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),ey=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0;var ty={fromBig:rd,split:Og,toBig:zg,shrSH:Ng,shrSL:Dg,rotrSH:Mg,rotrSL:qg,rotrBH:Lg,rotrBL:Hg,rotr32H:Gg,rotr32L:Fg,rotlSH:$g,rotlSL:Kg,rotlBH:jg,rotlBL:Vg,add:Wg,add3L:Qg,add3H:Yg,add4L:Xg,add4H:Zg,add5H:ey,add5L:Jg},Ae=ty;var[ry,ny]=(()=>Ae.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),mn=new Uint32Array(80),xn=new Uint32Array(80),oc=class extends ln{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)mn[E]=t.getUint32(e),xn[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=mn[E-15]|0,D=xn[E-15]|0,F=Ae.rotrSH(K,D,1)^Ae.rotrSH(K,D,8)^Ae.shrSH(K,D,7),J=Ae.rotrSL(K,D,1)^Ae.rotrSL(K,D,8)^Ae.shrSL(K,D,7),G=mn[E-2]|0,oe=xn[E-2]|0,de=Ae.rotrSH(G,oe,19)^Ae.rotrBH(G,oe,61)^Ae.shrSH(G,oe,6),ce=Ae.rotrSL(G,oe,19)^Ae.rotrBL(G,oe,61)^Ae.shrSL(G,oe,6),Pe=Ae.add4L(J,ce,xn[E-7],xn[E-16]),Oe=Ae.add4H(Pe,F,de,mn[E-7],mn[E-16]);mn[E]=Oe|0,xn[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Ae.rotrSH(y,w,14)^Ae.rotrSH(y,w,18)^Ae.rotrBH(y,w,41),D=Ae.rotrSL(y,w,14)^Ae.rotrSL(y,w,18)^Ae.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Ae.add5L(M,D,J,ny[E],xn[E]),oe=Ae.add5H(G,R,K,F,ry[E],mn[E]),de=G|0,ce=Ae.rotrSH(n,o,28)^Ae.rotrBH(n,o,34)^Ae.rotrBH(n,o,39),Pe=Ae.rotrSL(n,o,28)^Ae.rotrBL(n,o,34)^Ae.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Ae.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Ae.add3L(de,Pe,at);n=Ae.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Ae.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Ae.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Ae.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Ae.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Ae.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Ae.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Ae.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Ae.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){mn.fill(0),xn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var sc=ho(()=>new oc);function Vn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}function er(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function hr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(Vn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function gr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function ui(r,t="="){if(Vn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function sd(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function nd(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(Vn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");a=g%e;let y=Math.floor(g/e);if(s[f]=y,!Number.isSafeInteger(y)||y*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)y?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var id=(r,t)=>t?id(t,r%t):r,ci=(r,t)=>r+(t-id(r,t));function od(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(ci(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${ci(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(Vn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function oy(r){return Vn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return nd(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(nd(t,r,2**8))}}}function bn(r,t=!1){if(Vn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(ci(8,r)>32||ci(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return od(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(od(e,r,8,t))}}}function sy(r,t){if(Vn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}var YA=er(bn(4),hr("0123456789ABCDEF"),gr("")),XA=er(bn(5),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),ui(5),gr("")),ZA=er(bn(5),hr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),ui(5),gr("")),JA=er(bn(5),hr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),gr(""),sd(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),ui(6),gr("")),t1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),ui(6),gr("")),r1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),gr("")),iy=r=>er(oy(58),hr(r),gr("")),ay=iy("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var ad=r=>er(sy(4,t=>r(r(t))),ay),n1=er(hr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gr(""));var o1=er(bn(4),hr("0123456789abcdef"),gr(""),sd(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var fi=yt.ProjectivePoint,ic=ad(Yo);function cd(r){return BigInt(`0x${Of(r)}`)}function cy(r){return zf(r.toString(16).padStart(64,"0"))}var uy=La("Bitcoin seed"),ac={private:76066276,public:76067358},cc=2147483648,fy=r=>td(Yo(r)),dy=r=>dn(r).getUint32(0,!1),di=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);let t=new Uint8Array(4);return dn(t).setUint32(0,r,!1),t},yr=class{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return dy(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw new Error("No private key");return ic.encode(this.serialize(this.versions.private,Gn(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return ic.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=ac){if(Cr(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let n=yo(sc,uy,t);return new yr({versions:e,chainCode:n.slice(32),privateKey:n.slice(0,32)})}static fromExtendedKey(t,e=ac){let n=ic.decode(t),o=dn(n),s=o.getUint32(0,!1),a={versions:e,depth:n[4],parentFingerprint:o.getUint32(5,!1),index:o.getUint32(9,!1),chainCode:n.slice(13,45)},c=n.slice(45),f=c[0]===0;if(s!==e[f?"private":"public"])throw new Error("Version mismatch");return f?new yr({...a,privateKey:c.slice(1)}):new yr({...a,publicKey:c})}static fromJSON(t){return yr.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||ac,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!yt.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:cd(t.privateKey),this.privKeyBytes=cy(this.privKey),this.pubKey=yt.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=fi.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=fy(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),n=this;for(let o of e){let s=/^(\d+)('?)$/.exec(o),a=s&&s[1];if(!s||s.length!==3||typeof a!="string")throw new Error(`Invalid child index: ${o}`);let c=+a;if(!Number.isSafeInteger(c)||c>=cc)throw new Error("Invalid index");s[2]==="'"&&(c+=cc),n=n.deriveChild(c)}return n}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let e=di(t);if(t>=cc){let c=this.privateKey;if(!c)throw new Error("Could not derive hardened child key");e=Gn(new Uint8Array([0]),c,e)}else e=Gn(this.pubKey,e);let n=yo(sc,this.chainCode,e),o=cd(n.slice(0,32)),s=n.slice(32);if(!yt.utils.isValidPrivateKey(o))throw new Error("Tweak bigger than curve order");let a={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let c=ct(this.privKey+o,yt.CURVE.n);if(!yt.utils.isValidPrivateKey(c))throw new Error("The tweak was out of range or the resulted private key is invalid");a.privateKey=c}else{let c=fi.fromHex(this.pubKey).add(fi.fromPrivateKey(o));if(c.equals(fi.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");a.publicKey=c.toRawBytes(!0)}return new yr(a)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return Cr(t,32),yt.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){if(Cr(t,32),Cr(e,64),!this.publicKey)throw new Error("No publicKey set!");let n;try{n=yt.Signature.fromCompact(e)}catch{return!1}return yt.verify(n,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw new Error("No chainCode set");return Cr(e,33),Gn(di(t),new Uint8Array([this.depth]),di(this.parentFingerprint),di(this.index),this.chainCode,e)}};var mo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==mo.LENGTH)throw new Error(`PublicKey length should be ${mo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=Mn(s),c=o.toUint8Array();return yt.verify(c,a,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new mo(n)}static load(e){let n=e.deserializeBytes();return new mo(n)}},Gt=mo;Gt.LENGTH=65;var An=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==An.LENGTH)throw new Error(`PrivateKey length should be ${An.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=be.fromHexInput(e),o=Mn(n.toUint8Array()),s=yt.sign(o,this.key.toUint8Array());return new xr(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new An(n)}static generate(){let e=yt.utils.randomPrivateKey();return new An(e)}publicKey(){let e=yt.getPublicKey(this.key.toUint8Array(),!1);return new Gt(e)}static fromDerivationPath(e,n){if(!za(e))throw new Error(`Invalid derivation path ${e}`);return An.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n){let{privateKey:o}=yr.fromMasterSeed(n).derive(e);if(o===null)throw new Error("Invalid key");return new An(o)}},mr=An;mr.LENGTH=32;var xo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==xo.LENGTH)throw new Error(`Signature length should be ${xo.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new xo(n)}static load(e){let n=e.deserializeBytes();return new xo(n)}},xr=xo;xr.LENGTH=64;var Fe=class extends Pt{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof De)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof Gt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new Fe(De.load(e));case 1:return new Fe(Gt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var Pr=class extends Pt{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(a=>{a instanceof Fe?s.push(a):s.push(new Fe(a))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach((c,f)=>{if(f+1>this.publicKeys.length)throw new Error(`Signature index ${f+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(c))throw new Error(`Duplicate bit ${c} detected.`);a.add(c);let h=Math.floor(c/8),g=s[h];g|=o>>c%8,s[h]=g}),s}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(Fe),o=e.deserializeU8();return new Pr({publicKeys:n,signaturesRequired:o})}};var wn=class extends te{constructor(e){super();let{data:n}=e,o=be.fromHexInput(n);if(o.toUint8Array().length!==wn.LENGTH)throw new Error(`Authentication Key length should be ${wn.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(wn.LENGTH);return new wn({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let f=n.bcsToBytes();s=new Uint8Array([...f,o]);break}case 0:case 1:{let f=n.toUint8Array(),h=be.fromHexInput(f).toUint8Array();s=new Uint8Array([...h,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let a=Mn.create();a.update(s);let c=a.digest();return new wn({data:c})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof De)o=0 .valueOf();else if(n instanceof Et)o=1 .valueOf();else if(n instanceof Fe)o=2 .valueOf();else if(n instanceof Pr)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return wn.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new O(this.data.toUint8Array())}},Ft=wn;Ft.LENGTH=32;var St=class{constructor(t){let{privateKey:e,address:n,legacy:o}=t,s=o??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof De)s?this.signingScheme=0:(this.publicKey=new Fe(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof Et)this.signingScheme=1;else if(this.publicKey instanceof Gt)this.publicKey=new Fe(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e=t?.legacy??!0,n,o;switch(t?.scheme){case 2:n=mr.generate(),o=new Fe(n.publicKey());break;default:n=Zt.generate(),e===!1?o=new Fe(n.publicKey()):o=n.publicKey()}let a=Ft.fromPublicKey({publicKey:o}).derivedAddress();return new St({privateKey:n,address:a,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:n}=t,o=n??!0,s;if(e instanceof mr)s=new Fe(e.publicKey());else if(e instanceof Zt)o?s=e.publicKey():s=new Fe(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let c=Ft.fromPublicKey({publicKey:s}).derivedAddress();return new St({privateKey:e,address:c,legacy:o})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new St({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n,scheme:o,legacy:s}=t,a;switch(o){case 2:a=mr.fromDerivationPath(e,n);break;case 0:a=Zt.fromDerivationPath(e,n);break;default:throw new Error(`Unsupported scheme ${o}`)}return St.fromPrivateKey({privateKey:a,legacy:s})}static authKey(t){let{publicKey:e}=t;return Ft.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=be.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var ly=`
|
|
1
|
+
"use strict";var aptosSDK=(()=>{var Fd=Object.create;var Zn=Object.defineProperty;var Za=Object.getOwnPropertyDescriptor;var Kd=Object.getOwnPropertyNames;var Hd=Object.getPrototypeOf,$d=Object.prototype.hasOwnProperty;var Ja=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var we=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ec=(r,t)=>{for(var e in t)Zn(r,e,{get:t[e],enumerable:!0})},tc=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Kd(t))!$d.call(r,o)&&o!==e&&Zn(r,o,{get:()=>t[o],enumerable:!(n=Za(t,o))||n.enumerable});return r};var rc=(r,t,e)=>(e=r!=null?Fd(Hd(r)):{},tc(t||!r||!r.__esModule?Zn(e,"default",{value:r,enumerable:!0}):e,r)),Vd=r=>tc(Zn({},"__esModule",{value:!0}),r),wr=(r,t,e,n)=>{for(var o=n>1?void 0:n?Za(t,e):t,s=r.length-1,c;s>=0;s--)(c=r[s])&&(o=(n?c(t,e,o):c(o))||o);return n&&o&&Zn(t,e,o),o};var Ec=we(()=>{"use strict"});var Sc=we((oy,ri)=>{"use strict";(function(r){"use strict";var t=function(a){var d,f=new Float64Array(16);if(a)for(d=0;d<a.length;d++)f[d]=a[d];return f},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),c=t([1]),u=t([56129,1]),p=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),x=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),_=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function T(a,d,f,i){a[d]=f>>24&255,a[d+1]=f>>16&255,a[d+2]=f>>8&255,a[d+3]=f&255,a[d+4]=i>>24&255,a[d+5]=i>>16&255,a[d+6]=i>>8&255,a[d+7]=i&255}function N(a,d,f,i,l){var m,A=0;for(m=0;m<l;m++)A|=a[d+m]^f[i+m];return(1&A-1>>>8)-1}function E(a,d,f,i){return N(a,d,f,i,16)}function R(a,d,f,i){return N(a,d,f,i,32)}function P(a,d,f,i){for(var l=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,m=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,A=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,B=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,D=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,Te=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,G=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,te=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,re=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ue=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ce=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,ne=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ie=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,oe=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,F=l,W=m,q=A,H=S,$=B,M=V,b=D,w=Te,C=G,v=te,U=re,I=ue,Y=ce,fe=ne,le=ie,de=oe,g,he=0;he<20;he+=2)g=F+Y|0,$^=g<<7|g>>>32-7,g=$+F|0,C^=g<<9|g>>>32-9,g=C+$|0,Y^=g<<13|g>>>32-13,g=Y+C|0,F^=g<<18|g>>>32-18,g=M+W|0,v^=g<<7|g>>>32-7,g=v+M|0,fe^=g<<9|g>>>32-9,g=fe+v|0,W^=g<<13|g>>>32-13,g=W+fe|0,M^=g<<18|g>>>32-18,g=U+b|0,le^=g<<7|g>>>32-7,g=le+U|0,q^=g<<9|g>>>32-9,g=q+le|0,b^=g<<13|g>>>32-13,g=b+q|0,U^=g<<18|g>>>32-18,g=de+I|0,H^=g<<7|g>>>32-7,g=H+de|0,w^=g<<9|g>>>32-9,g=w+H|0,I^=g<<13|g>>>32-13,g=I+w|0,de^=g<<18|g>>>32-18,g=F+H|0,W^=g<<7|g>>>32-7,g=W+F|0,q^=g<<9|g>>>32-9,g=q+W|0,H^=g<<13|g>>>32-13,g=H+q|0,F^=g<<18|g>>>32-18,g=M+$|0,b^=g<<7|g>>>32-7,g=b+M|0,w^=g<<9|g>>>32-9,g=w+b|0,$^=g<<13|g>>>32-13,g=$+w|0,M^=g<<18|g>>>32-18,g=U+v|0,I^=g<<7|g>>>32-7,g=I+U|0,C^=g<<9|g>>>32-9,g=C+I|0,v^=g<<13|g>>>32-13,g=v+C|0,U^=g<<18|g>>>32-18,g=de+le|0,Y^=g<<7|g>>>32-7,g=Y+de|0,fe^=g<<9|g>>>32-9,g=fe+Y|0,le^=g<<13|g>>>32-13,g=le+fe|0,de^=g<<18|g>>>32-18;F=F+l|0,W=W+m|0,q=q+A|0,H=H+S|0,$=$+B|0,M=M+V|0,b=b+D|0,w=w+Te|0,C=C+G|0,v=v+te|0,U=U+re|0,I=I+ue|0,Y=Y+ce|0,fe=fe+ne|0,le=le+ie|0,de=de+oe|0,a[0]=F>>>0&255,a[1]=F>>>8&255,a[2]=F>>>16&255,a[3]=F>>>24&255,a[4]=W>>>0&255,a[5]=W>>>8&255,a[6]=W>>>16&255,a[7]=W>>>24&255,a[8]=q>>>0&255,a[9]=q>>>8&255,a[10]=q>>>16&255,a[11]=q>>>24&255,a[12]=H>>>0&255,a[13]=H>>>8&255,a[14]=H>>>16&255,a[15]=H>>>24&255,a[16]=$>>>0&255,a[17]=$>>>8&255,a[18]=$>>>16&255,a[19]=$>>>24&255,a[20]=M>>>0&255,a[21]=M>>>8&255,a[22]=M>>>16&255,a[23]=M>>>24&255,a[24]=b>>>0&255,a[25]=b>>>8&255,a[26]=b>>>16&255,a[27]=b>>>24&255,a[28]=w>>>0&255,a[29]=w>>>8&255,a[30]=w>>>16&255,a[31]=w>>>24&255,a[32]=C>>>0&255,a[33]=C>>>8&255,a[34]=C>>>16&255,a[35]=C>>>24&255,a[36]=v>>>0&255,a[37]=v>>>8&255,a[38]=v>>>16&255,a[39]=v>>>24&255,a[40]=U>>>0&255,a[41]=U>>>8&255,a[42]=U>>>16&255,a[43]=U>>>24&255,a[44]=I>>>0&255,a[45]=I>>>8&255,a[46]=I>>>16&255,a[47]=I>>>24&255,a[48]=Y>>>0&255,a[49]=Y>>>8&255,a[50]=Y>>>16&255,a[51]=Y>>>24&255,a[52]=fe>>>0&255,a[53]=fe>>>8&255,a[54]=fe>>>16&255,a[55]=fe>>>24&255,a[56]=le>>>0&255,a[57]=le>>>8&255,a[58]=le>>>16&255,a[59]=le>>>24&255,a[60]=de>>>0&255,a[61]=de>>>8&255,a[62]=de>>>16&255,a[63]=de>>>24&255}function Q(a,d,f,i){for(var l=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,m=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,A=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,B=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,V=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,D=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,Te=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,G=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,te=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,re=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ue=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ce=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,ne=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ie=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,oe=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,F=l,W=m,q=A,H=S,$=B,M=V,b=D,w=Te,C=G,v=te,U=re,I=ue,Y=ce,fe=ne,le=ie,de=oe,g,he=0;he<20;he+=2)g=F+Y|0,$^=g<<7|g>>>32-7,g=$+F|0,C^=g<<9|g>>>32-9,g=C+$|0,Y^=g<<13|g>>>32-13,g=Y+C|0,F^=g<<18|g>>>32-18,g=M+W|0,v^=g<<7|g>>>32-7,g=v+M|0,fe^=g<<9|g>>>32-9,g=fe+v|0,W^=g<<13|g>>>32-13,g=W+fe|0,M^=g<<18|g>>>32-18,g=U+b|0,le^=g<<7|g>>>32-7,g=le+U|0,q^=g<<9|g>>>32-9,g=q+le|0,b^=g<<13|g>>>32-13,g=b+q|0,U^=g<<18|g>>>32-18,g=de+I|0,H^=g<<7|g>>>32-7,g=H+de|0,w^=g<<9|g>>>32-9,g=w+H|0,I^=g<<13|g>>>32-13,g=I+w|0,de^=g<<18|g>>>32-18,g=F+H|0,W^=g<<7|g>>>32-7,g=W+F|0,q^=g<<9|g>>>32-9,g=q+W|0,H^=g<<13|g>>>32-13,g=H+q|0,F^=g<<18|g>>>32-18,g=M+$|0,b^=g<<7|g>>>32-7,g=b+M|0,w^=g<<9|g>>>32-9,g=w+b|0,$^=g<<13|g>>>32-13,g=$+w|0,M^=g<<18|g>>>32-18,g=U+v|0,I^=g<<7|g>>>32-7,g=I+U|0,C^=g<<9|g>>>32-9,g=C+I|0,v^=g<<13|g>>>32-13,g=v+C|0,U^=g<<18|g>>>32-18,g=de+le|0,Y^=g<<7|g>>>32-7,g=Y+de|0,fe^=g<<9|g>>>32-9,g=fe+Y|0,le^=g<<13|g>>>32-13,g=le+fe|0,de^=g<<18|g>>>32-18;a[0]=F>>>0&255,a[1]=F>>>8&255,a[2]=F>>>16&255,a[3]=F>>>24&255,a[4]=M>>>0&255,a[5]=M>>>8&255,a[6]=M>>>16&255,a[7]=M>>>24&255,a[8]=U>>>0&255,a[9]=U>>>8&255,a[10]=U>>>16&255,a[11]=U>>>24&255,a[12]=de>>>0&255,a[13]=de>>>8&255,a[14]=de>>>16&255,a[15]=de>>>24&255,a[16]=b>>>0&255,a[17]=b>>>8&255,a[18]=b>>>16&255,a[19]=b>>>24&255,a[20]=w>>>0&255,a[21]=w>>>8&255,a[22]=w>>>16&255,a[23]=w>>>24&255,a[24]=C>>>0&255,a[25]=C>>>8&255,a[26]=C>>>16&255,a[27]=C>>>24&255,a[28]=v>>>0&255,a[29]=v>>>8&255,a[30]=v>>>16&255,a[31]=v>>>24&255}function z(a,d,f,i){P(a,d,f,i)}function ee(a,d,f,i){Q(a,d,f,i)}var L=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function j(a,d,f,i,l,m,A){var S=new Uint8Array(16),B=new Uint8Array(64),V,D;for(D=0;D<16;D++)S[D]=0;for(D=0;D<8;D++)S[D]=m[D];for(;l>=64;){for(z(B,S,A,L),D=0;D<64;D++)a[d+D]=f[i+D]^B[D];for(V=1,D=8;D<16;D++)V=V+(S[D]&255)|0,S[D]=V&255,V>>>=8;l-=64,d+=64,i+=64}if(l>0)for(z(B,S,A,L),D=0;D<l;D++)a[d+D]=f[i+D]^B[D];return 0}function J(a,d,f,i,l){var m=new Uint8Array(16),A=new Uint8Array(64),S,B;for(B=0;B<16;B++)m[B]=0;for(B=0;B<8;B++)m[B]=i[B];for(;f>=64;){for(z(A,m,l,L),B=0;B<64;B++)a[d+B]=A[B];for(S=1,B=8;B<16;B++)S=S+(m[B]&255)|0,m[B]=S&255,S>>>=8;f-=64,d+=64}if(f>0)for(z(A,m,l,L),B=0;B<f;B++)a[d+B]=A[B];return 0}function X(a,d,f,i,l){var m=new Uint8Array(32);ee(m,i,l,L);for(var A=new Uint8Array(8),S=0;S<8;S++)A[S]=i[S+16];return J(a,d,f,A,m)}function Re(a,d,f,i,l,m,A){var S=new Uint8Array(32);ee(S,m,A,L);for(var B=new Uint8Array(8),V=0;V<8;V++)B[V]=m[V+16];return j(a,d,f,i,l,B,S)}var xe=function(a){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var d,f,i,l,m,A,S,B;d=a[0]&255|(a[1]&255)<<8,this.r[0]=d&8191,f=a[2]&255|(a[3]&255)<<8,this.r[1]=(d>>>13|f<<3)&8191,i=a[4]&255|(a[5]&255)<<8,this.r[2]=(f>>>10|i<<6)&7939,l=a[6]&255|(a[7]&255)<<8,this.r[3]=(i>>>7|l<<9)&8191,m=a[8]&255|(a[9]&255)<<8,this.r[4]=(l>>>4|m<<12)&255,this.r[5]=m>>>1&8190,A=a[10]&255|(a[11]&255)<<8,this.r[6]=(m>>>14|A<<2)&8191,S=a[12]&255|(a[13]&255)<<8,this.r[7]=(A>>>11|S<<5)&8065,B=a[14]&255|(a[15]&255)<<8,this.r[8]=(S>>>8|B<<8)&8191,this.r[9]=B>>>5&127,this.pad[0]=a[16]&255|(a[17]&255)<<8,this.pad[1]=a[18]&255|(a[19]&255)<<8,this.pad[2]=a[20]&255|(a[21]&255)<<8,this.pad[3]=a[22]&255|(a[23]&255)<<8,this.pad[4]=a[24]&255|(a[25]&255)<<8,this.pad[5]=a[26]&255|(a[27]&255)<<8,this.pad[6]=a[28]&255|(a[29]&255)<<8,this.pad[7]=a[30]&255|(a[31]&255)<<8};xe.prototype.blocks=function(a,d,f){for(var i=this.fin?0:2048,l,m,A,S,B,V,D,Te,G,te,re,ue,ce,ne,ie,oe,F,W,q,H=this.h[0],$=this.h[1],M=this.h[2],b=this.h[3],w=this.h[4],C=this.h[5],v=this.h[6],U=this.h[7],I=this.h[8],Y=this.h[9],fe=this.r[0],le=this.r[1],de=this.r[2],g=this.r[3],he=this.r[4],ve=this.r[5],_e=this.r[6],ge=this.r[7],Ae=this.r[8],be=this.r[9];f>=16;)l=a[d+0]&255|(a[d+1]&255)<<8,H+=l&8191,m=a[d+2]&255|(a[d+3]&255)<<8,$+=(l>>>13|m<<3)&8191,A=a[d+4]&255|(a[d+5]&255)<<8,M+=(m>>>10|A<<6)&8191,S=a[d+6]&255|(a[d+7]&255)<<8,b+=(A>>>7|S<<9)&8191,B=a[d+8]&255|(a[d+9]&255)<<8,w+=(S>>>4|B<<12)&8191,C+=B>>>1&8191,V=a[d+10]&255|(a[d+11]&255)<<8,v+=(B>>>14|V<<2)&8191,D=a[d+12]&255|(a[d+13]&255)<<8,U+=(V>>>11|D<<5)&8191,Te=a[d+14]&255|(a[d+15]&255)<<8,I+=(D>>>8|Te<<8)&8191,Y+=Te>>>5|i,G=0,te=G,te+=H*fe,te+=$*(5*be),te+=M*(5*Ae),te+=b*(5*ge),te+=w*(5*_e),G=te>>>13,te&=8191,te+=C*(5*ve),te+=v*(5*he),te+=U*(5*g),te+=I*(5*de),te+=Y*(5*le),G+=te>>>13,te&=8191,re=G,re+=H*le,re+=$*fe,re+=M*(5*be),re+=b*(5*Ae),re+=w*(5*ge),G=re>>>13,re&=8191,re+=C*(5*_e),re+=v*(5*ve),re+=U*(5*he),re+=I*(5*g),re+=Y*(5*de),G+=re>>>13,re&=8191,ue=G,ue+=H*de,ue+=$*le,ue+=M*fe,ue+=b*(5*be),ue+=w*(5*Ae),G=ue>>>13,ue&=8191,ue+=C*(5*ge),ue+=v*(5*_e),ue+=U*(5*ve),ue+=I*(5*he),ue+=Y*(5*g),G+=ue>>>13,ue&=8191,ce=G,ce+=H*g,ce+=$*de,ce+=M*le,ce+=b*fe,ce+=w*(5*be),G=ce>>>13,ce&=8191,ce+=C*(5*Ae),ce+=v*(5*ge),ce+=U*(5*_e),ce+=I*(5*ve),ce+=Y*(5*he),G+=ce>>>13,ce&=8191,ne=G,ne+=H*he,ne+=$*g,ne+=M*de,ne+=b*le,ne+=w*fe,G=ne>>>13,ne&=8191,ne+=C*(5*be),ne+=v*(5*Ae),ne+=U*(5*ge),ne+=I*(5*_e),ne+=Y*(5*ve),G+=ne>>>13,ne&=8191,ie=G,ie+=H*ve,ie+=$*he,ie+=M*g,ie+=b*de,ie+=w*le,G=ie>>>13,ie&=8191,ie+=C*fe,ie+=v*(5*be),ie+=U*(5*Ae),ie+=I*(5*ge),ie+=Y*(5*_e),G+=ie>>>13,ie&=8191,oe=G,oe+=H*_e,oe+=$*ve,oe+=M*he,oe+=b*g,oe+=w*de,G=oe>>>13,oe&=8191,oe+=C*le,oe+=v*fe,oe+=U*(5*be),oe+=I*(5*Ae),oe+=Y*(5*ge),G+=oe>>>13,oe&=8191,F=G,F+=H*ge,F+=$*_e,F+=M*ve,F+=b*he,F+=w*g,G=F>>>13,F&=8191,F+=C*de,F+=v*le,F+=U*fe,F+=I*(5*be),F+=Y*(5*Ae),G+=F>>>13,F&=8191,W=G,W+=H*Ae,W+=$*ge,W+=M*_e,W+=b*ve,W+=w*he,G=W>>>13,W&=8191,W+=C*g,W+=v*de,W+=U*le,W+=I*fe,W+=Y*(5*be),G+=W>>>13,W&=8191,q=G,q+=H*be,q+=$*Ae,q+=M*ge,q+=b*_e,q+=w*ve,G=q>>>13,q&=8191,q+=C*he,q+=v*g,q+=U*de,q+=I*le,q+=Y*fe,G+=q>>>13,q&=8191,G=(G<<2)+G|0,G=G+te|0,te=G&8191,G=G>>>13,re+=G,H=te,$=re,M=ue,b=ce,w=ne,C=ie,v=oe,U=F,I=W,Y=q,d+=16,f-=16;this.h[0]=H,this.h[1]=$,this.h[2]=M,this.h[3]=b,this.h[4]=w,this.h[5]=C,this.h[6]=v,this.h[7]=U,this.h[8]=I,this.h[9]=Y},xe.prototype.finish=function(a,d){var f=new Uint16Array(10),i,l,m,A;if(this.leftover){for(A=this.leftover,this.buffer[A++]=1;A<16;A++)this.buffer[A]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,A=2;A<10;A++)this.h[A]+=i,i=this.h[A]>>>13,this.h[A]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,f[0]=this.h[0]+5,i=f[0]>>>13,f[0]&=8191,A=1;A<10;A++)f[A]=this.h[A]+i,i=f[A]>>>13,f[A]&=8191;for(f[9]-=8192,l=(i^1)-1,A=0;A<10;A++)f[A]&=l;for(l=~l,A=0;A<10;A++)this.h[A]=this.h[A]&l|f[A];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,m=this.h[0]+this.pad[0],this.h[0]=m&65535,A=1;A<8;A++)m=(this.h[A]+this.pad[A]|0)+(m>>>16)|0,this.h[A]=m&65535;a[d+0]=this.h[0]>>>0&255,a[d+1]=this.h[0]>>>8&255,a[d+2]=this.h[1]>>>0&255,a[d+3]=this.h[1]>>>8&255,a[d+4]=this.h[2]>>>0&255,a[d+5]=this.h[2]>>>8&255,a[d+6]=this.h[3]>>>0&255,a[d+7]=this.h[3]>>>8&255,a[d+8]=this.h[4]>>>0&255,a[d+9]=this.h[4]>>>8&255,a[d+10]=this.h[5]>>>0&255,a[d+11]=this.h[5]>>>8&255,a[d+12]=this.h[6]>>>0&255,a[d+13]=this.h[6]>>>8&255,a[d+14]=this.h[7]>>>0&255,a[d+15]=this.h[7]>>>8&255},xe.prototype.update=function(a,d,f){var i,l;if(this.leftover){for(l=16-this.leftover,l>f&&(l=f),i=0;i<l;i++)this.buffer[this.leftover+i]=a[d+i];if(f-=l,d+=l,this.leftover+=l,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(l=f-f%16,this.blocks(a,d,l),d+=l,f-=l),f){for(i=0;i<f;i++)this.buffer[this.leftover+i]=a[d+i];this.leftover+=f}};function ye(a,d,f,i,l,m){var A=new xe(m);return A.update(f,i,l),A.finish(a,d),0}function Ve(a,d,f,i,l,m){var A=new Uint8Array(16);return ye(A,0,f,i,l,m),E(a,d,A,0)}function Qe(a,d,f,i,l){var m;if(f<32)return-1;for(Re(a,0,d,0,f,i,l),ye(a,16,a,32,f-32,a),m=0;m<16;m++)a[m]=0;return 0}function dt(a,d,f,i,l){var m,A=new Uint8Array(32);if(f<32||(X(A,0,32,i,l),Ve(d,16,d,32,f-32,A)!==0))return-1;for(Re(a,0,d,0,f,i,l),m=0;m<32;m++)a[m]=0;return 0}function O(a,d){var f;for(f=0;f<16;f++)a[f]=d[f]|0}function K(a){var d,f,i=1;for(d=0;d<16;d++)f=a[d]+i+65535,i=Math.floor(f/65536),a[d]=f-i*65536;a[0]+=i-1+37*(i-1)}function se(a,d,f){for(var i,l=~(f-1),m=0;m<16;m++)i=l&(a[m]^d[m]),a[m]^=i,d[m]^=i}function Ee(a,d){var f,i,l,m=t(),A=t();for(f=0;f<16;f++)A[f]=d[f];for(K(A),K(A),K(A),i=0;i<2;i++){for(m[0]=A[0]-65517,f=1;f<15;f++)m[f]=A[f]-65535-(m[f-1]>>16&1),m[f-1]&=65535;m[15]=A[15]-32767-(m[14]>>16&1),l=m[15]>>16&1,m[14]&=65535,se(A,m,1-l)}for(f=0;f<16;f++)a[2*f]=A[f]&255,a[2*f+1]=A[f]>>8}function Se(a,d){var f=new Uint8Array(32),i=new Uint8Array(32);return Ee(f,a),Ee(i,d),R(f,0,i,0)}function je(a){var d=new Uint8Array(32);return Ee(d,a),d[0]&1}function ot(a,d){var f;for(f=0;f<16;f++)a[f]=d[2*f]+(d[2*f+1]<<8);a[15]&=32767}function ke(a,d,f){for(var i=0;i<16;i++)a[i]=d[i]+f[i]}function Xe(a,d,f){for(var i=0;i<16;i++)a[i]=d[i]-f[i]}function ae(a,d,f){var i,l,m=0,A=0,S=0,B=0,V=0,D=0,Te=0,G=0,te=0,re=0,ue=0,ce=0,ne=0,ie=0,oe=0,F=0,W=0,q=0,H=0,$=0,M=0,b=0,w=0,C=0,v=0,U=0,I=0,Y=0,fe=0,le=0,de=0,g=f[0],he=f[1],ve=f[2],_e=f[3],ge=f[4],Ae=f[5],be=f[6],We=f[7],Ue=f[8],Me=f[9],De=f[10],qe=f[11],Je=f[12],st=f[13],at=f[14],ct=f[15];i=d[0],m+=i*g,A+=i*he,S+=i*ve,B+=i*_e,V+=i*ge,D+=i*Ae,Te+=i*be,G+=i*We,te+=i*Ue,re+=i*Me,ue+=i*De,ce+=i*qe,ne+=i*Je,ie+=i*st,oe+=i*at,F+=i*ct,i=d[1],A+=i*g,S+=i*he,B+=i*ve,V+=i*_e,D+=i*ge,Te+=i*Ae,G+=i*be,te+=i*We,re+=i*Ue,ue+=i*Me,ce+=i*De,ne+=i*qe,ie+=i*Je,oe+=i*st,F+=i*at,W+=i*ct,i=d[2],S+=i*g,B+=i*he,V+=i*ve,D+=i*_e,Te+=i*ge,G+=i*Ae,te+=i*be,re+=i*We,ue+=i*Ue,ce+=i*Me,ne+=i*De,ie+=i*qe,oe+=i*Je,F+=i*st,W+=i*at,q+=i*ct,i=d[3],B+=i*g,V+=i*he,D+=i*ve,Te+=i*_e,G+=i*ge,te+=i*Ae,re+=i*be,ue+=i*We,ce+=i*Ue,ne+=i*Me,ie+=i*De,oe+=i*qe,F+=i*Je,W+=i*st,q+=i*at,H+=i*ct,i=d[4],V+=i*g,D+=i*he,Te+=i*ve,G+=i*_e,te+=i*ge,re+=i*Ae,ue+=i*be,ce+=i*We,ne+=i*Ue,ie+=i*Me,oe+=i*De,F+=i*qe,W+=i*Je,q+=i*st,H+=i*at,$+=i*ct,i=d[5],D+=i*g,Te+=i*he,G+=i*ve,te+=i*_e,re+=i*ge,ue+=i*Ae,ce+=i*be,ne+=i*We,ie+=i*Ue,oe+=i*Me,F+=i*De,W+=i*qe,q+=i*Je,H+=i*st,$+=i*at,M+=i*ct,i=d[6],Te+=i*g,G+=i*he,te+=i*ve,re+=i*_e,ue+=i*ge,ce+=i*Ae,ne+=i*be,ie+=i*We,oe+=i*Ue,F+=i*Me,W+=i*De,q+=i*qe,H+=i*Je,$+=i*st,M+=i*at,b+=i*ct,i=d[7],G+=i*g,te+=i*he,re+=i*ve,ue+=i*_e,ce+=i*ge,ne+=i*Ae,ie+=i*be,oe+=i*We,F+=i*Ue,W+=i*Me,q+=i*De,H+=i*qe,$+=i*Je,M+=i*st,b+=i*at,w+=i*ct,i=d[8],te+=i*g,re+=i*he,ue+=i*ve,ce+=i*_e,ne+=i*ge,ie+=i*Ae,oe+=i*be,F+=i*We,W+=i*Ue,q+=i*Me,H+=i*De,$+=i*qe,M+=i*Je,b+=i*st,w+=i*at,C+=i*ct,i=d[9],re+=i*g,ue+=i*he,ce+=i*ve,ne+=i*_e,ie+=i*ge,oe+=i*Ae,F+=i*be,W+=i*We,q+=i*Ue,H+=i*Me,$+=i*De,M+=i*qe,b+=i*Je,w+=i*st,C+=i*at,v+=i*ct,i=d[10],ue+=i*g,ce+=i*he,ne+=i*ve,ie+=i*_e,oe+=i*ge,F+=i*Ae,W+=i*be,q+=i*We,H+=i*Ue,$+=i*Me,M+=i*De,b+=i*qe,w+=i*Je,C+=i*st,v+=i*at,U+=i*ct,i=d[11],ce+=i*g,ne+=i*he,ie+=i*ve,oe+=i*_e,F+=i*ge,W+=i*Ae,q+=i*be,H+=i*We,$+=i*Ue,M+=i*Me,b+=i*De,w+=i*qe,C+=i*Je,v+=i*st,U+=i*at,I+=i*ct,i=d[12],ne+=i*g,ie+=i*he,oe+=i*ve,F+=i*_e,W+=i*ge,q+=i*Ae,H+=i*be,$+=i*We,M+=i*Ue,b+=i*Me,w+=i*De,C+=i*qe,v+=i*Je,U+=i*st,I+=i*at,Y+=i*ct,i=d[13],ie+=i*g,oe+=i*he,F+=i*ve,W+=i*_e,q+=i*ge,H+=i*Ae,$+=i*be,M+=i*We,b+=i*Ue,w+=i*Me,C+=i*De,v+=i*qe,U+=i*Je,I+=i*st,Y+=i*at,fe+=i*ct,i=d[14],oe+=i*g,F+=i*he,W+=i*ve,q+=i*_e,H+=i*ge,$+=i*Ae,M+=i*be,b+=i*We,w+=i*Ue,C+=i*Me,v+=i*De,U+=i*qe,I+=i*Je,Y+=i*st,fe+=i*at,le+=i*ct,i=d[15],F+=i*g,W+=i*he,q+=i*ve,H+=i*_e,$+=i*ge,M+=i*Ae,b+=i*be,w+=i*We,C+=i*Ue,v+=i*Me,U+=i*De,I+=i*qe,Y+=i*Je,fe+=i*st,le+=i*at,de+=i*ct,m+=38*W,A+=38*q,S+=38*H,B+=38*$,V+=38*M,D+=38*b,Te+=38*w,G+=38*C,te+=38*v,re+=38*U,ue+=38*I,ce+=38*Y,ne+=38*fe,ie+=38*le,oe+=38*de,l=1,i=m+l+65535,l=Math.floor(i/65536),m=i-l*65536,i=A+l+65535,l=Math.floor(i/65536),A=i-l*65536,i=S+l+65535,l=Math.floor(i/65536),S=i-l*65536,i=B+l+65535,l=Math.floor(i/65536),B=i-l*65536,i=V+l+65535,l=Math.floor(i/65536),V=i-l*65536,i=D+l+65535,l=Math.floor(i/65536),D=i-l*65536,i=Te+l+65535,l=Math.floor(i/65536),Te=i-l*65536,i=G+l+65535,l=Math.floor(i/65536),G=i-l*65536,i=te+l+65535,l=Math.floor(i/65536),te=i-l*65536,i=re+l+65535,l=Math.floor(i/65536),re=i-l*65536,i=ue+l+65535,l=Math.floor(i/65536),ue=i-l*65536,i=ce+l+65535,l=Math.floor(i/65536),ce=i-l*65536,i=ne+l+65535,l=Math.floor(i/65536),ne=i-l*65536,i=ie+l+65535,l=Math.floor(i/65536),ie=i-l*65536,i=oe+l+65535,l=Math.floor(i/65536),oe=i-l*65536,i=F+l+65535,l=Math.floor(i/65536),F=i-l*65536,m+=l-1+37*(l-1),l=1,i=m+l+65535,l=Math.floor(i/65536),m=i-l*65536,i=A+l+65535,l=Math.floor(i/65536),A=i-l*65536,i=S+l+65535,l=Math.floor(i/65536),S=i-l*65536,i=B+l+65535,l=Math.floor(i/65536),B=i-l*65536,i=V+l+65535,l=Math.floor(i/65536),V=i-l*65536,i=D+l+65535,l=Math.floor(i/65536),D=i-l*65536,i=Te+l+65535,l=Math.floor(i/65536),Te=i-l*65536,i=G+l+65535,l=Math.floor(i/65536),G=i-l*65536,i=te+l+65535,l=Math.floor(i/65536),te=i-l*65536,i=re+l+65535,l=Math.floor(i/65536),re=i-l*65536,i=ue+l+65535,l=Math.floor(i/65536),ue=i-l*65536,i=ce+l+65535,l=Math.floor(i/65536),ce=i-l*65536,i=ne+l+65535,l=Math.floor(i/65536),ne=i-l*65536,i=ie+l+65535,l=Math.floor(i/65536),ie=i-l*65536,i=oe+l+65535,l=Math.floor(i/65536),oe=i-l*65536,i=F+l+65535,l=Math.floor(i/65536),F=i-l*65536,m+=l-1+37*(l-1),a[0]=m,a[1]=A,a[2]=S,a[3]=B,a[4]=V,a[5]=D,a[6]=Te,a[7]=G,a[8]=te,a[9]=re,a[10]=ue,a[11]=ce,a[12]=ne,a[13]=ie,a[14]=oe,a[15]=F}function Ze(a,d){ae(a,d,d)}function xr(a,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=253;i>=0;i--)Ze(f,f),i!==2&&i!==4&&ae(f,f,d);for(i=0;i<16;i++)a[i]=f[i]}function Rt(a,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=250;i>=0;i--)Ze(f,f),i!==1&&ae(f,f,d);for(i=0;i<16;i++)a[i]=f[i]}function Ar(a,d,f){var i=new Uint8Array(32),l=new Float64Array(80),m,A,S=t(),B=t(),V=t(),D=t(),Te=t(),G=t();for(A=0;A<31;A++)i[A]=d[A];for(i[31]=d[31]&127|64,i[0]&=248,ot(l,f),A=0;A<16;A++)B[A]=l[A],D[A]=S[A]=V[A]=0;for(S[0]=D[0]=1,A=254;A>=0;--A)m=i[A>>>3]>>>(A&7)&1,se(S,B,m),se(V,D,m),ke(Te,S,V),Xe(S,S,V),ke(V,B,D),Xe(B,B,D),Ze(D,Te),Ze(G,S),ae(S,V,S),ae(V,B,Te),ke(Te,S,V),Xe(S,S,V),Ze(B,S),Xe(V,D,G),ae(S,V,u),ke(S,S,D),ae(V,V,S),ae(S,D,G),ae(D,B,l),Ze(B,Te),se(S,B,m),se(V,D,m);for(A=0;A<16;A++)l[A+16]=S[A],l[A+32]=V[A],l[A+48]=B[A],l[A+64]=D[A];var te=l.subarray(32),re=l.subarray(16);return xr(te,te),ae(re,re,te),Ee(a,re),0}function vt(a,d){return Ar(a,d,o)}function Zt(a,d){return e(d,32),vt(a,d)}function Nr(a,d,f){var i=new Uint8Array(32);return Ar(i,f,d),ee(a,n,i,L)}var mt=Qe,br=dt;function En(a,d,f,i,l,m){var A=new Uint8Array(32);return Nr(A,l,m),mt(a,d,f,i,A)}function No(a,d,f,i,l,m){var A=new Uint8Array(32);return Nr(A,l,m),br(a,d,f,i,A)}var Qn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Va(a,d,f,i){for(var l=new Int32Array(16),m=new Int32Array(16),A,S,B,V,D,Te,G,te,re,ue,ce,ne,ie,oe,F,W,q,H,$,M,b,w,C,v,U,I,Y=a[0],fe=a[1],le=a[2],de=a[3],g=a[4],he=a[5],ve=a[6],_e=a[7],ge=d[0],Ae=d[1],be=d[2],We=d[3],Ue=d[4],Me=d[5],De=d[6],qe=d[7],Je=0;i>=128;){for($=0;$<16;$++)M=8*$+Je,l[$]=f[M+0]<<24|f[M+1]<<16|f[M+2]<<8|f[M+3],m[$]=f[M+4]<<24|f[M+5]<<16|f[M+6]<<8|f[M+7];for($=0;$<80;$++)if(A=Y,S=fe,B=le,V=de,D=g,Te=he,G=ve,te=_e,re=ge,ue=Ae,ce=be,ne=We,ie=Ue,oe=Me,F=De,W=qe,b=_e,w=qe,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=(g>>>14|Ue<<32-14)^(g>>>18|Ue<<32-18)^(Ue>>>41-32|g<<32-(41-32)),w=(Ue>>>14|g<<32-14)^(Ue>>>18|g<<32-18)^(g>>>41-32|Ue<<32-(41-32)),C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,b=g&he^~g&ve,w=Ue&Me^~Ue&De,C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,b=Qn[$*2],w=Qn[$*2+1],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,b=l[$%16],w=m[$%16],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,q=U&65535|I<<16,H=C&65535|v<<16,b=q,w=H,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=(Y>>>28|ge<<32-28)^(ge>>>34-32|Y<<32-(34-32))^(ge>>>39-32|Y<<32-(39-32)),w=(ge>>>28|Y<<32-28)^(Y>>>34-32|ge<<32-(34-32))^(Y>>>39-32|ge<<32-(39-32)),C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,b=Y&fe^Y&le^fe&le,w=ge&Ae^ge&be^Ae&be,C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,te=U&65535|I<<16,W=C&65535|v<<16,b=V,w=ne,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=q,w=H,C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,V=U&65535|I<<16,ne=C&65535|v<<16,fe=A,le=S,de=B,g=V,he=D,ve=Te,_e=G,Y=te,Ae=re,be=ue,We=ce,Ue=ne,Me=ie,De=oe,qe=F,ge=W,$%16===15)for(M=0;M<16;M++)b=l[M],w=m[M],C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=l[(M+9)%16],w=m[(M+9)%16],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,q=l[(M+1)%16],H=m[(M+1)%16],b=(q>>>1|H<<32-1)^(q>>>8|H<<32-8)^q>>>7,w=(H>>>1|q<<32-1)^(H>>>8|q<<32-8)^(H>>>7|q<<32-7),C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,q=l[(M+14)%16],H=m[(M+14)%16],b=(q>>>19|H<<32-19)^(H>>>61-32|q<<32-(61-32))^q>>>6,w=(H>>>19|q<<32-19)^(q>>>61-32|H<<32-(61-32))^(H>>>6|q<<32-6),C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,l[M]=U&65535|I<<16,m[M]=C&65535|v<<16;b=Y,w=ge,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[0],w=d[0],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[0]=Y=U&65535|I<<16,d[0]=ge=C&65535|v<<16,b=fe,w=Ae,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[1],w=d[1],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[1]=fe=U&65535|I<<16,d[1]=Ae=C&65535|v<<16,b=le,w=be,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[2],w=d[2],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[2]=le=U&65535|I<<16,d[2]=be=C&65535|v<<16,b=de,w=We,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[3],w=d[3],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[3]=de=U&65535|I<<16,d[3]=We=C&65535|v<<16,b=g,w=Ue,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[4],w=d[4],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[4]=g=U&65535|I<<16,d[4]=Ue=C&65535|v<<16,b=he,w=Me,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[5],w=d[5],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[5]=he=U&65535|I<<16,d[5]=Me=C&65535|v<<16,b=ve,w=De,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[6],w=d[6],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[6]=ve=U&65535|I<<16,d[6]=De=C&65535|v<<16,b=_e,w=qe,C=w&65535,v=w>>>16,U=b&65535,I=b>>>16,b=a[7],w=d[7],C+=w&65535,v+=w>>>16,U+=b&65535,I+=b>>>16,v+=C>>>16,U+=v>>>16,I+=U>>>16,a[7]=_e=U&65535|I<<16,d[7]=qe=C&65535|v<<16,Je+=128,i-=128}return i}function Mr(a,d,f){var i=new Int32Array(8),l=new Int32Array(8),m=new Uint8Array(256),A,S=f;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,l[0]=4089235720,l[1]=2227873595,l[2]=4271175723,l[3]=1595750129,l[4]=2917565137,l[5]=725511199,l[6]=4215389547,l[7]=327033209,Va(i,l,d,f),f%=128,A=0;A<f;A++)m[A]=d[S-f+A];for(m[f]=128,f=256-128*(f<112?1:0),m[f-9]=0,T(m,f-8,S/536870912|0,S<<3),Va(i,l,m,f),A=0;A<8;A++)T(a,8*A,i[A],l[A]);return 0}function Mo(a,d){var f=t(),i=t(),l=t(),m=t(),A=t(),S=t(),B=t(),V=t(),D=t();Xe(f,a[1],a[0]),Xe(D,d[1],d[0]),ae(f,f,D),ke(i,a[0],a[1]),ke(D,d[0],d[1]),ae(i,i,D),ae(l,a[3],d[3]),ae(l,l,h),ae(m,a[2],d[2]),ke(m,m,m),Xe(A,i,f),Xe(S,m,l),ke(B,m,l),ke(V,i,f),ae(a[0],A,S),ae(a[1],V,B),ae(a[2],B,S),ae(a[3],A,V)}function Qa(a,d,f){var i;for(i=0;i<4;i++)se(a[i],d[i],f)}function ji(a,d){var f=t(),i=t(),l=t();xr(l,d[2]),ae(f,d[0],l),ae(i,d[1],l),Ee(a,i),a[31]^=je(f)<<7}function Wi(a,d,f){var i,l;for(O(a[0],s),O(a[1],c),O(a[2],c),O(a[3],s),l=255;l>=0;--l)i=f[l/8|0]>>(l&7)&1,Qa(a,d,i),Mo(d,a),Mo(a,a),Qa(a,d,i)}function Do(a,d){var f=[t(),t(),t(),t()];O(f[0],y),O(f[1],x),O(f[2],c),ae(f[3],y,x),Wi(a,f,d)}function Yi(a,d,f){var i=new Uint8Array(64),l=[t(),t(),t(),t()],m;for(f||e(d,32),Mr(i,d,32),i[0]&=248,i[31]&=127,i[31]|=64,Do(l,i),ji(a,l),m=0;m<32;m++)d[m+32]=a[m];return 0}var qo=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Xi(a,d){var f,i,l,m;for(i=63;i>=32;--i){for(f=0,l=i-32,m=i-12;l<m;++l)d[l]+=f-16*d[i]*qo[l-(i-32)],f=Math.floor((d[l]+128)/256),d[l]-=f*256;d[l]+=f,d[i]=0}for(f=0,l=0;l<32;l++)d[l]+=f-(d[31]>>4)*qo[l],f=d[l]>>8,d[l]&=255;for(l=0;l<32;l++)d[l]-=f*qo[l];for(i=0;i<32;i++)d[i+1]+=d[i]>>8,a[i]=d[i]&255}function Zi(a){var d=new Float64Array(64),f;for(f=0;f<64;f++)d[f]=a[f];for(f=0;f<64;f++)a[f]=0;Xi(a,d)}function ja(a,d,f,i){var l=new Uint8Array(64),m=new Uint8Array(64),A=new Uint8Array(64),S,B,V=new Float64Array(64),D=[t(),t(),t(),t()];Mr(l,i,32),l[0]&=248,l[31]&=127,l[31]|=64;var Te=f+64;for(S=0;S<f;S++)a[64+S]=d[S];for(S=0;S<32;S++)a[32+S]=l[32+S];for(Mr(A,a.subarray(32),f+32),Zi(A),Do(D,A),ji(a,D),S=32;S<64;S++)a[S]=i[S];for(Mr(m,a,f+64),Zi(m),S=0;S<64;S++)V[S]=0;for(S=0;S<32;S++)V[S]=A[S];for(S=0;S<32;S++)for(B=0;B<32;B++)V[S+B]+=m[S]*l[B];return Xi(a.subarray(32),V),Te}function Dd(a,d){var f=t(),i=t(),l=t(),m=t(),A=t(),S=t(),B=t();return O(a[2],c),ot(a[1],d),Ze(l,a[1]),ae(m,l,p),Xe(l,l,a[2]),ke(m,a[2],m),Ze(A,m),Ze(S,A),ae(B,S,A),ae(f,B,l),ae(f,f,m),Rt(f,f),ae(f,f,l),ae(f,f,m),ae(f,f,m),ae(a[0],f,m),Ze(i,a[0]),ae(i,i,m),Se(i,l)&&ae(a[0],a[0],_),Ze(i,a[0]),ae(i,i,m),Se(i,l)?-1:(je(a[0])===d[31]>>7&&Xe(a[0],s,a[0]),ae(a[3],a[0],a[1]),0)}function Ji(a,d,f,i){var l,m=new Uint8Array(32),A=new Uint8Array(64),S=[t(),t(),t(),t()],B=[t(),t(),t(),t()];if(f<64||Dd(B,i))return-1;for(l=0;l<f;l++)a[l]=d[l];for(l=0;l<32;l++)a[l+32]=i[l];if(Mr(A,a,f),Zi(A),Wi(S,B,A),Do(B,d.subarray(32)),Mo(S,B),ji(m,S),f-=64,R(d,0,m,0)){for(l=0;l<f;l++)a[l]=0;return-1}for(l=0;l<f;l++)a[l]=d[l+64];return f}var es=32,Go=24,jn=32,Sn=16,Wn=32,Lo=32,Yn=32,Xn=32,ts=32,Wa=Go,qd=jn,Gd=Sn,Jt=64,Dr=32,Un=64,rs=32,ns=64;r.lowlevel={crypto_core_hsalsa20:ee,crypto_stream_xor:Re,crypto_stream:X,crypto_stream_salsa20_xor:j,crypto_stream_salsa20:J,crypto_onetimeauth:ye,crypto_onetimeauth_verify:Ve,crypto_verify_16:E,crypto_verify_32:R,crypto_secretbox:Qe,crypto_secretbox_open:dt,crypto_scalarmult:Ar,crypto_scalarmult_base:vt,crypto_box_beforenm:Nr,crypto_box_afternm:mt,crypto_box:En,crypto_box_open:No,crypto_box_keypair:Zt,crypto_hash:Mr,crypto_sign:ja,crypto_sign_keypair:Yi,crypto_sign_open:Ji,crypto_secretbox_KEYBYTES:es,crypto_secretbox_NONCEBYTES:Go,crypto_secretbox_ZEROBYTES:jn,crypto_secretbox_BOXZEROBYTES:Sn,crypto_scalarmult_BYTES:Wn,crypto_scalarmult_SCALARBYTES:Lo,crypto_box_PUBLICKEYBYTES:Yn,crypto_box_SECRETKEYBYTES:Xn,crypto_box_BEFORENMBYTES:ts,crypto_box_NONCEBYTES:Wa,crypto_box_ZEROBYTES:qd,crypto_box_BOXZEROBYTES:Gd,crypto_sign_BYTES:Jt,crypto_sign_PUBLICKEYBYTES:Dr,crypto_sign_SECRETKEYBYTES:Un,crypto_sign_SEEDBYTES:rs,crypto_hash_BYTES:ns,gf:t,D:p,L:qo,pack25519:Ee,unpack25519:ot,M:ae,A:ke,S:Ze,Z:Xe,pow2523:Rt,add:Mo,set25519:O,modL:Xi,scalarmult:Wi,scalarbase:Do};function Ya(a,d){if(a.length!==es)throw new Error("bad key size");if(d.length!==Go)throw new Error("bad nonce size")}function Ld(a,d){if(a.length!==Yn)throw new Error("bad public key size");if(d.length!==Xn)throw new Error("bad secret key size")}function xt(){for(var a=0;a<arguments.length;a++)if(!(arguments[a]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Xa(a){for(var d=0;d<a.length;d++)a[d]=0}r.randomBytes=function(a){var d=new Uint8Array(a);return e(d,a),d},r.secretbox=function(a,d,f){xt(a,d,f),Ya(f,d);for(var i=new Uint8Array(jn+a.length),l=new Uint8Array(i.length),m=0;m<a.length;m++)i[m+jn]=a[m];return Qe(l,i,i.length,d,f),l.subarray(Sn)},r.secretbox.open=function(a,d,f){xt(a,d,f),Ya(f,d);for(var i=new Uint8Array(Sn+a.length),l=new Uint8Array(i.length),m=0;m<a.length;m++)i[m+Sn]=a[m];return i.length<32||dt(l,i,i.length,d,f)!==0?null:l.subarray(jn)},r.secretbox.keyLength=es,r.secretbox.nonceLength=Go,r.secretbox.overheadLength=Sn,r.scalarMult=function(a,d){if(xt(a,d),a.length!==Lo)throw new Error("bad n size");if(d.length!==Wn)throw new Error("bad p size");var f=new Uint8Array(Wn);return Ar(f,a,d),f},r.scalarMult.base=function(a){if(xt(a),a.length!==Lo)throw new Error("bad n size");var d=new Uint8Array(Wn);return vt(d,a),d},r.scalarMult.scalarLength=Lo,r.scalarMult.groupElementLength=Wn,r.box=function(a,d,f,i){var l=r.box.before(f,i);return r.secretbox(a,d,l)},r.box.before=function(a,d){xt(a,d),Ld(a,d);var f=new Uint8Array(ts);return Nr(f,a,d),f},r.box.after=r.secretbox,r.box.open=function(a,d,f,i){var l=r.box.before(f,i);return r.secretbox.open(a,d,l)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var a=new Uint8Array(Yn),d=new Uint8Array(Xn);return Zt(a,d),{publicKey:a,secretKey:d}},r.box.keyPair.fromSecretKey=function(a){if(xt(a),a.length!==Xn)throw new Error("bad secret key size");var d=new Uint8Array(Yn);return vt(d,a),{publicKey:d,secretKey:new Uint8Array(a)}},r.box.publicKeyLength=Yn,r.box.secretKeyLength=Xn,r.box.sharedKeyLength=ts,r.box.nonceLength=Wa,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(a,d){if(xt(a,d),d.length!==Un)throw new Error("bad secret key size");var f=new Uint8Array(Jt+a.length);return ja(f,a,a.length,d),f},r.sign.open=function(a,d){if(xt(a,d),d.length!==Dr)throw new Error("bad public key size");var f=new Uint8Array(a.length),i=Ji(f,a,a.length,d);if(i<0)return null;for(var l=new Uint8Array(i),m=0;m<l.length;m++)l[m]=f[m];return l},r.sign.detached=function(a,d){for(var f=r.sign(a,d),i=new Uint8Array(Jt),l=0;l<i.length;l++)i[l]=f[l];return i},r.sign.detached.verify=function(a,d,f){if(xt(a,d,f),d.length!==Jt)throw new Error("bad signature size");if(f.length!==Dr)throw new Error("bad public key size");var i=new Uint8Array(Jt+a.length),l=new Uint8Array(Jt+a.length),m;for(m=0;m<Jt;m++)i[m]=d[m];for(m=0;m<a.length;m++)i[m+Jt]=a[m];return Ji(l,i,i.length,f)>=0},r.sign.keyPair=function(){var a=new Uint8Array(Dr),d=new Uint8Array(Un);return Yi(a,d),{publicKey:a,secretKey:d}},r.sign.keyPair.fromSecretKey=function(a){if(xt(a),a.length!==Un)throw new Error("bad secret key size");for(var d=new Uint8Array(Dr),f=0;f<d.length;f++)d[f]=a[32+f];return{publicKey:d,secretKey:new Uint8Array(a)}},r.sign.keyPair.fromSeed=function(a){if(xt(a),a.length!==rs)throw new Error("bad seed size");for(var d=new Uint8Array(Dr),f=new Uint8Array(Un),i=0;i<32;i++)f[i]=a[i];return Yi(d,f,!0),{publicKey:d,secretKey:f}},r.sign.publicKeyLength=Dr,r.sign.secretKeyLength=Un,r.sign.seedLength=rs,r.sign.signatureLength=Jt,r.hash=function(a){xt(a);var d=new Uint8Array(ns);return Mr(d,a,a.length),d},r.hash.hashLength=ns,r.verify=function(a,d){return xt(a,d),a.length===0||d.length===0||a.length!==d.length?!1:N(a,0,d,0,a.length)===0},r.setPRNG=function(a){e=a},function(){var a=typeof self<"u"?self.crypto||self.msCrypto:null;if(a&&a.getRandomValues){var d=65536;r.setPRNG(function(f,i){var l,m=new Uint8Array(i);for(l=0;l<i;l+=d)a.getRandomValues(m.subarray(l,l+Math.min(i-l,d)));for(l=0;l<i;l++)f[l]=m[l];Xa(m)})}else typeof Ja<"u"&&(a=Ec(),a&&a.randomBytes&&r.setPRNG(function(f,i){var l,m=a.randomBytes(i);for(l=0;l<i;l++)f[l]=m[l];Xa(m)}))}()})(typeof ri<"u"&&ri.exports?ri.exports:self.nacl=self.nacl||{})});var sa=we((Ox,Mu)=>{"use strict";Mu.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var rt=we((zx,Gu)=>{"use strict";var Sp=sa(),ca=Object.prototype.toString,ua=function(r){return function(t){var e=ca.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function sn(r){return r=r.toLowerCase(),function(e){return ua(e)===r}}function fa(r){return Array.isArray(r)}function vi(r){return typeof r>"u"}function Up(r){return r!==null&&!vi(r)&&r.constructor!==null&&!vi(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Du=sn("ArrayBuffer");function Cp(r){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Du(r.buffer),t}function Ip(r){return typeof r=="string"}function Bp(r){return typeof r=="number"}function qu(r){return r!==null&&typeof r=="object"}function Ti(r){if(ua(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var Rp=sn("Date"),Pp=sn("File"),kp=sn("Blob"),Op=sn("FileList");function da(r){return ca.call(r)==="[object Function]"}function zp(r){return qu(r)&&da(r.pipe)}function Np(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||ca.call(r)===t||da(r.toString)&&r.toString()===t)}var Mp=sn("URLSearchParams");function Dp(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function qp(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function la(r,t){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),fa(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function aa(){var r={};function t(o,s){Ti(r[s])&&Ti(o)?r[s]=aa(r[s],o):Ti(o)?r[s]=aa({},o):fa(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)la(arguments[e],t);return r}function Gp(r,t,e){return la(t,function(o,s){e&&typeof o=="function"?r[s]=Sp(o,e):r[s]=o}),r}function Lp(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Fp(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function Kp(r,t,e){var n,o,s,c={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],c[s]||(t[s]=r[s],c[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function Hp(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function $p(r){if(!r)return null;var t=r.length;if(vi(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var Vp=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Gu.exports={isArray:fa,isArrayBuffer:Du,isBuffer:Up,isFormData:Np,isArrayBufferView:Cp,isString:Ip,isNumber:Bp,isObject:qu,isPlainObject:Ti,isUndefined:vi,isDate:Rp,isFile:Pp,isBlob:kp,isFunction:da,isStream:zp,isURLSearchParams:Mp,isStandardBrowserEnv:qp,forEach:la,merge:aa,extend:Gp,trim:Dp,stripBOM:Lp,inherits:Fp,toFlatObject:Kp,kindOf:ua,kindOfTest:sn,endsWith:Hp,toArray:$p,isTypedArray:Vp,isFileList:Op}});var pa=we((Nx,Fu)=>{"use strict";var kn=rt();function Lu(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Fu.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(kn.isURLSearchParams(e))o=e.toString();else{var s=[];kn.forEach(e,function(p,h){p===null||typeof p>"u"||(kn.isArray(p)?h=h+"[]":p=[p],kn.forEach(p,function(x){kn.isDate(x)?x=x.toISOString():kn.isObject(x)&&(x=JSON.stringify(x)),s.push(Lu(h)+"="+Lu(x))}))}),o=s.join("&")}if(o){var c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Hu=we((Mx,Ku)=>{"use strict";var Qp=rt();function _i(){this.handlers=[]}_i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};_i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};_i.prototype.forEach=function(t){Qp.forEach(this.handlers,function(n){n!==null&&t(n)})};Ku.exports=_i});var Vu=we((Dx,$u)=>{"use strict";var jp=rt();$u.exports=function(t,e){jp.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var an=we((qx,Yu)=>{"use strict";var Qu=rt();function On(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}Qu.inherits(On,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var ju=On.prototype,Wu={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){Wu[r]={value:r}});Object.defineProperties(On,Wu);Object.defineProperty(ju,"isAxiosError",{value:!0});On.from=function(r,t,e,n,o,s){var c=Object.create(ju);return Qu.toFlatObject(r,c,function(p){return p!==Error.prototype}),On.call(c,r.message,t,e,n,o),c.name=r.name,s&&Object.assign(c,s),c};Yu.exports=On});var ga=we((Gx,Xu)=>{"use strict";Xu.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var ha=we((Lx,Zu)=>{"use strict";var Lt=rt();function Wp(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":Lt.isDate(s)?s.toISOString():Lt.isArrayBuffer(s)||Lt.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,c){if(Lt.isPlainObject(s)||Lt.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+c);e.push(s),Lt.forEach(s,function(p,h){if(!Lt.isUndefined(p)){var y=c?c+"."+h:h,x;if(p&&!c&&typeof p=="object"){if(Lt.endsWith(h,"{}"))p=JSON.stringify(p);else if(Lt.endsWith(h,"[]")&&(x=Lt.toArray(p))){x.forEach(function(_){!Lt.isUndefined(_)&&t.append(y,n(_))});return}}o(p,y)}}),e.pop()}else t.append(c,n(s))}return o(r),t}Zu.exports=Wp});var ef=we((Fx,Ju)=>{"use strict";var ya=an();Ju.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new ya("Request failed with status code "+n.status,[ya.ERR_BAD_REQUEST,ya.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var rf=we((Kx,tf)=>{"use strict";var Ei=rt();tf.exports=Ei.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,c,u){var p=[];p.push(e+"="+encodeURIComponent(n)),Ei.isNumber(o)&&p.push("expires="+new Date(o).toGMTString()),Ei.isString(s)&&p.push("path="+s),Ei.isString(c)&&p.push("domain="+c),u===!0&&p.push("secure"),document.cookie=p.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var of=we((Hx,nf)=>{"use strict";nf.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var af=we(($x,sf)=>{"use strict";sf.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var ma=we((Vx,cf)=>{"use strict";var Yp=of(),Xp=af();cf.exports=function(t,e){return t&&!Yp(e)?Xp(t,e):e}});var ff=we((Qx,uf)=>{"use strict";var xa=rt(),Zp=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];uf.exports=function(t){var e={},n,o,s;return t&&xa.forEach(t.split(`
|
|
2
|
+
`),function(u){if(s=u.indexOf(":"),n=xa.trim(u.substr(0,s)).toLowerCase(),o=xa.trim(u.substr(s+1)),n){if(e[n]&&Zp.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var pf=we((jx,lf)=>{"use strict";var df=rt();lf.exports=df.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var c=s;return t&&(e.setAttribute("href",c),c=e.href),e.setAttribute("href",c),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(c){var u=df.isString(c)?o(c):c;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}()});var po=we((Wx,hf)=>{"use strict";var Aa=an(),Jp=rt();function gf(r){Aa.call(this,r??"canceled",Aa.ERR_CANCELED),this.name="CanceledError"}Jp.inherits(gf,Aa,{__CANCEL__:!0});hf.exports=gf});var mf=we((Yx,yf)=>{"use strict";yf.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var ba=we((Xx,xf)=>{"use strict";var go=rt(),eg=ef(),tg=rf(),rg=pa(),ng=ma(),og=ff(),ig=pf(),sg=ga(),lr=an(),ag=po(),cg=mf();xf.exports=function(t){return new Promise(function(n,o){var s=t.data,c=t.headers,u=t.responseType,p;function h(){t.cancelToken&&t.cancelToken.unsubscribe(p),t.signal&&t.signal.removeEventListener("abort",p)}go.isFormData(s)&&go.isStandardBrowserEnv()&&delete c["Content-Type"];var y=new XMLHttpRequest;if(t.auth){var x=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";c.Authorization="Basic "+btoa(x+":"+_)}var T=ng(t.baseURL,t.url);y.open(t.method.toUpperCase(),rg(T,t.params,t.paramsSerializer),!0),y.timeout=t.timeout;function N(){if(y){var P="getAllResponseHeaders"in y?og(y.getAllResponseHeaders()):null,Q=!u||u==="text"||u==="json"?y.responseText:y.response,z={data:Q,status:y.status,statusText:y.statusText,headers:P,config:t,request:y};eg(function(L){n(L),h()},function(L){o(L),h()},z),y=null}}if("onloadend"in y?y.onloadend=N:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(N)},y.onabort=function(){y&&(o(new lr("Request aborted",lr.ECONNABORTED,t,y)),y=null)},y.onerror=function(){o(new lr("Network Error",lr.ERR_NETWORK,t,y,y)),y=null},y.ontimeout=function(){var Q=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",z=t.transitional||sg;t.timeoutErrorMessage&&(Q=t.timeoutErrorMessage),o(new lr(Q,z.clarifyTimeoutError?lr.ETIMEDOUT:lr.ECONNABORTED,t,y)),y=null},go.isStandardBrowserEnv()){var E=(t.withCredentials||ig(T))&&t.xsrfCookieName?tg.read(t.xsrfCookieName):void 0;E&&(c[t.xsrfHeaderName]=E)}"setRequestHeader"in y&&go.forEach(c,function(Q,z){typeof s>"u"&&z.toLowerCase()==="content-type"?delete c[z]:y.setRequestHeader(z,Q)}),go.isUndefined(t.withCredentials)||(y.withCredentials=!!t.withCredentials),u&&u!=="json"&&(y.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&y.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(p=function(P){y&&(o(!P||P&&P.type?new ag:P),y.abort(),y=null)},t.cancelToken&&t.cancelToken.subscribe(p),t.signal&&(t.signal.aborted?p():t.signal.addEventListener("abort",p))),s||(s=null);var R=cg(T);if(R&&["http","https","file"].indexOf(R)===-1){o(new lr("Unsupported protocol "+R+":",lr.ERR_BAD_REQUEST,t));return}y.send(s)})}});var bf=we((Zx,Af)=>{"use strict";Af.exports=null});var Ui=we((Jx,_f)=>{"use strict";var nt=rt(),wf=Vu(),Tf=an(),ug=ga(),fg=ha(),dg={"Content-Type":"application/x-www-form-urlencoded"};function vf(r,t){!nt.isUndefined(r)&&nt.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function lg(){var r;return typeof XMLHttpRequest<"u"?r=ba():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=ba()),r}function pg(r,t,e){if(nt.isString(r))try{return(t||JSON.parse)(r),nt.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Si={transitional:ug,adapter:lg(),transformRequest:[function(t,e){if(wf(e,"Accept"),wf(e,"Content-Type"),nt.isFormData(t)||nt.isArrayBuffer(t)||nt.isBuffer(t)||nt.isStream(t)||nt.isFile(t)||nt.isBlob(t))return t;if(nt.isArrayBufferView(t))return t.buffer;if(nt.isURLSearchParams(t))return vf(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=nt.isObject(t),o=e&&e["Content-Type"],s;if((s=nt.isFileList(t))||n&&o==="multipart/form-data"){var c=this.env&&this.env.FormData;return fg(s?{"files[]":t}:t,c&&new c)}else if(n||o==="application/json")return vf(e,"application/json"),pg(t);return t}],transformResponse:[function(t){var e=this.transitional||Si.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&nt.isString(t)&&t.length)try{return JSON.parse(t)}catch(c){if(s)throw c.name==="SyntaxError"?Tf.from(c,Tf.ERR_BAD_RESPONSE,this,null,this.response):c}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bf()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};nt.forEach(["delete","get","head"],function(t){Si.headers[t]={}});nt.forEach(["post","put","patch"],function(t){Si.headers[t]=nt.merge(dg)});_f.exports=Si});var Sf=we((eA,Ef)=>{"use strict";var gg=rt(),hg=Ui();Ef.exports=function(t,e,n){var o=this||hg;return gg.forEach(n,function(c){t=c.call(o,t,e)}),t}});var wa=we((tA,Uf)=>{"use strict";Uf.exports=function(t){return!!(t&&t.__CANCEL__)}});var Bf=we((rA,If)=>{"use strict";var Cf=rt(),Ta=Sf(),yg=wa(),mg=Ui(),xg=po();function va(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new xg}If.exports=function(t){va(t),t.headers=t.headers||{},t.data=Ta.call(t,t.data,t.headers,t.transformRequest),t.headers=Cf.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Cf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||mg.adapter;return e(t).then(function(o){return va(t),o.data=Ta.call(t,o.data,o.headers,t.transformResponse),o},function(o){return yg(o)||(va(t),o&&o.response&&(o.response.data=Ta.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var _a=we((nA,Rf)=>{"use strict";var Tt=rt();Rf.exports=function(t,e){e=e||{};var n={};function o(y,x){return Tt.isPlainObject(y)&&Tt.isPlainObject(x)?Tt.merge(y,x):Tt.isPlainObject(x)?Tt.merge({},x):Tt.isArray(x)?x.slice():x}function s(y){if(Tt.isUndefined(e[y])){if(!Tt.isUndefined(t[y]))return o(void 0,t[y])}else return o(t[y],e[y])}function c(y){if(!Tt.isUndefined(e[y]))return o(void 0,e[y])}function u(y){if(Tt.isUndefined(e[y])){if(!Tt.isUndefined(t[y]))return o(void 0,t[y])}else return o(void 0,e[y])}function p(y){if(y in e)return o(t[y],e[y]);if(y in t)return o(void 0,t[y])}var h={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:p};return Tt.forEach(Object.keys(t).concat(Object.keys(e)),function(x){var _=h[x]||s,T=_(x);Tt.isUndefined(T)&&_!==p||(n[x]=T)}),n}});var Ea=we((oA,Pf)=>{"use strict";Pf.exports={version:"0.27.2"}});var zf=we((iA,Of)=>{"use strict";var Ag=Ea().version,kr=an(),Sa={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){Sa[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var kf={};Sa.transitional=function(t,e,n){function o(s,c){return"[Axios v"+Ag+"] Transitional option '"+s+"'"+c+(n?". "+n:"")}return function(s,c,u){if(t===!1)throw new kr(o(c," has been removed"+(e?" in "+e:"")),kr.ERR_DEPRECATED);return e&&!kf[c]&&(kf[c]=!0,console.warn(o(c," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,c,u):!0}};function bg(r,t,e){if(typeof r!="object")throw new kr("options must be an object",kr.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],c=t[s];if(c){var u=r[s],p=u===void 0||c(u,s,r);if(p!==!0)throw new kr("option "+s+" must be "+p,kr.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new kr("Unknown option "+s,kr.ERR_BAD_OPTION)}}Of.exports={assertOptions:bg,validators:Sa}});var Lf=we((sA,Gf)=>{"use strict";var Df=rt(),wg=pa(),Nf=Hu(),Mf=Bf(),Ci=_a(),Tg=ma(),qf=zf(),zn=qf.validators;function Nn(r){this.defaults=r,this.interceptors={request:new Nf,response:new Nf}}Nn.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ci(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&qf.assertOptions(n,{silentJSONParsing:zn.transitional(zn.boolean),forcedJSONParsing:zn.transitional(zn.boolean),clarifyTimeoutError:zn.transitional(zn.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(e)===!1||(s=s&&T.synchronous,o.unshift(T.fulfilled,T.rejected))});var c=[];this.interceptors.response.forEach(function(T){c.push(T.fulfilled,T.rejected)});var u;if(!s){var p=[Mf,void 0];for(Array.prototype.unshift.apply(p,o),p=p.concat(c),u=Promise.resolve(e);p.length;)u=u.then(p.shift(),p.shift());return u}for(var h=e;o.length;){var y=o.shift(),x=o.shift();try{h=y(h)}catch(_){x(_);break}}try{u=Mf(h)}catch(_){return Promise.reject(_)}for(;c.length;)u=u.then(c.shift(),c.shift());return u};Nn.prototype.getUri=function(t){t=Ci(this.defaults,t);var e=Tg(t.baseURL,t.url);return wg(e,t.params,t.paramsSerializer)};Df.forEach(["delete","get","head","options"],function(t){Nn.prototype[t]=function(e,n){return this.request(Ci(n||{},{method:t,url:e,data:(n||{}).data}))}});Df.forEach(["post","put","patch"],function(t){function e(n){return function(s,c,u){return this.request(Ci(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:c}))}}Nn.prototype[t]=e(),Nn.prototype[t+"Form"]=e(!0)});Gf.exports=Nn});var Kf=we((aA,Ff)=>{"use strict";var vg=po();function Mn(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(c){e.subscribe(c),o=c}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new vg(o),t(e.reason))})}Mn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Mn.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};Mn.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};Mn.source=function(){var t,e=new Mn(function(o){t=o});return{token:e,cancel:t}};Ff.exports=Mn});var $f=we((cA,Hf)=>{"use strict";Hf.exports=function(t){return function(n){return t.apply(null,n)}}});var Qf=we((uA,Vf)=>{"use strict";var _g=rt();Vf.exports=function(t){return _g.isObject(t)&&t.isAxiosError===!0}});var Yf=we((fA,Ua)=>{"use strict";var jf=rt(),Eg=sa(),Ii=Lf(),Sg=_a(),Ug=Ui();function Wf(r){var t=new Ii(r),e=Eg(Ii.prototype.request,t);return jf.extend(e,Ii.prototype,t),jf.extend(e,t),e.create=function(o){return Wf(Sg(r,o))},e}var gt=Wf(Ug);gt.Axios=Ii;gt.CanceledError=po();gt.CancelToken=Kf();gt.isCancel=wa();gt.VERSION=Ea().version;gt.toFormData=ha();gt.AxiosError=an();gt.Cancel=gt.CanceledError;gt.all=function(t){return Promise.all(t)};gt.spread=$f();gt.isAxiosError=Qf();Ua.exports=gt;Ua.exports.default=gt});var Zf=we((dA,Xf)=>{"use strict";Xf.exports=Yf()});var Hg={};ec(Hg,{APTOS_BIP44_REGEX:()=>Oc,APTOS_COIN:()=>xs,APTOS_HARDENED_REGEX:()=>kc,Account:()=>dr,AccountAddress:()=>k,AccountAuthenticator:()=>ht,AccountAuthenticatorEd25519:()=>gr,AccountAuthenticatorMultiEd25519:()=>ki,AccountAuthenticatorMultiKey:()=>Dn,AccountAuthenticatorSingleKey:()=>Wt,AccountAuthenticatorVariant:()=>cs,AddressInvalidReason:()=>mc,AnyPublicKeyVariant:()=>us,AnySignatureVariant:()=>fs,Aptos:()=>yt,AptosApiError:()=>Vt,AptosApiType:()=>to,AptosConfig:()=>ho,AuthenticationKey:()=>Gt,Bool:()=>Ge,CKDPriv:()=>zs,ChainId:()=>ln,DEFAULT_MAX_GAS_AMOUNT:()=>ys,DEFAULT_NETWORK:()=>hs,DEFAULT_TXN_EXP_SEC_FROM_NOW:()=>ms,DEFAULT_TXN_TIMEOUT_SEC:()=>ro,DeriveScheme:()=>ac,Deserializer:()=>io,Ed25519PrivateKey:()=>or,Ed25519PublicKey:()=>Pe,Ed25519Signature:()=>Ke,EntryFunction:()=>vn,EntryFunctionBytes:()=>so,FeePayerRawTransaction:()=>mr,FixedBytes:()=>Er,HARDENED_OFFSET:()=>Ps,Hex:()=>me,HexInvalidReason:()=>hc,Identifier:()=>Ne,KeyType:()=>zc,MimeType:()=>Fo,ModuleId:()=>qn,MoveAbility:()=>ic,MoveFunctionVisibility:()=>oc,MoveOption:()=>Nt,MoveString:()=>Fe,MoveVector:()=>Be,MultiAgentRawTransaction:()=>yr,MultiEd25519PublicKey:()=>Dt,MultiEd25519Signature:()=>Yr,MultiKey:()=>nn,MultiSig:()=>Hn,MultisigTransactionPayload:()=>$n,Network:()=>eo,NetworkToChainId:()=>Ho,NetworkToFaucetAPI:()=>gs,NetworkToIndexerAPI:()=>Ko,NetworkToNetworkName:()=>Qd,NetworkToNodeAPI:()=>ps,ParsingError:()=>ft,PrivateKey:()=>Vr,PublicKey:()=>At,RAW_TRANSACTION_SALT:()=>As,RAW_TRANSACTION_WITH_DATA_SALT:()=>$o,RawTransaction:()=>Ft,RawTransactionWithData:()=>Ao,RoleType:()=>sc,RotationProofChallenge:()=>yo,Script:()=>Kn,ScriptTransactionArgumentVariants:()=>Cn,Secp256k1PrivateKey:()=>cr,Secp256k1PublicKey:()=>qt,Secp256k1Signature:()=>ur,Serializable:()=>Z,Serializer:()=>Ot,Signature:()=>Mt,SignedTransaction:()=>Kt,SigningScheme:()=>In,SigningSchemeInput:()=>ls,StructTag:()=>Xt,TransactionAuthenticator:()=>Yt,TransactionAuthenticatorEd25519:()=>cn,TransactionAuthenticatorFeePayer:()=>fn,TransactionAuthenticatorMultiAgent:()=>un,TransactionAuthenticatorMultiEd25519:()=>Oi,TransactionAuthenticatorSingleSender:()=>dn,TransactionAuthenticatorVariant:()=>as,TransactionPayload:()=>zr,TransactionPayloadEntryFunction:()=>Ln,TransactionPayloadMultisig:()=>Fn,TransactionPayloadScript:()=>Gn,TransactionPayloadVariants:()=>is,TransactionResponseType:()=>ds,TransactionVariants:()=>ss,TypeTag:()=>$e,TypeTagAddress:()=>bn,TypeTagBool:()=>pn,TypeTagGeneric:()=>wn,TypeTagParserError:()=>Oe,TypeTagParserErrorType:()=>ad,TypeTagReference:()=>xo,TypeTagSigner:()=>Or,TypeTagStruct:()=>hr,TypeTagU128:()=>xn,TypeTagU16:()=>hn,TypeTagU256:()=>An,TypeTagU32:()=>yn,TypeTagU64:()=>mn,TypeTagU8:()=>gn,TypeTagVariants:()=>os,TypeTagVector:()=>Tn,U128:()=>St,U16:()=>_t,U256:()=>Ut,U32:()=>Et,U64:()=>Le,U8:()=>it,aptosCoinStructTag:()=>Ig,aptosRequest:()=>Jn,buildTransaction:()=>Eo,convertArgument:()=>Na,deriveKey:()=>ii,deriveTransactionType:()=>Ga,deserializeFromScriptArgument:()=>od,ensureBoolean:()=>Xo,fetchEntryFunctionAbi:()=>za,findFirstNonSignerArg:()=>ka,generateMultiSignersSignedTransaction:()=>dd,generateRawTransaction:()=>fd,generateSignedTransaction:()=>qa,generateSignedTransactionForSimulation:()=>Ma,generateTransactionPayload:()=>_o,generateTransactionPayloadWithABI:()=>cd,get:()=>fc,getAptosFullNode:()=>lt,getAuthenticatorForSimulation:()=>vo,getFunctionParts:()=>$i,getSigningMessage:()=>ld,isBcsAddress:()=>To,isBcsBool:()=>Ni,isBcsFixedBytes:()=>Pa,isBcsString:()=>Mi,isBcsU128:()=>Fi,isBcsU16:()=>qi,isBcsU256:()=>Ki,isBcsU32:()=>Gi,isBcsU64:()=>Li,isBcsU8:()=>Di,isBool:()=>Ba,isLargeNumber:()=>wo,isNull:()=>Ra,isNumber:()=>bo,isScriptDataInput:()=>Hi,isString:()=>_n,isValidBIP44Path:()=>ks,isValidHardenedPath:()=>Os,mnemonicToSeed:()=>co,objectStructTag:()=>Pg,optionStructTag:()=>Rg,outOfRangeErrorMessage:()=>yc,paginateWithCursor:()=>qr,parseTypeTag:()=>Vn,post:()=>Vo,postAptosFaucet:()=>ws,postAptosFullNode:()=>Gr,postAptosIndexer:()=>bs,request:()=>uc,sign:()=>Da,splitPath:()=>Ns,standardizeTypeTags:()=>Oa,stringStructTag:()=>Bg,throwTypeMismatch:()=>ze,validateNumberInRange:()=>tr});var Vt=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var nc="0.0.4";var Fo=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(Fo||{}),os=(T=>(T[T.Bool=0]="Bool",T[T.U8=1]="U8",T[T.U64=2]="U64",T[T.U128=3]="U128",T[T.Address=4]="Address",T[T.Signer=5]="Signer",T[T.Vector=6]="Vector",T[T.Struct=7]="Struct",T[T.U16=8]="U16",T[T.U32=9]="U32",T[T.U256=10]="U256",T[T.Reference=254]="Reference",T[T.Generic=255]="Generic",T))(os||{}),Cn=(h=>(h[h.U8=0]="U8",h[h.U64=1]="U64",h[h.U128=2]="U128",h[h.Address=3]="Address",h[h.U8Vector=4]="U8Vector",h[h.Bool=5]="Bool",h[h.U16=6]="U16",h[h.U32=7]="U32",h[h.U256=8]="U256",h))(Cn||{}),is=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(is||{}),ss=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(ss||{}),as=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(as||{}),cs=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(cs||{}),us=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(us||{}),fs=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(fs||{}),ds=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(ds||{}),oc=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(oc||{}),ic=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(ic||{}),sc=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(sc||{}),In=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(In||{}),ls=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(ls||{}),ac=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(ac||{});var cc={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function uc(r,t){let{url:e,method:n,body:o,contentType:s,params:c,overrides:u}=r,p={...u?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${nc}`,"content-type":s??"application/json"};return u?.AUTH_TOKEN&&e.includes("faucet")&&(p.Authorization=`Bearer ${u?.AUTH_TOKEN}`),t.provider({url:e,method:n,body:o,params:c,headers:p,overrides:u})}async function Jn(r,t){let{url:e,path:n}=r,o=`${e}/${n??""}`,s=await uc({...r,url:o},t.client),c={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let p=c.data;if(p.errors)throw new Vt(r,c,p.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);c.data=p.data}if(c.status>=200&&c.status<300)return c;let u;throw"message"in s.data&&"error_code"in s.data?u=JSON.stringify(s.data):c.status in cc?u=cc[c.status]:u=`Unhandled Error ${s.status} : ${s.statusText}`,new Vt(r,c,u)}var Ko={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ps={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},gs={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},eo=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(eo||{}),Ho={mainnet:1,testnet:2},Qd={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};var to=(n=>(n[n.FULLNODE=0]="FULLNODE",n[n.INDEXER=1]="INDEXER",n[n.FAUCET=2]="FAUCET",n))(to||{}),hs="devnet",ys=2e5,ms=20,ro=20,xs="0x1::aptos_coin::AptosCoin",As="APTOS::RawTransaction",$o="APTOS::RawTransactionWithData";async function fc(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:c,originMethod:u,type:p}=r,h=t.getRequestUrl(p);return Jn({url:h,method:"GET",originMethod:u,path:c,contentType:o?.valueOf(),acceptType:s?.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function lt(r){return fc({...r,type:0})}async function qr(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await lt({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function Vo(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:c,params:u,aptosConfig:p,overrides:h}=r,y=p.getRequestUrl(t);return Jn({url:y,method:"POST",originMethod:e,path:n,body:o,contentType:c?.valueOf(),acceptType:s?.valueOf(),params:u,overrides:{...p.clientConfig,...h}},p)}async function Gr(r){return Vo({...r,type:0})}async function bs(r){return Vo({...r,type:1})}async function ws(r){return Vo({...r,type:2})}var Qo=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Ts=r=>r instanceof Uint8Array;var dc=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Qt=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Pt=(r,t)=>r<<32-t|r>>>t,jd=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!jd)throw new Error("Non little-endian hardware is not supported");var Wd=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Lr(r){if(!Ts(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Wd[r[e]];return t}function Bn(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),c=Number.parseInt(s,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");e[n]=c}return e}function vs(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function kt(r){if(typeof r=="string"&&(r=vs(r)),!Ts(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Fr(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!Ts(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var Tr=class{clone(){return this._cloneInto()}},Yd={}.toString;function lc(r,t){if(t!==void 0&&Yd.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,t)}function vr(r){let t=n=>r().update(kt(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function pc(r){let t=(n,o)=>r(o).update(kt(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}function gc(r=32){if(Qo&&typeof Qo.getRandomValues=="function")return Qo.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var jo=2**8-1,Wo=2**16-1,er=2**32-1,Kr=BigInt(2)**BigInt(64)-BigInt(1),no=BigInt(2)**BigInt(128)-BigInt(1),Yo=BigInt(2)**BigInt(256)-BigInt(1);var ft=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var hc=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(hc||{}),me=class r{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return Lr(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new ft("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new ft("Hex string must be an even number of hex characters.","invalid_length");try{return new r(Bn(e))}catch(n){let o=n;throw new ft(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new r(t):r.fromString(t)}static isValid(t){try{return r.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var Z=class{bcsToBytes(){let t=new Ot;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return me.fromHexInput(t)}},Ot=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){Xo(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(er),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&Kr,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&no,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};wr([Hr(0,jo)],Ot.prototype,"serializeU8",1),wr([Hr(0,Wo)],Ot.prototype,"serializeU16",1),wr([Hr(0,er)],Ot.prototype,"serializeU32",1),wr([Hr(BigInt(0),Kr)],Ot.prototype,"serializeU64",1),wr([Hr(BigInt(0),no)],Ot.prototype,"serializeU128",1),wr([Hr(BigInt(0),Yo)],Ot.prototype,"serializeU256",1),wr([Hr(0,er)],Ot.prototype,"serializeU32AsUleb128",1);function Xo(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var yc=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function tr(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(yc(r,t,e))}function Hr(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(u){return tr(u,r,t),s.apply(this,[u])},o}}var mc=(u=>(u.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",u.INVALID_HEX_CHARS="invalid_hex_chars",u.TOO_SHORT="too_short",u.TOO_LONG="too_long",u.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",u.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",u.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",u))(mc||{}),Ie=class Ie extends Z{constructor(e){super();if(e.length!==Ie.LENGTH)throw new ft("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=Lr(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return Lr(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(Ie.LENGTH);return new Ie(n)}static fromString(e){if(!e.startsWith("0x"))throw new ft("Hex string must start with a leading 0x.","leading_zero_x_required");let n=Ie.fromStringRelaxed(e);if(e.length!==Ie.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new ft(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new ft(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new ft("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new ft("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=Bn(n.padStart(64,"0"))}catch(s){let c=s;throw new ft(`Hex characters are invalid: ${c.message}`,"invalid_hex_chars")}return new Ie(o)}static fromRelaxed(e){return e instanceof Ie?e:e instanceof Uint8Array?new Ie(e):Ie.fromStringRelaxed(e)}static from(e){return e instanceof Ie?e:e instanceof Uint8Array?new Ie(e):Ie.fromString(e)}static isValid(e){try{return e.relaxed?Ie.fromRelaxed(e.input):Ie.from(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}};Ie.LENGTH=32,Ie.LONG_STRING_LENGTH=64,Ie.ZERO=Ie.from("0x0"),Ie.ONE=Ie.from("0x1"),Ie.TWO=Ie.from("0x2"),Ie.THREE=Ie.from("0x3"),Ie.FOUR=Ie.from("0x4");var k=Ie;function rr(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function zt(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Zo(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");rr(r.outputLen),rr(r.blockLen)}function nr(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function Jo(r,t){zt(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var ei=BigInt(4294967295),_s=BigInt(32);function xc(r,t=!1){return t?{h:Number(r&ei),l:Number(r>>_s&ei)}:{h:Number(r>>_s&ei)|0,l:Number(r&ei)|0}}function Es(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:c}=xc(r[o],t);[e[o],n[o]]=[s,c]}return[e,n]}var Xd=(r,t)=>BigInt(r>>>0)<<_s|BigInt(t>>>0),Zd=(r,t,e)=>r>>>e,Jd=(r,t,e)=>r<<32-e|t>>>e,el=(r,t,e)=>r>>>e|t<<32-e,tl=(r,t,e)=>r<<32-e|t>>>e,rl=(r,t,e)=>r<<64-e|t>>>e-32,nl=(r,t,e)=>r>>>e-32|t<<64-e,ol=(r,t)=>t,il=(r,t)=>r,Ss=(r,t,e)=>r<<e|t>>>32-e,Us=(r,t,e)=>t<<e|r>>>32-e,Cs=(r,t,e)=>t<<e-32|r>>>64-e,Is=(r,t,e)=>r<<e-32|t>>>64-e;function sl(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var al=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),cl=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,ul=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),fl=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,dl=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),ll=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0;var pl={fromBig:xc,split:Es,toBig:Xd,shrSH:Zd,shrSL:Jd,rotrSH:el,rotrSL:tl,rotrBH:rl,rotrBL:nl,rotr32H:ol,rotr32L:il,rotlSH:Ss,rotlSL:Us,rotlBH:Cs,rotlBL:Is,add:sl,add3L:al,add3H:cl,add4L:ul,add4H:fl,add5H:ll,add5L:dl},pe=pl;var[wc,Tc,vc]=[[],[],[]],gl=BigInt(0),oo=BigInt(1),hl=BigInt(2),yl=BigInt(7),ml=BigInt(256),xl=BigInt(113);for(let r=0,t=oo,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],wc.push(2*(5*n+e)),Tc.push((r+1)*(r+2)/2%64);let o=gl;for(let s=0;s<7;s++)t=(t<<oo^(t>>yl)*xl)%ml,t&hl&&(o^=oo<<(oo<<BigInt(s))-oo);vc.push(o)}var[Al,bl]=Es(vc,!0),Ac=(r,t,e)=>e>32?Cs(r,t,e):Ss(r,t,e),bc=(r,t,e)=>e>32?Is(r,t,e):Us(r,t,e);function wl(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let c=0;c<10;c++)e[c]=r[c]^r[c+10]^r[c+20]^r[c+30]^r[c+40];for(let c=0;c<10;c+=2){let u=(c+8)%10,p=(c+2)%10,h=e[p],y=e[p+1],x=Ac(h,y,1)^e[u],_=bc(h,y,1)^e[u+1];for(let T=0;T<50;T+=10)r[c+T]^=x,r[c+T+1]^=_}let o=r[2],s=r[3];for(let c=0;c<24;c++){let u=Tc[c],p=Ac(o,s,u),h=bc(o,s,u),y=wc[c];o=r[y],s=r[y+1],r[y]=p,r[y+1]=h}for(let c=0;c<50;c+=10){for(let u=0;u<10;u++)e[u]=r[c+u];for(let u=0;u<10;u++)r[c+u]^=~e[(u+2)%10]&e[(u+4)%10]}r[0]^=Al[n],r[1]^=bl[n]}e.fill(0)}var ti=class r extends Tr{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,rr(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=dc(this.state)}keccak(){wl(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){nr(this);let{blockLen:e,state:n}=this;t=kt(t);let o=t.length;for(let s=0;s<o;){let c=Math.min(e-this.pos,o-s);for(let u=0;u<c;u++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,e&128&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){nr(this,!1),zt(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let c=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+c),o),this.posOut+=c,o+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return rr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Jo(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:c}=this;return t||(t=new r(e,n,o,c,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=c,t.destroyed=this.destroyed,t}},_r=(r,t,e)=>vr(()=>new ti(t,r,e)),Vh=_r(6,144,224/8),$r=_r(6,136,256/8),Qh=_r(6,104,384/8),jh=_r(6,72,512/8),Wh=_r(1,144,224/8),Yh=_r(1,136,256/8),Xh=_r(1,104,384/8),Zh=_r(1,72,512/8),_c=(r,t,e)=>pc((n={})=>new ti(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Jh=_c(31,168,128/8),ey=_c(31,136,256/8);var uo=rc(Sc());var io=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===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 t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<er;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),!(n&128))break;e+=7}if(t>er)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var Er=class r extends Z{constructor(e){super();this.value=me.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new r(o)}};var so=class r extends Z{constructor(e){super();this.value=new Er(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=Er.deserialize(e,n);return new r(o.value)}};var Ge=class r extends Z{constructor(e){super();Xo(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new r(e.deserializeBool())}},it=class r extends Z{constructor(e){super();tr(e,0,jo),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new r(e.deserializeU8())}},_t=class r extends Z{constructor(e){super();tr(e,0,Wo),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new r(e.deserializeU16())}},Et=class r extends Z{constructor(e){super();tr(e,0,er),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new r(e.deserializeU32())}},Le=class r extends Z{constructor(e){super();tr(e,BigInt(0),Kr),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new r(e.deserializeU64())}},St=class r extends Z{constructor(e){super();tr(e,BigInt(0),no),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new r(e.deserializeU128())}},Ut=class r extends Z{constructor(e){super();tr(e,BigInt(0),Yo),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new r(e.deserializeU256())}};var Be=class r extends Z{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof it)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=me.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new r(n.map(o=>new it(o)))}static U16(e){return new r(e.map(n=>new _t(n)))}static U32(e){return new r(e.map(n=>new Et(n)))}static U64(e){return new r(e.map(n=>new Le(n)))}static U128(e){return new r(e.map(n=>new St(n)))}static U256(e){return new r(e.map(n=>new Ut(n)))}static Bool(e){return new r(e.map(n=>new Ge(n)))}static MoveString(e){return new r(e.map(n=>new Fe(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1)s.push(n.deserialize(e));return new r(s)}},Fe=class r extends Z{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){let n=this.bcsToBytes().slice(1);Be.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new r(e.deserializeStr())}},Nt=class r extends Z{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new Be([e]):this.vec=new Be([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}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 r(e!=null?new it(e):void 0)}static U16(e){return new r(e!=null?new _t(e):void 0)}static U32(e){return new r(e!=null?new Et(e):void 0)}static U64(e){return new r(e!=null?new Le(e):void 0)}static U128(e){return new r(e!=null?new St(e):void 0)}static U256(e){return new r(e!=null?new Ut(e):void 0)}static Bool(e){return new r(e!=null?new Ge(e):void 0)}static MoveString(e){return new r(e!=null?new Fe(e):void 0)}static deserialize(e,n){let o=Be.deserialize(e,n);return new r(o.values[0])}};var At=class extends Z{},Vr=class extends Z{},Mt=class extends Z{};var ni=class extends Tr{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Zo(t);let n=kt(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=t.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),s.fill(0)}update(t){return nr(this),this.iHash.update(t),this}digestInto(t){nr(this),zt(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:c,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=c,t.outputLen=u,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},jt=(r,t,e)=>new ni(r,t).update(e).digest();jt.create=(r,t)=>new ni(r,t);function Tl(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),c=Number(e>>o&s),u=Number(e&s),p=n?4:0,h=n?0:4;r.setUint32(t+p,c,n),r.setUint32(t+h,u,n)}var Sr=class extends Tr{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Qt(this.buffer)}update(t){nr(this);let{view:e,buffer:n,blockLen:o}=this;t=kt(t);let s=t.length;for(let c=0;c<s;){let u=Math.min(o-this.pos,s-c);if(u===o){let p=Qt(t);for(;o<=s-c;c+=o)this.process(p,c);continue}n.set(t.subarray(c,c+u),this.pos),this.pos+=u,c+=u,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){nr(this),Jo(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:c}=this;e[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(n,0),c=0);for(let x=c;x<o;x++)e[x]=0;Tl(n,o-8,BigInt(this.length*8),s),this.process(n,0);let u=Qt(t),p=this.outputLen;if(p%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=p/4,y=this.get();if(h>y.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<h;x++)u.setUint32(4*x,y[x],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:c,pos:u}=this;return t.length=o,t.pos=u,t.finished=s,t.destroyed=c,o%e&&t.buffer.set(n),t}};var[vl,_l]=(()=>pe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),Ur=new Uint32Array(80),Cr=new Uint32Array(80),Bs=class extends Sr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:c,Dh:u,Dl:p,Eh:h,El:y,Fh:x,Fl:_,Gh:T,Gl:N,Hh:E,Hl:R}=this;return[t,e,n,o,s,c,u,p,h,y,x,_,T,N,E,R]}set(t,e,n,o,s,c,u,p,h,y,x,_,T,N,E,R){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=c|0,this.Dh=u|0,this.Dl=p|0,this.Eh=h|0,this.El=y|0,this.Fh=x|0,this.Fl=_|0,this.Gh=T|0,this.Gl=N|0,this.Hh=E|0,this.Hl=R|0}process(t,e){for(let z=0;z<16;z++,e+=4)Ur[z]=t.getUint32(e),Cr[z]=t.getUint32(e+=4);for(let z=16;z<80;z++){let ee=Ur[z-15]|0,L=Cr[z-15]|0,j=pe.rotrSH(ee,L,1)^pe.rotrSH(ee,L,8)^pe.shrSH(ee,L,7),J=pe.rotrSL(ee,L,1)^pe.rotrSL(ee,L,8)^pe.shrSL(ee,L,7),X=Ur[z-2]|0,Re=Cr[z-2]|0,xe=pe.rotrSH(X,Re,19)^pe.rotrBH(X,Re,61)^pe.shrSH(X,Re,6),ye=pe.rotrSL(X,Re,19)^pe.rotrBL(X,Re,61)^pe.shrSL(X,Re,6),Ve=pe.add4L(J,ye,Cr[z-7],Cr[z-16]),Qe=pe.add4H(Ve,j,xe,Ur[z-7],Ur[z-16]);Ur[z]=Qe|0,Cr[z]=Ve|0}let{Ah:n,Al:o,Bh:s,Bl:c,Ch:u,Cl:p,Dh:h,Dl:y,Eh:x,El:_,Fh:T,Fl:N,Gh:E,Gl:R,Hh:P,Hl:Q}=this;for(let z=0;z<80;z++){let ee=pe.rotrSH(x,_,14)^pe.rotrSH(x,_,18)^pe.rotrBH(x,_,41),L=pe.rotrSL(x,_,14)^pe.rotrSL(x,_,18)^pe.rotrBL(x,_,41),j=x&T^~x&E,J=_&N^~_&R,X=pe.add5L(Q,L,J,_l[z],Cr[z]),Re=pe.add5H(X,P,ee,j,vl[z],Ur[z]),xe=X|0,ye=pe.rotrSH(n,o,28)^pe.rotrBH(n,o,34)^pe.rotrBH(n,o,39),Ve=pe.rotrSL(n,o,28)^pe.rotrBL(n,o,34)^pe.rotrBL(n,o,39),Qe=n&s^n&u^s&u,dt=o&c^o&p^c&p;P=E|0,Q=R|0,E=T|0,R=N|0,T=x|0,N=_|0,{h:x,l:_}=pe.add(h|0,y|0,Re|0,xe|0),h=u|0,y=p|0,u=s|0,p=c|0,s=n|0,c=o|0;let O=pe.add3L(xe,Ve,dt);n=pe.add3H(O,Re,ye,Qe),o=O|0}({h:n,l:o}=pe.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:c}=pe.add(this.Bh|0,this.Bl|0,s|0,c|0),{h:u,l:p}=pe.add(this.Ch|0,this.Cl|0,u|0,p|0),{h,l:y}=pe.add(this.Dh|0,this.Dl|0,h|0,y|0),{h:x,l:_}=pe.add(this.Eh|0,this.El|0,x|0,_|0),{h:T,l:N}=pe.add(this.Fh|0,this.Fl|0,T|0,N|0),{h:E,l:R}=pe.add(this.Gh|0,this.Gl|0,E|0,R|0),{h:P,l:Q}=pe.add(this.Hh|0,this.Hl|0,P|0,Q|0),this.set(n,o,s,c,u,p,h,y,x,_,T,N,E,R,P,Q)}roundClean(){Ur.fill(0),Cr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Qr=vr(()=>new Bs);function El(r,t,e,n){Zo(r);let o=lc({dkLen:32,asyncTick:10},n),{c:s,dkLen:c,asyncTick:u}=o;if(rr(s),rr(c),rr(u),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let p=kt(t),h=kt(e),y=new Uint8Array(c),x=jt.create(r,p),_=x._cloneInto().update(h);return{c:s,dkLen:c,asyncTick:u,DK:y,PRF:x,PRFSalt:_}}function Sl(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function Uc(r,t,e,n){let{c:o,dkLen:s,DK:c,PRF:u,PRFSalt:p}=El(r,t,e,n),h,y=new Uint8Array(4),x=Qt(y),_=new Uint8Array(u.outputLen);for(let T=1,N=0;N<s;T++,N+=u.outputLen){let E=c.subarray(N,N+u.outputLen);x.setInt32(0,T,!1),(h=p._cloneInto(h)).update(y).digestInto(_),E.set(_.subarray(0,E.length));for(let R=1;R<o;R++){u._cloneInto(h).update(_).digestInto(_);for(let P=0;P<E.length;P++)E[P]^=_[P]}}return Sl(u,p,c,h,_)}var Ul=(r,t,e)=>r&t^~r&e,Cl=(r,t,e)=>r&t^r&e^t&e,Il=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ir=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Br=new Uint32Array(64),Rs=class extends Sr{constructor(){super(64,32,8,!1),this.A=Ir[0]|0,this.B=Ir[1]|0,this.C=Ir[2]|0,this.D=Ir[3]|0,this.E=Ir[4]|0,this.F=Ir[5]|0,this.G=Ir[6]|0,this.H=Ir[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:c,G:u,H:p}=this;return[t,e,n,o,s,c,u,p]}set(t,e,n,o,s,c,u,p){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=u|0,this.H=p|0}process(t,e){for(let x=0;x<16;x++,e+=4)Br[x]=t.getUint32(e,!1);for(let x=16;x<64;x++){let _=Br[x-15],T=Br[x-2],N=Pt(_,7)^Pt(_,18)^_>>>3,E=Pt(T,17)^Pt(T,19)^T>>>10;Br[x]=E+Br[x-7]+N+Br[x-16]|0}let{A:n,B:o,C:s,D:c,E:u,F:p,G:h,H:y}=this;for(let x=0;x<64;x++){let _=Pt(u,6)^Pt(u,11)^Pt(u,25),T=y+_+Ul(u,p,h)+Il[x]+Br[x]|0,E=(Pt(n,2)^Pt(n,13)^Pt(n,22))+Cl(n,o,s)|0;y=h,h=p,p=u,u=c+T|0,c=s,s=o,o=n,n=T+E|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,u=u+this.E|0,p=p+this.F|0,h=h+this.G|0,y=y+this.H|0,this.set(n,o,s,c,u,p,h,y)}roundClean(){Br.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var ao=vr(()=>new Rs);function oi(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}function Ic(...r){let t=(o,s)=>c=>o(s(c)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function Bl(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function Rl(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function Cc(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(c=>{if(c<0||c>=t)throw new Error(`Wrong integer: ${c}`)});;){let c=0,u=!0;for(let p=n;p<s.length;p++){let h=s[p],y=t*c+h;if(!Number.isSafeInteger(y)||t*c/t!==c||y-h!==t*c)throw new Error("convertRadix: carry overflow");c=y%e;let x=Math.floor(y/e);if(s[p]=x,!Number.isSafeInteger(x)||x*e+c!==y)throw new Error("convertRadix: carry overflow");if(u)x?u=!1:n=p;else continue}if(o.push(c),u)break}for(let c=0;c<r.length-1&&r[c]===0;c++)o.push(0);return o.reverse()}function Pl(r){return{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Cc(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Cc(t,r,2**8))}}}function kl(r,t){if(typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let c=0;c<r;c++)if(o[c]!==s[c])throw new Error("Invalid checksum");return n}}}var Ol=r=>Ic(Pl(58),Bl(r),Rl("")),zl=Ol("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Bc=r=>Ic(kl(4,t=>r(r(t))),zl);function Rc(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function Nl(r){let t=Rc(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}var Ml=r=>Rc(`mnemonic${r}`);function Pc(r,t=""){return Uc(Qr,Nl(r).nfkd,Ml(t),{c:2048,dkLen:64})}var kc=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,Oc=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,zc=(t=>(t.ED25519="ed25519 seed",t))(zc||{}),Ps=2147483648;function ks(r){return Oc.test(r)}function Os(r){return kc.test(r)}var ii=(r,t)=>{let e=jt.create(Qr,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},zs=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),c=new Uint8Array([...s,...r,...o]);return ii(t,c)},ql=r=>r.replace("'",""),Ns=r=>r.split("/").slice(1).map(ql),co=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return Pc(t)};var jr=class jr extends At{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==jr.LENGTH)throw new Error(`PublicKey length should be ${jr.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=me.fromHexInput(n).toUint8Array(),c=o.toUint8Array();return uo.default.sign.detached.verify(s,c,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new jr(n)}static load(e){let n=e.deserializeBytes();return new jr(n)}};jr.LENGTH=32;var Pe=jr,pt=class pt extends Vr{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==pt.LENGTH)throw new Error(`PrivateKey length should be ${pt.LENGTH}`);this.signingKeyPair=uo.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,pt.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,pt.LENGTH)}toString(){return me.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=me.fromHexInput(e),o=uo.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new Ke(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new pt(n)}static generate(){let e=uo.default.sign.keyPair();return new pt(e.secretKey.slice(0,pt.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new Pe(e)}static fromDerivationPath(e,n){if(!Os(e))throw new Error(`Invalid derivation path ${e}`);return pt.fromDerivationPathInner(e,co(n))}static fromDerivationPathInner(e,n,o=Ps){let{key:s,chainCode:c}=ii(pt.SLIP_0010_SEED,n),u=Ns(e).map(h=>parseInt(h,10)),{key:p}=u.reduce((h,y)=>zs(h,y+o),{key:s,chainCode:c});return new pt(p)}};pt.LENGTH=32,pt.SLIP_0010_SEED="ed25519 seed";var or=pt,Wr=class Wr extends Mt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==Wr.LENGTH)throw new Error(`Signature length should be ${Wr.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Wr(n)}static load(e){let n=e.deserializeBytes();return new Wr(n)}};Wr.LENGTH=64;var Ke=Wr;var Ct=class Ct extends At{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>Ct.MAX_KEYS||n.length<Ct.MIN_KEYS)throw new Error(`Must have between ${Ct.MIN_KEYS} and ${Ct.MAX_KEYS} public keys, inclusive`);if(o<Ct.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${Ct.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*Pe.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*Pe.LENGTH)}),e[this.publicKeys.length*Pe.LENGTH]=this.threshold,e}toString(){return me.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let c=0;c<n.length-1;c+=Pe.LENGTH){let u=c;s.push(new Pe(n.subarray(u,u+Pe.LENGTH)))}return new Ct({publicKeys:s,threshold:o})}};Ct.MAX_KEYS=32,Ct.MIN_KEYS=2,Ct.MIN_THRESHOLD=1;var Dt=Ct,It=class It extends Mt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==It.BITMAP_LEN)throw new Error(`"bitmap" length should be ${It.BITMAP_LEN}`);if(n.length>It.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${It.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*Ke.LENGTH+It.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*Ke.LENGTH)}),e.set(this.bitmap,this.signatures.length*Ke.LENGTH),e}toString(){return me.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),c=new Set;return n.forEach(u=>{if(u>=It.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${It.MAX_SIGNATURES_SUPPORTED-1}.`);if(c.has(u))throw new Error("Duplicate bits detected.");c.add(u);let p=Math.floor(u/8),h=s[p];h|=o>>u%8,s[p]=h}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let c=0;c<n.length-o.length;c+=Ke.LENGTH){let u=c;s.push(new Ke(n.subarray(u,u+Ke.LENGTH)))}return new It({signatures:s,bitmap:o})}};It.MAX_SIGNATURES_SUPPORTED=32,It.BITMAP_LEN=4;var Yr=It;var Gs={};ec(Gs,{bitGet:()=>Vl,bitLen:()=>$l,bitMask:()=>fo,bitSet:()=>Ql,bytesToHex:()=>Xr,bytesToNumberBE:()=>ir,bytesToNumberLE:()=>ci,concatBytes:()=>Rn,createHmacDrbg:()=>qs,ensureBytes:()=>bt,equalBytes:()=>Kl,hexToBytes:()=>Zr,hexToNumber:()=>Ds,numberToBytesBE:()=>Rr,numberToBytesLE:()=>ui,numberToHexUnpadded:()=>Dc,numberToVarBytesBE:()=>Fl,utf8ToBytes:()=>Hl,validateObject:()=>Pr});var Mc=BigInt(0),si=BigInt(1),Gl=BigInt(2),ai=r=>r instanceof Uint8Array,Ll=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Xr(r){if(!ai(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Ll[r[e]];return t}function Dc(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function Ds(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function Zr(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),c=Number.parseInt(s,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");e[n]=c}return e}function ir(r){return Ds(Xr(r))}function ci(r){if(!ai(r))throw new Error("Uint8Array expected");return Ds(Xr(Uint8Array.from(r).reverse()))}function Rr(r,t){return Zr(r.toString(16).padStart(t*2,"0"))}function ui(r,t){return Rr(r,t).reverse()}function Fl(r){return Zr(Dc(r))}function bt(r,t,e){let n;if(typeof t=="string")try{n=Zr(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(ai(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function Rn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!ai(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function Kl(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function Hl(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function $l(r){let t;for(t=0;r>Mc;r>>=si,t+=1);return t}function Vl(r,t){return r>>BigInt(t)&si}var Ql=(r,t,e)=>r|(e?si:Mc)<<BigInt(t),fo=r=>(Gl<<BigInt(r-1))-si,Ms=r=>new Uint8Array(r),Nc=r=>Uint8Array.from(r);function qs(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Ms(r),o=Ms(r),s=0,c=()=>{n.fill(1),o.fill(0),s=0},u=(...x)=>e(o,n,...x),p=(x=Ms())=>{o=u(Nc([0]),x),n=u(),x.length!==0&&(o=u(Nc([1]),x),n=u())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let x=0,_=[];for(;x<t;){n=u();let T=n.slice();_.push(T),x+=n.length}return Rn(..._)};return(x,_)=>{c(),p(x);let T;for(;!(T=_(h()));)p();return c(),T}}var jl={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Pr(r,t,e={}){let n=(o,s,c)=>{let u=jl[s];if(typeof u!="function")throw new Error(`Invalid validator "${s}", expected function`);let p=r[o];if(!(c&&p===void 0)&&!u(p,r))throw new Error(`Invalid param ${String(o)}=${p} (${typeof p}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var et=BigInt(0),He=BigInt(1),Jr=BigInt(2),Wl=BigInt(3),Ls=BigInt(4),qc=BigInt(5),Gc=BigInt(8),Yl=BigInt(9),Xl=BigInt(16);function tt(r,t){let e=r%t;return e>=et?e:t+e}function Zl(r,t,e){if(e<=et||t<et)throw new Error("Expected power/modulo > 0");if(e===He)return et;let n=He;for(;t>et;)t&He&&(n=n*r%e),r=r*r%e,t>>=He;return n}function wt(r,t,e){let n=r;for(;t-- >et;)n*=n,n%=e;return n}function fi(r,t){if(r===et||t<=et)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=tt(r,t),n=t,o=et,s=He,c=He,u=et;for(;e!==et;){let h=n/e,y=n%e,x=o-c*h,_=s-u*h;n=e,e=y,o=c,s=u,c=x,u=_}if(n!==He)throw new Error("invert: does not exist");return tt(o,t)}function Jl(r){let t=(r-He)/Jr,e,n,o;for(e=r-He,n=0;e%Jr===et;e/=Jr,n++);for(o=Jr;o<r&&Zl(o,t,r)!==r-He;o++);if(n===1){let c=(r+He)/Ls;return function(p,h){let y=p.pow(h,c);if(!p.eql(p.sqr(y),h))throw new Error("Cannot find square root");return y}}let s=(e+He)/Jr;return function(u,p){if(u.pow(p,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let h=n,y=u.pow(u.mul(u.ONE,o),e),x=u.pow(p,s),_=u.pow(p,e);for(;!u.eql(_,u.ONE);){if(u.eql(_,u.ZERO))return u.ZERO;let T=1;for(let E=u.sqr(_);T<h&&!u.eql(E,u.ONE);T++)E=u.sqr(E);let N=u.pow(y,He<<BigInt(h-T-1));y=u.sqr(N),x=u.mul(x,N),_=u.mul(_,y),h=T}return x}}function ep(r){if(r%Ls===Wl){let t=(r+He)/Ls;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%Gc===qc){let t=(r-qc)/Gc;return function(n,o){let s=n.mul(o,Jr),c=n.pow(s,t),u=n.mul(o,c),p=n.mul(n.mul(u,Jr),c),h=n.mul(u,n.sub(p,n.ONE));if(!n.eql(n.sqr(h),o))throw new Error("Cannot find square root");return h}}return r%Xl,Jl(r)}var tp=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Fs(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=tp.reduce((n,o)=>(n[o]="function",n),t);return Pr(r,e)}function rp(r,t,e){if(e<et)throw new Error("Expected power > 0");if(e===et)return r.ONE;if(e===He)return t;let n=r.ONE,o=t;for(;e>et;)e&He&&(n=r.mul(n,o)),o=r.sqr(o),e>>=He;return n}function np(r,t){let e=new Array(t.length),n=t.reduce((s,c,u)=>r.is0(c)?s:(e[u]=s,r.mul(s,c)),r.ONE),o=r.inv(n);return t.reduceRight((s,c,u)=>r.is0(c)?s:(e[u]=r.mul(s,e[u]),r.mul(s,c)),o),e}function Ks(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function Lc(r,t,e=!1,n={}){if(r<=et)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Ks(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let c=ep(r),u=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:fo(o),ZERO:et,ONE:He,create:p=>tt(p,r),isValid:p=>{if(typeof p!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof p}`);return et<=p&&p<r},is0:p=>p===et,isOdd:p=>(p&He)===He,neg:p=>tt(-p,r),eql:(p,h)=>p===h,sqr:p=>tt(p*p,r),add:(p,h)=>tt(p+h,r),sub:(p,h)=>tt(p-h,r),mul:(p,h)=>tt(p*h,r),pow:(p,h)=>rp(u,p,h),div:(p,h)=>tt(p*fi(h,r),r),sqrN:p=>p*p,addN:(p,h)=>p+h,subN:(p,h)=>p-h,mulN:(p,h)=>p*h,inv:p=>fi(p,r),sqrt:n.sqrt||(p=>c(u,p)),invertBatch:p=>np(u,p),cmov:(p,h,y)=>y?h:p,toBytes:p=>e?ui(p,s):Rr(p,s),fromBytes:p=>{if(p.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${p.length}`);return e?ci(p):ir(p)}});return Object.freeze(u)}function Fc(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Hs(r){let t=Fc(r);return t+Math.ceil(t/2)}function Kc(r,t,e=!1){let n=r.length,o=Fc(t),s=Hs(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let c=e?ir(r):ci(r),u=tt(c,t-He)+He;return e?ui(u,o):Rr(u,o)}var ip=BigInt(0),$s=BigInt(1);function Hc(r,t){let e=(o,s)=>{let c=s.negate();return o?c:s},n=o=>{let s=Math.ceil(t/o)+1,c=2**(o-1);return{windows:s,windowSize:c}};return{constTimeNegate:e,unsafeLadder(o,s){let c=r.ZERO,u=o;for(;s>ip;)s&$s&&(c=c.add(u)),u=u.double(),s>>=$s;return c},precomputeWindow(o,s){let{windows:c,windowSize:u}=n(s),p=[],h=o,y=h;for(let x=0;x<c;x++){y=h,p.push(y);for(let _=1;_<u;_++)y=y.add(h),p.push(y);h=y.double()}return p},wNAF(o,s,c){let{windows:u,windowSize:p}=n(o),h=r.ZERO,y=r.BASE,x=BigInt(2**o-1),_=2**o,T=BigInt(o);for(let N=0;N<u;N++){let E=N*p,R=Number(c&x);c>>=T,R>p&&(R-=_,c+=$s);let P=E,Q=E+Math.abs(R)-1,z=N%2!==0,ee=R<0;R===0?y=y.add(e(z,s[P])):h=h.add(e(ee,s[Q]))}return{p:h,f:y}},wNAFCached(o,s,c,u){let p=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,p),p!==1&&s.set(o,u(h))),this.wNAF(p,h,c)}}}function Vs(r){return Fs(r.Fp),Pr(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ks(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function sp(r){let t=Vs(r);Pr(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:ap,hexToBytes:cp}=Gs,en={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=en;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:ap(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=en,e=typeof r=="string"?cp(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=en._parseInt(e.subarray(2)),{d:c,l:u}=en._parseInt(s);if(u.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:c}},hexFromSig(r){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,e=h=>{let y=h.toString(16);return y.length&1?`0${y}`:y},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,c=o.length/2,u=e(s),p=e(c);return`30${e(c+s+4)}02${p}${o}02${u}${n}`}},sr=BigInt(0),Bt=BigInt(1),Im=BigInt(2),$c=BigInt(3),Bm=BigInt(4);function up(r){let t=sp(r),{Fp:e}=t,n=t.toBytes||((N,E,R)=>{let P=E.toAffine();return Rn(Uint8Array.from([4]),e.toBytes(P.x),e.toBytes(P.y))}),o=t.fromBytes||(N=>{let E=N.subarray(1),R=e.fromBytes(E.subarray(0,e.BYTES)),P=e.fromBytes(E.subarray(e.BYTES,2*e.BYTES));return{x:R,y:P}});function s(N){let{a:E,b:R}=t,P=e.sqr(N),Q=e.mul(P,N);return e.add(e.add(Q,e.mul(N,E)),R)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function c(N){return typeof N=="bigint"&&sr<N&&N<t.n}function u(N){if(!c(N))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function p(N){let{allowedPrivateKeyLengths:E,nByteLength:R,wrapPrivateKey:P,n:Q}=t;if(E&&typeof N!="bigint"){if(N instanceof Uint8Array&&(N=Xr(N)),typeof N!="string"||!E.includes(N.length))throw new Error("Invalid key");N=N.padStart(R*2,"0")}let z;try{z=typeof N=="bigint"?N:ir(bt("private key",N,R))}catch{throw new Error(`private key must be ${R} bytes, hex or bigint, not ${typeof N}`)}return P&&(z=tt(z,Q)),u(z),z}let h=new Map;function y(N){if(!(N instanceof x))throw new Error("ProjectivePoint expected")}class x{constructor(E,R,P){if(this.px=E,this.py=R,this.pz=P,E==null||!e.isValid(E))throw new Error("x required");if(R==null||!e.isValid(R))throw new Error("y required");if(P==null||!e.isValid(P))throw new Error("z required")}static fromAffine(E){let{x:R,y:P}=E||{};if(!E||!e.isValid(R)||!e.isValid(P))throw new Error("invalid affine point");if(E instanceof x)throw new Error("projective point not allowed");let Q=z=>e.eql(z,e.ZERO);return Q(R)&&Q(P)?x.ZERO:new x(R,P,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){let R=e.invertBatch(E.map(P=>P.pz));return E.map((P,Q)=>P.toAffine(R[Q])).map(x.fromAffine)}static fromHex(E){let R=x.fromAffine(o(bt("pointHex",E)));return R.assertValidity(),R}static fromPrivateKey(E){return x.BASE.multiply(p(E))}_setWindowSize(E){this._WINDOW_SIZE=E,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:E,y:R}=this.toAffine();if(!e.isValid(E)||!e.isValid(R))throw new Error("bad point: x or y not FE");let P=e.sqr(R),Q=s(E);if(!e.eql(P,Q))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:E}=this.toAffine();if(e.isOdd)return!e.isOdd(E);throw new Error("Field doesn't support isOdd")}equals(E){y(E);let{px:R,py:P,pz:Q}=this,{px:z,py:ee,pz:L}=E,j=e.eql(e.mul(R,L),e.mul(z,Q)),J=e.eql(e.mul(P,L),e.mul(ee,Q));return j&&J}negate(){return new x(this.px,e.neg(this.py),this.pz)}double(){let{a:E,b:R}=t,P=e.mul(R,$c),{px:Q,py:z,pz:ee}=this,L=e.ZERO,j=e.ZERO,J=e.ZERO,X=e.mul(Q,Q),Re=e.mul(z,z),xe=e.mul(ee,ee),ye=e.mul(Q,z);return ye=e.add(ye,ye),J=e.mul(Q,ee),J=e.add(J,J),L=e.mul(E,J),j=e.mul(P,xe),j=e.add(L,j),L=e.sub(Re,j),j=e.add(Re,j),j=e.mul(L,j),L=e.mul(ye,L),J=e.mul(P,J),xe=e.mul(E,xe),ye=e.sub(X,xe),ye=e.mul(E,ye),ye=e.add(ye,J),J=e.add(X,X),X=e.add(J,X),X=e.add(X,xe),X=e.mul(X,ye),j=e.add(j,X),xe=e.mul(z,ee),xe=e.add(xe,xe),X=e.mul(xe,ye),L=e.sub(L,X),J=e.mul(xe,Re),J=e.add(J,J),J=e.add(J,J),new x(L,j,J)}add(E){y(E);let{px:R,py:P,pz:Q}=this,{px:z,py:ee,pz:L}=E,j=e.ZERO,J=e.ZERO,X=e.ZERO,Re=t.a,xe=e.mul(t.b,$c),ye=e.mul(R,z),Ve=e.mul(P,ee),Qe=e.mul(Q,L),dt=e.add(R,P),O=e.add(z,ee);dt=e.mul(dt,O),O=e.add(ye,Ve),dt=e.sub(dt,O),O=e.add(R,Q);let K=e.add(z,L);return O=e.mul(O,K),K=e.add(ye,Qe),O=e.sub(O,K),K=e.add(P,Q),j=e.add(ee,L),K=e.mul(K,j),j=e.add(Ve,Qe),K=e.sub(K,j),X=e.mul(Re,O),j=e.mul(xe,Qe),X=e.add(j,X),j=e.sub(Ve,X),X=e.add(Ve,X),J=e.mul(j,X),Ve=e.add(ye,ye),Ve=e.add(Ve,ye),Qe=e.mul(Re,Qe),O=e.mul(xe,O),Ve=e.add(Ve,Qe),Qe=e.sub(ye,Qe),Qe=e.mul(Re,Qe),O=e.add(O,Qe),ye=e.mul(Ve,O),J=e.add(J,ye),ye=e.mul(K,O),j=e.mul(dt,j),j=e.sub(j,ye),ye=e.mul(dt,Ve),X=e.mul(K,X),X=e.add(X,ye),new x(j,J,X)}subtract(E){return this.add(E.negate())}is0(){return this.equals(x.ZERO)}wNAF(E){return T.wNAFCached(this,h,E,R=>{let P=e.invertBatch(R.map(Q=>Q.pz));return R.map((Q,z)=>Q.toAffine(P[z])).map(x.fromAffine)})}multiplyUnsafe(E){let R=x.ZERO;if(E===sr)return R;if(u(E),E===Bt)return this;let{endo:P}=t;if(!P)return T.unsafeLadder(this,E);let{k1neg:Q,k1:z,k2neg:ee,k2:L}=P.splitScalar(E),j=R,J=R,X=this;for(;z>sr||L>sr;)z&Bt&&(j=j.add(X)),L&Bt&&(J=J.add(X)),X=X.double(),z>>=Bt,L>>=Bt;return Q&&(j=j.negate()),ee&&(J=J.negate()),J=new x(e.mul(J.px,P.beta),J.py,J.pz),j.add(J)}multiply(E){u(E);let R=E,P,Q,{endo:z}=t;if(z){let{k1neg:ee,k1:L,k2neg:j,k2:J}=z.splitScalar(R),{p:X,f:Re}=this.wNAF(L),{p:xe,f:ye}=this.wNAF(J);X=T.constTimeNegate(ee,X),xe=T.constTimeNegate(j,xe),xe=new x(e.mul(xe.px,z.beta),xe.py,xe.pz),P=X.add(xe),Q=Re.add(ye)}else{let{p:ee,f:L}=this.wNAF(R);P=ee,Q=L}return x.normalizeZ([P,Q])[0]}multiplyAndAddUnsafe(E,R,P){let Q=x.BASE,z=(L,j)=>j===sr||j===Bt||!L.equals(Q)?L.multiplyUnsafe(j):L.multiply(j),ee=z(this,R).add(z(E,P));return ee.is0()?void 0:ee}toAffine(E){let{px:R,py:P,pz:Q}=this,z=this.is0();E==null&&(E=z?e.ONE:e.inv(Q));let ee=e.mul(R,E),L=e.mul(P,E),j=e.mul(Q,E);if(z)return{x:e.ZERO,y:e.ZERO};if(!e.eql(j,e.ONE))throw new Error("invZ was invalid");return{x:ee,y:L}}isTorsionFree(){let{h:E,isTorsionFree:R}=t;if(E===Bt)return!0;if(R)return R(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:E,clearCofactor:R}=t;return E===Bt?this:R?R(x,this):this.multiplyUnsafe(t.h)}toRawBytes(E=!0){return this.assertValidity(),n(x,this,E)}toHex(E=!0){return Xr(this.toRawBytes(E))}}x.BASE=new x(t.Gx,t.Gy,e.ONE),x.ZERO=new x(e.ZERO,e.ONE,e.ZERO);let _=t.nBitLength,T=Hc(x,t.endo?Math.ceil(_/2):_);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:c}}function fp(r){let t=Vs(r);return Pr(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Vc(r){let t=fp(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function c(O){return sr<O&&O<e.ORDER}function u(O){return tt(O,n)}function p(O){return fi(O,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:y,weierstrassEquation:x,isWithinCurveOrder:_}=up({...t,toBytes(O,K,se){let Ee=K.toAffine(),Se=e.toBytes(Ee.x),je=Rn;return se?je(Uint8Array.from([K.hasEvenY()?2:3]),Se):je(Uint8Array.from([4]),Se,e.toBytes(Ee.y))},fromBytes(O){let K=O.length,se=O[0],Ee=O.subarray(1);if(K===o&&(se===2||se===3)){let Se=ir(Ee);if(!c(Se))throw new Error("Point is not on curve");let je=x(Se),ot=e.sqrt(je),ke=(ot&Bt)===Bt;return(se&1)===1!==ke&&(ot=e.neg(ot)),{x:Se,y:ot}}else if(K===s&&se===4){let Se=e.fromBytes(Ee.subarray(0,e.BYTES)),je=e.fromBytes(Ee.subarray(e.BYTES,2*e.BYTES));return{x:Se,y:je}}else throw new Error(`Point of length ${K} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),T=O=>Xr(Rr(O,t.nByteLength));function N(O){let K=n>>Bt;return O>K}function E(O){return N(O)?u(-O):O}let R=(O,K,se)=>ir(O.slice(K,se));class P{constructor(K,se,Ee){this.r=K,this.s=se,this.recovery=Ee,this.assertValidity()}static fromCompact(K){let se=t.nByteLength;return K=bt("compactSignature",K,se*2),new P(R(K,0,se),R(K,se,2*se))}static fromDER(K){let{r:se,s:Ee}=en.toSig(bt("DER",K));return new P(se,Ee)}assertValidity(){if(!_(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!_(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(K){return new P(this.r,this.s,K)}recoverPublicKey(K){let{r:se,s:Ee,recovery:Se}=this,je=J(bt("msgHash",K));if(Se==null||![0,1,2,3].includes(Se))throw new Error("recovery id invalid");let ot=Se===2||Se===3?se+t.n:se;if(ot>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let ke=Se&1?"03":"02",Xe=h.fromHex(ke+T(ot)),ae=p(ot),Ze=u(-je*ae),xr=u(Ee*ae),Rt=h.BASE.multiplyAndAddUnsafe(Xe,Ze,xr);if(!Rt)throw new Error("point at infinify");return Rt.assertValidity(),Rt}hasHighS(){return N(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return Zr(this.toDERHex())}toDERHex(){return en.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Zr(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}let Q={isValidPrivateKey(O){try{return y(O),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let O=Hs(t.n);return Kc(t.randomBytes(O),t.n)},precompute(O=8,K=h.BASE){return K._setWindowSize(O),K.multiply(BigInt(3)),K}};function z(O,K=!0){return h.fromPrivateKey(O).toRawBytes(K)}function ee(O){let K=O instanceof Uint8Array,se=typeof O=="string",Ee=(K||se)&&O.length;return K?Ee===o||Ee===s:se?Ee===2*o||Ee===2*s:O instanceof h}function L(O,K,se=!0){if(ee(O))throw new Error("first arg must be private key");if(!ee(K))throw new Error("second arg must be public key");return h.fromHex(K).multiply(y(O)).toRawBytes(se)}let j=t.bits2int||function(O){let K=ir(O),se=O.length*8-t.nBitLength;return se>0?K>>BigInt(se):K},J=t.bits2int_modN||function(O){return u(j(O))},X=fo(t.nBitLength);function Re(O){if(typeof O!="bigint")throw new Error("bigint expected");if(!(sr<=O&&O<X))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Rr(O,t.nByteLength)}function xe(O,K,se=ye){if(["recovered","canonical"].some(vt=>vt in se))throw new Error("sign() legacy options not supported");let{hash:Ee,randomBytes:Se}=t,{lowS:je,prehash:ot,extraEntropy:ke}=se;je==null&&(je=!0),O=bt("msgHash",O),ot&&(O=bt("prehashed msgHash",Ee(O)));let Xe=J(O),ae=y(K),Ze=[Re(ae),Re(Xe)];if(ke!=null){let vt=ke===!0?Se(e.BYTES):ke;Ze.push(bt("extraEntropy",vt))}let xr=Rn(...Ze),Rt=Xe;function Ar(vt){let Zt=j(vt);if(!_(Zt))return;let Nr=p(Zt),mt=h.BASE.multiply(Zt).toAffine(),br=u(mt.x);if(br===sr)return;let En=u(Nr*u(Rt+br*ae));if(En===sr)return;let No=(mt.x===br?0:2)|Number(mt.y&Bt),Qn=En;return je&&N(En)&&(Qn=E(En),No^=1),new P(br,Qn,No)}return{seed:xr,k2sig:Ar}}let ye={lowS:t.lowS,prehash:!1},Ve={lowS:t.lowS,prehash:!1};function Qe(O,K,se=ye){let{seed:Ee,k2sig:Se}=xe(O,K,se),je=t;return qs(je.hash.outputLen,je.nByteLength,je.hmac)(Ee,Se)}h.BASE._setWindowSize(8);function dt(O,K,se,Ee=Ve){let Se=O;if(K=bt("msgHash",K),se=bt("publicKey",se),"strict"in Ee)throw new Error("options.strict was renamed to lowS");let{lowS:je,prehash:ot}=Ee,ke,Xe;try{if(typeof Se=="string"||Se instanceof Uint8Array)try{ke=P.fromDER(Se)}catch(mt){if(!(mt instanceof en.Err))throw mt;ke=P.fromCompact(Se)}else if(typeof Se=="object"&&typeof Se.r=="bigint"&&typeof Se.s=="bigint"){let{r:mt,s:br}=Se;ke=new P(mt,br)}else throw new Error("PARSE");Xe=h.fromHex(se)}catch(mt){if(mt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(je&&ke.hasHighS())return!1;ot&&(K=t.hash(K));let{r:ae,s:Ze}=ke,xr=J(K),Rt=p(Ze),Ar=u(xr*Rt),vt=u(ae*Rt),Zt=h.BASE.multiplyAndAddUnsafe(Xe,Ar,vt)?.toAffine();return Zt?u(Zt.x)===ae:!1}return{CURVE:t,getPublicKey:z,getSharedSecret:L,sign:Qe,verify:dt,ProjectivePoint:h,Signature:P,utils:Q}}function dp(r){return{hash:r,hmac:(t,...e)=>jt(r,t,Fr(...e)),randomBytes:gc}}function Qc(r,t){let e=n=>Vc({...r,...dp(n)});return Object.freeze({...e(t),create:e})}var Yc=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),jc=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),lp=BigInt(1),Qs=BigInt(2),Wc=(r,t)=>(r+t/Qs)/t;function pp(r){let t=Yc,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),c=BigInt(23),u=BigInt(44),p=BigInt(88),h=r*r*r%t,y=h*h*r%t,x=wt(y,e,t)*y%t,_=wt(x,e,t)*y%t,T=wt(_,Qs,t)*h%t,N=wt(T,o,t)*T%t,E=wt(N,s,t)*N%t,R=wt(E,u,t)*E%t,P=wt(R,p,t)*R%t,Q=wt(P,u,t)*E%t,z=wt(Q,e,t)*y%t,ee=wt(z,c,t)*N%t,L=wt(ee,n,t)*h%t,j=wt(L,Qs,t);if(!js.eql(js.sqr(j),r))throw new Error("Cannot find square root");return j}var js=Lc(Yc,void 0,void 0,{sqrt:pp}),ut=Qc({a:BigInt(0),b:BigInt(7),Fp:js,n:jc,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=jc,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-lp*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,c=BigInt("0x100000000000000000000000000000000"),u=Wc(s*r,t),p=Wc(-n*r,t),h=tt(r-u*e-p*o,t),y=tt(-u*n-p*s,t),x=h>c,_=y>c;if(x&&(h=t-h),_&&(y=t-y),h>c||y>c)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:x,k1:h,k2neg:_,k2:y}}}},ao),qm=BigInt(0);var Gm=ut.ProjectivePoint;var gp=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Zc=Uint8Array.from({length:16},(r,t)=>t),hp=Zc.map(r=>(9*r+5)%16),Ys=[Zc],Xs=[hp];for(let r=0;r<4;r++)for(let t of[Ys,Xs])t.push(t[r].map(e=>gp[e]));var Jc=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),yp=Ys.map((r,t)=>r.map(e=>Jc[t][e])),mp=Xs.map((r,t)=>r.map(e=>Jc[t][e])),xp=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ap=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),di=(r,t)=>r<<t|r>>>32-t;function Xc(r,t,e,n){return r===0?t^e^n:r===1?t&e|~t&n:r===2?(t|~e)^n:r===3?t&n|e&~n:t^(e|~n)}var li=new Uint32Array(16),Ws=class extends Sr{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:n,h3:o,h4:s}=this;return[t,e,n,o,s]}set(t,e,n,o,s){this.h0=t|0,this.h1=e|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,e){for(let T=0;T<16;T++,e+=4)li[T]=t.getUint32(e,!0);let n=this.h0|0,o=n,s=this.h1|0,c=s,u=this.h2|0,p=u,h=this.h3|0,y=h,x=this.h4|0,_=x;for(let T=0;T<5;T++){let N=4-T,E=xp[T],R=Ap[T],P=Ys[T],Q=Xs[T],z=yp[T],ee=mp[T];for(let L=0;L<16;L++){let j=di(n+Xc(T,s,u,h)+li[P[L]]+E,z[L])+x|0;n=x,x=h,h=di(u,10)|0,u=s,s=j}for(let L=0;L<16;L++){let j=di(o+Xc(N,c,p,y)+li[Q[L]]+R,ee[L])+_|0;o=_,_=y,y=di(p,10)|0,p=c,c=j}}this.set(this.h1+u+y|0,this.h2+h+_|0,this.h3+x+o|0,this.h4+n+c|0,this.h0+s+p|0)}roundClean(){li.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},eu=vr(()=>new Ws);var pi=ut.ProjectivePoint,Zs=Bc(ao);function tu(r){return BigInt(`0x${Lr(r)}`)}function bp(r){return Bn(r.toString(16).padStart(64,"0"))}var wp=vs("Bitcoin seed"),Js={private:76066276,public:76067358},ea=2147483648,Tp=r=>eu(ao(r)),vp=r=>Qt(r).getUint32(0,!1),gi=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);let t=new Uint8Array(4);return Qt(t).setUint32(0,r,!1),t},hi=class r{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return vp(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw new Error("No private key");return Zs.encode(this.serialize(this.versions.private,Fr(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return Zs.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=Js){if(zt(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let n=jt(Qr,wp,t);return new r({versions:e,chainCode:n.slice(32),privateKey:n.slice(0,32)})}static fromExtendedKey(t,e=Js){let n=Zs.decode(t),o=Qt(n),s=o.getUint32(0,!1),c={versions:e,depth:n[4],parentFingerprint:o.getUint32(5,!1),index:o.getUint32(9,!1),chainCode:n.slice(13,45)},u=n.slice(45),p=u[0]===0;if(s!==e[p?"private":"public"])throw new Error("Version mismatch");return p?new r({...c,privateKey:u.slice(1)}):new r({...c,publicKey:u})}static fromJSON(t){return r.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||Js,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!ut.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:tu(t.privateKey),this.privKeyBytes=bp(this.privKey),this.pubKey=ut.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=pi.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=Tp(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),n=this;for(let o of e){let s=/^(\d+)('?)$/.exec(o),c=s&&s[1];if(!s||s.length!==3||typeof c!="string")throw new Error(`Invalid child index: ${o}`);let u=+c;if(!Number.isSafeInteger(u)||u>=ea)throw new Error("Invalid index");s[2]==="'"&&(u+=ea),n=n.deriveChild(u)}return n}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let e=gi(t);if(t>=ea){let u=this.privateKey;if(!u)throw new Error("Could not derive hardened child key");e=Fr(new Uint8Array([0]),u,e)}else e=Fr(this.pubKey,e);let n=jt(Qr,this.chainCode,e),o=tu(n.slice(0,32)),s=n.slice(32);if(!ut.utils.isValidPrivateKey(o))throw new Error("Tweak bigger than curve order");let c={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let u=tt(this.privKey+o,ut.CURVE.n);if(!ut.utils.isValidPrivateKey(u))throw new Error("The tweak was out of range or the resulted private key is invalid");c.privateKey=u}else{let u=pi.fromHex(this.pubKey).add(pi.fromPrivateKey(o));if(u.equals(pi.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");c.publicKey=u.toRawBytes(!0)}return new r(c)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return zt(t,32),ut.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){if(zt(t,32),zt(e,64),!this.publicKey)throw new Error("No publicKey set!");let n;try{n=ut.Signature.fromCompact(e)}catch{return!1}return ut.verify(n,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw new Error("No chainCode set");return zt(e,33),Fr(gi(t),new Uint8Array([this.depth]),gi(this.parentFingerprint),gi(this.index),this.chainCode,e)}};var tn=class tn extends At{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==tn.LENGTH)throw new Error(`PublicKey length should be ${tn.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=me.fromHexInput(n).toUint8Array(),c=$r(s),u=o.toUint8Array();return ut.verify(u,c,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new tn(n)}static load(e){let n=e.deserializeBytes();return new tn(n)}};tn.LENGTH=65;var qt=tn,ar=class ar extends Vr{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==ar.LENGTH)throw new Error(`PrivateKey length should be ${ar.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=me.fromHexInput(e),o=$r(n.toUint8Array()),s=ut.sign(o,this.key.toUint8Array());return new ur(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new ar(n)}static generate(){let e=ut.utils.randomPrivateKey();return new ar(e)}publicKey(){let e=ut.getPublicKey(this.key.toUint8Array(),!1);return new qt(e)}static fromDerivationPath(e,n){if(!ks(e))throw new Error(`Invalid derivation path ${e}`);return ar.fromDerivationPathInner(e,co(n))}static fromDerivationPathInner(e,n){let{privateKey:o}=hi.fromMasterSeed(n).derive(e);if(o===null)throw new Error("Invalid key");return new ar(o)}};ar.LENGTH=32;var cr=ar,rn=class rn extends Mt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==rn.LENGTH)throw new Error(`Signature length should be ${rn.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new rn(n)}static load(e){let n=e.deserializeBytes();return new rn(n)}};rn.LENGTH=64;var ur=rn;var Ye=class r extends At{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof Pe)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof qt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new r(Pe.load(e));case 1:return new r(qt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var nn=class r extends At{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(c=>{c instanceof Ye?s.push(c):s.push(new Ye(c))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),c=new Set;return n.forEach((u,p)=>{if(p+1>this.publicKeys.length)throw new Error(`Signature index ${p+1} is out of public keys range, ${this.publicKeys.length}.`);if(c.has(u))throw new Error(`Duplicate bit ${u} detected.`);c.add(u);let h=Math.floor(u/8),y=s[h];y|=o>>u%8,s[h]=y}),s}toString(){return me.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(Ye),o=e.deserializeU8();return new r({publicKeys:n,signaturesRequired:o})}};var fr=class fr extends Z{constructor(e){super();let{data:n}=e,o=me.fromHexInput(n);if(o.toUint8Array().length!==fr.LENGTH)throw new Error(`Authentication Key length should be ${fr.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(fr.LENGTH);return new fr({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let p=n.bcsToBytes();s=new Uint8Array([...p,o]);break}case 0:case 1:{let p=n.toUint8Array(),h=me.fromHexInput(p).toUint8Array();s=new Uint8Array([...h,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let c=$r.create();c.update(s);let u=c.digest();return new fr({data:u})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof Pe)o=0 .valueOf();else if(n instanceof Dt)o=1 .valueOf();else if(n instanceof Ye)o=2 .valueOf();else if(n instanceof nn)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return fr.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new k(this.data.toUint8Array())}};fr.LENGTH=32;var Gt=fr;var dr=class r{constructor(t){let{privateKey:e,address:n,legacy:o}=t,s=o??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof Pe)s?this.signingScheme=0:(this.publicKey=new Ye(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof Dt)this.signingScheme=1;else if(this.publicKey instanceof qt)this.publicKey=new Ye(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e=t?.legacy??!0,n,o;switch(t?.scheme){case 2:n=cr.generate(),o=new Ye(n.publicKey());break;default:n=or.generate(),e===!1?o=new Ye(n.publicKey()):o=n.publicKey()}let c=Gt.fromPublicKey({publicKey:o}).derivedAddress();return new r({privateKey:n,address:c,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:n}=t,o=n??!0,s;if(e instanceof cr)s=new Ye(e.publicKey());else if(e instanceof or)o?s=e.publicKey():s=new Ye(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let u=Gt.fromPublicKey({publicKey:s}).derivedAddress();return new r({privateKey:e,address:u,legacy:o})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new r({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n,scheme:o,legacy:s}=t,c;switch(o){case 2:c=cr.fromDerivationPath(e,n);break;case 0:c=or.fromDerivationPath(e,n);break;default:throw new Error(`Unsupported scheme ${o}`)}return r.fromPrivateKey({privateKey:c,legacy:s})}static authKey(t){let{publicKey:e}=t;return Gt.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=me.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var _p=`
|
|
3
3
|
fragment TokenActivitiesFields on token_activities_v2 {
|
|
4
4
|
after_value
|
|
5
5
|
before_value
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
transaction_version
|
|
18
18
|
type
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,yi=`
|
|
21
21
|
fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
|
|
22
22
|
token_standard
|
|
23
23
|
token_properties_mutated_v1
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,ru=`
|
|
67
67
|
query getAccountCoinsCount($address: String) {
|
|
68
68
|
current_fungible_asset_balances_aggregate(
|
|
69
69
|
where: {owner_address: {_eq: $address}}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
`,
|
|
76
|
+
`,nu=`
|
|
77
77
|
query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
|
|
78
78
|
current_fungible_asset_balances(
|
|
79
79
|
where: $where_condition
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,ou=`
|
|
110
110
|
query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
|
|
111
111
|
current_collection_ownership_v2_view(
|
|
112
112
|
where: $where_condition
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
single_token_uri
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
`,
|
|
143
|
+
`,iu=`
|
|
144
144
|
query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
|
|
145
145
|
current_objects(
|
|
146
146
|
where: $where_condition
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
is_deleted
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
`,
|
|
160
|
+
`,su=`
|
|
161
161
|
query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
162
162
|
current_token_ownerships_v2(
|
|
163
163
|
where: $where_condition
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
...CurrentTokenOwnershipFields
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
${
|
|
171
|
+
${yi}`,L0=`
|
|
172
172
|
query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
173
173
|
current_token_ownerships_v2(
|
|
174
174
|
where: $where_condition
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
...CurrentTokenOwnershipFields
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
${
|
|
182
|
+
${yi}`,au=`
|
|
183
183
|
query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
184
184
|
current_token_ownerships_v2(
|
|
185
185
|
where: $where_condition
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
...CurrentTokenOwnershipFields
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
${
|
|
193
|
+
${yi}`,cu=`
|
|
194
194
|
query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
|
|
195
195
|
current_token_ownerships_v2_aggregate(
|
|
196
196
|
where: $where_condition
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
`,
|
|
205
|
+
`,uu=`
|
|
206
206
|
query getAccountTransactionsCount($address: String) {
|
|
207
207
|
account_transactions_aggregate(where: {account_address: {_eq: $address}}) {
|
|
208
208
|
aggregate {
|
|
@@ -210,13 +210,13 @@
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
`,
|
|
213
|
+
`,fu=`
|
|
214
214
|
query getChainTopUserTransactions($limit: Int) {
|
|
215
215
|
user_transactions(limit: $limit, order_by: {version: desc}) {
|
|
216
216
|
version
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
`,
|
|
219
|
+
`,du=`
|
|
220
220
|
query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
|
|
221
221
|
current_collections_v2(where: $where_condition) {
|
|
222
222
|
collection_id
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
uri
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
`,
|
|
238
|
+
`,lu=`
|
|
239
239
|
query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
|
|
240
240
|
current_fungible_asset_balances(
|
|
241
241
|
where: $where_condition
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
token_standard
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
`,
|
|
256
|
+
`,pu=`
|
|
257
257
|
query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
|
|
258
258
|
delegated_staking_activities(
|
|
259
259
|
where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
transaction_version
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
`,
|
|
269
|
+
`,gu=`
|
|
270
270
|
query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
|
|
271
271
|
events(
|
|
272
272
|
where: $where_condition
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
indexed_type
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
`,
|
|
288
|
+
`,hu=`
|
|
289
289
|
query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
|
|
290
290
|
fungible_asset_activities(
|
|
291
291
|
where: $where_condition
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
type
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
`,
|
|
313
|
+
`,yu=`
|
|
314
314
|
query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
|
|
315
315
|
fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
|
|
316
316
|
icon_uri
|
|
@@ -327,14 +327,14 @@
|
|
|
327
327
|
token_standard
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
`,
|
|
330
|
+
`,ta=`
|
|
331
331
|
query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {
|
|
332
332
|
num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
|
|
333
333
|
num_active_delegator
|
|
334
334
|
pool_address
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
`,
|
|
337
|
+
`,mu=`
|
|
338
338
|
query getProcessorStatus {
|
|
339
339
|
processor_status {
|
|
340
340
|
last_success_version
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
last_updated
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,xu=`
|
|
346
346
|
query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
|
|
347
347
|
token_activities_v2(
|
|
348
348
|
where: $where_condition
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
...TokenActivitiesFields
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
|
-
${
|
|
356
|
+
${_p}`,ra=`
|
|
357
357
|
query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
|
|
358
358
|
current_token_ownerships_v2(
|
|
359
359
|
where: $where_condition
|
|
@@ -364,7 +364,7 @@
|
|
|
364
364
|
...CurrentTokenOwnershipFields
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
${
|
|
367
|
+
${yi}`,Au=`
|
|
368
368
|
query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
|
|
369
369
|
current_token_datas_v2(
|
|
370
370
|
where: $where_condition
|
|
@@ -403,10 +403,34 @@
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
`;async function pi(r){let{aptosConfig:t}=r,{data:e}=await bt({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function Ud(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function Bd(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function hi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await zn({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o?.ledgerVersion},body:n})).data}async function gi(r){let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await zn({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n?.ledgerVersion},body:{function:e.function,type_arguments:e.typeArguments??[],arguments:e.functionArguments??[]}});return o}async function Cd(r){let{aptosConfig:t,limit:e}=r;return(await Ne({aptosConfig:t,query:{query:md,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function Ne(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await da({aptosConfig:t,originMethod:n??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function py(r){let{aptosConfig:t}=r;return(await Ne({aptosConfig:t,query:{query:vd},originMethod:"getProcessorStatuses"})).processor_status}async function yi(r){return(await py({aptosConfig:r.aptosConfig}))[0].last_success_version}var dc=new Map;function bo(r,t,e){return async(...n)=>{if(dc.has(t)){let{value:s,timestamp:a}=dc.get(t);if(e===void 0||Date.now()-a<=e)return s}let o=await r(...n);return dc.set(t,{value:o,timestamp:Date.now()}),o}}async function Wn(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getInfo",path:`accounts/${O.from(e).toString()}`});return n}async function Pd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getModules",path:`accounts/${O.from(e).toString()}/modules`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??1e3}})}async function mi(r){return r.options?.ledgerVersion!==void 0?Id(r):bo(async()=>Id(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function Id(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getModule",path:`accounts/${O.from(e).toString()}/module/${n}`,params:{ledger_version:o?.ledgerVersion}});return s}async function kd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${O.from(e).toString()}/transactions`,params:{start:n?.offset,limit:n?.limit}})}async function Od(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getResources",path:`accounts/${O.from(e).toString()}/resources`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??999}})}async function lc(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getResource",path:`accounts/${O.from(e).toString()}/resource/${n}`,params:{ledger_version:o?.ledgerVersion}});return s.data}async function pc(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await lc({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o,a=O.from(e);try{let c=await hi({aptosConfig:t,handle:s,data:{key:a.toString(),key_type:"address",value_type:"address"},options:n});return O.from(c)}catch(c){if(c instanceof cr&&c.data.error_code==="table_item_not_found")return a;throw c}}async function zd(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}},a=await Ne({aptosConfig:t,query:{query:gd,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!a.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return a.current_token_ownerships_v2_aggregate.aggregate.count}async function Nd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.token_standard={_eq:n?.tokenStandard});let a={query:pd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Dd(r){let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=O.from(e).toStringLong(),a=O.from(n).toStringLong(),c={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};o?.tokenStandard&&(c.token_standard={_eq:o?.tokenStandard});let f={query:hd,variables:{where_condition:c,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await Ne({aptosConfig:t,query:f,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Md(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.current_collection={token_standard:{_eq:n?.tokenStandard}});let a={query:dd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function qd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:yd,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function Ld(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:fd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Hd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:ud,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function Gd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:ld,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function Fd(r){let{aptosConfig:t,privateKey:e}=r,n=new Fe(e.publicKey());if(e instanceof mr){let s=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2}).derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof Zt){let o=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await Rd({authKey:o,aptosConfig:t})){let f=o.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!1})}let a=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await Rd({authKey:a,aptosConfig:t})){let f=a.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function Rd(r){let{aptosConfig:t,authKey:e}=r,n=await pc({aptosConfig:t,authenticationKey:e.derivedAddress()});try{return await Wn({aptosConfig:t,accountAddress:n}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var Zo=class{constructor(t){this.config=t}async getAccountInfo(t){return Wn({aptosConfig:this.config,...t})}async getAccountModules(t){return Pd({aptosConfig:this.config,...t})}async getAccountModule(t){return mi({aptosConfig:this.config,...t})}async getAccountTransactions(t){return kd({aptosConfig:this.config,...t})}async getAccountResources(t){return Od({aptosConfig:this.config,...t})}async getAccountResource(t){return lc({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return pc({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return zd({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Nd({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return Dd({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Md({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return qd({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return Ld({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Hd({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return Gd({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return Fd({aptosConfig:this.config,...t})}};var sp=Zi(op(),1);async function ip(r){var t;let{params:e,method:n,url:o,headers:s,body:a,overrides:c}=r,f={headers:s,method:n,url:o,params:e,data:a,withCredentials:(t=c?.WITH_CREDENTIALS)!=null?t:!0};try{let h=await(0,sp.default)(f);return{status:h.status,statusText:h.statusText,data:h.data,headers:h.headers,config:h.config}}catch(h){let g=h;if(g.response)return g.response;throw h}}var ts=class{constructor(t){this.network=t?.network??bu,this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:ip},this.clientConfig=t?.clientConfig??{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ca[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return ua[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return Ss[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return Ss[this.network]===t}};var rs=class extends te{constructor(e){super();this.accountAddress=O.ONE;this.moduleName=new Ge("account");this.structName=new Ge("RotationProofChallenge");this.sequenceNumber=new He(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=ve.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};var $t=class extends Qt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof je)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof xr)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new $t(je.load(e));case 1:return new $t(xr.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Nc(r){return new Promise(t=>{setTimeout(t,r)})}async function ap(r){let{aptosConfig:t,options:e}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e?.offset,limit:e?.limit}})}async function Si(r){let{aptosConfig:t}=r;return bo(async()=>{let{data:e}=await bt({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function cp(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function Ui(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await bt({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function up(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await Ui({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if(n?.status===404)return!0;throw n}}async function Bi(r){let{aptosConfig:t,transactionHash:e,options:n}=r,o=n?.timeoutSecs??Bs,s=n?.checkSuccess??!0,a=n?.indexerVersionCheck??!0,c=!0,f=0,h,g,y=200,w=1.5;for(;c&&!(f>=o);){try{if(h=await Ui({aptosConfig:t,transactionHash:e}),c=h.type==="pending_transaction",!c)break}catch(b){if(!(b instanceof cr)||(g=b,b.status!==404&&b.status>=400&&b.status<500))throw b}await Nc(y),f+=y/1e3,y*=w}if(h===void 0)throw g||new ns(`Fetching transaction ${e} failed and timed out after ${o} seconds`,h);if(h.type==="pending_transaction")throw new ns(`Transaction ${e} timed out in pending state after ${o} seconds`,h);if(!s)return h;if(!h.success)throw new Dc(`Transaction ${e} failed with an error: ${h.vm_status}`,h);if(a)try{await ym({aptosConfig:t,ledgerVersion:Number(h.version)})}catch{throw new ns(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${h.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,h)}return h}async function ym(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await yi({aptosConfig:t}),s>=e)break;await Nc(200)}}var ns=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Dc=class extends Error{constructor(e,n){super(e);this.transaction=n}};var Bt=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return rr.load(t);case 1:return Eo.load(t);case 2:return Kt.load(t);case 3:return _n.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},rr=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new rr(n,o)}},Eo=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new Eo(n,o)}},Kt=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Fe.deserialize(e),o=$t.deserialize(e);return new Kt(n,o)}},_n=class extends Bt{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=Pr.deserialize(e),o=e.deserializeVector($t),s=e.deserializeBytes();return new _n(n,o,s)}};var br=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Or.load(t);case 1:return So.load(t);case 2:return zr.load(t);case 3:return Nr.load(t);case 4:return Dr.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},Or=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new Or(n,o)}},So=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new So(n,o)}},zr=class extends br{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt);return new zr(n,o,s)}},Nr=class extends br{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt),a=O.deserialize(e),c=Bt.deserialize(e),f={address:a,authenticator:c};return new Nr(n,o,s,f)}},Dr=class extends br{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=Bt.deserialize(e);return new Dr(n)}};var Mr=class extends te{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new Mr(n)}};var qe=class extends te{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new qe(n)}};var qr=class extends te{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new qr(O.fromStringRelaxed(n[0]),new qe(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e);return new qr(n,o)}};var Xe=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Lr.load(t);case 1:return Hr.load(t);case 2:return $r.load(t);case 3:return Kr.load(t);case 4:return Vr.load(t);case 5:return Ar.load(t);case 6:return Qr.load(t);case 7:return nr.load(t);case 8:return Gr.load(t);case 9:return Fr.load(t);case 10:return jr.load(t);case 255:return Wr.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof Lr}isAddress(){return this instanceof Vr}isGeneric(){return this instanceof Wr}isSigner(){return this instanceof Ar}isVector(){return this instanceof Qr}isStruct(){return this instanceof nr}isU8(){return this instanceof Hr}isU16(){return this instanceof Gr}isU32(){return this instanceof Fr}isU64(){return this instanceof $r}isU128(){return this instanceof Kr}isU256(){return this instanceof jr}},Lr=class extends Xe{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new Lr}},Hr=class extends Xe{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new Hr}},Gr=class extends Xe{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new Gr}},Fr=class extends Xe{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new Fr}},$r=class extends Xe{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new $r}},Kr=class extends Xe{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new Kr}},jr=class extends Xe{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new jr}},Vr=class extends Xe{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new Vr}},Ar=class extends Xe{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new Ar}},Xn=class extends Xe{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=Xe.deserialize(e);return new Xn(n)}},Wr=class extends Xe{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new Wr(n)}},Qr=class extends Xe{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=Xe.deserialize(e);return new Qr(n)}},nr=class extends Xe{constructor(e){super();this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=jt.deserialize(e);return new nr(n)}isTypeTag(e,n,o){return this.value.moduleName.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(O.ONE,"string","String")}isOption(){return this.isTypeTag(O.ONE,"option","Option")}isObject(){return this.isTypeTag(O.ONE,"object","Object")}},jt=class extends te{constructor(e,n,o,s){super();this.address=e,this.moduleName=n,this.name=o,this.typeArgs=s}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e),s=qe.deserialize(e),a=e.deserializeVector(Xe);return new jt(n,o,s,a)}};function mm(){return new jt(O.ONE,new qe("aptos_coin"),new qe("AptosCoin"),[])}function xm(){return new jt(O.ONE,new qe("string"),new qe("String"),[])}function bm(r){return new jt(O.ONE,new qe("option"),new qe("Option"),[r])}function Am(r){return new jt(O.ONE,new qe("object"),new qe("Object"),[r])}function fp(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return st.deserialize(r);case 1:return He.deserialize(r);case 2:return Tt.deserialize(r);case 3:return O.deserialize(r);case 4:return ve.deserialize(r,st);case 5:return Le.deserialize(r);case 6:return At.deserialize(r);case 7:return wt.deserialize(r);case 8:return _t.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var vn=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return En.load(t);case 2:return Sn.load(t);case 3:return Un.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},En=class extends vn{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=Bn.deserialize(e);return new En(n)}},Sn=class extends vn{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=wr.deserialize(e);return new Sn(n)}},Un=class extends vn{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=Cn.deserialize(e);return new Un(n)}},wr=class{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new wr(qr.fromStr(t),new qe(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=qr.deserialize(t),n=qe.deserialize(t),o=t.deserializeVector(Xe),s=t.deserializeUleb128AsU32(),a=new Array;for(let c=0;c<s;c+=1){let f=t.deserializeUleb128AsU32(),h=qn.deserialize(t,f);a.push(h)}return new wr(e,n,o,a)}},Bn=class{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector(Xe),o=t.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1){let c=fp(t);s.push(c)}return new Bn(e,n,s)}},Cn=class{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=O.deserialize(t),n=t.deserializeBool(),o;return n&&(o=In.deserialize(t)),new Cn(e,o)}},In=class{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new In(wr.deserialize(t))}};var Nt=class extends te{constructor(e,n,o,s,a,c,f){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=a,this.expiration_timestamp_secs=c,this.chain_id=f}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=e.deserializeU64(),s=vn.deserialize(e),a=e.deserializeU64(),c=e.deserializeU64(),f=e.deserializeU64(),h=Mr.deserialize(e);return new Nt(n,o,s,a,c,f,h)}},os=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return or.load(t);case 1:return sr.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},or=class extends os{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O);return new or(n,o)}},sr=class extends os{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O),s=O.deserialize(e);return new sr(n,o,s)}};var Dt=class extends te{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=Nt.deserialize(e),o=br.deserialize(e);return new Dt(n,o)}};function dp(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function lp(r){return!!r.match(/\s/)}function wm(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!lp(n))break}return e}var pp=(y=>(y.InvalidTypeTag="unknown type",y.UnexpectedTypeArgumentClose="unexpected '>'",y.UnexpectedWhitespaceCharacter="unexpected whitespace character",y.UnexpectedComma="unexpected ','",y.TypeArgumentCountMismatch="type argument count doesn't match expected amount",y.MissingTypeArgumentClose="no matching '>' for '<'",y.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",y.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",y.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",y.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",y.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",y))(pp||{}),$e=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Uo(r,t){let e=t?.allowGenerics??!1,n=[],o=[],s=[],a=0,c="",f=1;for(;a<r.length;){let h=r[a];if(h==="<")n.push({savedExpectedTypes:f,savedStr:c,savedTypes:s}),c="",s=[],f=1;else if(h===">"){if(c!==""){let I=Ci(c,o,e);s.push(I)}let g=n.pop();if(g===void 0)throw new $e(r,"unexpected '>'");if(f!==s.length)throw new $e(r,"type argument count doesn't match expected amount");let{savedStr:y,savedTypes:w,savedExpectedTypes:b}=g;o=s,s=w,c=y,f=b}else if(h===","){if(c.length!==0){let g=Ci(c,o,e);o=[],s.push(g),c="",f+=1}}else if(lp(h)){let g=!1;if(c.length!==0){let w=Ci(c,o,e);o=[],s.push(w),c="",g=!0}a=wm(r,a);let y=r[a];if(a<r.length&&g&&y!==","&&y!==">")throw new $e(r,"unexpected whitespace character");continue}else c+=h;a+=1}if(n.length>0)throw new $e(r,"no matching '>' for '<'");switch(s.length){case 0:return Ci(c,o,e);case 1:if(c==="")return s[0];throw new $e(r,"unexpected ','");default:throw new $e(r,"unexpected whitespace character")}}function Ci(r,t,e){switch(r){case"&signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Xn(new Ar);case"signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Ar;case"bool":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Lr;case"address":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Vr;case"u8":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Hr;case"u16":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Gr;case"u32":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Fr;case"u64":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new $r;case"u128":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Kr;case"u256":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new jr;case"vector":if(t.length!==1)throw new $e(r,"vector type expected to have exactly one type argument");return new Qr(t[0]);default:if(e&&r.match(/^T[0-9]+$/))return new Wr(Number(r.split("T")[1]));if(!r.match(/.*:.*/))throw new $e(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new $e(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!dp(n[1]))throw new $e(r,"module name must only contain alphanumeric or '_' characters");if(!dp(n[2]))throw new $e(r,"struct name must only contain alphanumeric or '_' characters");return new nr(new jt(O.fromStringRelaxed(n[0]),new qe(n[1]),new qe(n[2]),t))}}function Mc(r){return typeof r=="boolean"}function Zn(r){return typeof r=="string"}function ss(r){return typeof r=="number"}function is(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function qc(r){return r==null}function Ii(r){return r instanceof Le}function as(r){return r instanceof O}function Ri(r){return r instanceof Ge}function Lc(r){return r instanceof ur}function Pi(r){return r instanceof st}function ki(r){return r instanceof At}function Oi(r){return r instanceof wt}function zi(r){return r instanceof He}function Ni(r){return r instanceof Tt}function Di(r){return r instanceof _t}function Mi(r){return"bytecode"in r}function Ke(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function Hc(r){let t=r.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?r.params.length:t}function qi(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function Gc(r){return r?.map(t=>Zn(t)?Uo(t):t)??[]}async function Fc(r,t,e,n){let s=(await mi({aptosConfig:n,accountAddress:r,moduleName:t})).abi?.exposed_functions.find(f=>f.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let a=Hc(s),c=[];for(let f=a;f<s.params.length;f+=1)c.push(Uo(s.params[f],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:c}}function $c(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return Ii(e)||Pi(e)||ki(e)||Oi(e)||zi(e)||Ni(e)||Di(e)||as(e)||Ri(e)||Lc(e)||e instanceof ve||e instanceof tt?(Tm(t,e,n),e):Li(e,t.parameters[n],n,o)}function Li(r,t,e,n){if(t.isBool()){if(Mc(r))return new Le(r);Ke("boolean",e)}if(t.isAddress()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isU8()){if(ss(r))return new st(r);Ke("number",e)}if(t.isU16()){if(ss(r))return new At(r);Ke("number",e)}if(t.isU32()){if(ss(r))return new wt(r);Ke("number",e)}if(t.isU64()){if(is(r))return new He(BigInt(r));Ke("bigint | number | string",e)}if(t.isU128()){if(is(r))return new Tt(BigInt(r));Ke("bigint | number | string",e)}if(t.isU256()){if(is(r))return new _t(BigInt(r));Ke("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);Li(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&Zn(r))return ve.U8(be.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new ve(r.map(o=>Li(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(Zn(r))return new Ge(r);Ke("string",e)}if(t.isObject()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isOption())return qc(r)?new tt(null):new tt(Li(r,t.value.typeArgs[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function Tm(r,t,e){let n=r.parameters[e];if(n.isBool()){if(Ii(t))return;Ke("Bool",e)}if(n.isAddress()){if(as(t))return;Ke("AccountAddress",e)}if(n.isU8()){if(Pi(t))return;Ke("U8",e)}if(n.isU16()){if(ki(t))return;Ke("U16",e)}if(n.isU32()){if(Oi(t))return;Ke("U32",e)}if(n.isU64()){if(zi(t))return;Ke("U64",e)}if(n.isU128()){if(Ni(t))return;Ke("U128",e)}if(n.isU256()){if(Di(t))return;Ke("U256",e)}if(n.isVector()){if(t instanceof ve)return;Ke("MoveVector",e)}if(n instanceof nr){if(n.isString()){if(Ri(t))return;Ke("MoveString",e)}if(n.isObject()){if(as(t))return;Ke("AccountAddress",e)}if(n.isOption()){if(t instanceof tt)return;Ke("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function Kc(r){if(Mi(r))return gp(r);let{moduleAddress:t,moduleName:e,functionName:n}=qi(r.function),o=await bo(async()=>Fc(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return hp(r,o)}function hp(r,t){if(Mi(r))return gp(r);let{moduleAddress:e,moduleName:n,functionName:o}=qi(r.function),s=Gc(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let a=r.functionArguments.map((f,h)=>$c(r.function,t,f,h,s));if(a.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${a.length}`);let c=wr.build(`${e}::${n}`,o,s,a);if("multisigAddress"in r){let f;return typeof r.multisigAddress=="string"?f=O.from(r.multisigAddress):f=r.multisigAddress,new Un(new Cn(f,new In(c)))}return new Sn(c)}function gp(r){return new En(new Bn(be.fromHexInput(r.bytecode).toUint8Array(),r.typeArguments??[],r.functionArguments))}async function yp(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o?.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):Wn({aptosConfig:t,accountAddress:e}),a=Us[t.network]?Promise.resolve({chain_id:Us[t.network]}):pi({aptosConfig:t}),c=o?.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):Si({aptosConfig:t}),[{sequence_number:f},{chain_id:h},{gas_estimate:g}]=await Promise.all([s,a,c]),{maxGasAmount:y,gasUnitPrice:w,expireTimestamp:b}={maxGasAmount:BigInt(Au),gasUnitPrice:BigInt(g),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+wu),...o};return new Nt(O.fromRelaxed(e),BigInt(f),n,BigInt(y),BigInt(w),BigInt(b),new Mr(h))}async function jc(r){let{aptosConfig:t,sender:e,payload:n,options:o,secondarySignerAddresses:s,feePayerAddress:a}=r,c=await yp({aptosConfig:t,sender:e,payload:n,options:o});if(a){let f=s?s.map(h=>O.fromRelaxed(h)):[];return{rawTransaction:c,secondarySignerAddresses:f,feePayerAddress:O.fromRelaxed(a)}}if(s){let f=s.map(h=>O.fromRelaxed(h));return{rawTransaction:c,secondarySignerAddresses:f}}return{rawTransaction:c}}function Vc(r){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=new qo(e.rawTransaction.bcsToBytes()),a=Nt.deserialize(s),c=cs(t);if(e.feePayerAddress){let h=new sr(a,e.secondarySignerAddresses??[],e.feePayerAddress),g=[];n&&(g=n.map(b=>cs(b)));let y=cs(o),w=new Nr(c,e.secondarySignerAddresses??[],g,{address:e.feePayerAddress,authenticator:y});return new Dt(h.raw_txn,w).bcsToBytes()}if(e.secondarySignerAddresses){let h=new or(a,e.secondarySignerAddresses),g=[];g=n.map(w=>cs(w));let y=new zr(c,e.secondarySignerAddresses,g);return new Dt(h.raw_txn,y).bcsToBytes()}let f;if(c instanceof rr)f=new Or(c.public_key,c.signature);else if(c instanceof Kt)f=new Dr(c);else throw new Error("Invalid public key");return new Dt(a,f).bcsToBytes()}function cs(r){if(r instanceof Fe){if(r.publicKey instanceof De)return new Kt(r,new $t(new je(new Uint8Array(64))));if(r.publicKey instanceof Gt)return new Kt(r,new $t(new xr(new Uint8Array(64))))}return new rr(new De(r.toUint8Array()),new je(new Uint8Array(64)))}function Wc(r){let{signer:t,transaction:e}=r,n=Yc(e),o=xp(n),s=t.sign(o);switch(t.signingScheme){case 0:return new rr(new De(t.publicKey.toUint8Array()),new je(s.toUint8Array()));case 2:return new Kt(t.publicKey,new $t(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function Qc(r){let{transaction:t,senderAuthenticator:e,feePayerAuthenticator:n,additionalSignersAuthenticators:o}=r,s=Yc(t);if(n||o)return mp(s,e,n,o);if(e instanceof rr){let a=new Or(e.public_key,e.signature);return new Dt(s,a).bcsToBytes()}if(e instanceof Kt||e instanceof _n){let a=new Dr(e);return new Dt(s,a).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function Yc(r){return r.feePayerAddress?new sr(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):r.secondarySignerAddresses?new or(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function mp(r,t,e,n){if(r instanceof sr){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let o=new Nr(t,r.secondary_signer_addresses,n??[],{address:r.fee_payer_address,authenticator:e});return new Dt(r.raw_txn,o).bcsToBytes()}if(r instanceof or){if(!n)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let o=new zr(t,r.secondary_signer_addresses,n??[]);return new Dt(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function xp(r){let t=Mn.create();if(r instanceof Nt)t.update(_u);else if(r instanceof or)t.update(fa);else if(r instanceof sr)t.update(fa);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function ir(r){let{aptosConfig:t,sender:e,data:n,options:o,secondarySignerAddresses:s,hasFeePayer:a}=r,c;a===!0&&(c=O.ZERO.toString());let f;"bytecode"in n?f=n:"multisigAddress"in n?f={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments}:f={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments};let h=await Kc(f);return jc({aptosConfig:t,sender:e,payload:h,options:o,secondarySignerAddresses:s,feePayerAddress:c})}function Xc(r){return Wc({...r})}async function bp(r){let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}=r,c=Vc({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}),{data:f}=await zn({aptosConfig:t,body:c,path:"transactions/simulate",params:{estimate_gas_unit_price:r.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:r.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:r.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return f}async function Zc(r){let{aptosConfig:t}=r,e=Qc({...r}),{data:n}=await zn({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Jc(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=Xc({signer:e,transaction:n});return Zc({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function Ap(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,a=o.map(f=>ve.U8(f));return await ir({aptosConfig:t,sender:O.fromRelaxed(e),data:{function:"0x1::code::publish_package_txn",functionArguments:[ve.U8(n),new ve(a)]},options:s})}async function wp(r){let{aptosConfig:t,fromAccount:e,toNewPrivateKey:n}=r,o=await Wn({aptosConfig:t,accountAddress:e.accountAddress.toString()}),s=St.fromPrivateKey({privateKey:n,legacy:!0}),c=new rs({sequenceNumber:BigInt(o.sequence_number),originator:e.accountAddress,currentAuthKey:O.from(o.authentication_key),newPublicKey:s.publicKey}).bcsToBytes(),f=e.sign(c),h=s.sign(c),g=await ir({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new st(e.signingScheme.valueOf()),ve.U8(e.publicKey.toUint8Array()),new st(s.signingScheme.valueOf()),ve.U8(s.publicKey.toUint8Array()),ve.U8(f.toUint8Array()),ve.U8(h.toUint8Array())]}});return await Jc({aptosConfig:t,signer:e,transaction:g})}async function Tp(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:a}=r,c=s??Tu;return await ir({aptosConfig:t,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[Uo(c)],functionArguments:[O.from(n),new He(o)]},options:a})}var us=class{constructor(t){this.config=t}async transferCoinTransaction(t){return Tp({aptosConfig:this.config,...t})}};async function _p(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new Ge(r.collection),new Ge(r.description),new Ge(r.name),new Ge(r.uri),ve.MoveString([]),ve.MoveString([]),new ve([])]},options:e})}async function vp(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:Sd,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Ep(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:fc,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function Sp(r){let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:O.from(e).toStringLong()}},s={query:fc,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function Up(r){let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:O.from(e).toStringLong()}},s={query:Ed,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function Bp(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new Ge(r.description),new He(r.maxSupply??Nn),new Ge(r.name),new Ge(r.uri),new Le(r.mutableDescription??!0),new Le(r.mutableRoyalty??!0),new Le(r.mutableURI??!0),new Le(r.mutableTokenDescription??!0),new Le(r.mutableTokenName??!0),new Le(r.mutableTokenProperties??!0),new Le(r.mutableTokenURI??!0),new Le(r.tokensBurnableByCreator??!0),new Le(r.tokensFreezableByCreator??!0),new He(r.royaltyNumerator??0),new He(r.royaltyDenominator??1)]},options:e})}async function eu(r){let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=O.from(e),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return o?.tokenStandard&&(a.token_standard={_eq:o?.tokenStandard??"v2"}),(await Ne({aptosConfig:t,query:{query:xd,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function Cp(r){return(await eu(r)).collection_id}var fs=class{constructor(t){this.config=t}async createCollectionTransaction(t){return Bp({aptosConfig:this.config,...t})}async getCollectionData(t){return eu({aptosConfig:this.config,...t})}async getCollectionId(t){return Cp({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return _p({aptosConfig:this.config,...t})}async getTokenData(t){return vp({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Ep({aptosConfig:this.config,...t})}async getOwnedTokens(t){return Sp({aptosConfig:this.config,...t})}async getTokenActivity(t){return Up({aptosConfig:this.config,...t})}};async function Ip(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:O.from(t).toStringLong()},creation_number:{_eq:n}};return Hi({aptosConfig:e,options:{where:s}})}async function Rp(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,c={where:{account_address:{_eq:O.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:o?.pagination,orderBy:o?.orderBy};return Hi({aptosConfig:e,options:c})}async function Hi(r){let{aptosConfig:t,options:e}=r,n={query:wd,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var ds=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return Ip({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return Rp({aptosConfig:this.config,...t})}async getEvents(t){return Hi({aptosConfig:this.config,...t})}};async function Pp(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=o?.timeoutSecs||Bs,{data:a}=await la({aptosConfig:t,path:"fund",body:{address:O.fromRelaxed(e).toString(),amount:n},originMethod:"fundAccount"}),c=a.txn_hashes[0];return await Bi({aptosConfig:t,transactionHash:c,options:{timeoutSecs:s,checkSuccess:o?.checkSuccess,indexerVersionCheck:o?.indexerVersionCheck}}),c}var ls=class{constructor(t){this.config=t}async fundAccount(t){return Pp({aptosConfig:this.config,...t})}};async function tu(r){let{aptosConfig:t,options:e}=r,n={query:_d,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function kp(r){let{aptosConfig:t,options:e}=r,n={query:Td,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Op(r){let{aptosConfig:t,options:e}=r,n={query:bd,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var ps=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return tu({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await tu({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return kp({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Op({aptosConfig:this.config,...t})}};var hs=class{constructor(t){this.config=t}async getLedgerInfo(){return pi({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return Ud({aptosConfig:this.config,...t})}async getBlockByHeight(t){return Bd({aptosConfig:this.config,...t})}async getTableItem(t){return hi({aptosConfig:this.config,...t})}async view(t){return gi({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return Cd({aptosConfig:this.config,...t})}async queryIndexer(t){return Ne({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return yi({aptosConfig:this.config})}};var zp=["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 Np(r){return!(!r||r.length<3||r.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(r))}function Dp(r){let[t,e,...n]=r.replace(/\.apt$/,"").split(".");if(n.length>0)throw new Error(`${r} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!Np(t))throw new Error(`${t} is not valid. ${zp}`);if(e&&!Np(e))throw new Error(`${e} is not valid. ${zp}`);return{domainName:e||t,subdomainName:e?t:void 0}}var _m="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",vm={["testnet"]:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",["mainnet"]:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",["local"]:_m,["custom"]:null,["devnet"]:null};function Mp(r){let t=vm[r.network];if(!t)throw new Error(`The ANS contract is not deployed to ${r.network}`);return t}var Em=r=>({vec:[r]}),Sm=()=>({vec:[]}),Um=r=>r!=null?Em(r):Sm(),Bm=r=>{if(!!r&&typeof r=="object"&&"vec"in r&&Array.isArray(r.vec))return r.vec[0]};async function qp(r){let{aptosConfig:t,name:e}=r,n=Mp(t),{domainName:o,subdomainName:s}=Dp(e),a=await gi({aptosConfig:t,payload:{function:`${n}::router::get_owner_addr`,functionArguments:[o,Um(s)]}}),c=Bm(a[0]);return c?O.fromRelaxed(c).toString():void 0}async function Lp(r){let{aptosConfig:t,expiration:e,name:n,sender:o,targetAddress:s,toAddress:a,options:c}=r,f=Mp(t),{domainName:h,subdomainName:g}=Dp(n),y=e.policy==="subdomain:independent"||e.policy==="subdomain:follow-domain";if(g&&!y)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(y&&!g)throw new Error(`Policy is set to ${e.policy} but no subdomain was provided`);if(e.policy==="domain"){if(e.years!==1)throw new Error("For now, names can only be registered for 1 year at a time");let w=e.years*31536e3;return await ir({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${f}::router::register_domain`,functionArguments:[new Ge(h),new He(w),new tt(s?O.from(s):null),new tt(a?O.from(a):null)]},options:c})}throw new Error(`Policy ${e.policy} is not supported yet`)}var gs=class{constructor(t){this.config=t}async getOwnerAddress(t){return qp({aptosConfig:this.config,...t})}async registerName(t){return Lp({aptosConfig:this.config,...t})}};async function Hp(r){let{aptosConfig:t,poolAddress:e}=r,n=O.fromRelaxed(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:uc,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function Gp(r){let{aptosConfig:t,options:e}=r,n={query:uc,variables:{where_condition:{},order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function Fp(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:Ad,variables:{delegatorAddress:O.fromRelaxed(e).toStringLong(),poolAddress:O.fromRelaxed(n).toStringLong()}};return(await Ne({aptosConfig:t,query:o})).delegated_staking_activities}var ys=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return Hp({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return Gp({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return Fp({aptosConfig:this.config,...t})}};var ms=class{constructor(t){this.config=t}async getTransactions(t){return ap({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return cp({aptosConfig:this.config,...t})}async getTransactionByHash(t){return Ui({aptosConfig:this.config,...t})}async isPendingTransaction(t){return up({aptosConfig:this.config,...t})}async waitForTransaction(t){return Bi({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return Si({aptosConfig:this.config})}};var xs=class{constructor(t){this.config=t}async generateTransaction(t){return ir({aptosConfig:this.config,...t})}signTransaction(t){let{signer:e,transaction:n,asFeePayer:o}=t;return o&&(n.feePayerAddress=e.accountAddress),Xc({signer:e,transaction:n})}async simulateTransaction(t){return bp({aptosConfig:this.config,...t})}async submitTransaction(t){return Zc({aptosConfig:this.config,...t})}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Jc({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return Ap({aptosConfig:this.config,...t})}async rotateAuthKey(t){return wp({aptosConfig:this.config,...t})}};var Ct=class{constructor(t){this.config=new ts(t),this.account=new Zo(this.config),this.ans=new gs(this.config),this.coin=new us(this.config),this.digitalAsset=new fs(this.config),this.event=new ds(this.config),this.faucet=new ls(this.config),this.fungibleAsset=new ps(this.config),this.general=new hs(this.config),this.staking=new ys(this.config),this.transaction=new ms(this.config),this.transactionSubmission=new xs(this.config)}};function ar(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);!o||(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}ar(Ct,Zo,"account");ar(Ct,gs,"ans");ar(Ct,us,"coin");ar(Ct,fs,"digitalAsset");ar(Ct,ds,"event");ar(Ct,ls,"faucet");ar(Ct,ps,"fungibleAsset");ar(Ct,hs,"general");ar(Ct,ys,"staking");ar(Ct,ms,"transaction");ar(Ct,xs,"transactionSubmission");return Zp(Cm);})();
|
|
407
|
-
/*!
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
406
|
+
`;async function mi(r){let{aptosConfig:t}=r,{data:e}=await lt({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function bu(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await lt({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function wu(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await lt({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function xi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await Gr({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o?.ledgerVersion},body:n})).data}async function Ai(r){let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await Gr({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n?.ledgerVersion},body:{function:e.function,type_arguments:e.typeArguments??[],arguments:e.functionArguments??[]}});return o}async function Tu(r){let{aptosConfig:t,limit:e}=r;return(await Ce({aptosConfig:t,query:{query:fu,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function Ce(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await bs({aptosConfig:t,originMethod:n??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function Ep(r){let{aptosConfig:t}=r;return(await Ce({aptosConfig:t,query:{query:mu},originMethod:"getProcessorStatuses"})).processor_status}async function bi(r){return(await Ep({aptosConfig:r.aptosConfig}))[0].last_success_version}var na=new Map;function Pn(r,t,e){return async(...n)=>{if(na.has(t)){let{value:s,timestamp:c}=na.get(t);if(e===void 0||Date.now()-c<=e)return s}let o=await r(...n);return na.set(t,{value:o,timestamp:Date.now()}),o}}async function on(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await lt({aptosConfig:t,originMethod:"getInfo",path:`accounts/${k.from(e).toString()}`});return n}async function Eu(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return qr({aptosConfig:t,originMethod:"getModules",path:`accounts/${k.from(e).toString()}/modules`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??1e3}})}async function wi(r){return r.options?.ledgerVersion!==void 0?vu(r):Pn(async()=>vu(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function vu(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await lt({aptosConfig:t,originMethod:"getModule",path:`accounts/${k.from(e).toString()}/module/${n}`,params:{ledger_version:o?.ledgerVersion}});return s}async function Su(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return qr({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${k.from(e).toString()}/transactions`,params:{start:n?.offset,limit:n?.limit}})}async function Uu(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return qr({aptosConfig:t,originMethod:"getResources",path:`accounts/${k.from(e).toString()}/resources`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??999}})}async function oa(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await lt({aptosConfig:t,originMethod:"getResource",path:`accounts/${k.from(e).toString()}/resource/${n}`,params:{ledger_version:o?.ledgerVersion}});return s.data}async function ia(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await oa({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o,c=k.from(e);try{let u=await xi({aptosConfig:t,handle:s,data:{key:c.toString(),key_type:"address",value_type:"address"},options:n});return k.from(u)}catch(u){if(u instanceof Vt&&u.data.error_code==="table_item_not_found")return c;throw u}}async function Cu(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:k.from(e).toStringLong()},amount:{_gt:0}},c=await Ce({aptosConfig:t,query:{query:cu,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!c.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return c.current_token_ownerships_v2_aggregate.aggregate.count}async function Iu(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:k.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.token_standard={_eq:n?.tokenStandard});let c={query:su,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:c,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Bu(r){let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=k.from(e).toStringLong(),c=k.from(n).toStringLong(),u={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:c}},amount:{_gt:0}};o?.tokenStandard&&(u.token_standard={_eq:o?.tokenStandard});let p={query:au,variables:{where_condition:u,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await Ce({aptosConfig:t,query:p,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Ru(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:k.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.current_collection={token_standard:{_eq:n?.tokenStandard}});let c={query:ou,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:c,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function Pu(r){let{aptosConfig:t,accountAddress:e}=r,n=k.from(e).toStringLong(),s=await Ce({aptosConfig:t,query:{query:uu,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function ku(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:k.from(e).toStringLong()}},c={query:nu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:c,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Ou(r){let{aptosConfig:t,accountAddress:e}=r,n=k.from(e).toStringLong(),s=await Ce({aptosConfig:t,query:{query:ru,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function zu(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:k.from(e).toStringLong()}},c={query:iu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:c,originMethod:"getAccountOwnedObjects"})).current_objects}async function Nu(r){let{aptosConfig:t,privateKey:e}=r,n=new Ye(e.publicKey());if(e instanceof cr){let s=Gt.fromPublicKeyAndScheme({publicKey:n,scheme:2}).derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof or){let o=Gt.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await _u({authKey:o,aptosConfig:t})){let p=o.derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:p,legacy:!1})}let c=Gt.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await _u({authKey:c,aptosConfig:t})){let p=c.derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:p,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function _u(r){let{aptosConfig:t,authKey:e}=r,n=await ia({aptosConfig:t,authenticationKey:e.derivedAddress()});try{return await on({aptosConfig:t,accountAddress:n}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var lo=class{constructor(t){this.config=t}async getAccountInfo(t){return on({aptosConfig:this.config,...t})}async getAccountModules(t){return Eu({aptosConfig:this.config,...t})}async getAccountModule(t){return wi({aptosConfig:this.config,...t})}async getAccountTransactions(t){return Su({aptosConfig:this.config,...t})}async getAccountResources(t){return Uu({aptosConfig:this.config,...t})}async getAccountResource(t){return oa({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return ia({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return Cu({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Iu({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return Bu({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Ru({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return Pu({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return ku({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Ou({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return zu({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return Nu({aptosConfig:this.config,...t})}};var Jf=rc(Zf(),1);async function ed(r){var t;let{params:e,method:n,url:o,headers:s,body:c,overrides:u}=r,p={headers:s,method:n,url:o,params:e,data:c,withCredentials:(t=u?.WITH_CREDENTIALS)!=null?t:!0};try{let h=await(0,Jf.default)(p);return{status:h.status,statusText:h.statusText,data:h.data,headers:h.headers,config:h.config}}catch(h){let y=h;if(y.response)return y.response;throw h}}var ho=class{constructor(t){this.network=t?.network??hs,this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:ed},this.clientConfig=t?.clientConfig??{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ps[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return gs[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return Ko[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return Ko[this.network]===t}};var yo=class extends Z{constructor(e){super();this.accountAddress=k.ONE;this.moduleName=new Fe("account");this.structName=new Fe("RotationProofChallenge");this.sequenceNumber=new Le(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=Be.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};var pr=class r extends Mt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof Ke)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof ur)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new r(Ke.load(e));case 1:return new r(ur.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Ca(r){return new Promise(t=>{setTimeout(t,r)})}async function td(r){let{aptosConfig:t,options:e}=r;return qr({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e?.offset,limit:e?.limit}})}async function Bi(r){let{aptosConfig:t}=r;return Pn(async()=>{let{data:e}=await lt({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function rd(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await lt({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function Ri(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await lt({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function nd(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await Ri({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if(n?.status===404)return!0;throw n}}async function Pi(r){let{aptosConfig:t,transactionHash:e,options:n}=r,o=n?.timeoutSecs??ro,s=n?.checkSuccess??!0,c=n?.indexerVersionCheck??!0,u=!0,p=0,h,y,x=200,_=1.5;for(;u&&!(p>=o);){try{if(h=await Ri({aptosConfig:t,transactionHash:e}),u=h.type==="pending_transaction",!u)break}catch(T){if(!(T instanceof Vt)||(y=T,T.status!==404&&T.status>=400&&T.status<500))throw T}await Ca(x),p+=x/1e3,x*=_}if(h===void 0)throw y||new mo(`Fetching transaction ${e} failed and timed out after ${o} seconds`,h);if(h.type==="pending_transaction")throw new mo(`Transaction ${e} timed out in pending state after ${o} seconds`,h);if(!s)return h;if(!h.success)throw new Ia(`Transaction ${e} failed with an error: ${h.vm_status}`,h);if(c)try{await Cg({aptosConfig:t,ledgerVersion:Number(h.version)})}catch{throw new mo(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${h.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,h)}return h}async function Cg(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await bi({aptosConfig:t}),s>=e)break;await Ca(200)}}var mo=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Ia=class extends Error{constructor(e,n){super(e);this.transaction=n}};var ht=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return gr.load(t);case 1:return ki.load(t);case 2:return Wt.load(t);case 3:return Dn.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},gr=class r extends ht{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Pe.deserialize(e),o=Ke.deserialize(e);return new r(n,o)}},ki=class r extends ht{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Dt.deserialize(e),o=Yr.deserialize(e);return new r(n,o)}},Wt=class r extends ht{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Ye.deserialize(e),o=pr.deserialize(e);return new r(n,o)}},Dn=class r extends ht{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=nn.deserialize(e),o=e.deserializeVector(pr),s=e.deserializeBytes();return new r(n,o,s)}};var Yt=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return cn.load(t);case 1:return Oi.load(t);case 2:return un.load(t);case 3:return fn.load(t);case 4:return dn.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},cn=class r extends Yt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Pe.deserialize(e),o=Ke.deserialize(e);return new r(n,o)}},Oi=class r extends Yt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Dt.deserialize(e),o=Yr.deserialize(e);return new r(n,o)}},un=class r extends Yt{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=ht.deserialize(e),o=e.deserializeVector(k),s=e.deserializeVector(ht);return new r(n,o,s)}},fn=class r extends Yt{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=ht.deserialize(e),o=e.deserializeVector(k),s=e.deserializeVector(ht),c=k.deserialize(e),u=ht.deserialize(e),p={address:c,authenticator:u};return new r(n,o,s,p)}},dn=class r extends Yt{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=ht.deserialize(e);return new r(n)}};var ln=class r extends Z{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new r(n)}};var Ne=class r extends Z{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new r(n)}};var qn=class r extends Z{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new r(k.fromStringRelaxed(n[0]),new Ne(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=k.deserialize(e),o=Ne.deserialize(e);return new r(n,o)}};var $e=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return pn.load(t);case 1:return gn.load(t);case 2:return mn.load(t);case 3:return xn.load(t);case 4:return bn.load(t);case 5:return Or.load(t);case 6:return Tn.load(t);case 7:return hr.load(t);case 8:return hn.load(t);case 9:return yn.load(t);case 10:return An.load(t);case 255:return wn.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof pn}isAddress(){return this instanceof bn}isGeneric(){return this instanceof wn}isSigner(){return this instanceof Or}isVector(){return this instanceof Tn}isStruct(){return this instanceof hr}isU8(){return this instanceof gn}isU16(){return this instanceof hn}isU32(){return this instanceof yn}isU64(){return this instanceof mn}isU128(){return this instanceof xn}isU256(){return this instanceof An}},pn=class r extends $e{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new r}},gn=class r extends $e{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new r}},hn=class r extends $e{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new r}},yn=class r extends $e{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new r}},mn=class r extends $e{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new r}},xn=class r extends $e{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new r}},An=class r extends $e{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new r}},bn=class r extends $e{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new r}},Or=class r extends $e{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new r}},xo=class r extends $e{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=$e.deserialize(e);return new r(n)}},wn=class r extends $e{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new r(n)}},Tn=class r extends $e{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=$e.deserialize(e);return new r(n)}},hr=class r extends $e{constructor(e){super();this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=Xt.deserialize(e);return new r(n)}isTypeTag(e,n,o){return this.value.moduleName.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(k.ONE,"string","String")}isOption(){return this.isTypeTag(k.ONE,"option","Option")}isObject(){return this.isTypeTag(k.ONE,"object","Object")}},Xt=class r extends Z{constructor(e,n,o,s){super();this.address=e,this.moduleName=n,this.name=o,this.typeArgs=s}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let n=k.deserialize(e),o=Ne.deserialize(e),s=Ne.deserialize(e),c=e.deserializeVector($e);return new r(n,o,s,c)}};function Ig(){return new Xt(k.ONE,new Ne("aptos_coin"),new Ne("AptosCoin"),[])}function Bg(){return new Xt(k.ONE,new Ne("string"),new Ne("String"),[])}function Rg(r){return new Xt(k.ONE,new Ne("option"),new Ne("Option"),[r])}function Pg(r){return new Xt(k.ONE,new Ne("object"),new Ne("Object"),[r])}function od(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return it.deserialize(r);case 1:return Le.deserialize(r);case 2:return St.deserialize(r);case 3:return k.deserialize(r);case 4:return Be.deserialize(r,it);case 5:return Ge.deserialize(r);case 6:return _t.deserialize(r);case 7:return Et.deserialize(r);case 8:return Ut.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var zr=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Gn.load(t);case 2:return Ln.load(t);case 3:return Fn.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},Gn=class r extends zr{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=Kn.deserialize(e);return new r(n)}},Ln=class r extends zr{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=vn.deserialize(e);return new r(n)}},Fn=class r extends zr{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=Hn.deserialize(e);return new r(n)}},vn=class r{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new r(qn.fromStr(t),new Ne(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=qn.deserialize(t),n=Ne.deserialize(t),o=t.deserializeVector($e),s=t.deserializeUleb128AsU32(),c=new Array;for(let u=0;u<s;u+=1){let p=t.deserializeUleb128AsU32(),h=so.deserialize(t,p);c.push(h)}return new r(e,n,o,c)}},Kn=class r{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector($e),o=t.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let u=od(t);s.push(u)}return new r(e,n,s)}},Hn=class r{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=k.deserialize(t),n=t.deserializeBool(),o;return n&&(o=$n.deserialize(t)),new r(e,o)}},$n=class r{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(vn.deserialize(t))}};var Ft=class r extends Z{constructor(e,n,o,s,c,u,p){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=c,this.expiration_timestamp_secs=u,this.chain_id=p}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=k.deserialize(e),o=e.deserializeU64(),s=zr.deserialize(e),c=e.deserializeU64(),u=e.deserializeU64(),p=e.deserializeU64(),h=ln.deserialize(e);return new r(n,o,s,c,u,p,h)}},Ao=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return yr.load(t);case 1:return mr.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},yr=class r extends Ao{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=Ft.deserialize(e),o=e.deserializeVector(k);return new r(n,o)}},mr=class r extends Ao{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=Ft.deserialize(e),o=e.deserializeVector(k),s=k.deserialize(e);return new r(n,o,s)}};var Kt=class r extends Z{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=Ft.deserialize(e),o=Yt.deserialize(e);return new r(n,o)}};function id(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function sd(r){return!!r.match(/\s/)}function kg(r){return!!r.match(/^T[0-9]+$/)}function Og(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!sd(n))break}return e}var ad=(_=>(_.InvalidTypeTag="unknown type",_.UnexpectedGenericType="unexpected generic type",_.UnexpectedTypeArgumentClose="unexpected '>'",_.UnexpectedWhitespaceCharacter="unexpected whitespace character",_.UnexpectedComma="unexpected ','",_.TypeArgumentCountMismatch="type argument count doesn't match expected amount",_.MissingTypeArgumentClose="no matching '>' for '<'",_.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",_.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",_.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",_.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",_.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",_))(ad||{}),Oe=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Vn(r,t){let e=t?.allowGenerics??!1,n=[],o=[],s=[],c=0,u="",p=1;for(;c<r.length;){let h=r[c];if(h==="<")n.push({savedExpectedTypes:p,savedStr:u,savedTypes:s}),u="",s=[],p=1;else if(h===">"){if(u!==""){let N=zi(u,o,e);s.push(N)}let y=n.pop();if(y===void 0)throw new Oe(r,"unexpected '>'");if(p!==s.length)throw new Oe(r,"type argument count doesn't match expected amount");let{savedStr:x,savedTypes:_,savedExpectedTypes:T}=y;o=s,s=_,u=x,p=T}else if(h===","){if(u.length!==0){let y=zi(u,o,e);o=[],s.push(y),u="",p+=1}}else if(sd(h)){let y=!1;if(u.length!==0){let _=zi(u,o,e);o=[],s.push(_),u="",y=!0}c=Og(r,c);let x=r[c];if(c<r.length&&y&&x!==","&&x!==">")throw new Oe(r,"unexpected whitespace character");continue}else u+=h;c+=1}if(n.length>0)throw new Oe(r,"no matching '>' for '<'");switch(s.length){case 0:return zi(u,o,e);case 1:if(u==="")return s[0];throw new Oe(r,"unexpected ','");default:throw new Oe(r,"unexpected whitespace character")}}function zi(r,t,e){switch(r){case"&signer":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new xo(new Or);case"signer":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new Or;case"bool":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new pn;case"address":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new bn;case"u8":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new gn;case"u16":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new hn;case"u32":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new yn;case"u64":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new mn;case"u128":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new xn;case"u256":if(t.length>0)throw new Oe(r,"primitive types not expected to have type arguments");return new An;case"vector":if(t.length!==1)throw new Oe(r,"vector type expected to have exactly one type argument");return new Tn(t[0]);default:if(kg(r)){if(e)return new wn(Number(r.split("T")[1]));throw new Oe(r,"unexpected generic type")}if(!r.match(/.*:.*/))throw new Oe(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new Oe(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!id(n[1]))throw new Oe(r,"module name must only contain alphanumeric or '_' characters");if(!id(n[2]))throw new Oe(r,"struct name must only contain alphanumeric or '_' characters");return new hr(new Xt(k.fromStringRelaxed(n[0]),new Ne(n[1]),new Ne(n[2]),t))}}function Ba(r){return typeof r=="boolean"}function _n(r){return typeof r=="string"}function bo(r){return typeof r=="number"}function wo(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function Ra(r){return r==null}function Ni(r){return r instanceof Ge}function To(r){return r instanceof k}function Mi(r){return r instanceof Fe}function Pa(r){return r instanceof Er}function Di(r){return r instanceof it}function qi(r){return r instanceof _t}function Gi(r){return r instanceof Et}function Li(r){return r instanceof Le}function Fi(r){return r instanceof St}function Ki(r){return r instanceof Ut}function Hi(r){return"bytecode"in r}function ze(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function ka(r){let t=r.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?r.params.length:t}function $i(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function Oa(r){return r?.map(t=>_n(t)?Vn(t):t)??[]}async function za(r,t,e,n){let s=(await wi({aptosConfig:n,accountAddress:r,moduleName:t})).abi?.exposed_functions.find(p=>p.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let c=ka(s),u=[];for(let p=c;p<s.params.length;p+=1)u.push(Vn(s.params[p],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:u}}function Na(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return Ni(e)||Di(e)||qi(e)||Gi(e)||Li(e)||Fi(e)||Ki(e)||To(e)||Mi(e)||Pa(e)||e instanceof Be||e instanceof Nt?(zg(t,e,n),e):Vi(e,t.parameters[n],n,o)}function Vi(r,t,e,n){if(t.isBool()){if(Ba(r))return new Ge(r);ze("boolean",e)}if(t.isAddress()){if(_n(r))return k.fromStringRelaxed(r);ze("string",e)}if(t.isU8()){if(bo(r))return new it(r);ze("number",e)}if(t.isU16()){if(bo(r))return new _t(r);ze("number",e)}if(t.isU32()){if(bo(r))return new Et(r);ze("number",e)}if(t.isU64()){if(wo(r))return new Le(BigInt(r));ze("bigint | number | string",e)}if(t.isU128()){if(wo(r))return new St(BigInt(r));ze("bigint | number | string",e)}if(t.isU256()){if(wo(r))return new Ut(BigInt(r));ze("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);Vi(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&_n(r))return Be.U8(me.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new Be(r.map(o=>Vi(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(_n(r))return new Fe(r);ze("string",e)}if(t.isObject()){if(_n(r))return k.fromStringRelaxed(r);ze("string",e)}if(t.isOption())return Ra(r)?new Nt(null):new Nt(Vi(r,t.value.typeArgs[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function zg(r,t,e){let n=r.parameters[e];if(n.isBool()){if(Ni(t))return;ze("Bool",e)}if(n.isAddress()){if(To(t))return;ze("AccountAddress",e)}if(n.isU8()){if(Di(t))return;ze("U8",e)}if(n.isU16()){if(qi(t))return;ze("U16",e)}if(n.isU32()){if(Gi(t))return;ze("U32",e)}if(n.isU64()){if(Li(t))return;ze("U64",e)}if(n.isU128()){if(Fi(t))return;ze("U128",e)}if(n.isU256()){if(Ki(t))return;ze("U256",e)}if(n.isVector()){if(t instanceof Be)return;ze("MoveVector",e)}if(n instanceof hr){if(n.isString()){if(Mi(t))return;ze("MoveString",e)}if(n.isObject()){if(To(t))return;ze("AccountAddress",e)}if(n.isOption()){if(t instanceof Nt)return;ze("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function _o(r){if(Hi(r))return ud(r);let{moduleAddress:t,moduleName:e,functionName:n}=$i(r.function),o=await Pn(async()=>za(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return cd(r,o)}function cd(r,t){if(Hi(r))return ud(r);let{moduleAddress:e,moduleName:n,functionName:o}=$i(r.function),s=Oa(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let c=r.functionArguments.map((p,h)=>Na(r.function,t,p,h,s));if(c.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${c.length}`);let u=vn.build(`${e}::${n}`,o,s,c);if("multisigAddress"in r){let p;return typeof r.multisigAddress=="string"?p=k.from(r.multisigAddress):p=r.multisigAddress,new Fn(new Hn(p,new $n(u)))}return new Ln(u)}function ud(r){return new Gn(new Kn(me.fromHexInput(r.bytecode).toUint8Array(),r.typeArguments??[],r.functionArguments))}async function fd(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o?.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):on({aptosConfig:t,accountAddress:e}),c=Ho[t.network]?Promise.resolve({chain_id:Ho[t.network]}):mi({aptosConfig:t}),u=o?.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):Bi({aptosConfig:t}),[{sequence_number:p},{chain_id:h},{gas_estimate:y}]=await Promise.all([s,c,u]),{maxGasAmount:x,gasUnitPrice:_,expireTimestamp:T}={maxGasAmount:o?.maxGasAmount?BigInt(o.maxGasAmount):BigInt(ys),gasUnitPrice:BigInt(y),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+ms),...o};return new Ft(k.fromRelaxed(e),BigInt(p),n,BigInt(x),BigInt(_),BigInt(T),new ln(h))}async function Eo(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=await fd({aptosConfig:t,sender:e,payload:n,options:o});if("feePayerAddress"in r){let c=r.secondarySignerAddresses?.map(u=>k.fromRelaxed(u))??[];return{rawTransaction:s,secondarySignerAddresses:c,feePayerAddress:r?.feePayerAddress!==void 0?k.fromRelaxed(r.feePayerAddress):void 0}}if("secondarySignerAddresses"in r){let c=r.secondarySignerAddresses?.map(u=>k.fromRelaxed(u))??[];return{rawTransaction:s,secondarySignerAddresses:c}}return{rawTransaction:s}}function Ma(r){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=new io(e.rawTransaction.bcsToBytes()),c=Ft.deserialize(s),u=vo(t);if("feePayerAddress"in e){let h=new mr(c,e.secondarySignerAddresses??[],e.feePayerAddress),y=[];n&&(y=n.map(T=>vo(T)));let x=vo(o),_=new fn(u,e.secondarySignerAddresses??[],y,{address:e.feePayerAddress,authenticator:x});return new Kt(h.raw_txn,_).bcsToBytes()}if("secondarySignerAddresses"in e){let h=new yr(c,e.secondarySignerAddresses),y=[];y=n.map(_=>vo(_));let x=new un(u,e.secondarySignerAddresses,y);return new Kt(h.raw_txn,x).bcsToBytes()}let p;if(u instanceof gr)p=new cn(u.public_key,u.signature);else if(u instanceof Wt)p=new dn(u);else throw new Error("Invalid public key");return new Kt(c,p).bcsToBytes()}function vo(r){if(r instanceof Ye){if(r.publicKey instanceof Pe)return new Wt(r,new pr(new Ke(new Uint8Array(64))));if(r.publicKey instanceof qt)return new Wt(r,new pr(new ur(new Uint8Array(64))))}return new gr(new Pe(r.toUint8Array()),new Ke(new Uint8Array(64)))}function Da(r){let{signer:t,transaction:e}=r,n=Ga(e),o=ld(n),s=t.sign(o);switch(t.signingScheme){case 0:return new gr(new Pe(t.publicKey.toUint8Array()),new Ke(s.toUint8Array()));case 2:return new Wt(t.publicKey,new pr(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function qa(r){let{transaction:t,senderAuthenticator:e,feePayerAuthenticator:n,additionalSignersAuthenticators:o}=r,s=Ga(t);if(n||o)return dd(s,e,n,o);if(e instanceof gr){let c=new cn(e.public_key,e.signature);return new Kt(s,c).bcsToBytes()}if(e instanceof Wt||e instanceof Dn){let c=new dn(e);return new Kt(s,c).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function Ga(r){return"feePayerAddress"in r?new mr(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):"secondarySignerAddresses"in r?new yr(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function dd(r,t,e,n){if(r instanceof mr){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let o=new fn(t,r.secondary_signer_addresses,n??[],{address:r.fee_payer_address,authenticator:e});return new Kt(r.raw_txn,o).bcsToBytes()}if(r instanceof yr){if(!n)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let o=new un(t,r.secondary_signer_addresses,n??[]);return new Kt(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function ld(r){let t=$r.create();if(r instanceof Ft)t.update(As);else if(r instanceof yr)t.update($o);else if(r instanceof mr)t.update($o);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function Ht(r){let{aptosConfig:t,sender:e,data:n,options:o}=r,s;if("bytecode"in n?s=n:"multisigAddress"in n?s={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments}:s={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments},Ng(r)){let{secondarySignerAddresses:u}=r,p=r.hasFeePayer?k.ZERO:void 0,h=await _o(s);return Eo({aptosConfig:t,sender:e,payload:h,options:o,secondarySignerAddresses:u,feePayerAddress:p})}if(Mg(r)){let{secondarySignerAddresses:u}=r,p=await _o(s);return Eo({aptosConfig:t,sender:e,payload:p,options:o,secondarySignerAddresses:u})}let c=await _o(s);return Eo({aptosConfig:t,sender:e,payload:c,options:o})}function Ng(r){return"hasFeePayer"in r}function Mg(r){return"secondarySignerAddresses"in r}function La(r){return Da({...r})}async function pd(r){let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:c}=r,u=Ma({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:c}),{data:p}=await Gr({aptosConfig:t,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:r.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:r.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:r.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return p}async function Fa(r){let{aptosConfig:t}=r,e=qa({...r}),{data:n}=await Gr({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Ka(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=La({signer:e,transaction:n});return Fa({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function gd(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,c=o.map(p=>Be.U8(p));return await Ht({aptosConfig:t,sender:k.fromRelaxed(e),data:{function:"0x1::code::publish_package_txn",functionArguments:[Be.U8(n),new Be(c)]},options:s})}async function hd(r){let{aptosConfig:t,fromAccount:e,toNewPrivateKey:n}=r,o=await on({aptosConfig:t,accountAddress:e.accountAddress.toString()}),s=dr.fromPrivateKey({privateKey:n,legacy:!0}),u=new yo({sequenceNumber:BigInt(o.sequence_number),originator:e.accountAddress,currentAuthKey:k.from(o.authentication_key),newPublicKey:s.publicKey}).bcsToBytes(),p=e.sign(u),h=s.sign(u),y=await Ht({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new it(e.signingScheme.valueOf()),Be.U8(e.publicKey.toUint8Array()),new it(s.signingScheme.valueOf()),Be.U8(s.publicKey.toUint8Array()),Be.U8(p.toUint8Array()),Be.U8(h.toUint8Array())]}});return await Ka({aptosConfig:t,signer:e,transaction:y})}async function yd(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:c}=r,u=s??xs;return await Ht({aptosConfig:t,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[Vn(u)],functionArguments:[k.from(n),new Le(o)]},options:c})}var So=class{constructor(t){this.config=t}async transferCoinTransaction(t){return yd({aptosConfig:this.config,...t})}};async function md(r){let{aptosConfig:t,options:e,creator:n}=r;return await Ht({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new Fe(r.collection),new Fe(r.description),new Fe(r.name),new Fe(r.uri),Be.MoveString([]),Be.MoveString([]),new Be([])]},options:e})}async function xd(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:k.from(e).toStringLong()}};return(await Ce({aptosConfig:t,query:{query:Au,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Ad(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:k.from(e).toStringLong()}};return(await Ce({aptosConfig:t,query:{query:ra,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function bd(r){let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:k.from(e).toStringLong()}},s={query:ra,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function wd(r){let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:k.from(e).toStringLong()}},s={query:xu,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ce({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function Td(r){let{aptosConfig:t,options:e,creator:n}=r;return await Ht({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new Fe(r.description),new Le(r.maxSupply??Kr),new Fe(r.name),new Fe(r.uri),new Ge(r.mutableDescription??!0),new Ge(r.mutableRoyalty??!0),new Ge(r.mutableURI??!0),new Ge(r.mutableTokenDescription??!0),new Ge(r.mutableTokenName??!0),new Ge(r.mutableTokenProperties??!0),new Ge(r.mutableTokenURI??!0),new Ge(r.tokensBurnableByCreator??!0),new Ge(r.tokensFreezableByCreator??!0),new Le(r.royaltyNumerator??0),new Le(r.royaltyDenominator??1)]},options:e})}async function Ha(r){let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=k.from(e),c={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return o?.tokenStandard&&(c.token_standard={_eq:o?.tokenStandard??"v2"}),(await Ce({aptosConfig:t,query:{query:du,variables:{where_condition:c}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function vd(r){return(await Ha(r)).collection_id}var Uo=class{constructor(t){this.config=t}async createCollectionTransaction(t){return Td({aptosConfig:this.config,...t})}async getCollectionData(t){return Ha({aptosConfig:this.config,...t})}async getCollectionId(t){return vd({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return md({aptosConfig:this.config,...t})}async getTokenData(t){return xd({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Ad({aptosConfig:this.config,...t})}async getOwnedTokens(t){return bd({aptosConfig:this.config,...t})}async getTokenActivity(t){return wd({aptosConfig:this.config,...t})}};async function _d(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:k.from(t).toStringLong()},creation_number:{_eq:n}};return Qi({aptosConfig:e,options:{where:s}})}async function Ed(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,u={where:{account_address:{_eq:k.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:o?.pagination,orderBy:o?.orderBy};return Qi({aptosConfig:e,options:u})}async function Qi(r){let{aptosConfig:t,options:e}=r,n={query:gu,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await Ce({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var Co=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return _d({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return Ed({aptosConfig:this.config,...t})}async getEvents(t){return Qi({aptosConfig:this.config,...t})}};async function Sd(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=o?.timeoutSecs||ro,{data:c}=await ws({aptosConfig:t,path:"fund",body:{address:k.fromRelaxed(e).toString(),amount:n},originMethod:"fundAccount"}),u=c.txn_hashes[0];return await Pi({aptosConfig:t,transactionHash:u,options:{timeoutSecs:s,checkSuccess:o?.checkSuccess,indexerVersionCheck:o?.indexerVersionCheck}}),u}var Io=class{constructor(t){this.config=t}async fundAccount(t){return Sd({aptosConfig:this.config,...t})}};async function $a(r){let{aptosConfig:t,options:e}=r,n={query:yu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ce({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function Ud(r){let{aptosConfig:t,options:e}=r,n={query:hu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ce({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Cd(r){let{aptosConfig:t,options:e}=r,n={query:lu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ce({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var Bo=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return $a({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await $a({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return Ud({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Cd({aptosConfig:this.config,...t})}};var Ro=class{constructor(t){this.config=t}async getLedgerInfo(){return mi({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return bu({aptosConfig:this.config,...t})}async getBlockByHeight(t){return wu({aptosConfig:this.config,...t})}async getTableItem(t){return xi({aptosConfig:this.config,...t})}async view(t){return Ai({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return Tu({aptosConfig:this.config,...t})}async queryIndexer(t){return Ce({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return bi({aptosConfig:this.config})}};var Id=["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 Bd(r){return!(!r||r.length<3||r.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(r))}function Rd(r){let[t,e,...n]=r.replace(/\.apt$/,"").split(".");if(n.length>0)throw new Error(`${r} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!Bd(t))throw new Error(`${t} is not valid. ${Id}`);if(e&&!Bd(e))throw new Error(`${e} is not valid. ${Id}`);return{domainName:e||t,subdomainName:e?t:void 0}}var Dg="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",qg={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:Dg,custom:null,devnet:null};function Pd(r){let t=qg[r.network];if(!t)throw new Error(`The ANS contract is not deployed to ${r.network}`);return t}var Gg=r=>({vec:[r]}),Lg=()=>({vec:[]}),Fg=r=>r!=null?Gg(r):Lg(),Kg=r=>{if(r&&typeof r=="object"&&"vec"in r&&Array.isArray(r.vec))return r.vec[0]};async function kd(r){let{aptosConfig:t,name:e}=r,n=Pd(t),{domainName:o,subdomainName:s}=Rd(e),c=await Ai({aptosConfig:t,payload:{function:`${n}::router::get_owner_addr`,functionArguments:[o,Fg(s)]}}),u=Kg(c[0]);return u?k.fromRelaxed(u).toString():void 0}async function Od(r){let{aptosConfig:t,expiration:e,name:n,sender:o,targetAddress:s,toAddress:c,options:u}=r,p=Pd(t),{domainName:h,subdomainName:y}=Rd(n),x=e.policy==="subdomain:independent"||e.policy==="subdomain:follow-domain";if(y&&!x)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(x&&!y)throw new Error(`Policy is set to ${e.policy} but no subdomain was provided`);if(e.policy==="domain"){if(e.years!==1)throw new Error("For now, names can only be registered for 1 year at a time");let _=e.years*31536e3;return await Ht({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[new Fe(h),new Le(_),new Nt(s?k.from(s):null),new Nt(c?k.from(c):null)]},options:u})}throw new Error(`Policy ${e.policy} is not supported yet`)}var Po=class{constructor(t){this.config=t}async getOwnerAddress(t){return kd({aptosConfig:this.config,...t})}async registerName(t){return Od({aptosConfig:this.config,...t})}};async function zd(r){let{aptosConfig:t,poolAddress:e}=r,n=k.fromRelaxed(e).toStringLong(),s=await Ce({aptosConfig:t,query:{query:ta,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function Nd(r){let{aptosConfig:t,options:e}=r,n={query:ta,variables:{where_condition:{},order_by:e?.orderBy}};return(await Ce({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function Md(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:pu,variables:{delegatorAddress:k.fromRelaxed(e).toStringLong(),poolAddress:k.fromRelaxed(n).toStringLong()}};return(await Ce({aptosConfig:t,query:o})).delegated_staking_activities}var ko=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return zd({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return Nd({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return Md({aptosConfig:this.config,...t})}};var Oo=class{constructor(t){this.config=t}async getTransactions(t){return td({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return rd({aptosConfig:this.config,...t})}async getTransactionByHash(t){return Ri({aptosConfig:this.config,...t})}async isPendingTransaction(t){return nd({aptosConfig:this.config,...t})}async waitForTransaction(t){return Pi({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return Bi({aptosConfig:this.config})}};var zo=class{constructor(t){this.config=t}async generateTransaction(t){return Ht({aptosConfig:this.config,...t})}signTransaction(t){let{signer:e,transaction:n,asFeePayer:o}=t;if("feePayerAddress"in n&&o)n.feePayerAddress=e.accountAddress;else if(o)throw new Error("Transaction being signed is not a Fee payer transaction, but `asFeePayer` is set to true");return La({signer:e,transaction:n})}async simulateTransaction(t){return pd({aptosConfig:this.config,...t})}async submitTransaction(t){return Fa({aptosConfig:this.config,...t})}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Ka({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return gd({aptosConfig:this.config,...t})}async rotateAuthKey(t){return hd({aptosConfig:this.config,...t})}};var yt=class{constructor(t){this.config=new ho(t),this.account=new lo(this.config),this.ans=new Po(this.config),this.coin=new So(this.config),this.digitalAsset=new Uo(this.config),this.event=new Co(this.config),this.faucet=new Io(this.config),this.fungibleAsset=new Bo(this.config),this.general=new Ro(this.config),this.staking=new ko(this.config),this.transaction=new Oo(this.config),this.transactionSubmission=new zo(this.config)}};function $t(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);o&&(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}$t(yt,lo,"account");$t(yt,Po,"ans");$t(yt,So,"coin");$t(yt,Uo,"digitalAsset");$t(yt,Co,"event");$t(yt,Io,"faucet");$t(yt,Bo,"fungibleAsset");$t(yt,Ro,"general");$t(yt,ko,"staking");$t(yt,Oo,"transaction");$t(yt,zo,"transactionSubmission");return Vd(Hg);})();
|
|
407
|
+
/*! Bundled license information:
|
|
408
|
+
|
|
409
|
+
@noble/hashes/esm/utils.js:
|
|
410
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
411
|
+
|
|
412
|
+
@scure/base/lib/esm/index.js:
|
|
413
|
+
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
414
|
+
|
|
415
|
+
@noble/curves/esm/abstract/utils.js:
|
|
416
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
417
|
+
|
|
418
|
+
@noble/curves/esm/abstract/modular.js:
|
|
419
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
420
|
+
|
|
421
|
+
@noble/curves/esm/abstract/curve.js:
|
|
422
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
423
|
+
|
|
424
|
+
@noble/curves/esm/abstract/weierstrass.js:
|
|
425
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
426
|
+
|
|
427
|
+
@noble/curves/esm/_shortw_utils.js:
|
|
428
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
429
|
+
|
|
430
|
+
@noble/curves/esm/secp256k1.js:
|
|
431
|
+
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
432
|
+
|
|
433
|
+
@scure/bip32/lib/esm/index.js:
|
|
434
|
+
(*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
435
|
+
*/
|
|
412
436
|
//# sourceMappingURL=index.global.js.map
|