zumokit
Version:
ZumoKit is a Wallet as a Service SDK
46 lines (45 loc) • 2.7 kB
TypeScript
import { Decimal } from 'decimal.js';
import { ComposedTransaction } from './models';
/**
* User wallet interface describes methods for transfer and exchange of fiat and cryptocurrency funds.
* <p>
* User wallet instance can be obtained by {@link User.createWallet creating}, {@link User.unlockWallet unlocking} or {@link User.recoverWallet recovering} user wallet.
* <p>
* Sending a transaction or making an exchange is a two step process. First a transaction or
* exchange has to be composed via one of the compose methods, then {@link ComposedTransaction ComposedTransaction} or
* {@link ComposedExchange ComposedExchange} can be submitted.
*/
export declare class Wallet {
private zumoCoreModule;
private walletImpl;
/** @internal */
constructor(zumoCoreModule: any, walletImpl: any);
/**
* Compose Ethereum transaction asynchronously.
* Refer to <a href="https://developers.zumo.money/docs/guides/send-transactions#ethereum">Send Transactions</a>
* guide for usage details.
*
* @param fromAccountId {@link Account Account} identifier
* @param gasPrice gas price in gwei
* @param gasLimit gas limit
* @param destinationAddress destination wallet address
* @param amount amount in ETH
* @param data data in string format or null (defaults to null)
* @param nonce next transaction nonce or null (defaults to null)
* @param sendMax send maximum possible funds to destination (defaults to false)
*/
composeEthTransaction(fromAccountId: string, gasPrice: Decimal, gasLimit: number, destinationAddress: string | null, amount: Decimal | null, data?: string | null, nonce?: number | null, sendMax?: boolean): Promise<ComposedTransaction>;
/**
* Compose BTC or BSV transaction asynchronously.
* Refer to <a href="https://developers.zumo.money/docs/guides/send-transactions#bitcoin">Send Transactions</a>
* guide for usage details.
*
* @param fromAccountId {@link Account Account} identifier
* @param changeAccountId change {@link Account Account} identifier, which can be the same as fromAccountId
* @param destinationAddress destination wallet address
* @param amount amount in BTC or BSV
* @param feeRate fee rate in satoshis/byte
* @param sendMax send maximum possible funds to destination (defaults to false)
*/
composeTransaction(fromAccountId: string, changeAccountId: string, destinationAddress: string, amount: Decimal | null, feeRate: Decimal, sendMax?: boolean): Promise<ComposedTransaction>;
}