@smoothsend/sdk
Version:
Multi-chain gasless transaction SDK for seamless dApp integration
67 lines • 2.87 kB
TypeScript
import { SupportedChain, IChainAdapter, ChainConfig, TransferRequest, TransferQuote, SignatureData, SignedTransferData, TransferResult, TokenBalance, TokenInfo } from '../types';
/**
* Aptos Multi-Chain Adapter
* Handles all Aptos chains (aptos-testnet, aptos-mainnet)
* Routes requests to the appropriate chain endpoint on the Aptos relayer
* Supports Aptos-specific features like gasless transactions and Move-based contracts
*/
export declare class AptosAdapter implements IChainAdapter {
readonly chain: SupportedChain;
readonly config: ChainConfig;
private httpClient;
constructor(chain: SupportedChain, config: ChainConfig, relayerUrl: string);
/**
* Build API path with chain name for Aptos relayer
*/
private getApiPath;
getQuote(request: TransferRequest): Promise<TransferQuote>;
prepareTransfer(request: TransferRequest, quote: TransferQuote): Promise<SignatureData>;
executeTransfer(signedData: SignedTransferData): Promise<TransferResult>;
getBalance(address: string, token?: string): Promise<TokenBalance[]>;
getTokenInfo(token: string): Promise<TokenInfo>;
getNonce(address: string): Promise<string>;
getTransactionStatus(txHash: string): Promise<any>;
validateAddress(address: string): boolean;
validateAmount(amount: string, token: string): Promise<boolean>;
/**
* Get Aptos token address from symbol
*/
private getAptosTokenAddress;
/**
* Build Aptos explorer URL for transaction
*/
private buildAptosExplorerUrl;
/**
* Validate serialized transaction data for the new safe endpoint
* @param signedData The signed transfer data to validate
*/
private validateSerializedTransactionData;
/**
* Enhanced address validation with detailed error messages
* @param address The address to validate
* @returns true if valid, throws error if invalid
*/
validateAddressStrict(address: string): boolean;
/**
* Verify that a public key corresponds to an expected address
* This mirrors the enhanced verification in the relayer
* @param publicKey The public key to verify
* @param expectedAddress The expected address
* @returns true if they match
*/
verifyPublicKeyAddress(publicKey: string, expectedAddress: string): Promise<boolean>;
/**
* Enhanced transaction preparation with better signature data structure
* @param request Transfer request
* @param quote Transfer quote
* @returns Signature data with enhanced structure
*/
prepareTransferEnhanced(request: TransferRequest, quote: TransferQuote): Promise<SignatureData & {
metadata: any;
}>;
/**
* Aptos-specific Move contract interaction
*/
callMoveFunction(functionName: string, args: any[]): Promise<any>;
}
//# sourceMappingURL=aptos.d.ts.map