@kanalabs/aptos-smart-wallet
Version:
Typescript SDK to interact with the Aptos smart wallet
32 lines (31 loc) • 2.06 kB
TypeScript
import { Provider, AptosAccount } from 'aptos';
import { WalletNetworkOptions, SmartWalletDetails, TokenBalance, TransactionResponse } from '../common';
export declare class AptosWallet {
private options;
controller: string;
address: string;
provider: Provider;
wallet: AptosAccount;
readonly sponsor: AptosAccount;
constructor(privateKey: string, options: WalletNetworkOptions);
getWalletBalance(wallet?: string): Promise<TokenBalance[]>;
getSmartWalletDetails(wallet?: string): Promise<SmartWalletDetails>;
signMessage(message: string): Promise<string>;
computeAccountAddress(): Promise<string>;
getAccountAddress(controller?: string): Promise<string>;
createAccount(seed: string, guardians: string[], feePayers: string[]): Promise<TransactionResponse>;
changeControllerAccount(walletAddress: string, newController: string): Promise<TransactionResponse>;
recoverAccount(walletAddress: string, newController: string): Promise<TransactionResponse>;
addAccountFeePayers(walletAddress: string, feePayers: string[]): Promise<TransactionResponse>;
removeAccountFeePayers(walletAddress: string, feePayers: string[]): Promise<TransactionResponse>;
addAccountGuardians(walletAddress: string, guardians: string[]): Promise<TransactionResponse>;
removeAccountGuardians(walletAddress: string, guardians: string[]): Promise<TransactionResponse>;
depositToAccount(walletAddress: string, coinType: string, amount: number): Promise<TransactionResponse>;
withdrawFromAccount(walletAddress: string, coinType: string, amount: number): Promise<TransactionResponse>;
transferFromAccount(walletAddress: string, coinType: string, amount: number): Promise<TransactionResponse>;
executeAptosFunction(wallAddress: string, coinTypes: string[], payload: any[]): Promise<TransactionResponse>;
createAccountSponsored(seed: string, guardians: string[], feePayers: string[]): Promise<TransactionResponse>;
private sendTransaction;
private viewTransaction;
private hexToByteSeq;
}