import { BitGo } from '../bitgo'; import { BaseCoin, KeychainsTriplet } from './baseCoin'; import { NodeCallback, RequestTracer as IRequestTracer } from './types'; import { PaginationOptions, Wallet } from './wallet'; import * as Bluebird from 'bluebird'; import { RequestTracer } from './internal/util'; export interface WalletWithKeychains extends KeychainsTriplet { wallet: Wallet; warning?: string; } export interface GetWalletOptions { allTokens?: boolean; reqId?: IRequestTracer; id?: string; } export interface GenerateWalletOptions { label?: string; passphrase?: string; userKey?: string; backupXpub?: string; backupXpubProvider?: string; passcodeEncryptionCode?: string; enterprise?: string; disableTransactionNotifications?: string; gasPrice?: string; eip1559?: { maxFeePerGas: string; maxPriorityFeePerGas: string; }; walletVersion?: number; disableKRSEmail?: boolean; krsSpecific?: { [index: string]: boolean | string | number; }; coldDerivationSeed?: string; rootPrivateKey?: string; } export interface GetWalletByAddressOptions { address?: string; reqId?: RequestTracer; } export interface UpdateShareOptions { walletShareId?: string; state?: string; encryptedPrv?: string; } export interface AcceptShareOptions { overrideEncryptedPrv?: string; walletShareId?: string; userPassword?: string; newWalletPassphrase?: string; } export interface AddWalletOptions { type?: string; keys?: string[]; m?: number; n?: number; tags?: string[]; clientFlags?: string[]; signingKeyId?: string; isCold?: boolean; isCustodial?: boolean; address?: string; rootPub?: string; rootPrivateKey?: string; initializationTxs?: any; disableTransactionNotifications?: boolean; gasPrice?: number; walletVersion?: number; } export interface ListWalletOptions extends PaginationOptions { skip?: number; getbalances?: boolean; allTokens?: boolean; } export declare class Wallets { private readonly bitgo; private readonly baseCoin; constructor(bitgo: BitGo, baseCoin: BaseCoin); /** * Get a wallet by ID (proxy for getWallet) * @param params * @param callback */ get(params?: GetWalletOptions, callback?: NodeCallback): Bluebird; /** * List a user's wallets * @param params * @param callback * @returns {*} */ list(params?: ListWalletOptions, callback?: NodeCallback<{ wallets: Wallet[]; }>): Bluebird<{ wallets: Wallet[]; }>; /** * add * Add a new wallet (advanced mode). * This allows you to manually submit the keys, type, m and n of the wallet * Parameters include: * "label": label of the wallet to be shown in UI * "m": number of keys required to unlock wallet (2) * "n": number of keys available on the wallet (3) * "keys": array of keychain ids */ add(params?: AddWalletOptions, callback?: NodeCallback): Bluebird; /** * Generate a new wallet * 1. Creates the user keychain locally on the client, and encrypts it with the provided passphrase * 2. If no pub was provided, creates the backup keychain locally on the client, and encrypts it with the provided passphrase * 3. Uploads the encrypted user and backup keychains to BitGo * 4. Creates the BitGo key on the service * 5. Creates the wallet on BitGo with the 3 public keys above * @param params * @param params.label * @param params.passphrase * @param params.userKey User xpub * @param params.backupXpub Backup xpub * @param params.backupXpubProvider * @param params.enterprise * @param params.disableTransactionNotifications * @param params.passcodeEncryptionCode * @param params.coldDerivationSeed * @param params.gasPrice * @param params.disableKRSEmail * @param params.walletVersion * @param callback * @returns {*} */ generateWallet(params?: GenerateWalletOptions, callback?: NodeCallback): Bluebird; /** * List the user's wallet shares * @param params * @param callback */ listShares(params?: Record, callback?: NodeCallback): Bluebird; /** * Gets a wallet share information, including the encrypted sharing keychain. requires unlock if keychain is present. * @param params * @param params.walletShareId - the wallet share to get information on * @param callback */ getShare(params?: { walletShareId?: string; }, callback?: NodeCallback): Bluebird; /** * Update a wallet share * @param params.walletShareId - the wallet share to update * @param params.state - the new state of the wallet share * @param params * @param callback */ updateShare(params?: UpdateShareOptions, callback?: NodeCallback): Bluebird; /** * Resend a wallet share invitation email * @param params * @param params.walletShareId - the wallet share whose invitiation should be resent * @param callback */ resendShareInvite(params?: { walletShareId?: string; }, callback?: NodeCallback): Bluebird; /** * Cancel a wallet share * @param params * @param params.walletShareId - the wallet share to update * @param callback */ cancelShare(params?: { walletShareId?: string; }, callback?: NodeCallback): Bluebird; /** * Accepts a wallet share, adding the wallet to the user's list * Needs a user's password to decrypt the shared key * * @param params * @param params.walletShareId - the wallet share to accept * @param params.userPassword - (required if more a keychain was shared) user's password to decrypt the shared wallet * @param params.newWalletPassphrase - new wallet passphrase for saving the shared wallet prv. * If left blank and a wallet with more than view permissions was shared, * then the user's login password is used. * @param params.overrideEncryptedPrv - set only if the prv was received out-of-band. * @param callback */ acceptShare(params?: AcceptShareOptions, callback?: NodeCallback): Bluebird; /** * Get a wallet by its ID * @param params * @param params.id wallet id * @param callback * @returns {*} */ getWallet(params?: GetWalletOptions, callback?: NodeCallback): Bluebird; /** * Get a wallet by its address * @param params * @param params.address wallet address * @param callback * @returns {*} */ getWalletByAddress(params?: GetWalletByAddressOptions, callback?: NodeCallback): Bluebird; /** * For any given supported coin, get total balances for all wallets of that * coin type on the account. * @param params * @param callback * @returns {*} */ getTotalBalances(params?: Record, callback?: NodeCallback): Bluebird; } //# sourceMappingURL=wallets.d.ts.map