libdocs/effect_call_builder.js

import { CallBuilder } from "./call_builder";
/**
 * Creates a new {@link EffectCallBuilder} pointed to server defined by serverUrl.
 * Do not create this object directly, use {@link Server#effects}.
 *
 * @class EffectCallBuilder
 * @extends CallBuilder
 * @see [All Effects](https://developers.stellar.org/api/resources/effects/)
 * @constructor
 * @param {string} serverUrl Horizon server URL.
 */
export class EffectCallBuilder extends CallBuilder {
    constructor(serverUrl) {
        super(serverUrl, "effects");
        this.url.segment("effects");
    }
    /**
     * This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
     * @see [Effects for Account](https://developers.stellar.org/api/resources/accounts/effects/)
     * @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
     * @returns {EffectCallBuilder} this EffectCallBuilder instance
     */
    forAccount(accountId) {
        return this.forEndpoint("accounts", accountId);
    }
    /**
     * Effects are the specific ways that the ledger was changed by any operation.
     *
     * This endpoint represents all effects that occurred in the given ledger.
     * @see [Effects for Ledger](https://developers.stellar.org/api/resources/ledgers/effects/)
     * @param {number|string} sequence Ledger sequence
     * @returns {EffectCallBuilder} this EffectCallBuilder instance
     */
    forLedger(sequence) {
        return this.forEndpoint("ledgers", sequence.toString());
    }
    /**
     * This endpoint represents all effects that occurred as a result of a given transaction.
     * @see [Effects for Transaction](https://developers.stellar.org/api/resources/transactions/effects/)
     * @param {string} transactionId Transaction ID
     * @returns {EffectCallBuilder} this EffectCallBuilder instance
     */
    forTransaction(transactionId) {
        return this.forEndpoint("transactions", transactionId);
    }
    /**
     * This endpoint represents all effects that occurred as a result of a given operation.
     * @see [Effects for Operation](https://developers.stellar.org/api/resources/operations/effects/)
     * @param {number} operationId Operation ID
     * @returns {EffectCallBuilder} this EffectCallBuilder instance
     */
    forOperation(operationId) {
        return this.forEndpoint("operations", operationId);
    }
    /**
     * This endpoint represents all effects involving a particular liquidity pool.
     *
     * @param {string} poolId   liquidity pool ID
     * @returns {EffectCallBuilder} this EffectCallBuilder instance
     */
    forLiquidityPool(poolId) {
        return this.forEndpoint("liquidity_pools", poolId);
    }
}
//# sourceMappingURL=effect_call_builder.js.map