blockchain-wallet-ts
Version:
TypeScript wrapper for Blockchain.info's wallet API
66 lines (65 loc) • 1.94 kB
TypeScript
import { ServiceMyWalletApi } from './Interfaces/ServiceMyWalletApi';
import BlockchainHDWallet from './BlockchainHDWallet';
import ApiClient, { ApiClientConfig } from './Providers/ApiClient';
export default class BlockchainWallet extends ApiClient {
/**
* Blockchain.com wallet ID.
*/
readonly guid: string;
/**
* Blockchain.com wallet password.
*/
private readonly password;
/**
* API Base path.
*/
protected get basePath(): string;
/**
* Parameters to be included in every API request.
*/
protected get baseParams(): {
password: string;
};
/**
* Blockchain Wallet constructor.
*/
constructor(config: BlockchainWalletConfig);
/**
* Initiate a payment to the given address.
*/
pay(params: ServiceMyWalletApi.Params.makePayment): Promise<ServiceMyWalletApi.Response.makePayment>;
/**
* Initiate a payment to multiple recipients.
*/
payMany(params: ServiceMyWalletApi.Params.sendToMany): Promise<ServiceMyWalletApi.Response.sendToMany>;
/**
* Wallet balance in satoshis.
*/
get balance(): Promise<ServiceMyWalletApi.Response.fetchBalance>;
/**
* Enable HD wallet functionality for the current wallet.
*/
enableHD(): Promise<void>;
/**
* Active HD accounts connected to this wallet.
*/
get accounts(): Promise<ServiceMyWalletApi.Response.accounts>;
/**
* Fetch HD xPubs for this wallet.
*/
get xpubs(): Promise<ServiceMyWalletApi.Response.xpubs>;
/**
* Create HD account.
*/
createHD(params?: ServiceMyWalletApi.Params.createHDAccount): Promise<BlockchainHDWallet>;
}
export interface BlockchainWalletConfig extends ApiClientConfig {
/**
* Wallet GUID.
*/
guid: string;
/**
* Wallet password.
*/
password: string;
}