import { AptosClient, BCS, HexString, TxnBuilderTypes, Types } from "aptos"; import { APTTransferArgs, CoinRegisterArgs, CoinTransferArgs, EntryFunctionArgs, Fraction, IMultiSig, ModulePublishInfo, MoveScriptInfo, MSafeRegisterArgs, RegisterNFTArgs, RevertArgs, TransferNftArgs } from "../types"; import { Account, MSafeTransaction, Transaction } from "../modules"; export declare const MINUTE_SECONDS = 60; export declare const HOUR_SECONDS: number; export declare const DAY_SECONDS: number; export declare const WEEK_SECONDS: number; export declare const YEAR_SECONDS: number; export declare const DEFAULT_UNIT_PRICE = 120n; export declare const DEFAULT_REGISTER_MAX_GAS = 50000n; export declare abstract class AptosTxnBuilder { private _fromAddress; _sequenceNumber: bigint | undefined; private _chainId; private _maxGas; private _gasPrice; private _expiration; private _estimateGasPrice; private _estimateMaxGas; abstract payload(): TxnBuilderTypes.TransactionPayload; abstract validateAndFix(): void; get fromAddress(): HexString | undefined; from(from: HexString): this; sequenceNumber(sn: bigint): this; chainId(cid: number): this; maxGas(mg: bigint): this; gasPrice(gp: bigint): this; expiration(exp: number): this; setEstimateGasPrice(val: boolean): this; setEstimateMaxGas(val: boolean): this; withTxConfig(config: TxConfig): this; build(aptosClient: AptosClient, sender: Account | IMultiSig): Promise; private _validateAndFix; estimateGasPriceAndMaxGas(aptosClient: AptosClient, sender: Account | IMultiSig, gasPriceMultiFactor?: Fraction, maxGasMultiFactor?: Fraction): Promise<{ gasPrice: bigint; maxGas: bigint; }>; estimateGasPrice(aptosClient: AptosClient, gasPriceMultiFactor?: Fraction): Promise; estimateMaxGas(aptosClient: AptosClient, sender: Account | IMultiSig, usedGasPrice?: bigint, maxGasMultiFactor?: Fraction): Promise; private simulate; private buildTempForSimulation; private makeRawTransaction; private makeTempRawTransaction; private getSequenceNumber; private getTargetExpiration; private getChainId; } export declare class AptosCoinTransferTxnBuilder extends AptosTxnBuilder { private _toAddress; private _amount; amount(n: bigint): this; to(to: HexString): this; validateAndFix(): void; payload(): TxnBuilderTypes.TransactionPayload; } export declare class AptosEntryTxnBuilder extends AptosTxnBuilder { private _contract; private _module; private _method; private _type_args; private _args; addr(_contract: HexString): this; module(_module: string): this; method(_method: string): this; args(_args: any[]): this; type_args(_type_args: any[]): this; validateAndFix(): void; payload(): TxnBuilderTypes.TransactionPayload; } export declare class AptosScriptTxnBuilder extends AptosTxnBuilder { private _script; private _type_args; private _args; script(_script: Uint8Array): this; args(_args: TxnBuilderTypes.TransactionArgument[]): this; type_args(_type_args: string[]): this; validateAndFix(): void; payload(): TxnBuilderTypes.TransactionPayload; } export declare function applyDefaultOptions(aptosClient: AptosClient, sender: HexString, opts?: Options): Promise; export declare type Options = { maxGas?: bigint; gasPrice?: bigint; expirationSec?: number; sequenceNumber?: bigint; chainID?: number; estimateGasPrice?: boolean; estimateMaxGas?: boolean; }; export declare type TxConfig = { maxGas: bigint; gasPrice: bigint; expirationSec: number; sequenceNumber: bigint; chainID: number; estimateGasPrice: boolean; estimateMaxGas: boolean; }; export declare const DEF_REGISTER_MAX_GAS = 12000n; export declare function makeMSafeRegisterTx(aptosClient: AptosClient, sender: IMultiSig, args: MSafeRegisterArgs, DEPLOYER: HexString, opts?: Options): Promise; export declare function makeMSafeAPTTransferTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function makeMSafeAnyCoinRegisterTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function makeMSafeAnyCoinTransferBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function makeMSafeRevertTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, DEPLOYER: HexString, opts?: Options): Promise; export declare function makeRegisterNFTTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function makeTransferNftTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function makeEntryFunctionTxBuilder(aptosClient: AptosClient, sender: IMultiSig, args: Omit, opts?: Options): Promise; export declare function getFunctionABI(aptosClient: AptosClient, contract: HexString, moduleName: string, fnName: string): Promise; export declare function decodeEntryFunctionArgs(aptosClient: AptosClient, deployer: HexString, moduleName: string, fnName: string, args: BCS.Bytes[]): Promise<((string | HexString)[] | (string | bigint)[] | (string | number)[] | (string | boolean)[])[]>; export declare function decodeCoinType(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): string; export declare function parseTypeStructTag(typeTag: TxnBuilderTypes.TypeTagStruct): string; export declare function decodeCoinTransferArgs(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): [HexString, bigint]; export declare function decodeTokenTransferArgs(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): TransferNftArgs; export declare function decodeTypeArgs(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): string[]; export declare function decodeTypeTag(tArg: TxnBuilderTypes.TypeTag): string; export declare function isCoinTransferTxn(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isCoinRegisterTx(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isAptosCoinType(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isRevertTxn(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isModulePublishTxn(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isRegisterNFTTxn(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function isTransferNftTxn(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): boolean; export declare function getModuleComponents(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): [HexString, string, string]; export declare function decodeModulePublishArgs(payload: TxnBuilderTypes.TransactionPayloadEntryFunction): ModulePublishInfo; export declare function decodeMoveScriptArgs(payload: TxnBuilderTypes.TransactionPayloadScript): MoveScriptInfo; export declare function getModulePublishHash(metadataRaw: Uint8Array, codes: Uint8Array): HexString;