1 function accountsApi(http) {
6 * Create a new account.
8 * @see https://github.com/Bytom/bytom/wiki/API-Reference#create-account
10 * @param {Array of String} xpubs - root_xpubs, pubkey array.
11 * @param {Integer} quorum - The number of keys required to sign transactions for the account.
12 * @param {String} alias - Account alias.
14 accountsApi.prototype.create = function(xpubs, quorum, alias) {
15 return this.http.request('/create-account', {root_xpubs: xpubs, quorum, alias});
19 * List all accounts in the target Bytom node.
21 accountsApi.prototype.listAll = function() {
22 return this.http.request('/list-accounts', {});
26 * List all addresses for one account.
28 * @param {String} accountId - id of account.
30 accountsApi.prototype.listAddressesById = function(accountId) {
31 return this.http.request("/list-addresses", {account_id: accountId});
35 * List all addresses for one account.
37 * @param {String} accountAlias - alias of account.
39 accountsApi.prototype.listAddressesByAlias = function(accountAlias) {
40 return this.http.request("/list-addresses", {account_alias: accountAlias});
43 export default accountsApi;