@aptos-labs/ts-sdk
Version:
Aptos TypeScript SDK
2 lines • 1.69 kB
JavaScript
import{a as T}from"./chunk-I3MG3W4J.mjs";import{a as y}from"./chunk-YMHX6GC2.mjs";import{a as d}from"./chunk-HZ3YB6TN.mjs";import{a as A}from"./chunk-LVYNEPH4.mjs";import{d as g,e as a,h as m,i as p,j as f}from"./chunk-V6J6AW5T.mjs";import{a as i,b as s,c as r,d as e,e as c,g as u}from"./chunk-R5NNAF5B.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 a({...n})}signAsFeePayer(n){let{signer:t,transaction:o}=n;if(!o.feePayerAddress)throw new Error(`Transaction ${o} is not a Fee Payer transaction`);return o.feePayerAddress=t.accountAddress,a({signer:t,transaction:o})}async batchTransactionsForSingleAccount(n){try{let{sender:t,data:o,options:P}=n;this.batch.forSingleAccount({sender:t,data:o,options:P})}catch(t){throw new Error(`failed to submit transactions with error: ${t}`)}}async signAndSubmitTransaction(n){let{signer:t,transaction:o}=n;return m({aptosConfig:this.config,signer:t,transaction:o})}};export{h as a};
//# sourceMappingURL=chunk-DBC2JY65.mjs.map