Skip to content

Core / Transactions

Account

Create a new Account object.

Account represents a single account in the Stellar network and its sequence number. Account tracks the sequence number as it is used by TransactionBuilder. See Accounts for more information about how accounts work in Stellar.

class Account implements TransactionSource {
constructor(accountId: string, sequence: string);
accountId(): string;
incrementSequenceNumber(): void;
sequenceNumber(): string;
}

Source: src/base/account.ts:16

new Account(accountId, sequence)

constructor(accountId: string, sequence: string);

Parameters

  • accountIdstring (required) — ID of the account (ex. GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA). If you provide a muxed account address, this will throw; use MuxedAccount instead.
  • sequencestring (required) — current sequence number of the account

Source: src/base/account.ts:27

account.accountId()

Returns Stellar account ID, ex. GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA.

accountId(): string;

Source: src/base/account.ts:58

account.incrementSequenceNumber()

Increments sequence number in this object by one.

incrementSequenceNumber(): void;

Source: src/base/account.ts:72

account.sequenceNumber()

Returns sequence number for the account as a string

sequenceNumber(): string;

Source: src/base/account.ts:65

AuthClawbackEnabledFlag

When set using Operation.setOptions option, then any trustlines created by this account can have a ClawbackOp operation submitted for the corresponding asset.

const AuthClawbackEnabledFlag: number

See also

Source: src/base/operation.ts:83

AuthImmutableFlag

When set using Operation.setOptions option, then none of the authorization flags can be set and the account can never be deleted.

const AuthImmutableFlag: number

See also

Source: src/base/operation.ts:74

AuthRequiredFlag

When set using Operation.setOptions option, requires the issuing account to give other accounts permission before they can hold the issuing account’s credit.

const AuthRequiredFlag: number

See also

Source: src/base/operation.ts:60

AuthRevocableFlag

When set using Operation.setOptions option, allows the issuing account to revoke its credit held by other accounts.

const AuthRevocableFlag: number

See also

Source: src/base/operation.ts:67

BASE_FEE

Minimum base fee for transactions. If this fee is below the network minimum, the transaction will fail. The more operations in the transaction, the greater the required fee. Use Horizon.Server.fetchBaseFee to get an accurate value of minimum transaction fee on the network.

const BASE_FEE: "100"

See also

Source: src/base/transaction_builder.ts:39

FeeBumpTransaction

Use TransactionBuilder.buildFeeBumpTransaction to build a FeeBumpTransaction object. If you have an object or base64-encoded string of the transaction envelope XDR use TransactionBuilder.fromXDR.

Once a FeeBumpTransaction has been created, its attributes and operations should not be changed. You should only add signatures (using FeeBumpTransaction.sign) before submitting to the network or forwarding on to additional signers.

class FeeBumpTransaction {
constructor(envelope: string | TransactionEnvelope, networkPassphrase: string);
fee: string;
readonly feeSource: string;
readonly innerTransaction: Transaction;
networkPassphrase: string;
readonly operations: OperationRecord[];
signatures: DecoratedSignature[];
tx: TTx;
addDecoratedSignature(signature: DecoratedSignature): void;
addSignature(publicKey: string = "", signature: string = ""): void;
getKeypairSignature(keypair: Keypair): string;
hash(): Buffer;
sign(...keypairs: Keypair[]): void;
signatureBase(): Buffer;
signHashX(preimage: string | Buffer<ArrayBufferLike>): void;
toEnvelope(): TransactionEnvelope;
toXDR(): string;
}

Source: src/base/fee_bump_transaction.ts:17

new FeeBumpTransaction(envelope, networkPassphrase)

constructor(envelope: string | TransactionEnvelope, networkPassphrase: string);

Parameters

  • envelopestring | TransactionEnvelope (required) — transaction envelope object or base64 encoded string.
  • networkPassphrasestring (required) — passphrase of the target Stellar network (e.g. “Public Global Stellar Network ; September 2015”).

Source: src/base/fee_bump_transaction.ts:26

feeBumpTransaction.fee

The total fee for this transaction, in stroops.

fee: string;

Source: src/base/transaction_base.ts:76

feeBumpTransaction.feeSource

The account paying the fee for this transaction.

readonly feeSource: string;

Source: src/base/fee_bump_transaction.ts:78

feeBumpTransaction.innerTransaction

The inner transaction that this fee bump wraps.

readonly innerTransaction: Transaction;

Source: src/base/fee_bump_transaction.ts:64

feeBumpTransaction.networkPassphrase

The network passphrase for this transaction.

networkPassphrase: string;

Source: src/base/transaction_base.ts:85

feeBumpTransaction.operations

The operations from the inner transaction.

readonly operations: OperationRecord[];

Source: src/base/fee_bump_transaction.ts:71

feeBumpTransaction.signatures

The list of signatures for this transaction.

signatures: DecoratedSignature[];

Source: src/base/transaction_base.ts:35

feeBumpTransaction.tx

The underlying XDR transaction object.

Returns a defensive copy so that external mutations cannot alter the transaction that will be signed or serialized.

tx: TTx;

Throws

  • if the internal transaction is not a recognized XDR type

Source: src/base/transaction_base.ts:51

feeBumpTransaction.addDecoratedSignature(signature)

Add a decorated signature directly to the transaction envelope.

addDecoratedSignature(signature: DecoratedSignature): void;

Parameters

  • signatureDecoratedSignature (required) — raw signature to add

See also

    • Keypair.signDecorated
  • Keypair.signPayloadDecorated

Source: src/base/transaction_base.ts:196

feeBumpTransaction.addSignature(publicKey, signature)

Add a signature to the transaction. Useful when a party wants to pre-sign a transaction but doesn’t want to give access to their secret keys. This will also verify whether the signature is valid.

Here’s how you would use this feature to solicit multiple signatures.

  • Use TransactionBuilder to build a new transaction.
  • Make sure to set a long enough timeout on that transaction to give your signers enough time to sign!
  • Once you build the transaction, use transaction.toXDR() to get the base64-encoded XDR string.
  • Warning! Once you’ve built this transaction, don’t submit any other transactions onto your account! Doing so will invalidate this pre-compiled transaction!
  • Send this XDR string to your other parties. They can use the instructions for getKeypairSignature to sign the transaction.
  • They should send you back their publicKey and the signature string from getKeypairSignature, both of which you pass to this function.
addSignature(publicKey: string = "", signature: string = ""): void;

Parameters

  • publicKeystring (optional) (default: "") — the public key of the signer
  • signaturestring (optional) (default: "") — the base64 value of the signature XDR

Source: src/base/transaction_base.ts:156

feeBumpTransaction.getKeypairSignature(keypair)

Signs a transaction with the given Keypair. Useful if someone sends you a transaction XDR for you to sign and return (see addSignature for more information).

When you get a transaction XDR to sign…

  • Instantiate a Transaction object with the XDR
  • Use Keypair to generate a keypair object for your Stellar seed.
  • Run getKeypairSignature with that keypair
  • Send back the signature along with your publicKey (not your secret seed!)

Example:

// `transactionXDR` is a string from the person generating the transaction
const transaction = new Transaction(transactionXDR, networkPassphrase);
const keypair = Keypair.fromSecret(myStellarSeed);
return transaction.getKeypairSignature(keypair);

Returns the base64-encoded signature string for the given keypair.

getKeypairSignature(keypair: Keypair): string;

Parameters

  • keypairKeypair (required) — Keypair of signer

Source: src/base/transaction_base.ts:129

feeBumpTransaction.hash()

Returns a hash for this transaction, suitable for signing.

hash(): Buffer;

Source: src/base/transaction_base.ts:222

feeBumpTransaction.sign(keypairs)

Signs the transaction with the given Keypair.

sign(...keypairs: Keypair[]): void;

Parameters

  • ...keypairsKeypair[] (required) — Keypairs of signers

Source: src/base/transaction_base.ts:97

feeBumpTransaction.signatureBase()

Returns the “signature base” of this transaction, which is the value that, when hashed, should be signed to create a signature that validators on the Stellar Network will accept.

It is composed of a 4 prefix bytes followed by the xdr-encoded form of this transaction.

signatureBase(): Buffer;

Source: src/base/fee_bump_transaction.ts:90

feeBumpTransaction.signHashX(preimage)

Add hashX signer preimage as signature.

signHashX(preimage: string | Buffer<ArrayBufferLike>): void;

Parameters

  • preimagestring | Buffer<ArrayBufferLike> (required) — preimage of hash used as signer

Source: src/base/transaction_base.ts:204

feeBumpTransaction.toEnvelope()

To envelope returns a xdr.TransactionEnvelope which can be submitted to the network.

toEnvelope(): TransactionEnvelope;

Source: src/base/fee_bump_transaction.ts:107

feeBumpTransaction.toXDR()

Returns the transaction envelope as a base64-encoded XDR string.

toXDR(): string;

Source: src/base/transaction_base.ts:239

Int128

class Int128 extends LargeInt {
constructor(...args: (string | number | bigint)[]);
static MAX_VALUE: LargeInt;
static MIN_VALUE: LargeInt;
static defineIntBoundaries(): void;
static fromString(value: string): LargeInt;
static isValid(value: unknown): boolean;
readonly size: number;
readonly unsigned: boolean;
slice(chunkSize: number): bigint[];
toBigInt(): bigint;
toString(): string;
}

Source: src/base/numbers/int128.ts:3

new Int128(args)

Construct a signed 128-bit integer that can be XDR-encoded.

constructor(...args: (string | number | bigint)[]);

Parameters

  • ...args(string | number | bigint)[] (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits)

Source: src/base/numbers/int128.ts:10

Int128.MAX_VALUE

static MAX_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:14

Int128.MIN_VALUE

static MIN_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:13

Int128.defineIntBoundaries()

static defineIntBoundaries(): void;

Source: types/stellar__js-xdr/index.d.ts:12

Int128.fromString(value)

static fromString(value: string): LargeInt;

Parameters

  • valuestring (required)

Source: types/stellar__js-xdr/index.d.ts:16

Int128.isValid(value)

static isValid(value: unknown): boolean;

Parameters

  • valueunknown (required)

Source: types/stellar__js-xdr/index.d.ts:15

int128.size

readonly size: number;

Source: src/base/numbers/int128.ts:18

int128.unsigned

readonly unsigned: boolean;

Source: src/base/numbers/int128.ts:14

int128.slice(chunkSize)

slice(chunkSize: number): bigint[];

Parameters

  • chunkSizenumber (required)

Source: types/stellar__js-xdr/index.d.ts:21

int128.toBigInt()

toBigInt(): bigint;

Source: types/stellar__js-xdr/index.d.ts:19

int128.toString()

toString(): string;

Source: types/stellar__js-xdr/index.d.ts:20

Int256

class Int256 extends LargeInt {
constructor(...args: (string | number | bigint)[]);
static MAX_VALUE: LargeInt;
static MIN_VALUE: LargeInt;
static defineIntBoundaries(): void;
static fromString(value: string): LargeInt;
static isValid(value: unknown): boolean;
readonly size: number;
readonly unsigned: boolean;
slice(chunkSize: number): bigint[];
toBigInt(): bigint;
toString(): string;
}

Source: src/base/numbers/int256.ts:3

new Int256(args)

Construct a signed 256-bit integer that can be XDR-encoded.

constructor(...args: (string | number | bigint)[]);

Parameters

  • ...args(string | number | bigint)[] (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits)

Source: src/base/numbers/int256.ts:10

Int256.MAX_VALUE

static MAX_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:14

Int256.MIN_VALUE

static MIN_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:13

Int256.defineIntBoundaries()

static defineIntBoundaries(): void;

Source: types/stellar__js-xdr/index.d.ts:12

Int256.fromString(value)

static fromString(value: string): LargeInt;

Parameters

  • valuestring (required)

Source: types/stellar__js-xdr/index.d.ts:16

Int256.isValid(value)

static isValid(value: unknown): boolean;

Parameters

  • valueunknown (required)

Source: types/stellar__js-xdr/index.d.ts:15

int256.size

readonly size: number;

Source: src/base/numbers/int256.ts:18

int256.unsigned

readonly unsigned: boolean;

Source: src/base/numbers/int256.ts:14

int256.slice(chunkSize)

slice(chunkSize: number): bigint[];

Parameters

  • chunkSizenumber (required)

Source: types/stellar__js-xdr/index.d.ts:21

int256.toBigInt()

toBigInt(): bigint;

Source: types/stellar__js-xdr/index.d.ts:19

int256.toString()

toString(): string;

Source: types/stellar__js-xdr/index.d.ts:20

Memo

Memo represents memos attached to transactions.

class Memo<T extends MemoType = MemoType> {
constructor(type: "none", value?: null);
static fromXDRObject(object: Memo): Memo;
static hash(hash: string | Buffer<ArrayBufferLike>): Memo<"hash">;
static id(id: string): Memo<"id">;
static none(): Memo<"none">;
static return(hash: string | Buffer<ArrayBufferLike>): Memo<"return">;
static text(text: string): Memo<"text">;
type: T;
value: MemoTypeToValue<T>;
toXDRObject(): Memo;
}

See also

Source: src/base/memo.ts:63

new Memo(type, value)

constructor(type: "none", value?: null);

Parameters

  • type"none" (required)
  • valuenull (optional)

Source: src/base/memo.ts:67

Memo.fromXDRObject(object)

Returns Memo from XDR memo object.

