@aptos-labs/ts-sdk 1.4.0 → 1.5.1
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 +1 -1
- package/dist/browser/index.d.ts +306 -226
- package/dist/browser/index.global.js +30 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +306 -226
- package/dist/common/index.js +24 -24
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.d.mts +6 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.d.mts +5 -0
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.d.mts +8 -0
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.d.mts +89 -0
- package/dist/esm/api/transactionSubmission/management.mjs +2 -0
- package/dist/esm/api/transactionSubmission/management.mjs.map +1 -0
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/{chunk-KYI7YRRQ.mjs → chunk-25YXK6L2.mjs} +2 -2
- package/dist/esm/{chunk-Q7B4KMTR.mjs → chunk-2BSSYT6I.mjs} +2 -2
- package/dist/esm/chunk-2MOYURM2.mjs +2 -0
- package/dist/esm/chunk-2MOYURM2.mjs.map +1 -0
- package/dist/esm/{chunk-JHKU4VAL.mjs → chunk-2RN7N3EO.mjs} +2 -2
- package/dist/esm/{chunk-LGC5FYCC.mjs → chunk-3T4NSGK5.mjs} +2 -2
- package/dist/esm/{chunk-NWRKJFHV.mjs → chunk-4QWK47EH.mjs} +2 -2
- package/dist/esm/{chunk-RKWCYC3Y.mjs → chunk-4TGKQEEE.mjs} +2 -2
- package/dist/esm/{chunk-GGCQNE7J.mjs → chunk-6IMEQXW4.mjs} +2 -2
- package/dist/esm/{chunk-3PPUHF6D.mjs → chunk-6KILJ43F.mjs} +2 -2
- package/dist/esm/chunk-6XQ33PLM.mjs +2 -0
- package/dist/esm/chunk-6XQ33PLM.mjs.map +1 -0
- package/dist/esm/{chunk-SBMJNU2O.mjs → chunk-7WQA7OMS.mjs} +2 -2
- package/dist/esm/{chunk-3DM36HLF.mjs → chunk-ACMNL2LL.mjs} +2 -2
- package/dist/esm/{chunk-2QV6HI3M.mjs → chunk-APOQ4ODM.mjs} +2 -2
- package/dist/esm/{chunk-FXXTTZOI.mjs → chunk-ATHZ7INX.mjs} +2 -2
- package/dist/esm/{chunk-TN4RHL6A.mjs → chunk-BDHRLMQP.mjs} +2 -2
- package/dist/esm/{chunk-LLONKHWW.mjs → chunk-BQYQ45QQ.mjs} +2 -2
- package/dist/esm/{chunk-QQMEPYJ3.mjs → chunk-C53MNMPH.mjs} +2 -2
- package/dist/esm/{chunk-4RFWMHWT.mjs → chunk-CFQDJZBD.mjs} +2 -2
- package/dist/esm/{chunk-4DEYLX4E.mjs → chunk-DHFOORW6.mjs} +2 -2
- package/dist/esm/{chunk-BBJ3YXGC.mjs → chunk-DIWRS4YQ.mjs} +2 -2
- package/dist/esm/{chunk-CBMEWHLK.mjs → chunk-DSGIOUTJ.mjs} +2 -2
- package/dist/esm/{chunk-MJW4JGUR.mjs → chunk-ED2OMOMT.mjs} +2 -2
- package/dist/esm/{chunk-CHK4FLX4.mjs → chunk-FE2DRPX7.mjs} +2 -2
- package/dist/esm/{chunk-ERWQOVBF.mjs → chunk-FGHNLZRH.mjs} +2 -2
- package/dist/esm/{chunk-FW7B46XZ.mjs → chunk-FHUT4EJH.mjs} +2 -2
- package/dist/esm/{chunk-PXNW26UO.mjs → chunk-HT6K4NWZ.mjs} +2 -2
- package/dist/esm/{chunk-O74RSNEJ.mjs → chunk-HV4ZPHSZ.mjs} +2 -2
- package/dist/esm/{chunk-4BGNLZ5Y.mjs → chunk-IK7JAKXG.mjs} +2 -2
- package/dist/esm/{chunk-UCHGKGCF.mjs → chunk-J46VAO6L.mjs} +2 -2
- package/dist/esm/{chunk-YJQQF4GI.mjs → chunk-J4CN3Q2R.mjs} +2 -2
- package/dist/esm/{chunk-XSM3SOZY.mjs → chunk-JBWJE4IP.mjs} +2 -2
- package/dist/esm/{chunk-F362Q4BJ.mjs → chunk-JMV2QDNW.mjs} +2 -2
- package/dist/esm/{chunk-DHR4YEUH.mjs → chunk-JRQMEVDE.mjs} +2 -2
- package/dist/esm/{chunk-TJJSQSO3.mjs → chunk-K6IBDLVC.mjs} +2 -2
- package/dist/esm/chunk-LFWMWCS3.mjs +2 -0
- package/dist/esm/chunk-LFWMWCS3.mjs.map +1 -0
- package/dist/esm/{chunk-I4EKXYTB.mjs → chunk-NXAHJ4KY.mjs} +2 -2
- package/dist/esm/{chunk-FBFMQZTM.mjs → chunk-P7B32QR3.mjs} +2 -2
- package/dist/esm/{chunk-4OI7MPFH.mjs → chunk-PPNI7SJK.mjs} +2 -2
- package/dist/esm/chunk-QYB75IJ6.mjs +2 -0
- package/dist/esm/chunk-QYB75IJ6.mjs.map +1 -0
- package/dist/esm/{chunk-457LDQ3A.mjs → chunk-R3URESCV.mjs} +2 -2
- package/dist/esm/{chunk-XGM33CR7.mjs → chunk-TRTTUBC4.mjs} +2 -2
- package/dist/esm/{chunk-7Z4DTVZN.mjs → chunk-VP5JCW6I.mjs} +2 -2
- package/dist/esm/chunk-W5PZ5Z4H.mjs +2 -0
- package/dist/esm/chunk-W5PZ5Z4H.mjs.map +1 -0
- package/dist/esm/{chunk-FP5DPRYL.mjs → chunk-WXWFKCGO.mjs} +2 -2
- package/dist/esm/chunk-X3SXV2RB.mjs +2 -0
- package/dist/esm/{chunk-NXPN5XLB.mjs.map → chunk-X3SXV2RB.mjs.map} +1 -1
- package/dist/esm/{chunk-V6J34VOD.mjs → chunk-ZDT4TIOP.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +3 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.d.mts +2 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +29 -3
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +3 -2
- package/src/api/aptos.ts +1 -1
- package/src/api/transaction.ts +7 -9
- package/src/api/transactionSubmission/management.ts +106 -0
- package/src/client/core.ts +1 -1
- package/src/transactions/management/transactionWorker.ts +74 -14
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2EQNGCPL.mjs +0 -2
- package/dist/esm/chunk-2EQNGCPL.mjs.map +0 -1
- package/dist/esm/chunk-ATV7SH7J.mjs +0 -2
- package/dist/esm/chunk-ATV7SH7J.mjs.map +0 -1
- package/dist/esm/chunk-NXPN5XLB.mjs +0 -2
- package/dist/esm/chunk-QLAW63UU.mjs +0 -2
- package/dist/esm/chunk-QLAW63UU.mjs.map +0 -1
- package/dist/esm/chunk-RVQGLEBY.mjs +0 -2
- package/dist/esm/chunk-RVQGLEBY.mjs.map +0 -1
- /package/dist/esm/{chunk-KYI7YRRQ.mjs.map → chunk-25YXK6L2.mjs.map} +0 -0
- /package/dist/esm/{chunk-Q7B4KMTR.mjs.map → chunk-2BSSYT6I.mjs.map} +0 -0
- /package/dist/esm/{chunk-JHKU4VAL.mjs.map → chunk-2RN7N3EO.mjs.map} +0 -0
- /package/dist/esm/{chunk-LGC5FYCC.mjs.map → chunk-3T4NSGK5.mjs.map} +0 -0
- /package/dist/esm/{chunk-NWRKJFHV.mjs.map → chunk-4QWK47EH.mjs.map} +0 -0
- /package/dist/esm/{chunk-RKWCYC3Y.mjs.map → chunk-4TGKQEEE.mjs.map} +0 -0
- /package/dist/esm/{chunk-GGCQNE7J.mjs.map → chunk-6IMEQXW4.mjs.map} +0 -0
- /package/dist/esm/{chunk-3PPUHF6D.mjs.map → chunk-6KILJ43F.mjs.map} +0 -0
- /package/dist/esm/{chunk-SBMJNU2O.mjs.map → chunk-7WQA7OMS.mjs.map} +0 -0
- /package/dist/esm/{chunk-3DM36HLF.mjs.map → chunk-ACMNL2LL.mjs.map} +0 -0
- /package/dist/esm/{chunk-2QV6HI3M.mjs.map → chunk-APOQ4ODM.mjs.map} +0 -0
- /package/dist/esm/{chunk-FXXTTZOI.mjs.map → chunk-ATHZ7INX.mjs.map} +0 -0
- /package/dist/esm/{chunk-TN4RHL6A.mjs.map → chunk-BDHRLMQP.mjs.map} +0 -0
- /package/dist/esm/{chunk-LLONKHWW.mjs.map → chunk-BQYQ45QQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QQMEPYJ3.mjs.map → chunk-C53MNMPH.mjs.map} +0 -0
- /package/dist/esm/{chunk-4RFWMHWT.mjs.map → chunk-CFQDJZBD.mjs.map} +0 -0
- /package/dist/esm/{chunk-4DEYLX4E.mjs.map → chunk-DHFOORW6.mjs.map} +0 -0
- /package/dist/esm/{chunk-BBJ3YXGC.mjs.map → chunk-DIWRS4YQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-CBMEWHLK.mjs.map → chunk-DSGIOUTJ.mjs.map} +0 -0
- /package/dist/esm/{chunk-MJW4JGUR.mjs.map → chunk-ED2OMOMT.mjs.map} +0 -0
- /package/dist/esm/{chunk-CHK4FLX4.mjs.map → chunk-FE2DRPX7.mjs.map} +0 -0
- /package/dist/esm/{chunk-ERWQOVBF.mjs.map → chunk-FGHNLZRH.mjs.map} +0 -0
- /package/dist/esm/{chunk-FW7B46XZ.mjs.map → chunk-FHUT4EJH.mjs.map} +0 -0
- /package/dist/esm/{chunk-PXNW26UO.mjs.map → chunk-HT6K4NWZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-O74RSNEJ.mjs.map → chunk-HV4ZPHSZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-4BGNLZ5Y.mjs.map → chunk-IK7JAKXG.mjs.map} +0 -0
- /package/dist/esm/{chunk-UCHGKGCF.mjs.map → chunk-J46VAO6L.mjs.map} +0 -0
- /package/dist/esm/{chunk-YJQQF4GI.mjs.map → chunk-J4CN3Q2R.mjs.map} +0 -0
- /package/dist/esm/{chunk-XSM3SOZY.mjs.map → chunk-JBWJE4IP.mjs.map} +0 -0
- /package/dist/esm/{chunk-F362Q4BJ.mjs.map → chunk-JMV2QDNW.mjs.map} +0 -0
- /package/dist/esm/{chunk-DHR4YEUH.mjs.map → chunk-JRQMEVDE.mjs.map} +0 -0
- /package/dist/esm/{chunk-TJJSQSO3.mjs.map → chunk-K6IBDLVC.mjs.map} +0 -0
- /package/dist/esm/{chunk-I4EKXYTB.mjs.map → chunk-NXAHJ4KY.mjs.map} +0 -0
- /package/dist/esm/{chunk-FBFMQZTM.mjs.map → chunk-P7B32QR3.mjs.map} +0 -0
- /package/dist/esm/{chunk-4OI7MPFH.mjs.map → chunk-PPNI7SJK.mjs.map} +0 -0
- /package/dist/esm/{chunk-457LDQ3A.mjs.map → chunk-R3URESCV.mjs.map} +0 -0
- /package/dist/esm/{chunk-XGM33CR7.mjs.map → chunk-TRTTUBC4.mjs.map} +0 -0
- /package/dist/esm/{chunk-7Z4DTVZN.mjs.map → chunk-VP5JCW6I.mjs.map} +0 -0
- /package/dist/esm/{chunk-FP5DPRYL.mjs.map → chunk-WXWFKCGO.mjs.map} +0 -0
- /package/dist/esm/{chunk-V6J34VOD.mjs.map → chunk-ZDT4TIOP.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-WXWFKCGO.mjs";import{a as p}from"./chunk-7WQA7OMS.mjs";import{a as _}from"./chunk-P7B32QR3.mjs";import{b as m}from"./chunk-I7WRJY7K.mjs";import{b as y}from"./chunk-ZFIMVSCR.mjs";import{b as c}from"./chunk-F7CR75CJ.mjs";import{a as S}from"./chunk-AH44UPM4.mjs";import{d as b,g as d}from"./chunk-3T4NSGK5.mjs";import{d as C,e as h,f as w,g as k,h as T,j as O,k as q,l as v}from"./chunk-BQSE5HHW.mjs";import{b as g,c as A}from"./chunk-R3URESCV.mjs";import{a as l}from"./chunk-6FBKUTGF.mjs";async function M(e){let{aptosConfig:n,accountAddress:t}=e,{data:o}=await g({aptosConfig:n,originMethod:"getInfo",path:`accounts/${c.from(t).toString()}`});return o}async function io(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getModules",path:`accounts/${c.from(t).toString()}/modules`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??1e3}})}async function uo(e){return e.options?.ledgerVersion!==void 0?P(e):S(async()=>P(e),`module-${e.accountAddress}-${e.moduleName}`,1e3*60*5)()}async function P(e){let{aptosConfig:n,accountAddress:t,moduleName:o,options:r}=e,{data:s}=await g({aptosConfig:n,originMethod:"getModule",path:`accounts/${c.from(t).toString()}/module/${o}`,params:{ledger_version:r?.ledgerVersion}});return s}async function go(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getTransactions",path:`accounts/${c.from(t).toString()}/transactions`,params:{start:o?.offset,limit:o?.limit}})}async function Ao(e){let{aptosConfig:n,accountAddress:t,options:o}=e;return A({aptosConfig:n,originMethod:"getResources",path:`accounts/${c.from(t).toString()}/resources`,params:{ledger_version:o?.ledgerVersion,start:o?.offset,limit:o?.limit??999}})}async function K(e){let{aptosConfig:n,accountAddress:t,resourceType:o,options:r}=e,{data:s}=await g({aptosConfig:n,originMethod:"getResource",path:`accounts/${c.from(t).toString()}/resource/${o}`,params:{ledger_version:r?.ledgerVersion}});return s.data}async function Q(e){let{aptosConfig:n,authenticationKey:t,options:o}=e,r=await K({aptosConfig:n,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:o}),{address_map:{handle:s}}=r,a=c.from(t);try{let i=await b({aptosConfig:n,handle:s,data:{key:a.toString(),key_type:"address",value_type:"address"},options:o});return c.from(i)}catch(i){if(i instanceof l&&i.data.error_code==="table_item_not_found")return a;throw i}}async function po(e){let{aptosConfig:n,accountAddress:t}=e,r={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}},a=await d({aptosConfig:n,query:{query:q,variables:{where_condition:r}},originMethod:"getAccountTokensCount"});return a.current_token_ownerships_v2_aggregate.aggregate?a.current_token_ownerships_v2_aggregate.aggregate.count:0}async function fo(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(s.token_standard={_eq:o?.tokenStandard});let a={query:T,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function lo(e){let{aptosConfig:n,accountAddress:t,collectionAddress:o,options:r}=e,s=c.from(t).toStringLong(),a=c.from(o).toStringLong(),i={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};r?.tokenStandard&&(i.token_standard={_eq:r?.tokenStandard});let u={query:O,variables:{where_condition:i,offset:r?.offset,limit:r?.limit,order_by:r?.orderBy}};return(await d({aptosConfig:n,query:u,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function yo(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()},amount:{_gt:0}};o?.tokenStandard&&(s.current_collection={token_standard:{_eq:o?.tokenStandard}});let a={query:w,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function mo(e){let{aptosConfig:n,accountAddress:t}=e,o=c.from(t).toStringLong(),s=await d({aptosConfig:n,query:{query:v,variables:{address:o}},originMethod:"getAccountTransactionsCount"});return s.account_transactions_aggregate.aggregate?s.account_transactions_aggregate.aggregate.count:0}async function _o(e){let{aptosConfig:n,accountAddress:t,coinType:o}=e,r=c.from(t).toStringLong(),s=await I({aptosConfig:n,accountAddress:r,options:{where:{asset_type:{_eq:o}}}});return s[0]?s[0].amount:0}async function I(e){let{aptosConfig:n,accountAddress:t,options:o}=e,r=c.from(t).toStringLong(),s={...o?.where,owner_address:{_eq:r}},a={query:h,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Co(e){let{aptosConfig:n,accountAddress:t}=e,o=c.from(t).toStringLong(),s=await d({aptosConfig:n,query:{query:C,variables:{address:o}},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 ho(e){let{aptosConfig:n,accountAddress:t,options:o}=e,s={owner_address:{_eq:c.from(t).toStringLong()}},a={query:k,variables:{where_condition:s,offset:o?.offset,limit:o?.limit,order_by:o?.orderBy}};return(await d({aptosConfig:n,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function wo(e){let{aptosConfig:n,privateKey:t}=e,o=new _(t.publicKey());if(t instanceof m){let s=p.fromPublicKeyAndScheme({publicKey:o,scheme:2}).derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:s})}if(t instanceof y){let r=p.fromPublicKeyAndScheme({publicKey:o,scheme:2});if(await G({authKey:r,aptosConfig:n})){let u=r.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:u,legacy:!1})}let a=p.fromPublicKeyAndScheme({publicKey:o,scheme:0});if(await G({authKey:a,aptosConfig:n})){let u=a.derivedAddress();return f.fromPrivateKeyAndAddress({privateKey:t,address:u,legacy:!0})}}throw new Error(`Can't derive account from private key ${t}`)}async function G(e){let{aptosConfig:n,authKey:t}=e,o=await Q({aptosConfig:n,authenticationKey:t.derivedAddress()});try{return await M({aptosConfig:n,accountAddress:o}),!0}catch(r){if(r.status===404)return!1;throw new Error(`Error while looking for an account info ${o.toString()}`)}}export{M as a,io as b,uo as c,go as d,Ao as e,K as f,Q as g,po as h,fo as i,lo as j,yo as k,mo as l,_o as m,I as n,Co as o,ho as p,wo as q,G as r};
|
|
2
|
+
//# sourceMappingURL=chunk-4TGKQEEE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-4TGKQEEE.mjs";import{a as e}from"./chunk-3JPVQHOR.mjs";var n=()=>Math.floor(Date.now()/1e3),r=class{constructor(t,i,o,a,c){this.lastUncommintedNumber=null;this.currentNumber=null;this.lock=!1;this.aptosConfig=t,this.account=i,this.maxWaitTime=o,this.maximumInFlight=a,this.sleepTime=c}async nextSequenceNumber(){for(;this.lock;)await e(this.sleepTime);this.lock=!0;let t=BigInt(0);try{if((this.lastUncommintedNumber===null||this.currentNumber===null)&&await this.initialize(),this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight){await this.update();let i=n();for(;this.currentNumber-this.lastUncommintedNumber>=this.maximumInFlight;)await e(this.sleepTime),n()-i>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):await this.update()}t=this.currentNumber,this.currentNumber+=BigInt(1)}catch(i){console.error("error in getting next sequence number for this account",i)}finally{this.lock=!1}return t}async initialize(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});this.currentNumber=BigInt(t),this.lastUncommintedNumber=BigInt(t)}async update(){let{sequence_number:t}=await s({aptosConfig:this.aptosConfig,accountAddress:this.account.accountAddress});return this.lastUncommintedNumber=BigInt(t),this.lastUncommintedNumber}async synchronize(){if(this.lastUncommintedNumber!==this.currentNumber){for(;this.lock;)await e(this.sleepTime);this.lock=!0;try{await this.update();let t=n();for(;this.lastUncommintedNumber!==this.currentNumber;)n()-t>this.maxWaitTime?(console.warn(`Waited over 30 seconds for a transaction to commit, resyncing ${this.account.accountAddress.toString()}`),await this.initialize()):(await e(this.sleepTime),await this.update())}catch(t){console.error("error in synchronizing this account sequence number with the one on chain",t)}finally{this.lock=!1}}}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6IMEQXW4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-IK7JAKXG.mjs";import{a as s,b as t,c as r,d as i,e as c,f as u,g as d,h as A,i as g,j as m,k as a,l as p,m as f,n as y,o as C,p as O,q as T}from"./chunk-4TGKQEEE.mjs";import{f as o}from"./chunk-HHJBCGAQ.mjs";var l=class{constructor(e){this.config=e}async getAccountInfo(e){return s({aptosConfig:this.config,...e})}async getAccountModules(e){return t({aptosConfig:this.config,...e})}async getAccountModule(e){return r({aptosConfig:this.config,...e})}async getAccountTransactions(e){return i({aptosConfig:this.config,...e})}async getAccountResources(e){return c({aptosConfig:this.config,...e})}async getAccountResource(e){return u({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return d({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),A({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),g({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),m({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),a({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),p({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),y({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),C({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:o,...e})}async getAccountCoinAmount(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),f({aptosConfig:this.config,...e})}async getAccountOwnedObjects(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),O({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return T({aptosConfig:this.config,...e})}};export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6KILJ43F.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-QYB75IJ6.mjs";import{a as r}from"./chunk-DSGIOUTJ.mjs";import{a}from"./chunk-2BSSYT6I.mjs";import{a as c}from"./chunk-JRQMEVDE.mjs";import{a as g}from"./chunk-NXAHJ4KY.mjs";import{a as f}from"./chunk-CFQDJZBD.mjs";import{a as l}from"./chunk-JBWJE4IP.mjs";import{a as u}from"./chunk-ED2OMOMT.mjs";import{a as s}from"./chunk-6KILJ43F.mjs";import{a as p}from"./chunk-J4CN3Q2R.mjs";import{a as y}from"./chunk-4DI53MOX.mjs";var t=class{constructor(i){this.config=new y(i),this.account=new s(this.config),this.ans=new p(this.config),this.coin=new r(this.config),this.digitalAsset=new a(this.config),this.event=new c(this.config),this.faucet=new g(this.config),this.fungibleAsset=new f(this.config),this.general=new l(this.config),this.staking=new u(this.config),this.transaction=new h(this.config)}};function n(m,i,A){Object.getOwnPropertyNames(i.prototype).forEach(e=>{let o=Object.getOwnPropertyDescriptor(i.prototype,e);o&&(o.value=function(...d){return this[A][e](...d)},Object.defineProperty(m.prototype,e,o))})}n(t,s,"account");n(t,p,"ans");n(t,r,"coin");n(t,a,"digitalAsset");n(t,c,"event");n(t,g,"faucet");n(t,f,"fungibleAsset");n(t,l,"general");n(t,u,"staking");n(t,h,"transaction");export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6XQ33PLM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/aptos.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Account } from \"./account\";\nimport { AptosConfig } from \"./aptosConfig\";\nimport { Coin } from \"./coin\";\nimport { DigitalAsset } from \"./digitalAsset\";\nimport { Event } from \"./event\";\nimport { Faucet } from \"./faucet\";\nimport { FungibleAsset } from \"./fungibleAsset\";\nimport { General } from \"./general\";\nimport { ANS } from \"./ans\";\nimport { Staking } from \"./staking\";\nimport { Transaction } from \"./transaction\";\n\n/**\n * This class is the main entry point into Aptos's\n * APIs and separates functionality into different namespaces.\n *\n * To use the SDK, create a new Aptos instance to get access\n * to all the sdk functionality.\n */\nexport class Aptos {\n readonly config: AptosConfig;\n\n readonly account: Account;\n\n readonly ans: ANS;\n\n readonly coin: Coin;\n\n readonly digitalAsset: DigitalAsset;\n\n readonly event: Event;\n\n readonly faucet: Faucet;\n\n readonly fungibleAsset: FungibleAsset;\n\n readonly general: General;\n\n readonly staking: Staking;\n\n readonly transaction: Transaction;\n\n constructor(settings?: AptosConfig) {\n this.config = new AptosConfig(settings);\n this.account = new Account(this.config);\n this.ans = new ANS(this.config);\n this.coin = new Coin(this.config);\n this.digitalAsset = new DigitalAsset(this.config);\n this.event = new Event(this.config);\n this.faucet = new Faucet(this.config);\n this.fungibleAsset = new FungibleAsset(this.config);\n this.general = new General(this.config);\n this.staking = new Staking(this.config);\n this.transaction = new Transaction(this.config);\n }\n}\n\n// extends Aptos interface so all the methods and properties\n// from the other classes will be recognized by typescript.\nexport interface Aptos\n extends Account,\n ANS,\n Coin,\n DigitalAsset,\n Event,\n Faucet,\n FungibleAsset,\n General,\n Staking,\n Omit<Transaction, \"build\" | \"simulate\" | \"submit\" | \"batch\"> {}\n\n/**\nIn TypeScript, we can’t inherit or extend from more than one class,\nMixins helps us to get around that by creating a partial classes\nthat we can combine to form a single class that contains all the methods and properties from the partial classes.\n{@link https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern}\n\nHere, we combine any subclass and the Aptos class.\n*/\nfunction applyMixin(targetClass: any, baseClass: any, baseClassProp: string) {\n // Mixin instance methods\n Object.getOwnPropertyNames(baseClass.prototype).forEach((propertyName) => {\n const propertyDescriptor = Object.getOwnPropertyDescriptor(baseClass.prototype, propertyName);\n if (!propertyDescriptor) return;\n // eslint-disable-next-line func-names\n propertyDescriptor.value = function (...args: any) {\n return (this as any)[baseClassProp][propertyName](...args);\n };\n Object.defineProperty(targetClass.prototype, propertyName, propertyDescriptor);\n });\n}\n\napplyMixin(Aptos, Account, \"account\");\napplyMixin(Aptos, ANS, \"ans\");\napplyMixin(Aptos, Coin, \"coin\");\napplyMixin(Aptos, DigitalAsset, \"digitalAsset\");\napplyMixin(Aptos, Event, \"event\");\napplyMixin(Aptos, Faucet, \"faucet\");\napplyMixin(Aptos, FungibleAsset, \"fungibleAsset\");\napplyMixin(Aptos, General, \"general\");\napplyMixin(Aptos, Staking, \"staking\");\napplyMixin(Aptos, Transaction, \"transaction\");\n"],"mappings":"8bAsBO,IAAMA,EAAN,KAAY,CAuBjB,YAAYC,EAAwB,CAClC,KAAK,OAAS,IAAIC,EAAYD,CAAQ,EACtC,KAAK,QAAU,IAAIE,EAAQ,KAAK,MAAM,EACtC,KAAK,IAAM,IAAIC,EAAI,KAAK,MAAM,EAC9B,KAAK,KAAO,IAAIC,EAAK,KAAK,MAAM,EAChC,KAAK,aAAe,IAAIC,EAAa,KAAK,MAAM,EAChD,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,cAAgB,IAAIC,EAAc,KAAK,MAAM,EAClD,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,QAAU,IAAIC,EAAQ,KAAK,MAAM,EACtC,KAAK,YAAc,IAAIC,EAAY,KAAK,MAAM,CAChD,CACF,EAwBA,SAASC,EAAWC,EAAkBC,EAAgBC,EAAuB,CAE3E,OAAO,oBAAoBD,EAAU,SAAS,EAAE,QAASE,GAAiB,CACxE,IAAMC,EAAqB,OAAO,yBAAyBH,EAAU,UAAWE,CAAY,EACvFC,IAELA,EAAmB,MAAQ,YAAaC,EAAW,CACjD,OAAQ,KAAaH,CAAa,EAAEC,CAAY,EAAE,GAAGE,CAAI,CAC3D,EACA,OAAO,eAAeL,EAAY,UAAWG,EAAcC,CAAkB,EAC/E,CAAC,CACH,CAEAL,EAAWb,EAAOG,EAAS,SAAS,EACpCU,EAAWb,EAAOI,EAAK,KAAK,EAC5BS,EAAWb,EAAOK,EAAM,MAAM,EAC9BQ,EAAWb,EAAOM,EAAc,cAAc,EAC9CO,EAAWb,EAAOO,EAAO,OAAO,EAChCM,EAAWb,EAAOQ,EAAQ,QAAQ,EAClCK,EAAWb,EAAOS,EAAe,eAAe,EAChDI,EAAWb,EAAOU,EAAS,SAAS,EACpCG,EAAWb,EAAOW,EAAS,SAAS,EACpCE,EAAWb,EAAOY,EAAa,aAAa","names":["Aptos","settings","AptosConfig","Account","ANS","Coin","DigitalAsset","Event","Faucet","FungibleAsset","General","Staking","Transaction","applyMixin","targetClass","baseClass","baseClassProp","propertyName","propertyDescriptor","args"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as y}from"./chunk-7IGH7N52.mjs";import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as y}from"./chunk-7IGH7N52.mjs";import{a as m}from"./chunk-J46VAO6L.mjs";import{a as d}from"./chunk-P7B32QR3.mjs";import{a as l}from"./chunk-ZFIMVSCR.mjs";import{b as u}from"./chunk-F7CR75CJ.mjs";import{a as c}from"./chunk-N4RBQZ2B.mjs";import{b as s}from"./chunk-NL72WE3E.mjs";import{sha3_256 as b}from"@noble/hashes/sha3";var i=class i extends c{constructor(r){super();let{data:t}=r,e=s.fromHexInput(t);if(e.toUint8Array().length!==i.LENGTH)throw new Error(`Authentication Key length should be ${i.LENGTH}`);this.data=e}serialize(r){r.serializeFixedBytes(this.data.toUint8Array())}static deserialize(r){let t=r.deserializeFixedBytes(i.LENGTH);return new i({data:t})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(r){let{publicKey:t,scheme:e}=r,n;switch(e){case 3:case 2:{let a=t.bcsToBytes();n=new Uint8Array([...a,e]);break}case 0:case 1:{let a=t.toUint8Array(),p=s.fromHexInput(a).toUint8Array();n=new Uint8Array([...p,e]);break}default:throw new Error(`Scheme ${e} is not supported`)}let o=b.create();o.update(n);let f=o.digest();return new i({data:f})}static fromPublicKey(r){let{publicKey:t}=r,e;if(t instanceof l)e=0 .valueOf();else if(t instanceof y)e=1 .valueOf();else if(t instanceof d)e=2 .valueOf();else if(t instanceof m)e=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return i.fromPublicKeyAndScheme({publicKey:t,scheme:e})}derivedAddress(){return new u(this.data.toUint8Array())}};i.LENGTH=32;var h=i;export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7WQA7OMS.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as m}from"./chunk-K6IBDLVC.mjs";import{a as h}from"./chunk-QKTV6AZ7.mjs";import{b as t}from"./chunk-F7CR75CJ.mjs";import{a as u}from"./chunk-N4RBQZ2B.mjs";var o=class i extends u{constructor(e,s,a,n,d,l,_){super();this.sender=e,this.sequence_number=s,this.payload=a,this.max_gas_amount=n,this.gas_unit_price=d,this.expiration_timestamp_secs=l,this.chain_id=_}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 s=t.deserialize(e),a=e.deserializeU64(),n=m.deserialize(e),d=e.deserializeU64(),l=e.deserializeU64(),_=e.deserializeU64(),b=h.deserialize(e);return new i(s,a,n,d,l,_,b)}},c=class extends u{static deserialize(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return p.load(r);case 1:return y.load(r);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},p=class i extends c{constructor(e,s){super();this.raw_txn=e,this.secondary_signer_addresses=s}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let s=o.deserialize(e),a=e.deserializeVector(t);return new i(s,a)}},y=class i extends c{constructor(e,s,a){super();this.raw_txn=e,this.secondary_signer_addresses=s,this.fee_payer_address=a}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 s=o.deserialize(e),a=e.deserializeVector(t),n=t.deserialize(e);return new i(s,a,n)}};export{o as a,c as b,p as c,y as d};
|
|
2
|
+
//# sourceMappingURL=chunk-ACMNL2LL.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as i}from"./chunk-I7WRJY7K.mjs";import{c as e}from"./chunk-ZFIMVSCR.mjs";import{c as a}from"./chunk-V6JFR2CB.mjs";var s=class t extends a{constructor(r){super();this.signature=r}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(r){if(this.signature instanceof e)r.serializeU32AsUleb128(0),this.signature.serialize(r);else if(this.signature instanceof i)r.serializeU32AsUleb128(1),this.signature.serialize(r);else throw new Error("Unknown signature type")}static deserialize(r){let n=r.deserializeUleb128AsU32();switch(n){case 0:return new t(e.load(r));case 1:return new t(i.load(r));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-APOQ4ODM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-2RN7N3EO.mjs";import{f as n}from"./chunk-HHJBCGAQ.mjs";async function A(o){let{aptosConfig:r,sender:i,recipient:e,amount:s,coinType:c,options:a}=o;return await t({aptosConfig:r,sender:i,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[c??n],functionArguments:[e,s]},options:a})}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ATHZ7INX.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-6EMN3BOV.mjs";import{f as r}from"./chunk-2RN7N3EO.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var i=class{constructor(n){this.config=n}async simple(n){return r({aptosConfig:this.config,...n})}async multiAgent(n){return r({aptosConfig:this.config,...n})}};o([s],i.prototype,"simple",1),o([s],i.prototype,"multiAgent",1);export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BDHRLMQP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-F7CR75CJ.mjs";import{g as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-F7CR75CJ.mjs";import{g as d}from"./chunk-3T4NSGK5.mjs";import{q as c}from"./chunk-BQSE5HHW.mjs";async function v(o){let{accountAddress:t,aptosConfig:e,creationNumber:n}=o,i={account_address:{_eq:r.from(t).toStringLong()},creation_number:{_eq:n}};return p({aptosConfig:e,options:{where:i}})}async function y(o){let{accountAddress:t,aptosConfig:e,eventType:n,options:s}=o,a={where:{account_address:{_eq:r.from(t).toStringLong()},indexed_type:{_eq:n}},pagination:s,orderBy:s?.orderBy};return p({aptosConfig:e,options:a})}async function p(o){let{aptosConfig:t,options:e}=o,n={query:c,variables:{where_condition:e?.where,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await d({aptosConfig:t,query:n,originMethod:"getEvents"})).events}export{v as a,y as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-BQYQ45QQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from"./chunk-2RN7N3EO.mjs";import{d as v}from"./chunk-ZDT4TIOP.mjs";import{c as h}from"./chunk-S4QKXXBT.mjs";import{b as g}from"./chunk-F7CR75CJ.mjs";import{b as C}from"./chunk-F7MOQC7Z.mjs";import{a as u,e as T}from"./chunk-VRSUCKJA.mjs";import{d as P}from"./chunk-56CNRT2K.mjs";import{g as l}from"./chunk-3T4NSGK5.mjs";import{n as x,w as S,x as w,y as b}from"./chunk-BQSE5HHW.mjs";var y={BOOLEAN:"bool",U8:"u8",U16:"u16",U32:"u32",U64:"u64",U128:"u128",U256:"u256",ADDRESS:"address",STRING:"0x1::string::String",ARRAY:"vector<u8>"},d="0x4::token::Token";async function E(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:g.from(n).toStringLong()}};return(await l({aptosConfig:o,query:{query:b,variables:{where_condition:e}},originMethod:"getDigitalAssetData"})).current_token_datas_v2[0]}async function z(t){let{aptosConfig:o,digitalAssetAddress:n}=t,e={token_data_id:{_eq:g.from(n).toStringLong()}};return(await l({aptosConfig:o,query:{query:w,variables:{where_condition:e}},originMethod:"getCurrentDigitalAssetOwnership"})).current_token_ownerships_v2[0]}async function L(t){let{aptosConfig:o,ownerAddress:n,options:e}=t,r={owner_address:{_eq:g.from(n).toStringLong()},amount:{_gt:0}},s={query:w,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await l({aptosConfig:o,query:s,originMethod:"getOwnedDigitalAssets"})).current_token_ownerships_v2}async function F(t){let{aptosConfig:o,digitalAssetAddress:n,options:e}=t,r={token_data_id:{_eq:g.from(n).toStringLong()}},s={query:S,variables:{where_condition:r,offset:e?.offset,limit:e?.limit,order_by:e?.orderBy}};return(await l({aptosConfig:o,query:s,originMethod:"getDigitalAssetActivity"})).token_activities_v2}async function j(t){let{aptosConfig:o,options:n,creator:e}=t;return await p({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new C(t.description),new T(t.maxSupply??P),new C(t.name),new C(t.uri),new u(t.mutableDescription??!0),new u(t.mutableRoyalty??!0),new u(t.mutableURI??!0),new u(t.mutableTokenDescription??!0),new u(t.mutableTokenName??!0),new u(t.mutableTokenProperties??!0),new u(t.mutableTokenURI??!0),new u(t.tokensBurnableByCreator??!0),new u(t.tokensFreezableByCreator??!0),new T(t.royaltyNumerator??0),new T(t.royaltyDenominator??1)]},options:n})}async function O(t){let{aptosConfig:o,creatorAddress:n,collectionName:e,options:r}=t,s=g.from(n),i={collection_name:{_eq:e},creator_address:{_eq:s.toStringLong()}};return r?.tokenStandard&&(i.token_standard={_eq:r?.tokenStandard??"v2"}),(await l({aptosConfig:o,query:{query:x,variables:{where_condition:i}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function X(t){return(await O(t)).collection_id}async function Y(t){let{aptosConfig:o,options:n,creator:e,collection:r,description:s,name:i,uri:a,propertyKeys:c,propertyTypes:A,propertyValues:f}=t,m=A?.map(I=>y[I]);return await p({aptosConfig:o,sender:e.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[r,s,i,a,c??[],m??[],D(f??[],m??[])]},options:n})}async function H(t){let{aptosConfig:o,sender:n,digitalAssetAddress:e,recipient:r,digitalAssetType:s,options:i}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x1::object::transfer",typeArguments:[s??d],functionArguments:[e,r]},options:i})}async function J(t){let{aptosConfig:o,account:n,collection:e,description:r,name:s,uri:i,recipient:a,propertyKeys:c,propertyTypes:A,propertyValues:f,options:m}=t;if(c?.length!==f?.length)throw new Error("Property keys and property values counts do not match");if(A?.length!==f?.length)throw new Error("Property types and property values counts do not match");let _=A?.map(G=>y[G]);return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint_soul_bound",functionArguments:[e,r,s,i,c??[],_??[],D(f??[],_??[]),a]},options:m})}async function W(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::burn",typeArguments:[r??d],functionArguments:[e]},options:s})}async function Z(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::freeze_transfer",typeArguments:[r??d],functionArguments:[e]},options:s})}async function $(t){let{aptosConfig:o,creator:n,digitalAssetAddress:e,digitalAssetType:r,options:s}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::unfreeze_transfer",typeArguments:[r??d],functionArguments:[e]},options:s})}async function tt(t){let{aptosConfig:o,creator:n,description:e,digitalAssetAddress:r,digitalAssetType:s,options:i}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_description",typeArguments:[s??d],functionArguments:[r,e]},options:i})}async function et(t){let{aptosConfig:o,creator:n,name:e,digitalAssetAddress:r,digitalAssetType:s,options:i}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_name",typeArguments:[s??d],functionArguments:[r,e]},options:i})}async function nt(t){let{aptosConfig:o,creator:n,uri:e,digitalAssetAddress:r,digitalAssetType:s,options:i}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::set_uri",typeArguments:[s??d],functionArguments:[r,e]},options:i})}async function ot(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:i,digitalAssetType:a,options:c}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_property",typeArguments:[a??d],functionArguments:[i,e,y[r],k(s,y[r])]},options:c})}async function rt(t){let{aptosConfig:o,creator:n,propertyKey:e,digitalAssetAddress:r,digitalAssetType:s,options:i}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::remove_property",typeArguments:[s??d],functionArguments:[r,e]},options:i})}async function st(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:i,digitalAssetType:a,options:c}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_property",typeArguments:[a??d],functionArguments:[i,e,y[r],k(s,y[r])]},options:c})}async function it(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:i,digitalAssetType:a,options:c}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::add_typed_property",typeArguments:[a??d,y[r]],functionArguments:[i,e,s]},options:c})}async function at(t){let{aptosConfig:o,creator:n,propertyKey:e,propertyType:r,propertyValue:s,digitalAssetAddress:i,digitalAssetType:a,options:c}=t;return await p({aptosConfig:o,sender:n.accountAddress,data:{function:"0x4::aptos_token::update_typed_property",typeArguments:[a??d,y[r]],functionArguments:[i,e,s]},options:c})}function D(t,o){let n=new Array;return o.forEach((e,r)=>{n.push(k(t[r],e))}),n}function k(t,o){let n=h(o);return v(t,n,0,[]).bcsToBytes()}export{E as a,z as b,L as c,F as d,j as e,O as f,X as g,Y as h,H as i,J as j,W as k,Z as l,$ as m,tt as n,et as o,nt as p,ot as q,rt as r,st as s,it as t,at as u};
|
|
2
|
+
//# sourceMappingURL=chunk-C53MNMPH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as t,c as n,d as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i,b as t,c as n,d as o}from"./chunk-FHUT4EJH.mjs";import{a as s}from"./chunk-IK7JAKXG.mjs";var r=class{constructor(e){this.config=e}async getFungibleAssetMetadata(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),i({aptosConfig:this.config,...e})}async getFungibleAssetMetadataByAssetType(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),(await i({aptosConfig:this.config,options:{where:{asset_type:{_eq:e.assetType}}}}))[0]}async getFungibleAssetActivities(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),t({aptosConfig:this.config,...e})}async getCurrentFungibleAssetBalances(e){return await s({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"fungible_asset_processor"}),n({aptosConfig:this.config,...e})}async transferFungibleAsset(e){return o({aptosConfig:this.config,...e})}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CFQDJZBD.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-F7CR75CJ.mjs";import{f as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-F7CR75CJ.mjs";import{f as e}from"./chunk-VP5JCW6I.mjs";import{d as r}from"./chunk-25YXK6L2.mjs";import{e as s}from"./chunk-HHJBCGAQ.mjs";async function x(a){let{aptosConfig:t,accountAddress:i,amount:p,options:n}=a,u=n?.timeoutSecs||s,{data:d}=await r({aptosConfig:t,path:"fund",body:{address:c.from(i).toString(),amount:p},originMethod:"fundAccount"}),m=d.txn_hashes[0],o=await e({aptosConfig:t,transactionHash:m,options:{timeoutSecs:u,checkSuccess:n?.checkSuccess}});if(o.type==="user_transaction")return o;throw new Error(`Unexpected transaction received for fund account: ${o.type}`)}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DHFOORW6.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-2RN7N3EO.mjs";var o=class{constructor(n){this.config=n}async simple(n){return t({aptosConfig:this.config,...n})}async multiAgent(n){return t({aptosConfig:this.config,...n})}};export{o as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DIWRS4YQ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-ATHZ7INX.mjs";var t=class{constructor(n){this.config=n}async transferCoinTransaction(n){return o({aptosConfig:this.config,...n})}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DSGIOUTJ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as i,c as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r,b as i,c as s}from"./chunk-HT6K4NWZ.mjs";import{a as o}from"./chunk-IK7JAKXG.mjs";var t=class{constructor(e){this.config=e}async getNumberOfDelegators(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),r({aptosConfig:this.config,...e})}async getNumberOfDelegatorsForAllPools(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),i({aptosConfig:this.config,...e})}async getDelegatedStakingActivities(e){return await o({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"stake_processor"}),s({aptosConfig:this.config,...e})}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ED2OMOMT.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-2RN7N3EO.mjs";import{b as w}from"./chunk-F7CR75CJ.mjs";import{e as A,g}from"./chunk-3T4NSGK5.mjs";import{t as f}from"./chunk-BQSE5HHW.mjs";var E=["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 D(e){return!(!e||e.length<3||e.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(e))}function c(e){let[n,t,...o]=e.replace(/\.apt$/,"").split(".");if(o.length>0)throw new Error(`${e} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!D(n))throw new Error(`${n} is not valid. ${E}`);if(t&&!D(t))throw new Error(`${t} is not valid. ${E}`);return{domainName:t||n,subdomainName:t?n:void 0}}var Y="0x37368b46ce665362562c6d1d4ec01a08c8644c488690df5a17e13ba163e20221",G="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",O={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:G,custom:null,devnet:null};function d(e){let n=O[e.network];if(!n)throw new Error(`The ANS contract is not deployed to ${e.network}`);return n}var P=e=>({vec:[e]}),I=()=>({vec:[]}),S=e=>e!=null?P(e):I(),b=e=>{if(e&&typeof e=="object"&&"vec"in e&&Array.isArray(e.vec))return e.vec[0]};async function K(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await A({aptosConfig:n,payload:{function:`${o}::router::get_owner_addr`,functionArguments:[r,S(s)]}}),a=b(i[0]);return a?w.from(a).toString():void 0}async function W(e){let{aptosConfig:n,expiration:t,name:o,sender:r,targetAddress:s,toAddress:i,options:a,transferable:m}=e,p=d(n),{domainName:l,subdomainName:N}=c(o),x=t.policy==="subdomain:independent"||t.policy==="subdomain:follow-domain";if(N&&!x)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(x&&!N)throw new Error(`Policy is set to ${t.policy} but no subdomain was provided`);if(t.policy==="domain"){let T=t.years??1;if(T!==1)throw new Error("For now, names can only be registered for 1 year at a time");let v=T*31536e3;return await u({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_domain`,functionArguments:[l,v,s,i]},options:a})}if(!N)throw new Error(`${t.policy} requires a subdomain to be provided.`);let _=await q({aptosConfig:n,name:l});if(!_)throw new Error("The domain does not exist");let h=t.policy==="subdomain:independent"?t.expirationDate:_;if(h>_)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await u({aptosConfig:n,sender:r.accountAddress.toString(),data:{function:`${p}::router::register_subdomain`,functionArguments:[l,N,Math.round(h/1e3),t.policy==="subdomain:follow-domain"?1:0,!!m,s,i]},options:a})}async function q(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t);try{let i=await A({aptosConfig:n,payload:{function:`${o}::router::get_expiration`,functionArguments:[r,S(s)]}});return Number(i[0])*1e3}catch{return}}async function F(e){let{aptosConfig:n,address:t}=e,o=d(n),r=await A({aptosConfig:n,payload:{function:`${o}::router::get_primary_name`,functionArguments:[w.from(t).toString()]}}),s=b(r[1]),i=b(r[0]);if(s)return[i,s].filter(Boolean).join(".")}async function H(e){let{aptosConfig:n,sender:t,name:o,options:r}=e,s=d(n);if(!o)return await u({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:r});let{domainName:i,subdomainName:a}=c(o);return await u({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[i,a]},options:r})}async function J(e){let{aptosConfig:n,name:t}=e,o=d(n),{domainName:r,subdomainName:s}=c(t),i=await A({aptosConfig:n,payload:{function:`${o}::router::get_target_addr`,functionArguments:[r,S(s)]}}),a=b(i[0]);return a?w.from(a).toString():void 0}async function X(e){let{aptosConfig:n,sender:t,name:o,address:r,options:s}=e,i=d(n),{domainName:a,subdomainName:m}=c(o);return await u({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::set_target_addr`,functionArguments:[a,m,r]},options:s})}async function Z(e){let{aptosConfig:n,name:t}=e,{domainName:o,subdomainName:r=""}=c(t),a=(await g({aptosConfig:n,query:{query:f,variables:{where_condition:{domain:{_eq:o},subdomain:{_eq:r}},limit:1}},originMethod:"getName"})).current_aptos_names[0];return a&&(a=y(a)),a}async function ee(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await g({aptosConfig:n,originMethod:"getAccountNames",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r}}}}})).current_aptos_names.map(y)}async function ne(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await g({aptosConfig:n,originMethod:"getAccountDomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_eq:""}}}}})).current_aptos_names.map(y)}async function te(e){let{aptosConfig:n,options:t,accountAddress:o}=e,r=await C({aptosConfig:n});return(await g({aptosConfig:n,originMethod:"getAccountSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},owner_address:{_eq:o.toString()},expiration_timestamp:{_gte:r},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function oe(e){let{aptosConfig:n,options:t,domain:o}=e;return(await g({aptosConfig:n,originMethod:"getDomainSubdomains",query:{query:f,variables:{limit:t?.limit,offset:t?.offset,order_by:t?.orderBy,where_condition:{...e.options?.where??{},domain:{_eq:o},subdomain:{_neq:""}}}}})).current_aptos_names.map(y)}async function C(e){let{aptosConfig:n}=e,t=d(n),[o]=await A({aptosConfig:n,payload:{function:`${t}::config::reregistration_grace_sec`,functionArguments:[]}}),r=o/60/60/24,s=()=>new Date;return new Date(s().setDate(s().getDate()-r)).toISOString()}async function re(e){let{aptosConfig:n,sender:t,name:o,years:r=1,options:s}=e,i=d(n),a=r*31536e3,{domainName:m,subdomainName:p}=c(o);if(p)throw new Error("Subdomains cannot be renewed");if(r!==1)throw new Error("Currently, only 1 year renewals are supported");return await u({aptosConfig:n,sender:t.accountAddress.toString(),data:{function:`${i}::router::renew_domain`,functionArguments:[m,a]},options:s})}function y(e){return{...e,expiration_timestamp:new Date(e.expiration_timestamp).valueOf()}}export{E as a,D as b,c,Y as d,G as e,K as f,W as g,q as h,F as i,H as j,J as k,X as l,Z as m,ee as n,ne as o,te as p,oe as q,re as r};
|
|
2
|
+
//# sourceMappingURL=chunk-FE2DRPX7.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-APOQ4ODM.mjs";import{a as p,b as g}from"./chunk-7IGH7N52.mjs";import{a as A}from"./chunk-J46VAO6L.mjs";import{a as h}from"./chunk-P7B32QR3.mjs";import{a as d,c as b}from"./chunk-ZFIMVSCR.mjs";import{a as y}from"./chunk-N4RBQZ2B.mjs";var n=class extends y{static deserialize(t){let i=t.deserializeUleb128AsU32();switch(i){case 0:return a.load(t);case 1:return u.load(t);case 2:return l.load(t);case 3:return c.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${i}`)}}isEd25519(){return this instanceof a}isMultiEd25519(){return this instanceof u}isSingleKey(){return this instanceof l}isMultiKey(){return this instanceof c}},a=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(0),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=d.deserialize(i),r=b.deserialize(i);return new s(e,r)}},u=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(1),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=p.deserialize(i),r=g.deserialize(i);return new s(e,r)}},l=class s extends n{constructor(i,e){super();this.public_key=i,this.signature=e}serialize(i){i.serializeU32AsUleb128(2),this.public_key.serialize(i),this.signature.serialize(i)}static load(i){let e=h.deserialize(i),r=o.deserialize(i);return new s(e,r)}},c=class s extends n{constructor(i,e,r){super();this.public_keys=i,this.signatures=e,this.signatures_bitmap=r}serialize(i){i.serializeU32AsUleb128(3),this.public_keys.serialize(i),i.serializeVector(this.signatures),i.serializeBytes(this.signatures_bitmap)}static load(i){let e=A.deserialize(i),r=i.deserializeVector(o),z=i.deserializeBytes();return new s(e,r,z)}};export{n as a,a as b,u as c,l as d,c as e};
|
|
2
|
+
//# sourceMappingURL=chunk-FGHNLZRH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-2RN7N3EO.mjs";import{g as o}from"./chunk-3T4NSGK5.mjs";import{o as a,r,s as u}from"./chunk-BQSE5HHW.mjs";async function b(t){let{aptosConfig:s,options:e}=t,n={query:u,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function m(t){let{aptosConfig:s,options:e}=t,n={query:r,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function F(t){let{aptosConfig:s,options:e}=t,n={query:a,variables:{where_condition:e?.where,limit:e?.limit,offset:e?.offset}};return(await o({aptosConfig:s,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}async function y(t){let{aptosConfig:s,sender:e,fungibleAssetMetadataAddress:n,recipient:i,amount:A,options:c}=t;return await g({aptosConfig:s,sender:e.accountAddress,data:{function:"0x1::primary_fungible_store::transfer",typeArguments:["0x1::fungible_asset::Metadata"],functionArguments:[n,i,A]},options:c})}export{b as a,m as b,F as c,y as d};
|
|
2
|
+
//# sourceMappingURL=chunk-FHUT4EJH.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from"./chunk-F7CR75CJ.mjs";import{g as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from"./chunk-F7CR75CJ.mjs";import{g as n}from"./chunk-3T4NSGK5.mjs";import{p as g,u as d}from"./chunk-BQSE5HHW.mjs";async function m(e){let{aptosConfig:t,poolAddress:o}=e,r=s.from(o).toStringLong(),i=await n({aptosConfig:t,query:{query:d,variables:{where_condition:{pool_address:{_eq:r}}}}});return i.num_active_delegator_per_pool[0]?i.num_active_delegator_per_pool[0].num_active_delegator:0}async function f(e){let{aptosConfig:t,options:o}=e,r={query:d,variables:{order_by:o?.orderBy}};return(await n({aptosConfig:t,query:r})).num_active_delegator_per_pool}async function A(e){let{aptosConfig:t,delegatorAddress:o,poolAddress:r}=e,a={query:g,variables:{delegatorAddress:s.from(o).toStringLong(),poolAddress:s.from(r).toStringLong()}};return(await n({aptosConfig:t,query:a})).delegated_staking_activities}export{m as a,f as b,A as c};
|
|
2
|
+
//# sourceMappingURL=chunk-HT6K4NWZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-6EMN3BOV.mjs";import{g as a}from"./chunk-2RN7N3EO.mjs";import{a as o}from"./chunk-FVA2OPG4.mjs";var n=class{constructor(t){this.config=t}async simple(t){return a({aptosConfig:this.config,...t})}async multiAgent(t){return a({aptosConfig:this.config,...t})}};o([i],n.prototype,"simple",1),o([i],n.prototype,"multiAgent",1);export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-HV4ZPHSZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{g as e}from"./chunk-VP5JCW6I.mjs";async function i(o){o.minimumLedgerVersion!==void 0&&await e({aptosConfig:o.config,minimumLedgerVersion:o.minimumLedgerVersion,processorType:o.processorType})}export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IK7JAKXG.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o}from"./chunk-P7B32QR3.mjs";import{a as y}from"./chunk-V6JFR2CB.mjs";import{b as l}from"./chunk-NL72WE3E.mjs";var p=class h extends y{constructor(e){super();let{publicKeys:t,signaturesRequired:r}=e;if(r<1)throw new Error("The number of required signatures needs to be greater then 0");if(t.length<r)throw new Error(`Provided ${t.length} public keys is smaller than the ${r} required signatures`);let i=[];t.forEach(s=>{s instanceof o?i.push(s):i.push(new o(s))}),this.publicKeys=i,this.signaturesRequired=r}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:t}=e,r=128,i=new Uint8Array([0,0,0,0]),s=new Set;return t.forEach((n,u)=>{if(u+1>this.publicKeys.length)throw new Error(`Signature index ${u+1} is out of public keys range, ${this.publicKeys.length}.`);if(s.has(n))throw new Error(`Duplicate bit ${n} detected.`);s.add(n);let a=Math.floor(n/8),c=i[a];c|=r>>n%8,i[a]=c}),i}toString(){return l.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 t=e.deserializeVector(o),r=e.deserializeU8();return new h({publicKeys:t,signaturesRequired:r})}};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-J46VAO6L.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as n,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as n,g as s,h as t,i as o,j as r,k as i,l as a,m,n as c,o as g,p as u,q as p,r as d}from"./chunk-FE2DRPX7.mjs";var A=class{constructor(e){this.config=e}async getOwnerAddress(e){return n({aptosConfig:this.config,...e})}async getExpiration(e){return t({aptosConfig:this.config,...e})}async getTargetAddress(e){return i({aptosConfig:this.config,...e})}async setTargetAddress(e){return a({aptosConfig:this.config,...e})}async getPrimaryName(e){return o({aptosConfig:this.config,...e})}async setPrimaryName(e){return r({aptosConfig:this.config,...e})}async registerName(e){return s({aptosConfig:this.config,...e})}async renewDomain(e){return d({aptosConfig:this.config,...e})}async getName(e){return m({aptosConfig:this.config,...e})}async getAccountNames(e){return c({aptosConfig:this.config,...e})}async getAccountDomains(e){return g({aptosConfig:this.config,...e})}async getAccountSubdomains(e){return u({aptosConfig:this.config,...e})}async getDomainSubdomains(e){return p({aptosConfig:this.config,...e})}};export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-J4CN3Q2R.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as s,c as t,d as r,e as n,f as i,g as a,i as g,j as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as s,c as t,d as r,e as n,f as i,g as a,i as g,j as c}from"./chunk-3T4NSGK5.mjs";var u=class{constructor(e){this.config=e}async getLedgerInfo(){return o({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(e){return s({aptosConfig:this.config,...e})}async getBlockByHeight(e){return t({aptosConfig:this.config,...e})}async getTableItem(e){return r({aptosConfig:this.config,...e})}async view(e){return n({aptosConfig:this.config,...e})}async getChainTopUserTransactions(e){return i({aptosConfig:this.config,...e})}async queryIndexer(e){return a({aptosConfig:this.config,...e})}async getIndexerLastSuccessVersion(){return g({aptosConfig:this.config})}async getProcessorStatus(e){return c({aptosConfig:this.config,processorType:e})}};export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JBWJE4IP.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as V,b as Y,c as Z}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as V,b as Y,c as Z}from"./chunk-ZDT4TIOP.mjs";import{q as F,t as M}from"./chunk-PPNI7SJK.mjs";import{a as u}from"./chunk-TRTTUBC4.mjs";import{a as l,c as g,d as m}from"./chunk-ACMNL2LL.mjs";import{c as L,d as H,e as X,f as z,g as j,h as J,i as Q}from"./chunk-K6IBDLVC.mjs";import{a as q}from"./chunk-QKTV6AZ7.mjs";import{b as E,d as _,e as R,f as B}from"./chunk-4QWK47EH.mjs";import{b as f,d as y,e as O}from"./chunk-FGHNLZRH.mjs";import{a as k}from"./chunk-4TGKQEEE.mjs";import{a as h}from"./chunk-APOQ4ODM.mjs";import{a as x}from"./chunk-P7B32QR3.mjs";import{a as C,c as N}from"./chunk-I7WRJY7K.mjs";import{a as w,c as T}from"./chunk-ZFIMVSCR.mjs";import{b as A}from"./chunk-F7CR75CJ.mjs";import{b as v}from"./chunk-VP5JCW6I.mjs";import{a as K}from"./chunk-AH44UPM4.mjs";import{b as $}from"./chunk-NL72WE3E.mjs";import{a as W}from"./chunk-3T4NSGK5.mjs";import{c as D,d as U,g as G,h as b}from"./chunk-HHJBCGAQ.mjs";import{e as I}from"./chunk-LV33NV4J.mjs";import{sha3_256 as an}from"@noble/hashes/sha3";async function Un(n){if(F(n))return nn(n);let{moduleAddress:e,moduleName:t,functionName:o}=M(n.function),r=await K(async()=>Y(e,t,o,n.aptosConfig),`entry-function-${n.aptosConfig.network}-${e}-${t}-${o}`,1e3*60*5)();return on(n,r)}function on(n,e){if(F(n))return nn(n);let{moduleAddress:t,moduleName:o,functionName:r}=M(n.function),a=V(n.typeArguments);if(a.length!==e.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${e.typeParameters.length}, received ${a.length}`);let i=n.functionArguments.map((s,d)=>Z(n.function,e,s,d,a));if(i.length!==e.parameters.length)throw new Error(`Too few arguments for '${t}::${o}::${r}', expected ${e.parameters.length} but got ${i.length}`);let c=z.build(`${t}::${o}`,r,a,i);if("multisigAddress"in n){let s=A.from(n.multisigAddress);return new X(new J(s,new Q(c)))}return new H(c)}function nn(n){return new L(new j($.fromHexInput(n.bytecode).toUint8Array(),n.typeArguments??[],n.functionArguments))}async function sn(n){let{aptosConfig:e,sender:t,payload:o,options:r}=n,a=r?.accountSequenceNumber!==void 0?Promise.resolve({sequence_number:r.accountSequenceNumber}):k({aptosConfig:e,accountAddress:t}),i=I[e.network]?Promise.resolve({chain_id:I[e.network]}):W({aptosConfig:e}),c=r?.gasUnitPrice?Promise.resolve({gas_estimate:r.gasUnitPrice}):v({aptosConfig:e}),[{sequence_number:s},{chain_id:d},{gas_estimate:p}]=await Promise.all([a,i,c]),{maxGasAmount:S,gasUnitPrice:en,expireTimestamp:rn}={maxGasAmount:r?.maxGasAmount?BigInt(r.maxGasAmount):BigInt(D),gasUnitPrice:BigInt(p),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+U),...r};return new l(A.from(t),BigInt(s),o,BigInt(S),BigInt(en),BigInt(rn),new q(d))}async function Gn(n){let{aptosConfig:e,sender:t,payload:o,options:r}=n,a=await sn({aptosConfig:e,sender:t,payload:o,options:r});if("secondarySignerAddresses"in n){let i=n.secondarySignerAddresses?.map(c=>A.from(c))??[];return{rawTransaction:a,secondarySignerAddresses:i,feePayerAddress:n.feePayerAddress?A.from(n.feePayerAddress):void 0}}return{rawTransaction:a,feePayerAddress:n.feePayerAddress?A.from(n.feePayerAddress):void 0}}function $n(n){let{signerPublicKey:e,transaction:t,secondarySignersPublicKeys:o,feePayerPublicKey:r}=n,a=P(e);if(t.feePayerAddress){let c=new m(t.rawTransaction,t.secondarySignerAddresses??[],t.feePayerAddress),s=[];o&&(s=o.map(S=>P(S)));let d=P(r),p=new R(a,t.secondarySignerAddresses??[],s,{address:t.feePayerAddress,authenticator:d});return new u(c.raw_txn,p).bcsToBytes()}if(t.secondarySignerAddresses){let c=new g(t.rawTransaction,t.secondarySignerAddresses),s=[];s=o.map(p=>P(p));let d=new _(a,t.secondarySignerAddresses,s);return new u(c.raw_txn,d).bcsToBytes()}let i;if(a instanceof f)i=new E(a.public_key,a.signature);else if(a instanceof y)i=new B(a);else throw new Error("Invalid public key");return new u(t.rawTransaction,i).bcsToBytes()}function P(n){if(n instanceof x){if(n.publicKey instanceof w)return new y(n,new h(new T(new Uint8Array(64))));if(n.publicKey instanceof C)return new y(n,new h(new N(new Uint8Array(64))))}return new f(new w(n.toUint8Array()),new T(new Uint8Array(64)))}function Cn(n){let{signer:e,transaction:t}=n,o=un(t),r=e.sign(o);switch(e.signingScheme){case 0:return new f(new w(e.publicKey.toUint8Array()),new T(r.toUint8Array()));case 2:if(!x.isPublicKey(e.publicKey))throw new Error(`Cannot sign transaction, public key does not match ${e.signingScheme}`);return new y(e.publicKey,new h(r));default:throw new Error(`Cannot sign transaction, signing scheme ${e.signingScheme} not supported`)}}function Nn(n){let{transaction:e,senderAuthenticator:t,feePayerAuthenticator:o,additionalSignersAuthenticators:r}=n,a=tn(e);if((o||r)&&(a instanceof g||a instanceof m))return cn(a,t,o,r);if(t instanceof f&&a instanceof l){let i=new E(t.public_key,t.signature);return new u(a,i).bcsToBytes()}if((t instanceof y||t instanceof O)&&a instanceof l){let i=new B(t);return new u(a,i).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${t} is not a supported account authentication scheme`)}function tn(n){return n.feePayerAddress?new m(n.rawTransaction,n.secondarySignerAddresses??[],n.feePayerAddress):n.secondarySignerAddresses?new g(n.rawTransaction,n.secondarySignerAddresses):n.rawTransaction}function cn(n,e,t,o){if(n instanceof m){if(!t)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let r=new R(e,n.secondary_signer_addresses,o??[],{address:n.fee_payer_address,authenticator:t});return new u(n.raw_txn,r).bcsToBytes()}if(n instanceof g){if(!o)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let r=new _(e,n.secondary_signer_addresses,o??[]);return new u(n.raw_txn,r).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof n} transaction is not supported`)}function un(n){let e=tn(n),t=an.create();if(e instanceof l)t.update(G);else if(e instanceof g)t.update(b);else if(e instanceof m)t.update(b);else throw new Error(`Unknown transaction type to sign on: ${e}`);let o=t.digest(),r=e.bcsToBytes(),a=new Uint8Array(o.length+r.length);return a.set(o),a.set(r,o.length),a}export{Un as a,on as b,sn as c,Gn as d,$n as e,P as f,Cn as g,Nn as h,tn as i,cn as j,un as k};
|
|
2
|
+
//# sourceMappingURL=chunk-JMV2QDNW.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as r,c as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as r,c as t}from"./chunk-BQYQ45QQ.mjs";import{a as n}from"./chunk-IK7JAKXG.mjs";var s=class{constructor(e){this.config=e}async getAccountEventsByCreationNumber(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),o({aptosConfig:this.config,...e})}async getAccountEventsByEventType(e){return await n({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"events_processor"}),r({aptosConfig:this.config,...e})}async getEvents(e){return await n({config:this.config,minimumLedgerVersion:e?.minimumLedgerVersion,processorType:"events_processor"}),t({aptosConfig:this.config,...e})}};export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JRQMEVDE.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-HI6QP2FB.mjs";import{a as g}from"./chunk-7D5LHQNS.mjs";import{a as p}from"./chunk-IHCIKE42.mjs";import{b as d}from"./chunk-F7CR75CJ.mjs";import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-HI6QP2FB.mjs";import{a as g}from"./chunk-7D5LHQNS.mjs";import{a as p}from"./chunk-IHCIKE42.mjs";import{b as d}from"./chunk-F7CR75CJ.mjs";import{a as v}from"./chunk-F7MOQC7Z.mjs";import{a as F,b as y,c as T,d as x,e as E,f as _,g as w}from"./chunk-VRSUCKJA.mjs";import{a as S}from"./chunk-PPTG6BDV.mjs";import{a as u}from"./chunk-N4RBQZ2B.mjs";function D(r){let e=r.deserializeUleb128AsU32();switch(e){case 0:return y.deserialize(r);case 1:return E.deserialize(r);case 2:return _.deserialize(r);case 3:return d.deserialize(r);case 4:return v.deserialize(r,y);case 5:return F.deserialize(r);case 6:return T.deserialize(r);case 7:return x.deserialize(r);case 8:return w.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${e}`)}}var a=class extends u{static deserialize(e){let t=e.deserializeUleb128AsU32();switch(t){case 0:return A.load(e);case 2:return z.load(e);case 3:return h.load(e);default:throw new Error(`Unknown variant index for TransactionPayload: ${t}`)}}},A=class r extends a{constructor(t){super();this.script=t}serialize(t){t.serializeU32AsUleb128(0),this.script.serialize(t)}static load(t){let i=U.deserialize(t);return new r(i)}},z=class r extends a{constructor(t){super();this.entryFunction=t}serialize(t){t.serializeU32AsUleb128(2),this.entryFunction.serialize(t)}static load(t){let i=l.deserialize(t);return new r(i)}},h=class r extends a{constructor(t){super();this.multiSig=t}serialize(t){t.serializeU32AsUleb128(3),this.multiSig.serialize(t)}static load(t){let i=f.deserialize(t);return new r(i)}},l=class r{constructor(e,t,i,n){this.module_name=e,this.function_name=t,this.type_args=i,this.args=n}static build(e,t,i,n){return new r(g.fromStr(e),new p(t),i,n)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForEntryFunction(e)})}static deserialize(e){let t=g.deserialize(e),i=p.deserialize(e),n=e.deserializeVector(m),o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let M=e.deserializeUleb128AsU32(),B=S.deserialize(e,M);s.push(B)}return new r(t,i,n,s)}},U=class r{constructor(e,t,i){this.bytecode=e,this.type_args=t,this.args=i}serialize(e){e.serializeBytes(this.bytecode),e.serializeVector(this.type_args),e.serializeU32AsUleb128(this.args.length),this.args.forEach(t=>{t.serializeForScriptFunction(e)})}static deserialize(e){let t=e.deserializeBytes(),i=e.deserializeVector(m),n=e.deserializeUleb128AsU32(),o=new Array;for(let s=0;s<n;s+=1){let c=D(e);o.push(c)}return new r(t,i,o)}},f=class r{constructor(e,t){this.multisig_address=e,this.transaction_payload=t}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){let t=d.deserialize(e),i=e.deserializeBool(),n;return i&&(n=b.deserialize(e)),new r(t,n)}},b=class r extends u{constructor(t){super();this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(l.deserialize(t))}};export{D as a,a as b,A as c,z as d,h as e,l as f,U as g,f as h,b as i};
|
|
2
|
+
//# sourceMappingURL=chunk-K6IBDLVC.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as d}from"./chunk-6FBKUTGF.mjs";import{a as R}from"./chunk-X3SXV2RB.mjs";var p={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 c(o,a){let{url:r,method:i,body:u,contentType:s,params:e,overrides:t}=o,n={...t?.HEADERS,"x-aptos-client":`aptos-typescript-sdk/${R}`,"content-type":s??"application/json"};return t?.AUTH_TOKEN&&r.includes("faucet")&&(n.Authorization=`Bearer ${t?.AUTH_TOKEN}`),t?.API_KEY&&!r.includes("faucet")&&(n.Authorization=`Bearer ${t?.API_KEY}`),a.provider({url:r,method:i,body:u,params:e,headers:n,overrides:t})}async function T(o,a){let{url:r,path:i}=o,u=i?`${r}/${i}`:r,s=await c({...o,url:u},a.client),e={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:u};if(a.isIndexerRequest(r)){let n=e.data;if(n.errors)throw new d(o,e,n.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);e.data=n.data}if(e.status>=200&&e.status<300)return e;let t;throw e&&e.data&&"message"in e.data&&"error_code"in e.data?t=JSON.stringify(e.data):e.status in p?t=p[e.status]:t=`Unhandled Error ${e.status} : ${e.statusText}`,new d(o,e,t)}export{c as a,T as b};
|
|
2
|
+
//# sourceMappingURL=chunk-LFWMWCS3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/client/core.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"../api/aptosConfig\";\nimport { AptosApiError, AptosResponse } from \"./types\";\nimport { VERSION } from \"../version\";\nimport { AptosRequest, MimeType, ClientRequest, ClientResponse, Client, AnyNumber } from \"../types\";\n\n/**\n * Meaningful errors map\n */\nconst errors: Record<number, string> = {\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 429: \"Too Many Requests\",\n 500: \"Internal Server Error\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n};\n\n/**\n * Given a url and method, sends the request with axios and\n * returns the response.\n */\nexport async function request<Req, Res>(options: ClientRequest<Req>, client: Client): Promise<ClientResponse<Res>> {\n const { url, method, body, contentType, params, overrides } = options;\n const headers: Record<string, string | AnyNumber | boolean | undefined> = {\n ...overrides?.HEADERS,\n \"x-aptos-client\": `aptos-typescript-sdk/${VERSION}`,\n \"content-type\": contentType ?? MimeType.JSON,\n };\n\n // TODO - auth token is being used only for faucet, it breaks full node requests.\n // Find a more sophisticated way than that but without the need to add the\n // auth_token on every `aptos.fundAccount()` call\n if (overrides?.AUTH_TOKEN && url.includes(\"faucet\")) {\n headers.Authorization = `Bearer ${overrides?.AUTH_TOKEN}`;\n }\n if (overrides?.API_KEY && !url.includes(\"faucet\")) {\n headers.Authorization = `Bearer ${overrides?.API_KEY}`;\n }\n\n /*\n * make a call using the @aptos-labs/aptos-client package\n * {@link https://www.npmjs.com/package/@aptos-labs/aptos-client}\n */\n return client.provider<Req, Res>({\n url,\n method,\n body,\n params,\n headers,\n overrides,\n });\n}\n\n/**\n * The main function to use when doing an API request.\n *\n * @param options AptosRequest\n * @param aptosConfig The config information for the SDK client instance\n * @returns the response or AptosApiError\n */\nexport async function aptosRequest<Req extends {}, Res extends {}>(\n options: AptosRequest,\n aptosConfig: AptosConfig,\n): Promise<AptosResponse<Req, Res>> {\n const { url, path } = options;\n const fullUrl = path ? `${url}/${path}` : url;\n const response = await request<Req, Res>({ ...options, url: fullUrl }, aptosConfig.client);\n\n const result: AptosResponse<Req, Res> = {\n status: response.status,\n statusText: response.statusText!,\n data: response.data,\n headers: response.headers,\n config: response.config,\n request: response.request,\n url: fullUrl,\n };\n\n // to support both fullnode and indexer responses,\n // check if it is an indexer query, and adjust response.data\n if (aptosConfig.isIndexerRequest(url)) {\n const indexerResponse = result.data as any;\n // errors from indexer\n if (indexerResponse.errors) {\n throw new AptosApiError(\n options,\n result,\n indexerResponse.errors[0].message ?? `Unhandled Error ${response.status} : ${response.statusText}`,\n );\n }\n result.data = indexerResponse.data as Res;\n }\n\n if (result.status >= 200 && result.status < 300) {\n return result;\n }\n\n let errorMessage: string;\n\n if (result && result.data && \"message\" in result.data && \"error_code\" in result.data) {\n errorMessage = JSON.stringify(result.data);\n } else if (result.status in errors) {\n // If it's not an API type, it must come form infra, these are prehandled\n errorMessage = errors[result.status];\n } else {\n // Everything else is unhandled\n errorMessage = `Unhandled Error ${result.status} : ${result.statusText}`;\n }\n\n throw new AptosApiError(options, result, errorMessage);\n}\n"],"mappings":"kFAWA,IAAMA,EAAiC,CACrC,IAAK,cACL,IAAK,eACL,IAAK,YACL,IAAK,YACL,IAAK,oBACL,IAAK,wBACL,IAAK,cACL,IAAK,qBACP,EAMA,eAAsBC,EAAkBC,EAA6BC,EAA8C,CACjH,GAAM,CAAE,IAAAC,EAAK,OAAAC,EAAQ,KAAAC,EAAM,YAAAC,EAAa,OAAAC,EAAQ,UAAAC,CAAU,EAAIP,EACxDQ,EAAoE,CACxE,GAAGD,GAAW,QACd,iBAAkB,wBAAwBE,CAAO,GACjD,eAAgBJ,qBAClB,EAKA,OAAIE,GAAW,YAAcL,EAAI,SAAS,QAAQ,IAChDM,EAAQ,cAAgB,UAAUD,GAAW,UAAU,IAErDA,GAAW,SAAW,CAACL,EAAI,SAAS,QAAQ,IAC9CM,EAAQ,cAAgB,UAAUD,GAAW,OAAO,IAO/CN,EAAO,SAAmB,CAC/B,IAAAC,EACA,OAAAC,EACA,KAAAC,EACA,OAAAE,EACA,QAAAE,EACA,UAAAD,CACF,CAAC,CACH,CASA,eAAsBG,EACpBV,EACAW,EACkC,CAClC,GAAM,CAAE,IAAAT,EAAK,KAAAU,CAAK,EAAIZ,EAChBa,EAAUD,EAAO,GAAGV,CAAG,IAAIU,CAAI,GAAKV,EACpCY,EAAW,MAAMf,EAAkB,CAAE,GAAGC,EAAS,IAAKa,CAAQ,EAAGF,EAAY,MAAM,EAEnFI,EAAkC,CACtC,OAAQD,EAAS,OACjB,WAAYA,EAAS,WACrB,KAAMA,EAAS,KACf,QAASA,EAAS,QAClB,OAAQA,EAAS,OACjB,QAASA,EAAS,QAClB,IAAKD,CACP,EAIA,GAAIF,EAAY,iBAAiBT,CAAG,EAAG,CACrC,IAAMc,EAAkBD,EAAO,KAE/B,GAAIC,EAAgB,OAClB,MAAM,IAAIC,EACRjB,EACAe,EACAC,EAAgB,OAAO,CAAC,EAAE,SAAW,mBAAmBF,EAAS,MAAM,MAAMA,EAAS,UAAU,EAClG,EAEFC,EAAO,KAAOC,EAAgB,IAChC,CAEA,GAAID,EAAO,QAAU,KAAOA,EAAO,OAAS,IAC1C,OAAOA,EAGT,IAAIG,EAEJ,MAAIH,GAAUA,EAAO,MAAQ,YAAaA,EAAO,MAAQ,eAAgBA,EAAO,KAC9EG,EAAe,KAAK,UAAUH,EAAO,IAAI,EAChCA,EAAO,UAAUjB,EAE1BoB,EAAepB,EAAOiB,EAAO,MAAM,EAGnCG,EAAe,mBAAmBH,EAAO,MAAM,MAAMA,EAAO,UAAU,GAGlE,IAAIE,EAAcjB,EAASe,EAAQG,CAAY,CACvD","names":["errors","request","options","client","url","method","body","contentType","params","overrides","headers","VERSION","aptosRequest","aptosConfig","path","fullUrl","response","result","indexerResponse","AptosApiError","errorMessage"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-DHFOORW6.mjs";import{g as t}from"./chunk-VP5JCW6I.mjs";var r=class{constructor(o){this.config=o}async fundAccount(o){let n=await i({aptosConfig:this.config,...o});return o.options?.waitForIndexer!==!1&&await t({aptosConfig:this.config,minimumLedgerVersion:BigInt(n.version)}),n}};export{r as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NXAHJ4KY.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-I7WRJY7K.mjs";import{a as r}from"./chunk-ZFIMVSCR.mjs";import{a as s}from"./chunk-V6JFR2CB.mjs";var c=class n extends s{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:i,signature:u}=e;return this.publicKey.verifySignature({message:i,signature:u})}serialize(e){if(this.publicKey instanceof r)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof t)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let i=e.deserializeUleb128AsU32();switch(i){case 0:return new n(r.load(e));case 1:return new n(t.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${i}`)}}static isPublicKey(e){return e instanceof n}isEd25519(){return this.publicKey instanceof r}isSecp256k1PublicKey(){return this.publicKey instanceof t}};export{c as a};
|
|
2
|
+
//# sourceMappingURL=chunk-P7B32QR3.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as r}from"./chunk-F7CR75CJ.mjs";import{a
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as r}from"./chunk-F7CR75CJ.mjs";import{a,b as g,c as f}from"./chunk-F7MOQC7Z.mjs";import{a as o,b as u,c as s,d as c,e as p,f as y,g as m}from"./chunk-VRSUCKJA.mjs";import{a as i}from"./chunk-B2ZKW23W.mjs";function M(n){return typeof n=="boolean"}function D(n){return typeof n=="string"}function N(n){return typeof n=="number"}function P(n){return typeof n=="number"||typeof n=="bigint"||typeof n=="string"}function w(n){return n==null}function G(n){return A(n)||x(n)||S(n)||B(n)||U(n)||I(n)||b(n)||T(n)||E(n)||d(n)||n instanceof a||n instanceof f}function A(n){return n instanceof o}function T(n){return n instanceof r}function E(n){return n instanceof g}function d(n){return n instanceof i}function x(n){return n instanceof u}function S(n){return n instanceof s}function B(n){return n instanceof c}function U(n){return n instanceof p}function I(n){return n instanceof y}function b(n){return n instanceof m}function $(n){return"bytecode"in n}function R(n,t){throw new Error(`Type mismatch for argument ${t}, expected '${n}'`)}function W(n){let t=n.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?n.params.length:t}function L(n){let t=n.split("::");if(t.length!==3)throw new Error(`Invalid function ${n}`);let e=t[0],F=t[1],l=t[2];return{moduleAddress:e,moduleName:F,functionName:l}}export{M as a,D as b,N as c,P as d,w as e,G as f,A as g,T as h,E as i,d as j,x as k,S as l,B as m,U as n,I as o,b as p,$ as q,R as r,W as s,L as t};
|
|
2
|
+
//# sourceMappingURL=chunk-PPNI7SJK.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-DIWRS4YQ.mjs";import{a as d}from"./chunk-2MOYURM2.mjs";import{a as A}from"./chunk-BDHRLMQP.mjs";import{a as T}from"./chunk-HV4ZPHSZ.mjs";import{d as g,e as o,h as m,i as p,j as f}from"./chunk-2RN7N3EO.mjs";import{a as i,b as s,c as r,d as e,e as c,f as u}from"./chunk-VP5JCW6I.mjs";var h=class{constructor(n){this.config=n,this.build=new y(this.config),this.simulate=new A(this.config),this.submit=new T(this.config),this.batch=new d(this.config)}async getTransactions(n){return i({aptosConfig:this.config,...n})}async getTransactionByVersion(n){return r({aptosConfig:this.config,...n})}async getTransactionByHash(n){return e({aptosConfig:this.config,...n})}async isPendingTransaction(n){return c({aptosConfig:this.config,...n})}async waitForTransaction(n){return u({aptosConfig:this.config,...n})}async getGasPriceEstimation(){return s({aptosConfig:this.config})}getSigningMessage(n){return g(n)}async publishPackageTransaction(n){return p({aptosConfig:this.config,...n})}async rotateAuthKey(n){return f({aptosConfig:this.config,...n})}sign(n){return o({...n})}signAsFeePayer(n){let{signer:t,transaction:a}=n;if(!a.feePayerAddress)throw new Error(`Transaction ${a} is not a Fee Payer transaction`);return a.feePayerAddress=t.accountAddress,o({signer:t,transaction:a})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:a,options:P}=n;this.batch.forSingleAccount({sender:t,data:a,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:a}=n;return m({aptosConfig:this.config,signer:t,transaction:a})}};export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QYB75IJ6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/api/transaction.ts"],"sourcesContent":["// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AptosConfig } from \"./aptosConfig\";\nimport {\n getGasPriceEstimation,\n getTransactionByHash,\n getTransactionByVersion,\n getTransactions,\n isTransactionPending,\n waitForTransaction,\n} from \"../internal/transaction\";\nimport {\n AnyNumber,\n CommittedTransactionResponse,\n GasEstimation,\n HexInput,\n PaginationArgs,\n PendingTransactionResponse,\n TransactionResponse,\n WaitForTransactionOptions,\n} from \"../types\";\nimport {\n getSigningMessage,\n publicPackageTransaction,\n rotateAuthKey,\n signAndSubmitTransaction,\n signTransaction,\n} from \"../internal/transactionSubmission\";\nimport {\n AccountAuthenticator,\n AnyRawTransaction,\n InputGenerateTransactionOptions,\n InputGenerateTransactionPayloadData,\n SimpleTransaction,\n} from \"../transactions\";\nimport { AccountAddressInput, Account, PrivateKey } from \"../core\";\nimport { Build } from \"./transactionSubmission/build\";\nimport { Simulate } from \"./transactionSubmission/simulate\";\nimport { Submit } from \"./transactionSubmission/submit\";\nimport { TransactionManagement } from \"./transactionSubmission/management\";\n\nexport class Transaction {\n readonly config: AptosConfig;\n\n readonly build: Build;\n\n readonly simulate: Simulate;\n\n readonly submit: Submit;\n\n readonly batch: TransactionManagement;\n\n constructor(config: AptosConfig) {\n this.config = config;\n this.build = new Build(this.config);\n this.simulate = new Simulate(this.config);\n this.submit = new Submit(this.config);\n this.batch = new TransactionManagement(this.config);\n }\n\n /**\n * Queries on-chain transactions. This function will not return pending\n * transactions. For that, use `getTransactionsByHash`.\n *\n * @param args.options.offset The number transaction to start with\n * @param args.options.limit Number of results to return\n *\n * @returns Array of on-chain transactions\n */\n async getTransactions(args?: { options?: PaginationArgs }): Promise<TransactionResponse[]> {\n return getTransactions({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by version. This function will not return pending transactions.\n *\n * @param args.ledgerVersion - Transaction version is an unsigned 64-bit number.\n * @returns On-chain transaction. Only on-chain transactions have versions, so this\n * function cannot be used to query pending transactions.\n */\n async getTransactionByVersion(args: { ledgerVersion: AnyNumber }): Promise<TransactionResponse> {\n return getTransactionByVersion({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Queries on-chain transaction by transaction hash. This function will return pending transactions.\n * @param args.transactionHash - Transaction hash should be hex-encoded bytes string with 0x prefix.\n * @returns Transaction from mempool (pending) or on-chain (committed) transaction\n */\n async getTransactionByHash(args: { transactionHash: HexInput }): Promise<TransactionResponse> {\n return getTransactionByHash({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Defines if specified transaction is currently in pending state\n *\n * To create a transaction hash:\n *\n * 1. Create a hash message from the bytes: \"Aptos::Transaction\" bytes + the BCS-serialized Transaction bytes.\n * 2. Apply hash algorithm SHA3-256 to the hash message bytes.\n * 3. Hex-encode the hash bytes with 0x prefix.\n *\n * @param args.transactionHash A hash of transaction\n * @returns `true` if transaction is in pending state and `false` otherwise\n */\n async isPendingTransaction(args: { transactionHash: HexInput }): Promise<boolean> {\n return isTransactionPending({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Waits for a transaction to move past the pending state.\n *\n * There are 4 cases.\n * 1. Transaction is successfully processed and committed to the chain.\n * - The function will resolve with the transaction response from the API.\n * 2. Transaction is rejected for some reason, and is therefore not committed to the blockchain.\n * - The function will throw an AptosApiError with an HTTP status code indicating some problem with the request.\n * 3. Transaction is committed but execution failed, meaning no changes were\n * written to the blockchain state.\n * - If `checkSuccess` is true, the function will throw a FailedTransactionError\n * If `checkSuccess` is false, the function will resolve with the transaction response where the `success` field is false.\n * 4. Transaction does not move past the pending state within `args.options.timeoutSecs` seconds.\n * - The function will throw a WaitForTransactionError\n *\n *\n * @param args.transactionHash The hash of a transaction previously submitted to the blockchain.\n * @param args.options.timeoutSecs Timeout in seconds. Defaults to 20 seconds.\n * @param args.options.checkSuccess A boolean which controls whether the function will error if the transaction failed.\n * Defaults to true. See case 3 above.\n * @returns The transaction on-chain. See above for more details.\n */\n async waitForTransaction(args: {\n transactionHash: HexInput;\n options?: WaitForTransactionOptions;\n }): Promise<CommittedTransactionResponse> {\n return waitForTransaction({\n aptosConfig: this.config,\n ...args,\n });\n }\n\n /**\n * Gives an estimate of the gas unit price required to get a\n * transaction on chain in a reasonable amount of time.\n * For more information {@link https://fullnode.mainnet.aptoslabs.com/v1/spec#/operations/estimate_gas_price}\n *\n * @returns Object holding the outputs of the estimate gas API\n * @example\n * ```\n * {\n * gas_estimate: number;\n * deprioritized_gas_estimate?: number;\n * prioritized_gas_estimate?: number;\n * }\n * ```\n */\n async getGasPriceEstimation(): Promise<GasEstimation> {\n return getGasPriceEstimation({\n aptosConfig: this.config,\n });\n }\n\n /**\n * Returns a signing message for a transaction.\n *\n * This allows a user to sign a transaction using their own preferred signing method, and\n * then submit it to the network.\n * @param args.transaction A raw transaction for signing elsewhere\n */\n // eslint-disable-next-line class-methods-use-this\n getSigningMessage(args: { transaction: AnyRawTransaction }): Uint8Array {\n return getSigningMessage(args);\n }\n\n /**\n * Generates a transaction to publish a move package to chain.\n *\n * To get the `metadataBytes` and `byteCode`, can compile using Aptos CLI with command\n * `aptos move compile --save-metadata ...`,\n * For more info {@link https://aptos.dev/tutorials/your-first-dapp/#step-4-publish-a-move-module}\n *\n * @param args.account The publisher account\n * @param args.metadataBytes The package metadata bytes\n * @param args.moduleBytecode An array of the bytecode of each module in the package in compiler output order\n *\n * @returns A SimpleTransaction that can be simulated or submitted to chain\n */\n async publishPackageTransaction(args: {\n account: AccountAddressInput;\n metadataBytes: HexInput;\n moduleBytecode: Array<HexInput>;\n options?: InputGenerateTransactionOptions;\n }): Promise<SimpleTransaction> {\n return publicPackageTransaction({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Rotate an account's auth key. After rotation, only the new private key can be used to sign txns for\n * the account.\n * Note: Only legacy Ed25519 scheme is supported for now.\n * More info: {@link https://aptos.dev/guides/account-management/key-rotation/}\n * @param args.fromAccount The account to rotate the auth key for\n * @param args.toNewPrivateKey The new private key to rotate to\n *\n * @returns PendingTransactionResponse\n */\n async rotateAuthKey(args: { fromAccount: Account; toNewPrivateKey: PrivateKey }): Promise<TransactionResponse> {\n return rotateAuthKey({ aptosConfig: this.config, ...args });\n }\n\n /**\n * Sign a transaction that can later be submitted to chain\n *\n * @param args.signer The signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n sign(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n return signTransaction({\n ...args,\n });\n }\n\n /**\n * Sign a transaction as a fee payer that can later be submitted to chain\n *\n * @param args.signer The fee payer signer account\n * @param args.transaction A raw transaction to sign on\n *\n * @returns AccountAuthenticator\n */\n // eslint-disable-next-line class-methods-use-this\n signAsFeePayer(args: { signer: Account; transaction: AnyRawTransaction }): AccountAuthenticator {\n const { signer, transaction } = args;\n\n // if transaction doesnt hold a \"feePayerAddress\" prop it means\n // this is not a fee payer transaction\n if (!transaction.feePayerAddress) {\n throw new Error(`Transaction ${transaction} is not a Fee Payer transaction`);\n }\n\n // Set the feePayerAddress to the signer account address\n transaction.feePayerAddress = signer.accountAddress;\n\n return signTransaction({\n signer,\n transaction,\n });\n }\n\n // TRANSACTION SUBMISSION //\n\n /**\n * @deprecated Prefer to use `aptos.transaction.batch.forSingleAccount()`\n *\n * Batch transactions for a single account.\n *\n * This function uses a transaction worker that receives payloads to be processed\n * and submitted to chain.\n * Note that this process is best for submitting multiple transactions that\n * dont rely on each other, i.e batch funds, batch token mints, etc.\n *\n * If any worker failure, the functions throws an error.\n *\n * @param args.sender The sender account to sign and submit the transaction\n * @param args.data An array of transaction payloads\n * @param args.options optional. Transaction generation configurations (excluding accountSequenceNumber)\n *\n * @return void. Throws if any error\n */\n async batchTransactionsForSingleAccount(args: {\n sender: Account;\n data: InputGenerateTransactionPayloadData[];\n options?: Omit<InputGenerateTransactionOptions, \"accountSequenceNumber\">;\n }): Promise<void> {\n try {\n const { sender, data, options } = args;\n this.batch.forSingleAccount({ sender, data, options });\n } catch (error: any) {\n throw new Error(`failed to submit transactions with error: ${error}`);\n }\n }\n\n /**\n * Sign and submit a single signer transaction to chain\n *\n * @param args.signer The signer account to sign the transaction\n * @param args.transaction An instance of a RawTransaction, plus optional secondary/fee payer addresses\n * ```\n * {\n * rawTransaction: RawTransaction,\n * secondarySignerAddresses? : Array<AccountAddress>,\n * feePayerAddress?: AccountAddress\n * }\n * ```\n *\n * @return PendingTransactionResponse\n */\n async signAndSubmitTransaction(args: {\n signer: Account;\n transaction: AnyRawTransaction;\n }): Promise<PendingTransactionResponse> {\n const { signer, transaction } = args;\n return signAndSubmitTransaction({\n aptosConfig: this.config,\n signer,\n transaction,\n });\n }\n}\n"],"mappings":"qTA0CO,IAAMA,EAAN,KAAkB,CAWvB,YAAYC,EAAqB,CAC/B,KAAK,OAASA,EACd,KAAK,MAAQ,IAAIC,EAAM,KAAK,MAAM,EAClC,KAAK,SAAW,IAAIC,EAAS,KAAK,MAAM,EACxC,KAAK,OAAS,IAAIC,EAAO,KAAK,MAAM,EACpC,KAAK,MAAQ,IAAIC,EAAsB,KAAK,MAAM,CACpD,CAWA,MAAM,gBAAgBC,EAAqE,CACzF,OAAOC,EAAgB,CACrB,YAAa,KAAK,OAClB,GAAGD,CACL,CAAC,CACH,CASA,MAAM,wBAAwBA,EAAkE,CAC9F,OAAOE,EAAwB,CAC7B,YAAa,KAAK,OAClB,GAAGF,CACL,CAAC,CACH,CAOA,MAAM,qBAAqBA,EAAmE,CAC5F,OAAOG,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGH,CACL,CAAC,CACH,CAcA,MAAM,qBAAqBA,EAAuD,CAChF,OAAOI,EAAqB,CAC1B,YAAa,KAAK,OAClB,GAAGJ,CACL,CAAC,CACH,CAwBA,MAAM,mBAAmBA,EAGiB,CACxC,OAAOK,EAAmB,CACxB,YAAa,KAAK,OAClB,GAAGL,CACL,CAAC,CACH,CAiBA,MAAM,uBAAgD,CACpD,OAAOM,EAAsB,CAC3B,YAAa,KAAK,MACpB,CAAC,CACH,CAUA,kBAAkBN,EAAsD,CACtE,OAAOO,EAAkBP,CAAI,CAC/B,CAeA,MAAM,0BAA0BA,EAKD,CAC7B,OAAOQ,EAAyB,CAAE,YAAa,KAAK,OAAQ,GAAGR,CAAK,CAAC,CACvE,CAYA,MAAM,cAAcA,EAA2F,CAC7G,OAAOS,EAAc,CAAE,YAAa,KAAK,OAAQ,GAAGT,CAAK,CAAC,CAC5D,CAWA,KAAKA,EAAiF,CACpF,OAAOU,EAAgB,CACrB,GAAGV,CACL,CAAC,CACH,CAWA,eAAeA,EAAiF,CAC9F,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAIhC,GAAI,CAACY,EAAY,gBACf,MAAM,IAAI,MAAM,eAAeA,CAAW,iCAAiC,EAI7E,OAAAA,EAAY,gBAAkBD,EAAO,eAE9BD,EAAgB,CACrB,OAAAC,EACA,YAAAC,CACF,CAAC,CACH,CAsBA,MAAM,kCAAkCZ,EAItB,CAChB,GAAI,CACF,GAAM,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,EAAIf,EAClC,KAAK,MAAM,iBAAiB,CAAE,OAAAa,EAAQ,KAAAC,EAAM,QAAAC,CAAQ,CAAC,CACvD,OAASC,EAAY,CACnB,MAAM,IAAI,MAAM,6CAA6CA,CAAK,EAAE,CACtE,CACF,CAiBA,MAAM,yBAAyBhB,EAGS,CACtC,GAAM,CAAE,OAAAW,EAAQ,YAAAC,CAAY,EAAIZ,EAChC,OAAOiB,EAAyB,CAC9B,YAAa,KAAK,OAClB,OAAAN,EACA,YAAAC,CACF,CAAC,CACH,CACF","names":["Transaction","config","Build","Simulate","Submit","TransactionManagement","args","getTransactions","getTransactionByVersion","getTransactionByHash","isTransactionPending","waitForTransaction","getGasPriceEstimation","getSigningMessage","publicPackageTransaction","rotateAuthKey","signTransaction","signer","transaction","sender","data","options","error","signAndSubmitTransaction"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as n}from"./chunk-LFWMWCS3.mjs";async function p(e){let{aptosConfig:t,overrides:s,params:r,contentType:o,acceptType:i,path:a,originMethod:u,type:R}=e,d=t.getRequestUrl(R);return n({url:d,method:"GET",originMethod:u,path:a,contentType:o?.valueOf(),acceptType:i?.valueOf(),params:r,overrides:{...t.clientConfig,...s}},t)}async function g(e){return p({...e,type:0})}async function f(e){let t=[],s,r=e.params;for(;;){r.start=s;let o=await p({type:0,aptosConfig:e.aptosConfig,originMethod:e.originMethod,path:e.path,params:r,overrides:e.overrides});if(s=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),s==null)break}return t}export{p as a,g as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-R3URESCV.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-ACMNL2LL.mjs";import{a as i}from"./chunk-4QWK47EH.mjs";import{a as r}from"./chunk-N4RBQZ2B.mjs";var n=class o extends r{constructor(t,a){super();this.raw_txn=t,this.authenticator=a}serialize(t){this.raw_txn.serialize(t),this.authenticator.serialize(t)}static deserialize(t){let a=e.deserialize(t),s=i.deserialize(t);return new o(a,s)}};export{n as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TRTTUBC4.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A}from"./chunk-AH44UPM4.mjs";import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as A}from"./chunk-AH44UPM4.mjs";import{i as w,j as C}from"./chunk-3T4NSGK5.mjs";import{b as c,c as l}from"./chunk-R3URESCV.mjs";import{a as h}from"./chunk-6FBKUTGF.mjs";import{a as d}from"./chunk-3JPVQHOR.mjs";import{e as y}from"./chunk-HHJBCGAQ.mjs";async function F(o){let{aptosConfig:n,options:t}=o;return l({aptosConfig:n,originMethod:"getTransactions",path:"transactions",params:{start:t?.offset,limit:t?.limit}})}async function L(o){let{aptosConfig:n}=o;return A(async()=>{let{data:t}=await c({aptosConfig:n,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return t},`gas-price-${n.network}`,1e3*60*5)()}async function v(o){let{aptosConfig:n,ledgerVersion:t}=o,{data:s}=await c({aptosConfig:n,originMethod:"getTransactionByVersion",path:`transactions/by_version/${t}`});return s}async function x(o){let{aptosConfig:n,transactionHash:t}=o,{data:s}=await c({aptosConfig:n,path:`transactions/by_hash/${t}`,originMethod:"getTransactionByHash"});return s}async function N(o){let{aptosConfig:n,transactionHash:t}=o;try{return(await x({aptosConfig:n,transactionHash:t})).type==="pending_transaction"}catch(s){if(s?.status===404)return!0;throw s}}async function G(o){let{aptosConfig:n,transactionHash:t,options:s}=o,r=s?.timeoutSecs??y,f=s?.checkSuccess??!0,i=!0,u=0,e,g,m=200,P=1.5;for(;i&&!(u>=r);){try{if(e=await x({aptosConfig:n,transactionHash:t}),i=e.type==="pending_transaction",!i)break}catch(a){if(!(a instanceof h)||(g=a,a.status!==404&&a.status>=400&&a.status<500))throw a}await d(m),u+=m/1e3,m*=P}if(e===void 0)throw g||new p(`Fetching transaction ${t} failed and timed out after ${r} seconds`,e);if(e.type==="pending_transaction")throw new p(`Transaction ${t} timed out in pending state after ${r} seconds`,e);if(!f)return e;if(!e.success)throw new T(`Transaction ${t} failed with an error: ${e.vm_status}`,e);return e}async function D(o){let{aptosConfig:n,processorType:t}=o,s=BigInt(o.minimumLedgerVersion),r=3e3,f=new Date().getTime(),i=BigInt(-1);for(;i<s;){if(new Date().getTime()-f>r)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(t===void 0?i=await w({aptosConfig:n}):i=(await C({aptosConfig:n,processorType:t})).last_success_version,i>=s)break;await d(200)}}var p=class extends Error{constructor(t,s){super(t);this.lastSubmittedTransaction=s}},T=class extends Error{constructor(t,s){super(t);this.transaction=s}};export{F as a,L as b,v as c,x as d,N as e,G as f,D as g,p as h,T as i};
|
|
2
|
+
//# sourceMappingURL=chunk-VP5JCW6I.mjs.map
|