blockchain-wallet-ts
Version:
TypeScript wrapper for Blockchain.info's wallet API
45 lines (44 loc) • 1.14 kB
TypeScript
import { AxiosInstance } from 'axios';
import { ServiceMyWalletApi } from './Interfaces/ServiceMyWalletApi';
import BlockchainWallet from './BlockchainWallet';
export default class BlockchainApi {
/**
* Blockchain.com API key
*/
private readonly apiKey?;
/**
* Service client.
*/
protected http: AxiosInstance;
/**
* Blockchain Wallet constructor
*/
constructor(config: BlockchainApiConfig);
/**
* Create a new wallet.
*/
createWallet(params: ServiceMyWalletApi.Params.createWallet): Promise<BlockchainWallet>;
/**
* Fetch an existing wallet using the given guid and password.
*/
getWallet(wallet: {
guid: string;
password: string;
}): BlockchainWallet;
}
/**
* Constructor options.
*/
export interface BlockchainApiConfig {
/**
* URL to running 'service-my-wallet', include port!
* E.g. http://localhost:3000
*
* @link https://github.com/blockchain/service-my-wallet-v3
*/
apiUrl: string;
/**
* Your API Key
*/
apiKey?: string;
}