UNPKG

@goequitize/rwa-token-sdk

Version:

SDK for creating and managing RWA token transactions with compliance features

192 lines (191 loc) 5.9 kB
import { SDKConfig } from './types'; import { EvmChainConfig } from './chains/evm'; import { TxBuildResult } from './types'; /** * @goequitize/rwa-token-sdk * SDK for RWA Token operations */ export declare class RwaTokenSDK { private config; private provider; private implementation; private tokenAddress; /** * Create a new instance of the RwaTokenSDK * @param config The SDK configuration * @param tokenAddress The RWA token contract address * @param customChainConfig Optional custom chain configuration for EVM chains */ constructor(config: SDKConfig, tokenAddress: string, customChainConfig?: Partial<EvmChainConfig>); /** * Get the token's decimals * @param tokenAddress Optional token address, defaults to the one provided in constructor * @returns The number of decimals of the token */ getDecimals(tokenAddress?: string): Promise<number>; /** * Get the token's symbol * @param tokenAddress Optional token address, defaults to the one provided in constructor * @returns The symbol of the token */ getSymbol(tokenAddress?: string): Promise<string>; /** * Get the token balance of an address * @param address The address to check * @param tokenAddress Optional token address, defaults to the one provided in constructor * @returns The formatted token balance */ getTokenBalance(address: string, tokenAddress?: string): Promise<string>; /** * Get gas price information * @param txnType Optional transaction type for gas estimation * @returns Gas price information */ getGasInfo(txnType?: string): Promise<import("./types").GasInfo>; /** * Build a mint transaction * @param params Parameters for the mint operation * @returns Transaction build result */ buildMintTxn(params: { to: string; amount: string; from: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Build a burn transaction * @param params Parameters for the burn operation * @returns Transaction build result */ buildBurnTxn(params: { from: string; amount: string; sender: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Build a transfer transaction * @param params Parameters for the transfer operation * @returns Transaction build result */ buildTransferTxn(params: { to: string; amount: string; from: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Build a forced transfer transaction * @param params Parameters for the forced transfer operation * @returns Transaction build result */ buildForcedTransferTxn(params: { from: string; to: string; amount: string; sender: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Build a pause transaction * @param params Parameters for the pause operation * @returns Transaction build result */ buildPauseTxn(params: { from: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Build an unpause transaction * @param params Parameters for the unpause operation * @returns Transaction build result */ buildUnpauseTxn(params: { from: string; }): Promise<{ isError: boolean; errorMsg?: string; data?: { rawTx: import("./types").UnsignedTransaction; gasCost: string; gasPrice: string; gasLimit: string; }; }>; /** * Sign a transaction using a private key * @param rawTx The unsigned transaction * @param privateKey The private key to sign with * @returns The signed transaction */ signTxn(rawTx: any, privateKey: string): Promise<string>; /** * Broadcast a signed transaction to the network * @param signedTxn The signed transaction * @returns Transaction response with hash and explorer URL */ broadcast(signedTxn: string): Promise<import("./types").TransactionResponse>; /** * Get transaction logs and status * @param txHash The transaction hash * @returns Transaction logs and status */ getTxnLogs(txHash: string): Promise<{ status: "success" | "pending" | "failed"; logs: any[]; }>; /** * Build a cross-chain transfer transaction using LayerZero's OFT standard * @param params The parameters for the cross-chain transfer operation * @returns The transaction build result */ buildCrossChainTransferTxn(params: { to: string; amount: string; destinationChainId: number; destinationAddress: string; adapterParams?: string; from: string; }): Promise<TxBuildResult>; }