1 import ApiBase from './base'
4 * An account is an object in Bytom that tracks ownership of assets on a
7 * @typedef {Object} Account
10 * @property {String} id
11 * Unique account identifier in one Bytom node.
13 * @property {String} alias
14 * User specified, unique identifier in one Bytom node.
16 * @property {Key[]} keys
17 * The list of keys used to create control programs under the account.
18 * Signatures from these keys are required for spending funds held in the account.
20 * @property {Number} quorum
21 * The number of keys required to sign transactions for the account.
26 * API for interacting with {@link Account accounts}.
31 constructor(connection) {
32 this.connection = connection
35 create(xpubs, quorum, alias) {
36 this.connection.request('/create-account', {
44 this.connection.request('/list-accounts', {id})
47 createReceiverById(accountId) {
48 this.connection.request('/create-account-receiver', {
53 listAddressesById(accountId) {
54 this.connection.request('/list-addresses', {
60 this.connection.request('/delete-account', {
66 export default AccountsApi