static fromXDRObject(object: Memo): Memo;

Parameters

  • objectMemo (required) — XDR memo object

Source: src/base/memo.ts:302

Memo.hash(hash)

Creates and returns a MemoHash memo.

static hash(hash: string | Buffer<ArrayBufferLike>): Memo<"hash">;

Parameters

  • hashstring | Buffer<ArrayBufferLike> (required) — 32 byte hash or hex encoded string

Source: src/base/memo.ts:260

Memo.id(id)

Creates and returns a MemoID memo.

static id(id: string): Memo<"id">;

Parameters

  • idstring (required) — 64-bit number represented as a string

Source: src/base/memo.ts:251

Memo.none()

Returns an empty memo (MemoNone).

static none(): Memo<"none">;

Source: src/base/memo.ts:233

Memo.return(hash)

Creates and returns a MemoReturn memo.

static return(hash: string | Buffer<ArrayBufferLike>): Memo<"return">;

Parameters

  • hashstring | Buffer<ArrayBufferLike> (required) — 32 byte hash or hex encoded string

Source: src/base/memo.ts:269

Memo.text(text)

Creates and returns a MemoText memo.

static text(text: string): Memo<"text">;

Parameters

  • textstring (required) — memo text

Source: src/base/memo.ts:242

memo.type

Contains memo type: MemoNone, MemoID, MemoText, MemoHash or MemoReturn

type: T;

Source: src/base/memo.ts:107

memo.value

Contains memo value:

  • null for MemoNone,
  • string for MemoID,
  • Buffer for MemoText after decoding using fromXDRObject, original value otherwise,
  • Buffer for MemoHash, MemoReturn.
value: MemoTypeToValue<T>;

Source: src/base/memo.ts:122

memo.toXDRObject()

Returns XDR memo object.

toXDRObject(): Memo;

Source: src/base/memo.ts:276

MemoHash

Type of Memo.

const MemoHash: "hash"

Source: src/base/memo.ts:21

MemoID

Type of Memo.

const MemoID: "id"

Source: src/base/memo.ts:13

MemoNone

Type of Memo.

const MemoNone: "none"

Source: src/base/memo.ts:9

MemoReturn

Type of Memo.

const MemoReturn: "return"

Source: src/base/memo.ts:25

MemoText

Type of Memo.

const MemoText: "text"

Source: src/base/memo.ts:17

MuxedAccount

Represents a muxed account for transactions and operations.

A muxed (or multiplexed) account (defined rigorously in CAP-27 and briefly in SEP-23) is one that resolves a single Stellar G... account to many different underlying IDs.

For example, you may have a single Stellar address for accounting purposes: GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ

Yet would like to use it for 4 different family members: 1: MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAAGZFQ 2: MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAALIWQ 3: MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAAPYHQ 4: MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUAAAAAAAAAAAAQLQQ

This object makes it easy to create muxed accounts from regular accounts, duplicate them, get/set the underlying IDs, etc. without mucking around with the raw XDR.

Because muxed accounts are purely an off-chain convention, they all share the sequence number tied to their underlying G… account. Thus, this object requires an Account instance to be passed in, so that muxed instances of an account can collectively modify the sequence number whenever a muxed account is used as the source of a Transaction with TransactionBuilder.

class MuxedAccount implements TransactionSource {
constructor(baseAccount: Account, id: string);
static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount;
accountId(): string;
baseAccount(): Account;
equals(otherMuxedAccount: MuxedAccount): boolean;
id(): string;
incrementSequenceNumber(): void;
sequenceNumber(): string;
setId(id: string): MuxedAccount;
toXDRObject(): MuxedAccount;
}

See also

Source: src/base/muxed_account.ts:60

new MuxedAccount(baseAccount, id)

constructor(baseAccount: Account, id: string);

Parameters

  • baseAccountAccount (required) — the Account instance representing the underlying G… address
  • idstring (required) — a stringified uint64 value that represents the ID of the muxed account

Source: src/base/muxed_account.ts:72

MuxedAccount.fromAddress(mAddress, sequenceNum)

Parses an M-address into a MuxedAccount object.

static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount;

Parameters

  • mAddressstring (required) — an M-address to transform
  • sequenceNumstring (required) — the sequence number of the underlying Account, to use for the underlying base account MuxedAccount.baseAccount. If you’re using the SDK, you can use server.loadAccount to fetch this if you don’t know it.

Source: src/base/muxed_account.ts:96

muxedAccount.accountId()

Returns the M-address representing this account’s (G-address, ID).

accountId(): string;

Source: src/base/muxed_account.ts:115

muxedAccount.baseAccount()

Returns the underlying account object shared among all muxed accounts with this Stellar address.

baseAccount(): Account;

Source: src/base/muxed_account.ts:108

muxedAccount.equals(otherMuxedAccount)

Checks whether two muxed accounts are equal by comparing their M-addresses.

equals(otherMuxedAccount: MuxedAccount): boolean;

Parameters

  • otherMuxedAccountMuxedAccount (required) — the MuxedAccount to compare against

Source: src/base/muxed_account.ts:171

muxedAccount.id()

Returns the uint64 ID of this muxed account as a string.

id(): string;

Source: src/base/muxed_account.ts:122

muxedAccount.incrementSequenceNumber()

Increments the underlying account’s sequence number by one.

incrementSequenceNumber(): void;

Source: src/base/muxed_account.ts:154

muxedAccount.sequenceNumber()

Returns the stringified sequence number for the underlying account.

sequenceNumber(): string;

Source: src/base/muxed_account.ts:147

muxedAccount.setId(id)

Updates the muxed account’s ID, regenerating the M-address accordingly.

setId(id: string): MuxedAccount;

Parameters

  • idstring (required) — a stringified uint64 value to set as the new muxed account ID

Source: src/base/muxed_account.ts:131

muxedAccount.toXDRObject()

Returns the XDR object representing this muxed account’s G-address and uint64 ID.

toXDRObject(): MuxedAccount;

Source: src/base/muxed_account.ts:162

Operation

Operation class represents operations in Stellar network.

Use one of static methods to create operations:

class Operation {
constructor();
static accountMerge: (opts: AccountMergeOpts) => Operation2<AccountMergeResult>;
static allowTrust: (opts: AllowTrustOpts) => Operation2<AllowTrustResult>;
static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation2<BeginSponsoringFutureReservesResult>;
static bumpSequence: (opts: BumpSequenceOpts) => Operation2<BumpSequenceResult>;
static changeTrust: (opts: ChangeTrustOpts) => Operation2<ChangeTrustResult>;
static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation2<ClaimClaimableBalanceResult>;
static clawback: (opts: ClawbackOpts) => Operation2<ClawbackResult>;
static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation2<ClawbackClaimableBalanceResult>;
static createAccount: (opts: CreateAccountOpts) => Operation2<CreateAccountResult>;
static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation2<CreateClaimableBalanceResult>;
static createCustomContract: (opts: CreateCustomContractOpts) => Operation2<InvokeHostFunctionResult>;
static createPassiveSellOffer: (opts: CreatePassiveSellOfferOpts) => Operation2<CreatePassiveSellOfferResult>;
static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation2<InvokeHostFunctionResult>;
static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation2<EndSponsoringFutureReservesResult>;
static extendFootprintTtl: (opts: ExtendFootprintTtlOpts) => Operation2<ExtendFootprintTTLResult>;
static inflation: (opts: InflationOpts = {}) => Operation2<InflationResult>;
static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation2<InvokeHostFunctionResult>;
static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation2<InvokeHostFunctionResult>;
static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation2<LiquidityPoolDepositResult>;
static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation2<LiquidityPoolWithdrawResult>;
static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation2<ManageBuyOfferResult>;
static manageData: (opts: ManageDataOpts) => Operation2<ManageDataResult>;
static manageSellOffer: (opts: ManageSellOfferOpts) => Operation2<ManageSellOfferResult>;
static pathPaymentStrictReceive: (opts: PathPaymentStrictReceiveOpts) => Operation2<PathPaymentStrictReceiveResult>;
static pathPaymentStrictSend: (opts: PathPaymentStrictSendOpts) => Operation2<PathPaymentStrictSendResult>;
static payment: (opts: PaymentOpts) => Operation2<PaymentResult>;
static restoreFootprint: (opts: RestoreFootprintOpts = {}) => Operation2<RestoreFootprintResult>;
static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation2<RevokeAccountSponsorshipResult>;
static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation2<RevokeClaimableBalanceSponsorshipResult>;
static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation2<RevokeDataSponsorshipResult>;
static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation2<RevokeLiquidityPoolSponsorshipResult>;
static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation2<RevokeOfferSponsorshipResult>;
static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation2<RevokeSignerSponsorshipResult>;
static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation2<RevokeTrustlineSponsorshipResult>;
static setOptions: <T extends SignerOpts = never>(opts: SetOptionsOpts<T>) => Operation2<SetOptionsResult<T>>;
static setTrustLineFlags: (opts: SetTrustLineFlagsOpts) => Operation2<SetTrustLineFlagsResult>;
static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation2<InvokeHostFunctionResult>;
static fromXDRObject<T extends OperationRecord = OperationRecord>(operation: Operation2<T>): T;
}

Source: src/base/operation.ts:131

new Operation()

constructor();

Operation.accountMerge

Transfers native balance to destination account.

static accountMerge: (opts: AccountMergeOpts) => Operation2<AccountMergeResult>;

Parameters

  • optsAccountMergeOpts (required) — options object
    • destination: destination to merge the source account into
    • source: operation source account (defaults to transaction source)

Source: src/base/operation.ts:436

Operation.allowTrust

Deprecated. since v5.0

An “allow trust” operation authorizes another account to hold your account’s credit for a given asset.

static allowTrust: (opts: AllowTrustOpts) => Operation2<AllowTrustResult>;

Parameters

  • optsAllowTrustOpts (required) — Options object
    • trustor: The trusting account (the one being authorized)
    • assetCode: The asset code being authorized.
    • authorize: 1 to authorize, 2 to authorize to maintain liabilities, and 0 to deauthorize.
    • source: The source account (defaults to transaction source).

Source: src/base/operation.ts:437

Operation.beginSponsoringFutureReserves

Create a “begin sponsoring future reserves” operation.

static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation2<BeginSponsoringFutureReservesResult>;

Parameters

  • optsBeginSponsoringFutureReservesOpts (required) — Options object
    • sponsoredId: The sponsored account id.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.beginSponsoringFutureReserves({
sponsoredId: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
});

Source: src/base/operation.ts:453

Operation.bumpSequence

This operation bumps sequence number.

static bumpSequence: (opts: BumpSequenceOpts) => Operation2<BumpSequenceResult>;

Parameters

  • optsBumpSequenceOpts (required) — Options object
    • bumpTo: Sequence number to bump to.
    • source: The optional source account.

Source: src/base/operation.ts:438

Operation.changeTrust

A “change trust” operation adds, removes, or updates a trust line for a given asset from the source account to another.

static changeTrust: (opts: ChangeTrustOpts) => Operation2<ChangeTrustResult>;

Parameters

  • optsChangeTrustOpts (required) — Options object
    • asset: The asset for the trust line.
    • limit: The limit for the asset, defaults to max int64. If the limit is set to “0” it deletes the trustline.
    • source: The source account (defaults to transaction source).

Source: src/base/operation.ts:439

Operation.claimClaimableBalance

Create a new claim claimable balance operation.

static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation2<ClaimClaimableBalanceResult>;

