PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm
Просмотр файла: chunk-DBTKJMLV.mjs
import{a as d}from"./chunk-NZ7M6NG2.mjs";import{a as y,b as l,c as C,d as T,e as O,f as h,g as L,h as P,i as S,j as V,k as b,l as R,n as w,o as I,p as v,q as k}from"./chunk-4OV2A6PJ.mjs";import{a as o}from"./chunk-33CVOPIN.mjs";import{a as f}from"./chunk-6ZOVTYLJ.mjs";import{b as r}from"./chunk-JNO7KPMG.mjs";import{a as p}from"./chunk-HBIDHQ2M.mjs";import{h as g,i as m}from"./chunk-V4FKFCBL.mjs";import{e as u,f as A}from"./chunk-J7PJSK3J.mjs";var M=class{constructor(e){this.config=e}async getAccountInfo(e){return y({aptosConfig:this.config,...e})}async getAccountModules(e){return l({aptosConfig:this.config,...e})}async getAccountModule(e){return C({aptosConfig:this.config,...e})}async getAccountTransactions(e){return T({aptosConfig:this.config,...e})}async getAccountResources(e){return O({aptosConfig:this.config,...e})}async getAccountResource(e){return h({aptosConfig:this.config,...e})}async lookupOriginalAccountAddress(e){return L({aptosConfig:this.config,...e})}async getAccountTokensCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),P({aptosConfig:this.config,...e})}async getAccountOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),S({aptosConfig:this.config,...e})}async getAccountOwnedTokensFromCollectionAddress(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),V({aptosConfig:this.config,...e})}async getAccountCollectionsWithOwnedTokens(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"token_v2_processor"}),b({aptosConfig:this.config,...e})}async getAccountTransactionsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"account_transactions_processor"}),R({aptosConfig:this.config,...e})}async getAccountCoinsData(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),w({aptosConfig:this.config,...e})}async getAccountCoinsCount(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"fungible_asset_processor"}),I({aptosConfig:this.config,...e})}async getAccountAPTAmount(e){return this.getAccountCoinAmount({coinType:u,faMetadataAddress:A,...e})}async getAccountCoinAmount(e){let{accountAddress:a,coinType:s,faMetadataAddress:t,minimumLedgerVersion:N}=e;N&&console.warn(`minimumLedgerVersion is not used anymore, here for backward
compatibility see https://github.com/aptos-labs/aptos-ts-sdk/pull/519,
will be removed in the near future`);let c=s;s===void 0&&t!==void 0&&(c=await p(async()=>{try{let n=(await d({aptosConfig:this.config,payload:{function:"0x1::coin::paired_coin",functionArguments:[t]}})).at(0);if(n.vec.length>0&&m(n.vec[0]))return g(n.vec[0])}catch{}},`coin-mapping-${t.toString()}`,1e3*60*5)());let i;if(s!==void 0&&t!==void 0)i=r.from(t).toStringLong();else if(s!==void 0&&t===void 0)s===u?i=r.A.toStringLong():i=f(r.A,s).toStringLong();else if(s===void 0&&t!==void 0){let n=r.from(t);i=n.toStringLong(),n===r.A&&(c=u)}else throw new Error("Either coinType, faMetadataAddress, or both must be provided");if(c!==void 0){let[n]=await d({aptosConfig:this.config,payload:{function:"0x1::coin::balance",typeArguments:[c],functionArguments:[a]}});return parseInt(n,10)}let[E]=await d({aptosConfig:this.config,payload:{function:"0x1::primary_fungible_store::balance",typeArguments:["0x1::object::ObjectCore"],functionArguments:[a,i]}});return parseInt(E,10)}async getAccountOwnedObjects(e){return await o({config:this.config,minimumLedgerVersion:e.minimumLedgerVersion,processorType:"default_processor"}),v({aptosConfig:this.config,...e})}async deriveAccountFromPrivateKey(e){return k({aptosConfig:this.config,...e})}};export{M as a};
//# sourceMappingURL=chunk-DBTKJMLV.mjs.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!