PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm
Просмотр файла: chunk-SK3LIS4Z.mjs
import{a as g,f as l,g as R,i as x}from"./chunk-LPVGVTWT.mjs";import{a as K}from"./chunk-4OV2A6PJ.mjs";import{a as S}from"./chunk-ELXJ5A4B.mjs";import{a as y,b as C}from"./chunk-DC2IESER.mjs";import{d as I}from"./chunk-SNYYEVJA.mjs";import{a as w}from"./chunk-2C27NY4D.mjs";import{a as b}from"./chunk-F2WY2DEY.mjs";import{c as m,m as c}from"./chunk-T6ADNZE5.mjs";import{a as h}from"./chunk-U3T4ZT7B.mjs";import{i as P}from"./chunk-PXMNAP2Q.mjs";import{b as p}from"./chunk-JNO7KPMG.mjs";import{b as d}from"./chunk-LKKI2KAP.mjs";import{a as s}from"./chunk-ZMMLM6ZJ.mjs";import{b as f}from"./chunk-42H7WETG.mjs";import{a as T}from"./chunk-J3E4UMBB.mjs";async function _(t){let e=await k(t);return v(t,e)}async function k(t){let{aptosConfig:e,data:n}=t,o,a;return"bytecode"in n?a=await g(n):"multisigAddress"in n?(o={aptosConfig:e,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},a=await g(o)):(o={aptosConfig:e,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments,abi:n.abi},a=await g(o)),a}async function v(t,e){let{aptosConfig:n,sender:o,options:a}=t,i;if(M(t)&&(i=p.ZERO.toString()),N(t)){let{secondarySignerAddresses:r}=t;return l({aptosConfig:n,sender:o,payload:e,options:a,secondarySignerAddresses:r,feePayerAddress:i})}return l({aptosConfig:n,sender:o,payload:e,options:a,feePayerAddress:i})}function M(t){return t.withFeePayer===!0}function N(t){return"secondarySignerAddresses"in t}function sn(t){let{transaction:e}=t;return I(e)}function D(t){let{signer:e,transaction:n}=t;return e.signTransactionWithAuthenticator(n)}function G(t){let{signer:e,transaction:n}=t;if(!n.feePayerAddress)throw new Error(`Transaction ${n} is not a Fee Payer transaction`);return n.feePayerAddress=e.accountAddress,D({signer:e,transaction:n})}async function cn(t){let{aptosConfig:e,transaction:n,signerPublicKey:o,secondarySignersPublicKeys:a,feePayerPublicKey:i,options:r}=t,u=R({transaction:n,signerPublicKey:o,secondarySignersPublicKeys:a,feePayerPublicKey:i,options:r}),{data:A}=await d({aptosConfig:e,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:t.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:t.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:t.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return A}async function U(t){let{aptosConfig:e}=t,n=x({...t});try{let{data:o}=await d({aptosConfig:e,body:n,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return o}catch(o){let a=b.deserialize(new T(n));throw a.authenticator.isSingleSender()&&a.authenticator.sender.isSingleKey()&&(a.authenticator.sender.public_key.publicKey instanceof P||a.authenticator.sender.public_key.publicKey instanceof h)&&await C.fetchJWK({aptosConfig:e,publicKey:a.authenticator.sender.public_key.publicKey,kid:a.authenticator.sender.signature.signature.getJwkKid()}),o}}async function O(t){let{aptosConfig:e,signer:n,feePayer:o,transaction:a}=t;y(n)&&await n.checkKeylessAccountValidity(e),y(o)&&await o.checkKeylessAccountValidity(e);let i=t.feePayerAuthenticator||o&&G({signer:o,transaction:a}),r=D({signer:n,transaction:a});return U({aptosConfig:e,transaction:a,senderAuthenticator:r,feePayerAuthenticator:i})}async function un(t){let{aptosConfig:e,senderAuthenticator:n,feePayer:o,transaction:a}=t;y(o)&&await o.checkKeylessAccountValidity(e);let i=G({signer:o,transaction:a});return U({aptosConfig:e,transaction:a,senderAuthenticator:n,feePayerAuthenticator:i})}var E={typeParameters:[],parameters:[c.u8(),new c(c.u8())]};async function pn(t){let{aptosConfig:e,account:n,metadataBytes:o,moduleBytecode:a,options:i}=t,r=a.map(u=>s.U8(u));return _({aptosConfig:e,sender:p.from(n),data:{function:"0x1::code::publish_package_txn",functionArguments:[s.U8(o),new s(r)],abi:E},options:i})}var V={typeParameters:[],parameters:[new m,c.u8(),new m,c.u8(),c.u8(),c.u8()]};async function yn(t){let{aptosConfig:e,fromAccount:n,toNewPrivateKey:o}=t,a=await K({aptosConfig:e,accountAddress:n.accountAddress}),i=S.fromPrivateKey({privateKey:o,legacy:!0}),u=new w({sequenceNumber:BigInt(a.sequence_number),originator:n.accountAddress,currentAuthKey:p.from(a.authentication_key),newPublicKey:i.publicKey}).bcsToBytes(),A=n.sign(u),B=i.sign(u),F=await _({aptosConfig:e,sender:n.accountAddress,data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new f(n.signingScheme),s.U8(n.publicKey.toUint8Array()),new f(i.signingScheme),s.U8(i.publicKey.toUint8Array()),s.U8(A.toUint8Array()),s.U8(B.toUint8Array())],abi:V}});return O({aptosConfig:e,signer:n,transaction:F})}export{_ as a,k as b,v as c,sn as d,D as e,G as f,cn as g,U as h,O as i,un as j,pn as k,yn as l};
//# sourceMappingURL=chunk-SK3LIS4Z.mjs.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!