Parameters

  • optsClaimClaimableBalanceOpts (optional) (default: ...) — Options object
    • balanceId: The claimable balance id to be claimed.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.claimClaimableBalance({
balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

Source: src/base/operation.ts:442

Operation.clawback

Creates a clawback operation.

static clawback: (opts: ClawbackOpts) => Operation2<ClawbackResult>;

Parameters

  • optsClawbackOpts (required) — Options object
    • asset: The asset being clawed back.
    • amount: The amount of the asset to claw back.
    • from: The public key of the (optionally-muxed) account to claw back from.
    • source: The source account for the operation. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:463

Operation.clawbackClaimableBalance

Creates a clawback operation for a claimable balance.

static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation2<ClawbackClaimableBalanceResult>;

Parameters

  • optsClawbackClaimableBalanceOpts (optional) (default: ...) — Options object
    • balanceId: The claimable balance ID to be clawed back.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.clawbackClaimableBalance({
balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

See also

Source: src/base/operation.ts:443

Operation.createAccount

Create and fund a non-existent account.

static createAccount: (opts: CreateAccountOpts) => Operation2<CreateAccountResult>;

Parameters

  • optsCreateAccountOpts (required) — Options object
    • destination: Destination account ID to create an account for.
    • startingBalance: Amount in XLM the account should be funded for. Must be greater than the reserve balance amount.
    • source: The source account for the payment. Defaults to the transaction’s source account.

Source: src/base/operation.ts:440

Operation.createClaimableBalance

Create a new claimable balance operation.

static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation2<CreateClaimableBalanceResult>;

Parameters

  • optsCreateClaimableBalanceOpts (required) — Options object
    • asset: The asset for the claimable balance.
    • amount: Amount.
    • claimants: An array of Claimants
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const asset = new Asset(
'USD',
'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
);
const amount = '100.0000000';
const claimants = [
new Claimant(
'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ',
Claimant.predicateBeforeAbsoluteTime("4102444800000")
)
];
const op = Operation.createClaimableBalance({
asset,
amount,
claimants
});

Source: src/base/operation.ts:441

Operation.createCustomContract

Returns an operation that creates a custom WASM contract and atomically invokes its constructor.

static createCustomContract: (opts: CreateCustomContractOpts) => Operation2<InvokeHostFunctionResult>;

Parameters

  • optsCreateCustomContractOpts (required) — the set of parameters
    • address: the contract uploader address
    • wasmHash: the SHA-256 hash of the contract WASM you’re uploading
    • constructorArgs: the optional parameters to pass to the constructor
    • salt: an optional, 32-byte salt to distinguish deployment instances
    • auth: an optional list outlining the tree of authorizations required for the call
    • source: an optional source account

See also

Source: src/base/operation.ts:475

Operation.createPassiveSellOffer

A “create passive offer” operation creates an offer that won’t consume a counter offer that exactly matches this offer. This is useful for offers just used as 1:1 exchanges for path payments. Use manage offer to manage this offer after using this operation to create it.

static createPassiveSellOffer: (opts: CreatePassiveSellOfferOpts) => Operation2<CreatePassiveSellOfferResult>;

Parameters

  • optsCreatePassiveSellOfferOpts (required) — Options object
    • selling: What you’re selling.
    • buying: What you’re buying.
    • amount: The total amount you’re selling. If 0, deletes the offer.
    • price: Price of 1 unit of selling in terms of buying.
    • price.n: If opts.price is an object: the price numerator
    • price.d: If opts.price is an object: the price denominator
    • source: The source account (defaults to transaction source).

Throws

  • when the best rational approximation of price cannot be found.

Source: src/base/operation.ts:444

Operation.createStellarAssetContract

Returns an operation that wraps a Stellar asset into a token contract.

static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation2<InvokeHostFunctionResult>;

Parameters

  • optsCreateStellarAssetContractOpts (required) — the set of parameters
    • asset: the Stellar asset to wrap, either as an Asset object or in canonical form (SEP-11, code:issuer)
    • auth: an optional list outlining the tree of authorizations required for the upload
    • source: an optional source account

See also

Source: src/base/operation.ts:473

Operation.endSponsoringFutureReserves

Create an “end sponsoring future reserves” operation.

static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation2<EndSponsoringFutureReservesResult>;

Parameters

  • optsEndSponsoringFutureReservesOpts (optional) (default: {}) — Options object
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.endSponsoringFutureReserves();

Source: src/base/operation.ts:454

Operation.extendFootprintTtl

Builds an operation to bump the time-to-live (TTL) of the ledger keys. The keys for extension have to be provided in the read-only footprint of the transaction.

The only parameter of the operation itself is the new minimum TTL for all the provided entries. If an entry already has a higher TTL, then it will just be skipped.

TTL is the number of ledgers from the current ledger (exclusive) until the last ledger the entry is still considered alive (inclusive). Thus the exact ledger until the entries will live will only be determined when transaction has been applied.

The footprint has to be specified in the transaction. See TransactionBuilder’s opts.sorobanData parameter, which is a xdr.SorobanTransactionData instance that contains fee data & resource usage as part of xdr.SorobanResources.

static extendFootprintTtl: (opts: ExtendFootprintTtlOpts) => Operation2<ExtendFootprintTTLResult>;

Parameters

  • optsExtendFootprintTtlOpts (required) — object holding operation parameters
    • extendTo: the minimum TTL that all the entries in the read-only footprint will have
    • source: an optional source account

Source: src/base/operation.ts:468

Operation.inflation

This operation generates the inflation.

static inflation: (opts: InflationOpts = {}) => Operation2<InflationResult>;

Parameters

  • optsInflationOpts (optional) (default: {}) — Options object
    • source: The optional source account.

Source: src/base/operation.ts:445

Operation.invokeContractFunction

Returns an operation that invokes a contract function.

static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation2<InvokeHostFunctionResult>;

Parameters

  • optsInvokeContractFunctionOpts (required) — the set of parameters
    • contract: a strkey-fied contract address (C...)
    • function: the name of the contract fn to invoke
    • args: parameters to pass to the function invocation
    • auth: an optional list outlining the tree of authorizations required for the call
    • source: an optional source account

See also

    • Operation.invokeHostFunction
  • Contract.call
  • Address

Source: src/base/operation.ts:474

Operation.invokeHostFunction

Invokes a single smart contract host function.

static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation2<InvokeHostFunctionResult>;

Parameters

  • optsInvokeHostFunctionOpts (required) — options object
    • func: host function to execute (with its wrapped parameters)
    • auth: list outlining the tree of authorizations required for the call
    • source: an optional source account

See also

Source: src/base/operation.ts:467

Operation.liquidityPoolDeposit

Creates a liquidity pool deposit operation.

static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation2<LiquidityPoolDepositResult>;

Parameters

  • optsLiquidityPoolDepositOpts (optional) (default: ...) — Options object
    • liquidityPoolId: The liquidity pool ID.
    • maxAmountA: Maximum amount of first asset to deposit.
    • maxAmountB: Maximum amount of second asset to deposit.
    • minPrice: Minimum depositA/depositB price.
    • minPrice.n: If opts.minPrice is an object: the price numerator
    • minPrice.d: If opts.minPrice is an object: the price denominator
    • maxPrice: Maximum depositA/depositB price.
    • maxPrice.n: If opts.maxPrice is an object: the price numerator
    • maxPrice.d: If opts.maxPrice is an object: the price denominator
    • source: The source account for the operation. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:465

Operation.liquidityPoolWithdraw

Creates a liquidity pool withdraw operation.

static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation2<LiquidityPoolWithdrawResult>;

Parameters

  • optsLiquidityPoolWithdrawOpts (optional) (default: ...) — Options object
    • liquidityPoolId: The liquidity pool ID.
    • amount: Amount of pool shares to withdraw.
    • minAmountA: Minimum amount of first asset to withdraw.
    • minAmountB: Minimum amount of second asset to withdraw.
    • source: The source account for the operation. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:466

Operation.manageBuyOffer

Returns a XDR ManageBuyOfferOp. A “manage buy offer” operation creates, updates, or deletes a buy offer.

static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation2<ManageBuyOfferResult>;

Parameters

  • optsManageBuyOfferOpts (required) — Options object
    • selling: What you’re selling.
    • buying: What you’re buying.
    • buyAmount: The total amount you’re buying. If 0, deletes the offer.
    • price: Price of 1 unit of buying in terms of selling.
    • price.n: If opts.price is an object: the price numerator
    • price.d: If opts.price is an object: the price denominator
    • offerId: If 0, will create a new offer (default). Otherwise, edits an existing offer.
    • source: The source account (defaults to transaction source).

Throws

  • when the best rational approximation of price cannot be found.

Source: src/base/operation.ts:448

Operation.manageData

This operation adds data entry to the ledger.

static manageData: (opts: ManageDataOpts) => Operation2<ManageDataResult>;

Parameters

  • optsManageDataOpts (required) — Options object
    • name: The name of the data entry.
    • value: The value of the data entry.
    • source: The optional source account.

Source: src/base/operation.ts:446

Operation.manageSellOffer

Returns a XDR ManageSellOfferOp. A “manage sell offer” operation creates, updates, or deletes an offer.

static manageSellOffer: (opts: ManageSellOfferOpts) => Operation2<ManageSellOfferResult>;

Parameters

  • optsManageSellOfferOpts (required) — Options object
    • selling: What you’re selling.
    • buying: What you’re buying.
    • amount: The total amount you’re selling. If 0, deletes the offer.
    • price: Price of 1 unit of selling in terms of buying.
    • price.n: If opts.price is an object: the price numerator
    • price.d: If opts.price is an object: the price denominator
    • offerId: If 0, will create a new offer (default). Otherwise, edits an existing offer.
    • source: The source account (defaults to transaction source).

Throws

  • when the best rational approximation of price cannot be found.

Source: src/base/operation.ts:447

Operation.pathPaymentStrictReceive

Creates a PathPaymentStrictReceive operation.

A PathPaymentStrictReceive operation sends the specified amount to the destination account. It credits the destination with destAmount of destAsset, while debiting at most sendMax of sendAsset from the source. The transfer optionally occurs through a path. XLM payments create the destination account if it does not exist.

static pathPaymentStrictReceive: (opts: PathPaymentStrictReceiveOpts) => Operation2<PathPaymentStrictReceiveResult>;

Parameters

  • optsPathPaymentStrictReceiveOpts (required) — Options object
    • sendAsset: asset to pay with
    • sendMax: maximum amount of sendAsset to send
    • destination: destination account to send to
    • destAsset: asset the destination will receive
    • destAmount: amount the destination receives
    • path: array of Asset objects to use as the path
    • source: The source account for the payment. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:449

Operation.pathPaymentStrictSend

Creates a PathPaymentStrictSend operation.

A PathPaymentStrictSend operation sends the specified amount to the destination account crediting at least destMin of destAsset, optionally through a path. XLM payments create the destination account if it does not exist.

static pathPaymentStrictSend: (opts: PathPaymentStrictSendOpts) => Operation2<PathPaymentStrictSendResult>;

Parameters

  • optsPathPaymentStrictSendOpts (required) — Options object
    • sendAsset: asset to pay with
    • sendAmount: amount of sendAsset to send (excluding fees)
    • destination: destination account to send to
    • destAsset: asset the destination will receive
    • destMin: minimum amount of destAsset to be received
    • path: array of Asset objects to use as the path
    • source: The source account for the payment. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:450

Operation.payment

Create a payment operation.

static payment: (opts: PaymentOpts) => Operation2<PaymentResult>;

Parameters

  • optsPaymentOpts (required) — options object
    • destination: destination account ID
    • asset: asset to send
    • amount: amount to send
    • source: The source account for the payment. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:451

Operation.restoreFootprint

Builds an operation to restore the archived ledger entries specified by the ledger keys.

The ledger keys to restore are specified separately from the operation in read-write footprint of the transaction.

It takes no parameters because the relevant footprint is derived from the transaction itself. See TransactionBuilder’s opts.sorobanData parameter (or TransactionBuilder.setSorobanData), which is a xdr.SorobanTransactionData instance that contains fee data & resource usage as part of xdr.SorobanTransactionData.

static restoreFootprint: (opts: RestoreFootprintOpts = {}) => Operation2<RestoreFootprintResult>;

Parameters

  • optsRestoreFootprintOpts (optional) (default: {}) — an optional set of parameters
    • source: an optional source account

Source: src/base/operation.ts:469

Operation.revokeAccountSponsorship

Create a “revoke sponsorship” operation for an account.

static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation2<RevokeAccountSponsorshipResult>;

Parameters

  • optsRevokeAccountSponsorshipOpts (optional) (default: ...) — Options object
    • account: The sponsored account ID.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeAccountSponsorship({
account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
});

Source: src/base/operation.ts:455

Operation.revokeClaimableBalanceSponsorship

Create a “revoke sponsorship” operation for a claimable balance.

static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation2<RevokeClaimableBalanceSponsorshipResult>;

Parameters

  • optsRevokeClaimableBalanceSponsorshipOpts (optional) (default: ...) — Options object
    • balanceId: The sponsored claimable balance ID.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeClaimableBalanceSponsorship({
balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',
});

Source: src/base/operation.ts:459

Operation.revokeDataSponsorship

Create a “revoke sponsorship” operation for a data entry.

static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation2<RevokeDataSponsorshipResult>;

Parameters

  • optsRevokeDataSponsorshipOpts (optional) (default: ...) — Options object
    • account: The account ID which owns the data entry.
    • name: The name of the data entry.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeDataSponsorship({
account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',
name: 'foo'
});

Source: src/base/operation.ts:458

Operation.revokeLiquidityPoolSponsorship

Creates a “revoke sponsorship” operation for a liquidity pool.

static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation2<RevokeLiquidityPoolSponsorshipResult>;

Parameters

  • optsRevokeLiquidityPoolSponsorshipOpts (optional) (default: ...) — Options object.
    • liquidityPoolId: The sponsored liquidity pool ID in ‘hex’ string.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeLiquidityPoolSponsorship({
liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7',
});

Source: src/base/operation.ts:461

Operation.revokeOfferSponsorship

Create a “revoke sponsorship” operation for an offer.

static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation2<RevokeOfferSponsorshipResult>;

Parameters

  • optsRevokeOfferSponsorshipOpts (optional) (default: ...) — Options object
    • seller: The account ID which created the offer.
    • offerId: The offer ID.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeOfferSponsorship({
seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',
offerId: '1234'
});

Source: src/base/operation.ts:457

Operation.revokeSignerSponsorship

Create a “revoke sponsorship” operation for a signer.

static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation2<RevokeSignerSponsorshipResult>;

Parameters

  • optsRevokeSignerSponsorshipOpts (optional) (default: ...) — Options object
    • account: The account ID where the signer sponsorship is being removed from.
    • signer: The signer whose sponsorship is being removed. Exactly one of the following must be set:
    • signer.ed25519PublicKey: (optional) The ed25519 public key of the signer.
    • signer.sha256Hash: (optional) sha256 hash (Buffer or hex string).
    • signer.preAuthTx: (optional) Hash (Buffer or hex string) of transaction.
    • signer.ed25519SignedPayload: (optional) Signed payload signer (StrKey P… address).
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeSignerSponsorship({
account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',
signer: {
ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'
}
})

Source: src/base/operation.ts:462

Operation.revokeTrustlineSponsorship

Create a “revoke sponsorship” operation for a trustline.

static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation2<RevokeTrustlineSponsorshipResult>;

Parameters

  • optsRevokeTrustlineSponsorshipOpts (optional) (default: ...) — Options object
    • account: The account ID which owns the trustline.
    • asset: The trustline asset.
    • source: The source account for the operation. Defaults to the transaction’s source account.

Example

const op = Operation.revokeTrustlineSponsorship({
account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',
asset: new StellarBase.LiquidityPoolId(
'USDUSD',
'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'
)
});

Source: src/base/operation.ts:456

Operation.setOptions

Returns an XDR SetOptionsOp. A “set options” operations set or clear account flags, set the account’s inflation destination, and/or add new signers to the account. The flags used in opts.clearFlags and opts.setFlags can be the following:

It’s possible to set/clear multiple flags at once using logical or.

static setOptions: <T extends SignerOpts = never>(opts: SetOptionsOpts<T>) => Operation2<SetOptionsResult<T>>;

Parameters

  • optsSetOptionsOpts<T> (required) — Options object
    • inflationDest: Set this account ID as the account’s inflation destination.
    • clearFlags: Bitmap integer for which account flags to clear.
    • setFlags: Bitmap integer for which account flags to set.
    • masterWeight: The master key weight.
    • lowThreshold: The sum weight for the low threshold.
    • medThreshold: The sum weight for the medium threshold.
    • highThreshold: The sum weight for the high threshold.
    • signer: Add or remove a signer from the account. The signer is deleted if the weight is 0. Only one of ed25519PublicKey, sha256Hash, preAuthTx should be defined.
    • signer.ed25519PublicKey: The ed25519 public key of the signer.
    • signer.sha256Hash: sha256 hash (Buffer or hex string) of preimage that will unlock funds. Preimage should be used as signature of future transaction.
    • signer.preAuthTx: Hash (Buffer or hex string) of transaction that will unlock funds.
    • signer.ed25519SignedPayload: Signed payload signer (ed25519 public key + raw payload) for atomic transaction signature disclosure.
    • signer.weight: The weight of the new signer (0 to delete or 1-255)
    • homeDomain: sets the home domain used for reverse federation lookup.
    • source: The source account (defaults to transaction source).

See also

Source: src/base/operation.ts:452

Operation.setTrustLineFlags

Creates a trustline flag configuring operation.

For the flags, set them to true to enable them and false to disable them. Any unmodified operations will be marked undefined in the result.

Note that you can only clear the clawbackEnabled flag set; it must be set account-wide via operations.SetOptions (setting xdr.AccountFlags.clawbackEnabled).

static setTrustLineFlags: (opts: SetTrustLineFlagsOpts) => Operation2<SetTrustLineFlagsResult>;

Parameters

  • optsSetTrustLineFlagsOpts (required) — Options object
    • trustor: the account whose trustline this is
    • asset: the asset on the trustline
    • flags: the set of flags to modify
    • flags.authorized: authorize account to perform transactions with its credit
    • flags.authorizedToMaintainLiabilities: authorize account to maintain and reduce liabilities for its credit
    • flags.clawbackEnabled: stop claimable balances on this trustlines from having clawbacks enabled (this flag can only be set to false!)
    • source: The source account for the operation. Defaults to the transaction’s source account.

See also

Source: src/base/operation.ts:464

Operation.uploadContractWasm

Returns an operation that uploads WASM for a contract.

static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation2<InvokeHostFunctionResult>;

Parameters

  • optsUploadContractWasmOpts (required) — the set of parameters
    • wasm: a WASM blob to upload to the ledger
    • auth: an optional list outlining the tree of authorizations required for the upload
    • source: an optional source account

See also

Source: src/base/operation.ts:476

Operation.fromXDRObject(operation)

Deconstructs the raw XDR operation object into the structured object that was used to create the operation (i.e. the opts parameter to most ops).

static fromXDRObject<T extends OperationRecord = OperationRecord>(operation: Operation2<T>): T;

Parameters

  • operationOperation2<T> (required) — An XDR Operation.

Source: src/base/operation.ts:139

ScInt

Provides an easier way to manipulate large numbers for Stellar operations.

You can instantiate this “smart contract integer” value either from bigints, strings, or numbers (whole numbers, or this will throw).

If you need to create a native BigInt from a list of integer “parts” (for example, you have a series of encoded 32-bit integers that represent a larger value), you can use the lower level abstraction XdrLargeInt. For example, you could do new XdrLargeInt('u128', bytes...).toBigInt().

class ScInt extends XdrLargeInt {
constructor(value: string | number | bigint, opts?: { type?: ScIntType; [key: string]: unknown });
static getType(scvType: string): ScIntType | undefined;
static isType(type: string): type is ScIntType;
int: LargeInt;
type: ScIntType;
toBigInt(): bigint;
toDuration(): ScVal;
toI128(): ScVal;
toI256(): ScVal;
toI64(): ScVal;
toJSON(): { type: string; value: string };
toNumber(): number;
toScVal(): ScVal;
toString(): string;
toTimepoint(): ScVal;
toU128(): ScVal;
toU256(): ScVal;
toU64(): ScVal;
valueOf(): unknown;
}

Example

import { xdr, ScInt, scValToBigInt } from "@stellar/stellar-base";
// You have an ScVal from a contract and want to parse it into JS native.
const value = xdr.ScVal.fromXDR(someXdr, "base64");
const bigi = scValToBigInt(value); // grab it as a BigInt
let sci = new ScInt(bigi);
sci.toNumber(); // gives native JS type (w/ size check)
sci.toBigInt(); // gives the native BigInt value
sci.toU64(); // gives ScValType-specific XDR constructs (with size checks)
// You have a number and want to shove it into a contract.
sci = new ScInt(0xdeadcafebabe);
sci.toBigInt() // returns 244838016400062n
sci.toNumber() // throws: too large
// Pass any to e.g. a Contract.call(), conversion happens automatically
// regardless of the initial type.
const scValU128 = sci.toU128();
const scValI256 = sci.toI256();
const scValU64 = sci.toU64();
// Lots of ways to initialize:
new ScInt("123456789123456789")
new ScInt(123456789123456789n);
new ScInt(1n << 140n);
new ScInt(-42);
new ScInt(scValToBigInt(scValU128)); // from above
// If you know the type ahead of time (accessing `.raw` is faster than
// conversions), you can specify the type directly (otherwise, it's
// interpreted from the numbers you pass in):
const i = new ScInt(123456789n, { type: "u256" });
// For example, you can use the underlying `sdk.U256` and convert it to an
// `xdr.ScVal` directly like so:
const scv = new xdr.ScVal.scvU256(i.raw);
// Or reinterpret it as a different type (size permitting):
const scv = i.toI64();

Source: src/base/numbers/sc_int.ts:63

new ScInt(value, opts)

constructor(value: string | number | bigint, opts?: { type?: ScIntType; [key: string]: unknown });

Parameters

  • valuestring | number | bigint (required) — a single, integer-like value which will be interpreted in the smallest appropriate XDR type supported by Stellar (64, 128, or 256 bit integer values). signed values are supported, though they are sanity-checked against opts.type. if you need 32-bit values, you can construct them directly without needing this wrapper, e.g. xdr.ScVal.scvU32(1234).
  • opts{ type?: ScIntType; [key: string]: unknown } (optional) — an optional object controlling optional parameters
    • type: specify a type (‘i64’, ‘u64’, ‘i128’, ‘u128’, ‘i256’, or ‘u256’) to override the default type selection. If not specified, the smallest type that fits the value is used.

Source: src/base/numbers/sc_int.ts:76

ScInt.getType(scvType)

Convert the raw ScValType string (e.g. ‘scvI128’, generated by the XDR) to a type description for XdrLargeInt construction (e.g. ‘i128’)

static getType(scvType: string): ScIntType | undefined;

Parameters

  • scvTypestring (required) — the xdr.ScValType as a string

Returns

the corresponding ScIntType if it’s an integer type, or undefined if it’s not an integer type

Source: src/base/numbers/xdr_large_int.ts:322

ScInt.isType(type)

Returns true if the given string is a valid XDR large integer type name.

static isType(type: string): type is ScIntType;

Parameters

  • typestring (required)

Source: src/base/numbers/xdr_large_int.ts:298

scInt.int

int: LargeInt;

Source: src/base/numbers/xdr_large_int.ts:36

scInt.type

type: ScIntType;

Source: src/base/numbers/xdr_large_int.ts:37

scInt.toBigInt()

Converts to a native BigInt.

toBigInt(): bigint;

Source: src/base/numbers/xdr_large_int.ts:116

scInt.toDuration()

The integer encoded with ScValType = Duration

toDuration(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:152

scInt.toI128()

The integer encoded with ScValType = I128.

toI128(): ScVal;

Throws

  • if the value cannot fit in 128 bits

Source: src/base/numbers/xdr_large_int.ts:164

scInt.toI256()

The integer encoded with ScValType = I256

toI256(): ScVal;

Throws

  • if the value cannot fit in a signed 256-bit integer

Source: src/base/numbers/xdr_large_int.ts:204

scInt.toI64()

The integer encoded with ScValType = I64.

toI64(): ScVal;

Throws

  • if the value cannot fit in 64 bits

Source: src/base/numbers/xdr_large_int.ts:125

scInt.toJSON()

Returns a JSON-friendly representation with value and type fields.

toJSON(): { type: string; value: string };

Source: src/base/numbers/xdr_large_int.ts:284

scInt.toNumber()

Converts to a native JS number.

toNumber(): number;

Throws

  • if the value can’t fit into a Number

Source: src/base/numbers/xdr_large_int.ts:103

scInt.toScVal()

The smallest interpretation of the stored value

toScVal(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:247

scInt.toString()

Returns the string representation of this integer.

toString(): string;

Source: src/base/numbers/xdr_large_int.ts:279

scInt.toTimepoint()

The integer encoded with ScValType = Timepoint

toTimepoint(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:144

scInt.toU128()

The integer encoded with ScValType = U128.

toU128(): ScVal;

Throws

  • if the value cannot fit in 128 bits

Source: src/base/numbers/xdr_large_int.ts:187

scInt.toU256()

The integer encoded with ScValType = U256

Note: No size check needed - U256 is the largest unsigned type.

toU256(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:229

scInt.toU64()

The integer encoded with ScValType = U64

toU64(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:136

scInt.valueOf()

Returns the primitive value of this integer.

valueOf(): unknown;

Source: src/base/numbers/xdr_large_int.ts:274

TimeoutInfinite

const TimeoutInfinite: 0

See also

    • TransactionBuilder.setTimeout
  • Timeout

Source: src/base/transaction_builder.ts:45

Transaction

Use TransactionBuilder to build a transaction object. If you have an object or base64-encoded string of the transaction envelope XDR, use TransactionBuilder.fromXDR.

Once a Transaction has been created, its attributes and operations should not be changed. You should only add signatures (using Transaction.sign) to a Transaction object before submitting to the network or forwarding on to additional signers.

class Transaction {
constructor(envelope: string | TransactionEnvelope, networkPassphrase: string);
extraSigners: SignerKey[] | undefined;
fee: string;
ledgerBounds: { maxLedger: number; minLedger: number } | undefined;
memo: Memo<MemoType>;
minAccountSequence: string | undefined;
minAccountSequenceAge: bigint | undefined;
minAccountSequenceLedgerGap: number | undefined;
networkPassphrase: string;
operations: OperationRecord[];
sequence: string;
signatures: DecoratedSignature[];
source: string;
timeBounds: { maxTime: string; minTime: string } | undefined;
tx: TTx;
addDecoratedSignature(signature: DecoratedSignature): void;
addSignature(publicKey: string = "", signature: string = ""): void;
getClaimableBalanceId(opIndex: number): string;
getKeypairSignature(keypair: Keypair): string;
hash(): Buffer;
sign(...keypairs: Keypair[]): void;
signatureBase(): Buffer;
signHashX(preimage: string | Buffer<ArrayBufferLike>): void;
toEnvelope(): TransactionEnvelope;
toXDR(): string;
}

Source: src/base/transaction.ts:25

new Transaction(envelope, networkPassphrase)

constructor(envelope: string | TransactionEnvelope, networkPassphrase: string);

Parameters

  • envelopestring | TransactionEnvelope (required) — transaction envelope object or base64 encoded string
  • networkPassphrasestring (required) — passphrase of the target stellar network (e.g. “Public Global Stellar Network ; September 2015”)

Source: src/base/transaction.ts:45

transaction.extraSigners

Array of extra signers as XDR objects; use SignerKey.encodeSignerKey to convert to StrKey strings.

extraSigners: SignerKey[] | undefined;

Source: src/base/transaction.ts:199

transaction.fee

The total fee for this transaction, in stroops.

fee: string;

Source: src/base/transaction_base.ts:76

transaction.ledgerBounds

The ledger bounds for this transaction, with minLedger (uint32) and maxLedger (uint32, or 0 for no upper bound).

ledgerBounds: { maxLedger: number; minLedger: number } | undefined;

Source: src/base/transaction.ts:164

transaction.memo

The memo attached to this transaction.

memo: Memo<MemoType>;

Source: src/base/transaction.ts:231

transaction.minAccountSequence

The minimum account sequence (64-bit, as a string).

minAccountSequence: string | undefined;

Source: src/base/transaction.ts:172

transaction.minAccountSequenceAge

The minimum account sequence age (64-bit number of seconds).

minAccountSequenceAge: bigint | undefined;

Source: src/base/transaction.ts:180

transaction.minAccountSequenceLedgerGap

The minimum account sequence ledger gap (32-bit number of ledgers).

minAccountSequenceLedgerGap: number | undefined;

Source: src/base/transaction.ts:188

transaction.networkPassphrase

The network passphrase for this transaction.

networkPassphrase: string;

Source: src/base/transaction_base.ts:85

transaction.operations

The list of operations in this transaction.

operations: OperationRecord[];

Source: src/base/transaction.ts:223

transaction.sequence

The sequence number for this transaction.

sequence: string;

Source: src/base/transaction.ts:207

transaction.signatures

The list of signatures for this transaction.

signatures: DecoratedSignature[];

Source: src/base/transaction_base.ts:35

transaction.source

The source account for this transaction.

source: string;

Source: src/base/transaction.ts:215

transaction.timeBounds

The time bounds for this transaction, with minTime and maxTime as 64-bit unix timestamps (strings).

timeBounds: { maxTime: string; minTime: string } | undefined;

Source: src/base/transaction.ts:153

transaction.tx

The underlying XDR transaction object.

Returns a defensive copy so that external mutations cannot alter the transaction that will be signed or serialized.

tx: TTx;

Throws

  • if the internal transaction is not a recognized XDR type

Source: src/base/transaction_base.ts:51

transaction.addDecoratedSignature(signature)

Add a decorated signature directly to the transaction envelope.

addDecoratedSignature(signature: DecoratedSignature): void;

Parameters

  • signatureDecoratedSignature (required) — raw signature to add

See also

    • Keypair.signDecorated
  • Keypair.signPayloadDecorated

Source: src/base/transaction_base.ts:196

transaction.addSignature(publicKey, signature)

Add a signature to the transaction. Useful when a party wants to pre-sign a transaction but doesn’t want to give access to their secret keys. This will also verify whether the signature is valid.

Here’s how you would use this feature to solicit multiple signatures.

  • Use TransactionBuilder to build a new transaction.
  • Make sure to set a long enough timeout on that transaction to give your signers enough time to sign!
  • Once you build the transaction, use transaction.toXDR() to get the base64-encoded XDR string.
  • Warning! Once you’ve built this transaction, don’t submit any other transactions onto your account! Doing so will invalidate this pre-compiled transaction!
  • Send this XDR string to your other parties. They can use the instructions for getKeypairSignature to sign the transaction.
  • They should send you back their publicKey and the signature string from getKeypairSignature, both of which you pass to this function.
addSignature(publicKey: string = "", signature: string = ""): void;

Parameters

  • publicKeystring (optional) (default: "") — the public key of the signer
  • signaturestring (optional) (default: "") — the base64 value of the signature XDR

Source: src/base/transaction_base.ts:156

transaction.getClaimableBalanceId(opIndex)

Calculate the claimable balance ID for an operation within the transaction.

getClaimableBalanceId(opIndex: number): string;

Parameters

  • opIndexnumber (required) — the index of the CreateClaimableBalance op

Throws

  • for invalid opIndex value, if op at opIndex is not CreateClaimableBalance, or for general XDR un/marshalling failures

See also

Source: src/base/transaction.ts:321

transaction.getKeypairSignature(keypair)

Signs a transaction with the given Keypair. Useful if someone sends you a transaction XDR for you to sign and return (see addSignature for more information).

When you get a transaction XDR to sign…

  • Instantiate a Transaction object with the XDR
  • Use Keypair to generate a keypair object for your Stellar seed.
  • Run getKeypairSignature with that keypair
  • Send back the signature along with your publicKey (not your secret seed!)

Example:

// `transactionXDR` is a string from the person generating the transaction
const transaction = new Transaction(transactionXDR, networkPassphrase);
const keypair = Keypair.fromSecret(myStellarSeed);
return transaction.getKeypairSignature(keypair);

Returns the base64-encoded signature string for the given keypair.

getKeypairSignature(keypair: Keypair): string;

Parameters

  • keypairKeypair (required) — Keypair of signer

Source: src/base/transaction_base.ts:129

transaction.hash()

Returns a hash for this transaction, suitable for signing.

hash(): Buffer;

Source: src/base/transaction_base.ts:222

transaction.sign(keypairs)

Signs the transaction with the given Keypair.

sign(...keypairs: Keypair[]): void;

Parameters

  • ...keypairsKeypair[] (required) — Keypairs of signers

Source: src/base/transaction_base.ts:97

transaction.signatureBase()

Returns the “signature base” of this transaction, which is the value that, when hashed, should be signed to create a signature that validators on the Stellar Network will accept.

It is composed of a 4 prefix bytes followed by the xdr-encoded form of this transaction.

signatureBase(): Buffer;

Source: src/base/transaction.ts:246

transaction.signHashX(preimage)

Add hashX signer preimage as signature.

signHashX(preimage: string | Buffer<ArrayBufferLike>): void;

Parameters

  • preimagestring | Buffer<ArrayBufferLike> (required) — preimage of hash used as signer

Source: src/base/transaction_base.ts:204

transaction.toEnvelope()

To envelope returns a xdr.TransactionEnvelope which can be submitted to the network.

toEnvelope(): TransactionEnvelope;

Source: src/base/transaction.ts:279

transaction.toXDR()

Returns the transaction envelope as a base64-encoded XDR string.

toXDR(): string;

Source: src/base/transaction_base.ts:239

TransactionBuilder

Transaction builder helps constructs a new [`Transaction`](#transaction) using the given `Account` as the transaction's "source account". The transaction will use the current sequence number of the given account as its sequence number and increment the given account's sequence number by one. The given source account must include a private key for signing the transaction or an error will be thrown.

Operations can be added to the transaction via their corresponding builder methods, and each returns the TransactionBuilder object so they can be chained together. After adding the desired operations, call the `build()` method on the `TransactionBuilder` to return a fully constructed `Transaction` that can be signed. The returned transaction will contain the sequence number of the source account and include the signature from the source account.

Be careful about unsubmitted transactions! When you build a transaction, `stellar-sdk` automatically increments the source account's sequence number. If you end up not submitting this transaction and submitting another one instead, it'll fail due to the sequence number being wrong. So if you decide not to use a built transaction, make sure to update the source account's sequence number with [Server.loadAccount](https://stellar.github.io/js-stellar-sdk/Server.html#loadAccount) before creating another transaction.

The following code example creates a new transaction with `Operation.createAccount` and `Operation.payment` operations. The Transaction's source account first funds `destinationA`, then sends a payment to `destinationB`. The built transaction is then signed by `sourceKeypair`.

var transaction = new TransactionBuilder(source, { fee, networkPassphrase: Networks.TESTNET })
.addOperation(Operation.createAccount({
destination: destinationA,
startingBalance: "20"
})) // <- funds and creates destinationA
.addOperation(Operation.payment({
destination: destinationB,
amount: "100",
asset: Asset.native()
})) // <- sends 100 XLM to destinationB
.setTimeout(30)
.build();
transaction.sign(sourceKeypair);
class TransactionBuilder {
constructor(sourceAccount: TransactionSource, opts: TransactionBuilderOptions = ...);
static buildFeeBumpTransaction(feeSource: string | Keypair, baseFee: string, innerTx: Transaction, networkPassphrase: string): FeeBumpTransaction;
static cloneFrom(tx: Transaction, opts: Partial<TransactionBuilderOptions> = {}): TransactionBuilder;
static fromXDR(envelope: string | TransactionEnvelope, networkPassphrase: string): Transaction | FeeBumpTransaction;
baseFee: string;
extraSigners: string[] | null;
ledgerbounds: { maxLedger?: number; minLedger?: number } | null;
memo: Memo;
minAccountSequence: string | null;
minAccountSequenceAge: bigint | null;
minAccountSequenceLedgerGap: number | null;
networkPassphrase: string | null;
operations: Operation2<OperationRecord>[];
sorobanData: SorobanTransactionData | null;
source: TransactionSource;
timebounds: { maxTime?: string | number | Date; minTime?: string | number | Date } | null;
addMemo(memo: Memo): TransactionBuilder;
addOperation(operation: Operation2): TransactionBuilder;
addOperationAt(operation: Operation2, index: number): TransactionBuilder;
addSacTransferOperation(destination: string, asset: Asset, amount: string | bigint, sorobanFees?: SorobanFees): TransactionBuilder;
build(): Transaction;
clearOperationAt(index: number): TransactionBuilder;
clearOperations(): TransactionBuilder;
hasV2Preconditions(): boolean;
setExtraSigners(extraSigners: string[]): TransactionBuilder;
setLedgerbounds(minLedger: number, maxLedger: number): TransactionBuilder;
setMinAccountSequence(minAccountSequence: string): TransactionBuilder;
setMinAccountSequenceAge(durationInSeconds: bigint): TransactionBuilder;
setMinAccountSequenceLedgerGap(gap: number): TransactionBuilder;
setNetworkPassphrase(networkPassphrase: string): TransactionBuilder;
setSorobanData(sorobanData: string | SorobanTransactionData): TransactionBuilder;
setTimebounds(minEpochOrDate: number | Date, maxEpochOrDate: number | Date): TransactionBuilder;
setTimeout(timeoutSeconds: number): TransactionBuilder;
}

Source: src/base/transaction_builder.ts:153

new TransactionBuilder(sourceAccount, opts)

constructor(sourceAccount: TransactionSource, opts: TransactionBuilderOptions = ...);

Parameters

  • sourceAccountTransactionSource (required) — source account for this transaction
  • optsTransactionBuilderOptions (optional) (default: ...) — options object (see TransactionBuilderOptions)

Source: src/base/transaction_builder.ts:174

TransactionBuilder.buildFeeBumpTransaction(feeSource, baseFee, innerTx, networkPassphrase)

Builds a FeeBumpTransaction, enabling you to resubmit an existing transaction with a higher fee.

static buildFeeBumpTransaction(feeSource: string | Keypair, baseFee: string, innerTx: Transaction, networkPassphrase: string): FeeBumpTransaction;

Parameters

  • feeSourcestring | Keypair (required) — account paying for the transaction, in the form of either a Keypair (only the public key is used) or an account ID (in G… or M… form, but refer to withMuxing)

  • baseFeestring (required) — max fee willing to pay per operation in inner transaction (in stroops)

  • innerTxTransaction (required) — Transaction to be bumped by the fee bump transaction

  • networkPassphrasestring (required) — passphrase of the target Stellar network (e.g. “Public Global Stellar Network ; September 2015”, see Networks)

    TODO: Alongside the next major version bump, this type signature can be changed to be less awkward: accept a MuxedAccount as the feeSource rather than a keypair or string.

    Your fee-bump amount should be >= 10x the original fee.

See also

Source: src/base/transaction_builder.ts:1110

TransactionBuilder.cloneFrom(tx, opts)

Creates a builder instance using an existing Transaction as a template, ignoring any existing envelope signatures.

Note that the sequence number WILL be cloned, so EITHER this transaction or the one it was cloned from will be valid. This is useful in situations where you are constructing a transaction in pieces and need to make adjustments as you go (for example, when filling out Soroban resource information).

static cloneFrom(tx: Transaction, opts: Partial<TransactionBuilderOptions> = {}): TransactionBuilder;

Parameters

  • txTransaction (required) — a “template” transaction to clone exactly

  • optsPartial<TransactionBuilderOptions> (optional) (default: {}) — additional options to override the clone, e.g. {fee: '1000'} will override the existing base fee derived from tx (see the TransactionBuilder constructor for detailed options)

    Warning: This does not clone the transaction’s xdr.SorobanTransactionData (if applicable), use SorobanDataBuilder and TransactionBuilder.setSorobanData as needed, instead.

    TODO: This cannot clone FeeBumpTransactions, yet.

Source: src/base/transaction_builder.ts:281

TransactionBuilder.fromXDR(envelope, networkPassphrase)

Build a Transaction or FeeBumpTransaction from an xdr.TransactionEnvelope.

static fromXDR(envelope: string | TransactionEnvelope, networkPassphrase: string): Transaction | FeeBumpTransaction;

Parameters

  • envelopestring | TransactionEnvelope (required) — The transaction envelope object or base64 encoded string.
  • networkPassphrasestring (required) — The network passphrase of the target Stellar network (e.g. “Public Global Stellar Network ; September 2015”), see Networks.

Source: src/base/transaction_builder.ts:1221

transactionBuilder.baseFee

baseFee: string;

Source: src/base/transaction_builder.ts:156

transactionBuilder.extraSigners

extraSigners: string[] | null;

Source: src/base/transaction_builder.ts:165

transactionBuilder.ledgerbounds

ledgerbounds: { maxLedger?: number; minLedger?: number } | null;

Source: src/base/transaction_builder.ts:161

transactionBuilder.memo

memo: Memo;

Source: src/base/transaction_builder.ts:166

transactionBuilder.minAccountSequence

minAccountSequence: string | null;

Source: src/base/transaction_builder.ts:162

transactionBuilder.minAccountSequenceAge

minAccountSequenceAge: bigint | null;

Source: src/base/transaction_builder.ts:163

transactionBuilder.minAccountSequenceLedgerGap

minAccountSequenceLedgerGap: number | null;

Source: src/base/transaction_builder.ts:164

transactionBuilder.networkPassphrase

networkPassphrase: string | null;

Source: src/base/transaction_builder.ts:167

transactionBuilder.operations

operations: Operation2<OperationRecord>[];

Source: src/base/transaction_builder.ts:155

transactionBuilder.sorobanData

sorobanData: SorobanTransactionData | null;

Source: src/base/transaction_builder.ts:168

transactionBuilder.source

source: TransactionSource;

Source: src/base/transaction_builder.ts:154

transactionBuilder.timebounds

timebounds: { maxTime?: string | number | Date; minTime?: string | number | Date } | null;

Source: src/base/transaction_builder.ts:157

transactionBuilder.addMemo(memo)

Adds a memo to the transaction.

addMemo(memo: Memo): TransactionBuilder;

Parameters

  • memoMemo (required) — Memo object

Source: src/base/transaction_builder.ts:412

transactionBuilder.addOperation(operation)

Adds an operation to the transaction.

addOperation(operation: Operation2): TransactionBuilder;

Parameters

  • operationOperation2 (required) — The xdr operation object, use Operation static methods.

Source: src/base/transaction_builder.ts:374

transactionBuilder.addOperationAt(operation, index)

Adds an operation to the transaction at a specific index.

addOperationAt(operation: Operation2, index: number): TransactionBuilder;

Parameters

  • operationOperation2 (required) — The xdr operation object to add, use Operation static methods.
  • indexnumber (required) — The index at which to insert the operation.

Source: src/base/transaction_builder.ts:385

transactionBuilder.addSacTransferOperation(destination, asset, amount, sorobanFees)

Creates and adds an invoke host function operation for transferring SAC tokens. This method removes the need for simulation by handling the creation of the appropriate authorization entries and ledger footprint for the transfer operation.

addSacTransferOperation(destination: string, asset: Asset, amount: string | bigint, sorobanFees?: SorobanFees): TransactionBuilder;

Parameters

  • destinationstring (required) — the address of the recipient of the SAC transfer (should be a valid Stellar address or contract ID)
  • assetAsset (required) — the SAC asset to be transferred
  • amountstring | bigint (required) — the amount of tokens to be transferred in 7 decimals. IE 1 token with 7 decimals of precision would be represented as “1_0000000”
  • sorobanFeesSorobanFees (optional) — optional Soroban fees for the transaction to override the default fees used

Source: src/base/transaction_builder.ts:719

transactionBuilder.build()

Builds the transaction and increments the source account’s sequence number by 1.

build(): Transaction;

Source: src/base/transaction_builder.ts:939

transactionBuilder.clearOperationAt(index)

Removes the operation at the specified index from the transaction.

clearOperationAt(index: number): TransactionBuilder;

Parameters

  • indexnumber (required) — The index of the operation to remove.

Source: src/base/transaction_builder.ts:403

transactionBuilder.clearOperations()

Removes the operations from the builder (useful when cloning).

clearOperations(): TransactionBuilder;

Source: src/base/transaction_builder.ts:393

transactionBuilder.hasV2Preconditions()

Checks whether any v2 preconditions have been set on this builder.

hasV2Preconditions(): boolean;

Source: src/base/transaction_builder.ts:1078

transactionBuilder.setExtraSigners(extraSigners)

For the transaction to be valid, there must be a signature corresponding to every Signer in this array, even if the signature is not otherwise required by the sourceAccount or operations. Internally this will set the extraSigners precondition.

setExtraSigners(extraSigners: string[]): TransactionBuilder;

Parameters

  • extraSignersstring[] (required) — required extra signers (as StrKeys)

Source: src/base/transaction_builder.ts:654

transactionBuilder.setLedgerbounds(minLedger, maxLedger)

If you want to prepare a transaction which will only be valid within some range of ledgers, you can set a ledgerbounds precondition. Internally this will set the minLedger and maxLedger preconditions.

setLedgerbounds(minLedger: number, maxLedger: number): TransactionBuilder;

Parameters

  • minLedgernumber (required) — The minimum ledger this transaction is valid at or after. Cannot be negative. If the value is 0 (the default), the transaction is valid immediately.
  • maxLedgernumber (required) — The maximum ledger this transaction is valid before. Cannot be negative. If the value is 0, the transaction is valid indefinitely.

Source: src/base/transaction_builder.ts:542

transactionBuilder.setMinAccountSequence(minAccountSequence)

If you want to prepare a transaction which will be valid only while the account sequence number is

`minAccountSequence <= sourceAccountSequence < tx.seqNum`

Note that after execution the account’s sequence number is always raised to tx.seqNum. Internally this will set the minAccountSequence precondition.

setMinAccountSequence(minAccountSequence: string): TransactionBuilder;

Parameters

  • minAccountSequencestring (required) — The minimum source account sequence number this transaction is valid for. If the value is 0 (the default), the transaction is valid when sourceAccount’s sequence number == tx.seqNum - 1.

Source: src/base/transaction_builder.ts:579

transactionBuilder.setMinAccountSequenceAge(durationInSeconds)

For the transaction to be valid, the current ledger time must be at least minAccountSequenceAge greater than sourceAccount’s sequenceTime. Internally this will set the minAccountSequenceAge precondition.

setMinAccountSequenceAge(durationInSeconds: bigint): TransactionBuilder;

Parameters

  • durationInSecondsbigint (required) — The minimum amount of time between source account sequence time and the ledger time when this transaction will become valid. If the value is 0, the transaction is unrestricted by the account sequence age. Cannot be negative.

Source: src/base/transaction_builder.ts:601

transactionBuilder.setMinAccountSequenceLedgerGap(gap)

For the transaction to be valid, the current ledger number must be at least minAccountSequenceLedgerGap greater than sourceAccount’s ledger sequence. Internally this will set the minAccountSequenceLedgerGap precondition.

setMinAccountSequenceLedgerGap(gap: number): TransactionBuilder;

Parameters

  • gapnumber (required) — The minimum number of ledgers between source account sequence and the ledger number when this transaction will become valid. If the value is 0, the transaction is unrestricted by the account sequence ledger. Cannot be negative.

Source: src/base/transaction_builder.ts:630

transactionBuilder.setNetworkPassphrase(networkPassphrase)

Set network passphrase for the Transaction that will be built.

setNetworkPassphrase(networkPassphrase: string): TransactionBuilder;

Parameters

  • networkPassphrasestring (required) — passphrase of the target Stellar network (e.g. “Public Global Stellar Network ; September 2015”).

Source: src/base/transaction_builder.ts:680

transactionBuilder.setSorobanData(sorobanData)

Sets the transaction’s internal Soroban transaction data (resources, footprint, etc.).

For non-contract(non-Soroban) transactions, this setting has no effect. In the case of Soroban transactions, this is either an instance of xdr.SorobanTransactionData or a base64-encoded string of said structure. This is usually obtained from the simulation response based on a transaction with a Soroban operation (e.g. Operation.invokeHostFunction, providing necessary resource and storage footprint estimations for contract invocation.

setSorobanData(sorobanData: string | SorobanTransactionData): TransactionBuilder;

Parameters

  • sorobanDatastring | SorobanTransactionData (required) — the xdr.SorobanTransactionData as a raw xdr object or a base64 string to be decoded

See also

  • SorobanDataBuilder

Source: src/base/transaction_builder.ts:702

transactionBuilder.setTimebounds(minEpochOrDate, maxEpochOrDate)

If you want to prepare a transaction which will become valid at some point in the future, or be invalid after some time, you can set a timebounds precondition. Internally this will set the minTime, and maxTime preconditions. Conflicts with setTimeout, so use one or the other.

setTimebounds(minEpochOrDate: number | Date, maxEpochOrDate: number | Date): TransactionBuilder;

Parameters

  • minEpochOrDatenumber | Date (required) — Either a JS Date object, or a number of UNIX epoch seconds. The transaction is valid after this timestamp. Can’t be negative. If the value is 0, the transaction is valid immediately.
  • maxEpochOrDatenumber | Date (required) — Either a JS Date object, or a number of UNIX epoch seconds. The transaction is valid until this timestamp. Can’t be negative. If the value is 0, the transaction is valid indefinitely.

Source: src/base/transaction_builder.ts:493

transactionBuilder.setTimeout(timeoutSeconds)

Sets a timeout precondition on the transaction.

Because of the distributed nature of the Stellar network it is possible that the status of your transaction will be determined after a long time if the network is highly congested. If you want to be sure to receive the status of the transaction within a given period you should set the time bounds with maxTime on the transaction (this is what setTimeout does internally; if there’s minTime set but no maxTime it will be added).

A call to TransactionBuilder.setTimeout is required if Transaction does not have max_time set. If you don’t want to set timeout, use TimeoutInfinite. In general you should set TimeoutInfinite only in smart contracts.

Please note that Horizon may still return 504 Gateway Timeout error, even for short timeouts. In such case you need to resubmit the same transaction again without making any changes to receive a status. This method is using the machine system time (UTC), make sure it is set correctly.

setTimeout(timeoutSeconds: number): TransactionBuilder;

Parameters

  • timeoutSecondsnumber (required) — Number of seconds the transaction is good. Can’t be negative. If the value is TimeoutInfinite, the transaction is good indefinitely.

See also

Source: src/base/transaction_builder.ts:446

Uint128

class Uint128 extends LargeInt {
constructor(...args: (string | number | bigint)[]);
static MAX_VALUE: LargeInt;
static MIN_VALUE: LargeInt;
static defineIntBoundaries(): void;
static fromString(value: string): LargeInt;
static isValid(value: unknown): boolean;
readonly size: number;
readonly unsigned: boolean;
slice(chunkSize: number): bigint[];
toBigInt(): bigint;
toString(): string;
}

Source: src/base/numbers/uint128.ts:3

new Uint128(args)

Construct an unsigned 128-bit integer that can be XDR-encoded.

constructor(...args: (string | number | bigint)[]);

Parameters

  • ...args(string | number | bigint)[] (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits)

Source: src/base/numbers/uint128.ts:10

Uint128.MAX_VALUE

static MAX_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:14

Uint128.MIN_VALUE

static MIN_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:13

Uint128.defineIntBoundaries()

static defineIntBoundaries(): void;

Source: types/stellar__js-xdr/index.d.ts:12

Uint128.fromString(value)

static fromString(value: string): LargeInt;

Parameters

  • valuestring (required)

Source: types/stellar__js-xdr/index.d.ts:16

Uint128.isValid(value)

static isValid(value: unknown): boolean;

Parameters

  • valueunknown (required)

Source: types/stellar__js-xdr/index.d.ts:15

uint128.size

readonly size: number;

Source: src/base/numbers/uint128.ts:18

uint128.unsigned

readonly unsigned: boolean;

Source: src/base/numbers/uint128.ts:14

uint128.slice(chunkSize)

slice(chunkSize: number): bigint[];

Parameters

  • chunkSizenumber (required)

Source: types/stellar__js-xdr/index.d.ts:21

uint128.toBigInt()

toBigInt(): bigint;

Source: types/stellar__js-xdr/index.d.ts:19

uint128.toString()

toString(): string;

Source: types/stellar__js-xdr/index.d.ts:20

Uint256

class Uint256 extends LargeInt {
constructor(...args: (string | number | bigint)[]);
static MAX_VALUE: LargeInt;
static MIN_VALUE: LargeInt;
static defineIntBoundaries(): void;
static fromString(value: string): LargeInt;
static isValid(value: unknown): boolean;
readonly size: number;
readonly unsigned: boolean;
slice(chunkSize: number): bigint[];
toBigInt(): bigint;
toString(): string;
}

Source: src/base/numbers/uint256.ts:3

new Uint256(args)

Construct an unsigned 256-bit integer that can be XDR-encoded.

constructor(...args: (string | number | bigint)[]);

Parameters

  • ...args(string | number | bigint)[] (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits)

Source: src/base/numbers/uint256.ts:10

Uint256.MAX_VALUE

static MAX_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:14

Uint256.MIN_VALUE

static MIN_VALUE: LargeInt;

Source: types/stellar__js-xdr/index.d.ts:13

Uint256.defineIntBoundaries()

static defineIntBoundaries(): void;

Source: types/stellar__js-xdr/index.d.ts:12

Uint256.fromString(value)

static fromString(value: string): LargeInt;

Parameters

  • valuestring (required)

Source: types/stellar__js-xdr/index.d.ts:16

Uint256.isValid(value)

static isValid(value: unknown): boolean;

Parameters

  • valueunknown (required)

Source: types/stellar__js-xdr/index.d.ts:15

uint256.size

readonly size: number;

Source: src/base/numbers/uint256.ts:18

uint256.unsigned

readonly unsigned: boolean;

Source: src/base/numbers/uint256.ts:14

uint256.slice(chunkSize)

slice(chunkSize: number): bigint[];

Parameters

  • chunkSizenumber (required)

Source: types/stellar__js-xdr/index.d.ts:21

uint256.toBigInt()

toBigInt(): bigint;

Source: types/stellar__js-xdr/index.d.ts:19

uint256.toString()

toString(): string;

Source: types/stellar__js-xdr/index.d.ts:20

XdrLargeInt

A wrapper class to represent large XDR-encodable integers.

This operates at a lower level than ScInt by forcing you to specify the type / width / size in bits of the integer you’re targeting, regardless of the input value(s) you provide.

class XdrLargeInt {
constructor(type: ScIntType, values: XdrLargeIntValues);
static getType(scvType: string): ScIntType | undefined;
static isType(type: string): type is ScIntType;
int: LargeInt;
type: ScIntType;
toBigInt(): bigint;
toDuration(): ScVal;
toI128(): ScVal;
toI256(): ScVal;
toI64(): ScVal;
toJSON(): { type: string; value: string };
toNumber(): number;
toScVal(): ScVal;
toString(): string;
toTimepoint(): ScVal;
toU128(): ScVal;
toU256(): ScVal;
toU64(): ScVal;
valueOf(): unknown;
}

Source: src/base/numbers/xdr_large_int.ts:35

new XdrLargeInt(type, values)

constructor(type: ScIntType, values: XdrLargeIntValues);

Parameters

  • typeScIntType (required) — specifies a data type to use to represent the integer, one of: ‘i64’, ‘u64’, ‘i128’, ‘u128’, ‘i256’, ‘u256’, ‘timepoint’, and ‘duration’ (see XdrLargeInt.isType)
  • valuesXdrLargeIntValues (required) — a list of integer-like values interpreted in big-endian order

Source: src/base/numbers/xdr_large_int.ts:45

XdrLargeInt.getType(scvType)

Convert the raw ScValType string (e.g. ‘scvI128’, generated by the XDR) to a type description for XdrLargeInt construction (e.g. ‘i128’)

static getType(scvType: string): ScIntType | undefined;

Parameters

  • scvTypestring (required) — the xdr.ScValType as a string

Returns

the corresponding ScIntType if it’s an integer type, or undefined if it’s not an integer type

Source: src/base/numbers/xdr_large_int.ts:322

XdrLargeInt.isType(type)

Returns true if the given string is a valid XDR large integer type name.

static isType(type: string): type is ScIntType;

Parameters

  • typestring (required)

Source: src/base/numbers/xdr_large_int.ts:298

xdrLargeInt.int

int: LargeInt;

Source: src/base/numbers/xdr_large_int.ts:36

xdrLargeInt.type

type: ScIntType;

Source: src/base/numbers/xdr_large_int.ts:37

xdrLargeInt.toBigInt()

Converts to a native BigInt.

toBigInt(): bigint;

Source: src/base/numbers/xdr_large_int.ts:116

xdrLargeInt.toDuration()

The integer encoded with ScValType = Duration

toDuration(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:152

xdrLargeInt.toI128()

The integer encoded with ScValType = I128.

toI128(): ScVal;

Throws

  • if the value cannot fit in 128 bits

Source: src/base/numbers/xdr_large_int.ts:164

xdrLargeInt.toI256()

The integer encoded with ScValType = I256

toI256(): ScVal;

Throws

  • if the value cannot fit in a signed 256-bit integer

Source: src/base/numbers/xdr_large_int.ts:204

xdrLargeInt.toI64()

The integer encoded with ScValType = I64.

toI64(): ScVal;

Throws

  • if the value cannot fit in 64 bits

Source: src/base/numbers/xdr_large_int.ts:125

xdrLargeInt.toJSON()

Returns a JSON-friendly representation with value and type fields.

toJSON(): { type: string; value: string };

Source: src/base/numbers/xdr_large_int.ts:284

xdrLargeInt.toNumber()

Converts to a native JS number.

toNumber(): number;

Throws

  • if the value can’t fit into a Number

Source: src/base/numbers/xdr_large_int.ts:103

xdrLargeInt.toScVal()

The smallest interpretation of the stored value

toScVal(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:247

xdrLargeInt.toString()

Returns the string representation of this integer.

toString(): string;

Source: src/base/numbers/xdr_large_int.ts:279

xdrLargeInt.toTimepoint()

The integer encoded with ScValType = Timepoint

toTimepoint(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:144

xdrLargeInt.toU128()

The integer encoded with ScValType = U128.

toU128(): ScVal;

Throws

  • if the value cannot fit in 128 bits

Source: src/base/numbers/xdr_large_int.ts:187

xdrLargeInt.toU256()

The integer encoded with ScValType = U256

Note: No size check needed - U256 is the largest unsigned type.

toU256(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:229

xdrLargeInt.toU64()

The integer encoded with ScValType = U64

toU64(): ScVal;

Source: src/base/numbers/xdr_large_int.ts:136

xdrLargeInt.valueOf()

Returns the primitive value of this integer.

valueOf(): unknown;

Source: src/base/numbers/xdr_large_int.ts:274

cereal

const cereal: { XdrReader: typeof XdrReader; XdrWriter: typeof XdrWriter }

Source: src/base/jsxdr.ts:7

decodeAddressToMuxedAccount

Converts a Stellar address (in G… or M… form) to an xdr.MuxedAccount structure, using the ed25519 representation when possible.

This supports full muxed accounts, where an M... address will resolve to both its underlying G... address and an integer ID.

decodeAddressToMuxedAccount(address: string): MuxedAccount

Parameters

  • addressstring (required) — G… or M… address to encode into XDR

Source: src/base/util/decode_encode_muxed_account.ts:13

encodeMuxedAccount

Transform a Stellar address (G…) and an ID into its XDR representation.

encodeMuxedAccount(address: string, id: string): MuxedAccount

Parameters

  • addressstring (required) — a Stellar G… address
  • idstring (required) — a Uint64 ID represented as a string

Source: src/base/util/decode_encode_muxed_account.ts:52

encodeMuxedAccountToAddress

Converts an xdr.MuxedAccount to its StrKey representation.

Returns the “M…” string representation if there is a muxing ID within the object, or the “G…” representation otherwise.

encodeMuxedAccountToAddress(muxedAccount: MuxedAccount): string

Parameters

  • muxedAccountMuxedAccount (required) — raw account to stringify

See also

Source: src/base/util/decode_encode_muxed_account.ts:33

extractBaseAddress

Extracts the underlying base (G…) address from an M-address.

extractBaseAddress(address: string): string

Parameters

  • addressstring (required) — an account address (either M… or G…)

Source: src/base/util/decode_encode_muxed_account.ts:74

scValToBigInt

Transforms an opaque xdr.ScVal into a native bigint, if possible.

If you then want to use this in the abstractions provided by this module, you can pass it to the constructor of XdrLargeInt.

scValToBigInt(scv: ScVal): bigint

Parameters

  • scvScVal (required) — the XDR smart contract value to convert

Throws

  • if the scv input value doesn’t represent an integer

Example

let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal
let bigi = scValToBigInt(scv);
new ScInt(bigi); // if you don't care about types, and
new XdrLargeInt('i128', bigi); // if you do

Source: src/base/numbers/index.ts:31

Types

AuthFlag

type AuthFlag = { readonly clawbackEnabled: 8; readonly immutable: 4; readonly required: 1; readonly revocable: 2 }

Source: src/base/operations/types.ts:431

AuthFlag

type AuthFlag = typeof AuthFlag[keyof typeof AuthFlag]

Source: src/base/operations/types.ts:431

AuthFlag.clawbackEnabled

type clawbackEnabled = 8

Source: src/base/operations/types.ts:444

AuthFlag.immutable

type immutable = 4

Source: src/base/operations/types.ts:443

AuthFlag.required

type required = 1

Source: src/base/operations/types.ts:441

AuthFlag.revocable

type revocable = 2

Source: src/base/operations/types.ts:442

MemoType

type MemoType = MemoTypeHash | MemoTypeID | MemoTypeNone | MemoTypeReturn | MemoTypeText

Source: src/base/memo.ts:33

MemoType.Hash

type Hash = MemoTypeHash

Source: src/base/memo.ts:37

MemoType.ID

type ID = MemoTypeID

Source: src/base/memo.ts:35

MemoType.None

type None = MemoTypeNone

Source: src/base/memo.ts:34

MemoType.Return

type Return = MemoTypeReturn

Source: src/base/memo.ts:38

MemoType.Text

type Text = MemoTypeText

Source: src/base/memo.ts:36

MemoTypeHash

type MemoTypeHash = typeof MemoHash

Source: src/base/memo.ts:30

MemoTypeID

type MemoTypeID = typeof MemoID

Source: src/base/memo.ts:28

MemoTypeNone

type MemoTypeNone = typeof MemoNone

Source: src/base/memo.ts:27

MemoTypeReturn

type MemoTypeReturn = typeof MemoReturn

Source: src/base/memo.ts:31

MemoTypeText

type MemoTypeText = typeof MemoText

Source: src/base/memo.ts:29

MemoValue

type MemoValue = Buffer | string | null

Source: src/base/memo.ts:47

Networks

Contains passphrases for common networks:

  • Networks.PUBLIC: Public Global Stellar Network ; September 2015
  • Networks.TESTNET: Test SDF Network ; September 2015
  • Networks.FUTURENET: Test SDF Future Network ; October 2022
  • Networks.SANDBOX: Local Sandbox Stellar Network ; September 2022
  • Networks.STANDALONE: Standalone Network ; February 2017
enum Networks

Source: src/base/network.ts:9

Operation.AccountMerge

type AccountMerge = AccountMergeResult

Source: src/base/operation.ts:613

Operation.AllowTrust

type AllowTrust = AllowTrustResult

Source: src/base/operation.ts:612

Operation.BaseOperation

type BaseOperation<T extends _OperationType = _OperationType> = _BaseOperation<T>

Source: src/base/operation.ts:601

Operation.BeginSponsoringFutureReserves

type BeginSponsoringFutureReserves = BeginSponsoringFutureReservesResult

Source: src/base/operation.ts:619

Operation.BumpSequence

type BumpSequence = BumpSequenceResult

Source: src/base/operation.ts:616

Operation.ChangeTrust

type ChangeTrust = ChangeTrustResult

Source: src/base/operation.ts:611

Operation.ClaimClaimableBalance

type ClaimClaimableBalance = ClaimClaimableBalanceResult

Source: src/base/operation.ts:618

Operation.Clawback

type Clawback = ClawbackResult

Source: src/base/operation.ts:631

Operation.ClawbackClaimableBalance

type ClawbackClaimableBalance = ClawbackClaimableBalanceResult

Source: src/base/operation.ts:632

Operation.CreateAccount

type CreateAccount = CreateAccountResult

Source: src/base/operation.ts:603

Operation.CreateClaimableBalance

type CreateClaimableBalance = CreateClaimableBalanceResult

Source: src/base/operation.ts:617

Operation.CreatePassiveSellOffer

type CreatePassiveSellOffer = CreatePassiveSellOfferResult

Source: src/base/operation.ts:607

Operation.EndSponsoringFutureReserves

type EndSponsoringFutureReserves = EndSponsoringFutureReservesResult

Source: src/base/operation.ts:621

Operation.ExtendFootprintTTL

type ExtendFootprintTTL = ExtendFootprintTTLResult

Source: src/base/operation.ts:637

Operation.Inflation

type Inflation = InflationResult

Source: src/base/operation.ts:614

Operation.InvokeHostFunction

type InvokeHostFunction = InvokeHostFunctionResult

Source: src/base/operation.ts:636

Operation.LiquidityPoolDeposit

type LiquidityPoolDeposit = LiquidityPoolDepositResult

Source: src/base/operation.ts:634

Operation.LiquidityPoolWithdraw

type LiquidityPoolWithdraw = LiquidityPoolWithdrawResult

Source: src/base/operation.ts:635

Operation.ManageBuyOffer

type ManageBuyOffer = ManageBuyOfferResult

Source: src/base/operation.ts:609

Operation.ManageData

type ManageData = ManageDataResult

Source: src/base/operation.ts:615

Operation.ManageSellOffer

type ManageSellOffer = ManageSellOfferResult

Source: src/base/operation.ts:608

Operation.PathPaymentStrictReceive

type PathPaymentStrictReceive = PathPaymentStrictReceiveResult

Source: src/base/operation.ts:605

Operation.PathPaymentStrictSend

type PathPaymentStrictSend = PathPaymentStrictSendResult

Source: src/base/operation.ts:606

Operation.Payment

type Payment = PaymentResult

Source: src/base/operation.ts:604

Operation.RestoreFootprint

type RestoreFootprint = RestoreFootprintResult

Source: src/base/operation.ts:638

Operation.RevokeAccountSponsorship

type RevokeAccountSponsorship = RevokeAccountSponsorshipResult

Source: src/base/operation.ts:622

Operation.RevokeClaimableBalanceSponsorship

type RevokeClaimableBalanceSponsorship = RevokeClaimableBalanceSponsorshipResult

Source: src/base/operation.ts:626

Operation.RevokeDataSponsorship

type RevokeDataSponsorship = RevokeDataSponsorshipResult

Source: src/base/operation.ts:625

Operation.RevokeLiquidityPoolSponsorship

type RevokeLiquidityPoolSponsorship = RevokeLiquidityPoolSponsorshipResult

Source: src/base/operation.ts:628

Operation.RevokeOfferSponsorship

type RevokeOfferSponsorship = RevokeOfferSponsorshipResult

Source: src/base/operation.ts:624

Operation.RevokeSignerSponsorship

type RevokeSignerSponsorship = RevokeSignerSponsorshipResult

Source: src/base/operation.ts:630

Operation.RevokeTrustlineSponsorship

type RevokeTrustlineSponsorship = RevokeTrustlineSponsorshipResult

Source: src/base/operation.ts:623

Operation.SetOptions

type SetOptions = SetOptionsResult<Signer>

Source: src/base/operation.ts:610

Operation.SetTrustLineFlags

type SetTrustLineFlags = SetTrustLineFlagsResult

Source: src/base/operation.ts:633

OperationOptions

type OperationOptions = AccountMergeOpts | AllowTrustOpts | BeginSponsoringFutureReservesOpts | BumpSequenceOpts | ChangeTrustOpts | ClaimClaimableBalanceOpts | ClawbackClaimableBalanceOpts | ClawbackOpts | CreateAccountOpts | CreateClaimableBalanceOpts | CreateCustomContractOpts | CreatePassiveSellOfferOpts | CreateStellarAssetContractOpts | EndSponsoringFutureReservesOpts | ExtendFootprintTtlOpts | InflationOpts | InvokeContractFunctionOpts | InvokeHostFunctionOpts | LiquidityPoolDepositOpts | LiquidityPoolWithdrawOpts | ManageBuyOfferOpts | ManageDataOpts | ManageSellOfferOpts | PathPaymentStrictReceiveOpts | PathPaymentStrictSendOpts | PaymentOpts | RestoreFootprintOpts | RevokeAccountSponsorshipOpts | RevokeClaimableBalanceSponsorshipOpts | RevokeDataSponsorshipOpts | RevokeLiquidityPoolSponsorshipOpts | RevokeOfferSponsorshipOpts | RevokeSignerSponsorshipOpts | RevokeTrustlineSponsorshipOpts | SetOptionsOpts | SetTrustLineFlagsOpts | UploadContractWasmOpts

Source: src/base/operations/types.ts:311

OperationRecord

Union of all possible operation objects returned by Operation.fromXDRObject.

type OperationRecord = AccountMergeResult | AllowTrustResult | BeginSponsoringFutureReservesResult | BumpSequenceResult | ChangeTrustResult | ClaimClaimableBalanceResult | ClawbackClaimableBalanceResult | ClawbackResult | CreateAccountResult | CreateClaimableBalanceResult | CreatePassiveSellOfferResult | EndSponsoringFutureReservesResult | ExtendFootprintTTLResult | InflationResult | InvokeHostFunctionResult | LiquidityPoolDepositResult | LiquidityPoolWithdrawResult | ManageBuyOfferResult | ManageDataResult | ManageSellOfferResult | PathPaymentStrictReceiveResult | PathPaymentStrictSendResult | PaymentResult | RestoreFootprintResult | RevokeAccountSponsorshipResult | RevokeClaimableBalanceSponsorshipResult | RevokeDataSponsorshipResult | RevokeLiquidityPoolSponsorshipResult | RevokeOfferSponsorshipResult | RevokeSignerSponsorshipResult | RevokeTrustlineSponsorshipResult | SetOptionsResult<SignerOpts> | SetTrustLineFlagsResult

Source: src/base/operations/types.ts:686

OperationType

type OperationType = OperationType.AccountMerge | OperationType.AllowTrust | OperationType.BeginSponsoringFutureReserves | OperationType.BumpSequence | OperationType.ChangeTrust | OperationType.ClaimClaimableBalance | OperationType.Clawback | OperationType.ClawbackClaimableBalance | OperationType.CreateAccount | OperationType.CreateClaimableBalance | OperationType.CreatePassiveSellOffer | OperationType.EndSponsoringFutureReserves | OperationType.ExtendFootprintTTL | OperationType.Inflation | OperationType.InvokeHostFunction | OperationType.LiquidityPoolDeposit | OperationType.LiquidityPoolWithdraw | OperationType.ManageBuyOffer | OperationType.ManageData | OperationType.ManageSellOffer | OperationType.PathPaymentStrictReceive | OperationType.PathPaymentStrictSend | OperationType.Payment | OperationType.RestoreFootprint | OperationType.RevokeAccountSponsorship | OperationType.RevokeClaimableBalanceSponsorship | OperationType.RevokeDataSponsorship | OperationType.RevokeLiquidityPoolSponsorship | OperationType.RevokeOfferSponsorship | OperationType.RevokeSignerSponsorship | OperationType.RevokeTrustlineSponsorship | OperationType.SetOptions | OperationType.SetTrustLineFlags

Source: src/base/operations/types.ts:354

OperationType.AccountMerge

type AccountMerge = "accountMerge"

Source: src/base/operations/types.ts:365

OperationType.AllowTrust

type AllowTrust = "allowTrust"

Source: src/base/operations/types.ts:364

OperationType.BeginSponsoringFutureReserves

type BeginSponsoringFutureReserves = "beginSponsoringFutureReserves"

Source: src/base/operations/types.ts:371

OperationType.BumpSequence

type BumpSequence = "bumpSequence"

Source: src/base/operations/types.ts:368

OperationType.ChangeTrust

type ChangeTrust = "changeTrust"

Source: src/base/operations/types.ts:363

OperationType.ClaimClaimableBalance

type ClaimClaimableBalance = "claimClaimableBalance"

Source: src/base/operations/types.ts:370

OperationType.Clawback

type Clawback = "clawback"

Source: src/base/operations/types.ts:383

OperationType.ClawbackClaimableBalance

type ClawbackClaimableBalance = "clawbackClaimableBalance"

Source: src/base/operations/types.ts:384

OperationType.CreateAccount

type CreateAccount = "createAccount"

Source: src/base/operations/types.ts:355

OperationType.CreateClaimableBalance

type CreateClaimableBalance = "createClaimableBalance"

Source: src/base/operations/types.ts:369

OperationType.CreatePassiveSellOffer

type CreatePassiveSellOffer = "createPassiveSellOffer"

Source: src/base/operations/types.ts:359

OperationType.EndSponsoringFutureReserves

type EndSponsoringFutureReserves = "endSponsoringFutureReserves"

Source: src/base/operations/types.ts:372

OperationType.ExtendFootprintTTL

type ExtendFootprintTTL = "extendFootprintTtl"

Source: src/base/operations/types.ts:389

OperationType.Inflation

type Inflation = "inflation"

Source: src/base/operations/types.ts:366

OperationType.InvokeHostFunction

type InvokeHostFunction = "invokeHostFunction"

Source: src/base/operations/types.ts:388

OperationType.LiquidityPoolDeposit

type LiquidityPoolDeposit = "liquidityPoolDeposit"

Source: src/base/operations/types.ts:386

OperationType.LiquidityPoolWithdraw

type LiquidityPoolWithdraw = "liquidityPoolWithdraw"

Source: src/base/operations/types.ts:387

OperationType.ManageBuyOffer

type ManageBuyOffer = "manageBuyOffer"

Source: src/base/operations/types.ts:361

OperationType.ManageData

type ManageData = "manageData"

Source: src/base/operations/types.ts:367

OperationType.ManageSellOffer

type ManageSellOffer = "manageSellOffer"

Source: src/base/operations/types.ts:360

OperationType.PathPaymentStrictReceive

type PathPaymentStrictReceive = "pathPaymentStrictReceive"

Source: src/base/operations/types.ts:357

OperationType.PathPaymentStrictSend

type PathPaymentStrictSend = "pathPaymentStrictSend"

Source: src/base/operations/types.ts:358

OperationType.Payment

type Payment = "payment"

Source: src/base/operations/types.ts:356

OperationType.RestoreFootprint

type RestoreFootprint = "restoreFootprint"

Source: src/base/operations/types.ts:390

OperationType.RevokeAccountSponsorship

type RevokeAccountSponsorship = "revokeAccountSponsorship"

Source: src/base/operations/types.ts:375

OperationType.RevokeClaimableBalanceSponsorship

type RevokeClaimableBalanceSponsorship = "revokeClaimableBalanceSponsorship"

Source: src/base/operations/types.ts:379

OperationType.RevokeDataSponsorship

type RevokeDataSponsorship = "revokeDataSponsorship"

Source: src/base/operations/types.ts:378

OperationType.RevokeLiquidityPoolSponsorship

type RevokeLiquidityPoolSponsorship = "revokeLiquidityPoolSponsorship"

Source: src/base/operations/types.ts:381

OperationType.RevokeOfferSponsorship

type RevokeOfferSponsorship = "revokeOfferSponsorship"

Source: src/base/operations/types.ts:377

OperationType.RevokeSignerSponsorship

type RevokeSignerSponsorship = "revokeSignerSponsorship"

Source: src/base/operations/types.ts:382

OperationType.RevokeSponsorship

Deprecated. Never emitted by fromXDRObject — use the specific Revoke* types instead.

type RevokeSponsorship = "revokeSponsorship"

Source: src/base/operations/types.ts:374

OperationType.RevokeTrustlineSponsorship

type RevokeTrustlineSponsorship = "revokeTrustlineSponsorship"

Source: src/base/operations/types.ts:376

OperationType.SetOptions

type SetOptions = "setOptions"

Source: src/base/operations/types.ts:362

OperationType.SetTrustLineFlags

type SetTrustLineFlags = "setTrustLineFlags"

Source: src/base/operations/types.ts:385

ScIntType

type ScIntType = "duration" | "i64" | "i128" | "i256" | "timepoint" | "u64" | "u128" | "u256"

Source: src/base/numbers/xdr_large_int.ts:18

Signer

type Signer = Signer.Ed25519PublicKey | Signer.Ed25519SignedPayload | Signer.PreAuthTx | Signer.Sha256Hash

Source: src/base/operations/types.ts:462

Signer.Ed25519PublicKey

interface Ed25519PublicKey {
ed25519PublicKey: string;
weight?: number;
}

Source: src/base/operations/types.ts:463

ed25519PublicKey.ed25519PublicKey

ed25519PublicKey: string;

Source: src/base/operations/types.ts:464

ed25519PublicKey.weight

weight?: number;

Source: src/base/operations/types.ts:465

Signer.Ed25519SignedPayload

interface Ed25519SignedPayload {
ed25519SignedPayload: string;
weight?: number;
}

Source: src/base/operations/types.ts:475

ed25519SignedPayload.ed25519SignedPayload

ed25519SignedPayload: string;

Source: src/base/operations/types.ts:476

ed25519SignedPayload.weight

weight?: number;

Source: src/base/operations/types.ts:477

Signer.PreAuthTx

interface PreAuthTx {
preAuthTx: Buffer;
weight?: number;
}

Source: src/base/operations/types.ts:471

preAuthTx.preAuthTx

preAuthTx: Buffer;

Source: src/base/operations/types.ts:472

preAuthTx.weight

weight?: number;

Source: src/base/operations/types.ts:473

Signer.Sha256Hash

interface Sha256Hash {
sha256Hash: Buffer;
weight?: number;
}

Source: src/base/operations/types.ts:467

sha256Hash.sha256Hash

sha256Hash: Buffer;

Source: src/base/operations/types.ts:468

sha256Hash.weight

weight?: number;

Source: src/base/operations/types.ts:469

SorobanFees

Soroban fee parameters for resource-limited transactions.

interface SorobanFees {
instructions: number;
readBytes: number;
resourceFee: bigint;
writeBytes: number;
}

Source: src/base/transaction_builder.ts:50

sorobanFees.instructions

The number of instructions executed by the transaction.

instructions: number;

Source: src/base/transaction_builder.ts:52

sorobanFees.readBytes

The number of bytes read from the ledger by the transaction.

readBytes: number;

Source: src/base/transaction_builder.ts:54

sorobanFees.resourceFee

The fee to be paid for the transaction, in stroops.

resourceFee: bigint;

Source: src/base/transaction_builder.ts:58

sorobanFees.writeBytes

The number of bytes written to the ledger by the transaction.

writeBytes: number;

Source: src/base/transaction_builder.ts:56

TransactionSource

The contract that TransactionBuilder requires of a transaction’s source account: a way to read the account’s address and sequence number, and to advance the sequence number in place (the builder calls TransactionSource.incrementSequenceNumber when it builds a transaction).

Both the concrete Account and MuxedAccount classes implement this, as does Horizon’s AccountResponse. Implement it yourself if you manage sequence numbers out-of-band (e.g. a server-side sequence pool) and want to pass a custom source to TransactionBuilder.

This is intentionally a brand-free structural interface: assignability is by shape, not by class identity, so any account-like object that honors the contract is accepted.

interface TransactionSource {
accountId(): string;
incrementSequenceNumber(): void;
sequenceNumber(): string;
}

Source: src/base/transaction_source.ts:17

transactionSource.accountId()

The source account’s address — a G… account address or, for a muxed source, its M… address.

accountId(): string;

Source: src/base/transaction_source.ts:22

transactionSource.incrementSequenceNumber()

Increments the sequence number in place by one. TransactionBuilder calls this when building a transaction so that the next transaction built from the same source uses the next sequence number.

incrementSequenceNumber(): void;

Source: src/base/transaction_source.ts:32

transactionSource.sequenceNumber()

The current sequence number, as a string.

sequenceNumber(): string;

Source: src/base/transaction_source.ts:25

TrustLineFlag

type TrustLineFlag = TrustLineFlag.authorize | TrustLineFlag.authorizeToMaintainLiabilities | TrustLineFlag.deauthorize

Source: src/base/operations/types.ts:451

TrustLineFlag.authorize

type authorize = 1

Source: src/base/operations/types.ts:453

TrustLineFlag.authorizeToMaintainLiabilities

type authorizeToMaintainLiabilities = 2

Source: src/base/operations/types.ts:454

TrustLineFlag.deauthorize

type deauthorize = 0

Source: src/base/operations/types.ts:452