import { CallBuilder } from "./call_builder";
/**
* Creates a new {@link PaymentCallBuilder} pointed to server defined by serverUrl.
*
* Do not create this object directly, use {@link Server#payments}.
* @see [All Payments](https://developers.stellar.org/api/resources/payments/)
* @constructor
* @extends CallBuilder
* @param {string} serverUrl Horizon server URL.
*/
export class PaymentCallBuilder extends CallBuilder {
constructor(serverUrl) {
super(serverUrl, "payments");
this.url.segment("payments");
}
/**
* This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.
* @see [Payments for Account](https://developers.stellar.org/api/resources/accounts/payments/)
* @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
*/
forAccount(accountId) {
return this.forEndpoint("accounts", accountId);
}
/**
* This endpoint represents all payment operations that are part of a valid transactions in a given ledger.
* @see [Payments for Ledger](https://developers.stellar.org/api/resources/ledgers/payments/)
* @param {number|string} sequence Ledger sequence
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
*/
forLedger(sequence) {
return this.forEndpoint("ledgers", sequence.toString());
}
/**
* This endpoint represents all payment operations that are part of a given transaction.
* @see [Payments for Transaction](https://developers.stellar.org/api/resources/transactions/payments/)
* @param {string} transactionId Transaction ID
* @returns {PaymentCallBuilder} this PaymentCallBuilder instance
*/
forTransaction(transactionId) {
return this.forEndpoint("transactions", transactionId);
}
}
//# sourceMappingURL=payment_call_builder.js.map