all files / src/ account_call_builder.js

100% Statements 62/62
100% Branches 30/30
100% Functions 9/9
100% Lines 6/6
17 statements, 15 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                        15× 15×                       10× 10×      
import {CallBuilder} from "./call_builder";
 
export class AccountCallBuilder extends CallBuilder {
    /**
     * Creates a new {@link AccountCallBuilder} pointed to server defined by serverUrl.
     *
     * Do not create this object directly, use {@link Server#accounts}.
     * @see [All Accounts](https://www.stellar.org/developers/horizon/reference/accounts-all.html)
     * @constructor
     * @extends CallBuilder
     * @param {string} serverUrl Horizon server URL.
     */
    constructor(serverUrl) {
        super(serverUrl);
        this.url.segment('accounts');
    }
 
    /**
     * Returns information and links relating to a single account.
     * The balances section in the returned JSON will also list all the trust lines this account has set up.
     *
     * @see [Account Details](https://www.stellar.org/developers/horizon/reference/accounts-single.html)
     * @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
     * @returns {AccountCallBuilder}
     */
    accountId(id) {
      this.filter.push(['accounts', id]);
      return this;
    }
}