/// import type { Network } from "@aptos-labs/ts-sdk"; import { Aptos, AptosConfig as AptosSDKConfig } from "@aptos-labs/ts-sdk"; import type { Signer } from "arbundles"; import { InjectedAptosSigner, AptosSigner } from "arbundles/web"; import BigNumber from "bignumber.js"; import type { TokenConfig, Tx } from "../../common/types"; import BaseWebToken from "./base"; export type SignMessagePayload = { address?: boolean; application?: boolean; chainId?: boolean; message: string; nonce: string; }; export type SignMessageResponse = { address: string; application: string; chainId: number; fullMessage: string; message: string; nonce: string; prefix: string; signature: string; }; type NetworkInfo = { name: Network; chainId?: string; url?: string; }; export type AptosWallet = { account: { address: string; publicKey: string; }; connect: () => void; disconnect: () => void; connected: boolean; network: NetworkInfo; signAndSubmitTransaction: (transaction: any) => Promise; signMessage: (payload: SignMessagePayload) => Promise; signTransaction: (transaction: any) => Promise; }; export default class AptosConfig extends BaseWebToken { protected providerInstance?: Aptos; protected signerInstance: InjectedAptosSigner | AptosSigner; protected wallet: AptosWallet; protected _publicKey: Buffer; protected aptosConfig: AptosSDKConfig; protected signingFn?: (msg: Uint8Array) => Promise; constructor(config: TokenConfig); getProvider(): Promise; getTx(txId: string): Promise; ownerToAddress(owner: any): string; sign(data: Uint8Array): Promise; getSigner(): Signer; verify(pub: any, data: Uint8Array, signature: Uint8Array): Promise; getCurrentHeight(): Promise; getFee(amount: BigNumber.Value, to?: string): Promise<{ gasUnitPrice: number; maxGasAmount: number; }>; sendTx(data: any): Promise; createTx(amount: BigNumber.Value, to: string, fee?: { gasUnitPrice: number; maxGasAmount: number; }): Promise<{ txId: string | undefined; tx: any; }>; getPublicKey(): Promise; ready(): Promise; } export {};