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:91

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:82

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:68

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:75

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:70

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(): Uint8Array;
sign(...keypairs: Keypair[]): void;
signatureBase(): Uint8Array;
signHashX(preimage: string | Uint8Array<ArrayBufferLike>): void;
toEnvelope(): TransactionEnvelope;
toXdr(): string;
toXDR(): string;
}

Source: src/base/fee_bump_transaction.ts:25

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:34

feeBumpTransaction.fee

The total fee for this transaction, in stroops.

fee: string;

Source: src/base/transaction_base.ts:84

feeBumpTransaction.feeSource

The account paying the fee for this transaction.

readonly feeSource: string;

Source: src/base/fee_bump_transaction.ts:86

feeBumpTransaction.innerTransaction

The inner transaction that this fee bump wraps.

readonly innerTransaction: Transaction;

Source: src/base/fee_bump_transaction.ts:72

feeBumpTransaction.networkPassphrase

The network passphrase for this transaction.

networkPassphrase: string;

Source: src/base/transaction_base.ts:93

feeBumpTransaction.operations

The operations from the inner transaction.

readonly operations: OperationRecord[];

Source: src/base/fee_bump_transaction.ts:79

feeBumpTransaction.signatures

The list of signatures for this transaction.

signatures: DecoratedSignature[];

Source: src/base/transaction_base.ts:43

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:59

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:204

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:164

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:137

feeBumpTransaction.hash()

Returns a hash for this transaction, suitable for signing.

hash(): Uint8Array;

Source: src/base/transaction_base.ts:230

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:105

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(): Uint8Array;

Source: src/base/fee_bump_transaction.ts:98

feeBumpTransaction.signHashX(preimage)

Add hashX signer preimage as signature.

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

Parameters

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

Source: src/base/transaction_base.ts:212

feeBumpTransaction.toEnvelope()

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

toEnvelope(): TransactionEnvelope;

Source: src/base/fee_bump_transaction.ts:115

feeBumpTransaction.toXdr()

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

toXdr(): string;

Source: src/base/transaction_base.ts:247

feeBumpTransaction.toXDR()

Deprecated. Use toXdr instead. Deprecated in version v17.0.0

toXDR(): string;

Source: src/base/transaction_base.ts:255

Memo

Memo represents memos attached to transactions.

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

See also

Source: src/base/memo.ts:59

new Memo(type, value)

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

Parameters

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

Source: src/base/memo.ts:63

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:299

Memo.fromXDRObject(object)

Deprecated. Use Memo.fromXdrObject instead. Deprecated in version v17.0.0

static fromXDRObject(object: Memo): Memo;

Parameters

  • objectMemo (required)

Source: src/base/memo.ts:330

Memo.hash(hash)

Creates and returns a MemoHash memo.

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

Parameters

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

Source: src/base/memo.ts:258

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:249

Memo.none()

Returns an empty memo (MemoNone).

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

Source: src/base/memo.ts:229

Memo.return(hash)

Creates and returns a MemoReturn memo.

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

Parameters

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

Source: src/base/memo.ts:267

Memo.text(text)

Creates and returns a MemoText memo.

static text(text: string | Uint8Array<ArrayBufferLike>): Memo<"text">;

Parameters

  • textstring | Uint8Array<ArrayBufferLike> (required) — memo text. A JS string is UTF-8 encoded on the wire; pass a Uint8Array for byte-exact content. A plain number[] is not accepted (16.2.0 and earlier took one); wrap it: new Uint8Array(arr).

Source: src/base/memo.ts:240

memo.type

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

type: T;

Source: src/base/memo.ts:103

memo.value

Contains memo value:

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

Source: src/base/memo.ts:118

memo.toXdrObject()

Returns XDR memo object.

toXdrObject(): Memo;

Source: src/base/memo.ts:274

memo.toXDRObject()

Deprecated. Use toXdrObject instead. Deprecated in version v17.0.0

toXDRObject(): Memo;

Source: src/base/memo.ts:322

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;
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:118

muxedAccount.baseAccount()

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

baseAccount(): Account;

Source: src/base/muxed_account.ts:111

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:182

muxedAccount.id()

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

id(): string;

Source: src/base/muxed_account.ts:125

muxedAccount.incrementSequenceNumber()

Increments the underlying account’s sequence number by one.

incrementSequenceNumber(): void;

Source: src/base/muxed_account.ts:157

muxedAccount.sequenceNumber()

Returns the stringified sequence number for the underlying account.

sequenceNumber(): string;

Source: src/base/muxed_account.ts:150

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:134

muxedAccount.toXdrObject()

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

toXdrObject(): MuxedAccount;

Source: src/base/muxed_account.ts:165

muxedAccount.toXDRObject()

Deprecated. Use toXdrObject instead. Deprecated in version v17.0.0

toXDRObject(): MuxedAccount;

Source: src/base/muxed_account.ts:173

Operation

Operation class represents operations in Stellar network.

Use one of static methods to create operations:

class Operation {
constructor();
static accountMerge: (opts: AccountMergeOpts) => Operation;
static allowTrust: (opts: AllowTrustOpts) => Operation;
static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation;
static bumpSequence: (opts: BumpSequenceOpts) => Operation;
static changeTrust: (opts: ChangeTrustOpts) => Operation;
static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation;
static clawback: (opts: ClawbackOpts) => Operation;
static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation;
static createAccount: (opts: CreateAccountOpts) => Operation;
static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation;
static createCustomContract: (opts: CreateCustomContractOpts) => Operation;
static createPassiveSellOffer: (opts: CreatePassiveSellOfferOpts) => Operation;
static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation;
static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation;
static extendFootprintTtl: (opts: ExtendFootprintTtlOpts) => Operation;
static inflation: (opts: InflationOpts = {}) => Operation;
static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation;
static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation;
static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation;
static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation;
static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation;
static manageData: (opts: ManageDataOpts) => Operation;
static manageSellOffer: (opts: ManageSellOfferOpts) => Operation;
static pathPaymentStrictReceive: (opts: PathPaymentStrictReceiveOpts) => Operation;
static pathPaymentStrictSend: (opts: PathPaymentStrictSendOpts) => Operation;
static payment: (opts: PaymentOpts) => Operation;
static restoreFootprint: (opts: RestoreFootprintOpts = {}) => Operation;
static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation;
static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation;
static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation;
static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation;
static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation;
static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation;
static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation;
static setOptions: <T extends SignerOpts = never>(opts: SetOptionsOpts<T>) => Operation;
static setTrustLineFlags: (opts: SetTrustLineFlagsOpts) => Operation;
static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation;
static fromXdrObject<T extends OperationRecord = OperationRecord>(operation: Operation): T;
static fromXDRObject<T extends OperationRecord = OperationRecord>(operation: Operation): T;
}

Source: src/base/operation.ts:139

new Operation()

constructor();

Operation.accountMerge

Transfers native balance to destination account.

static accountMerge: (opts: AccountMergeOpts) => Operation;

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:454

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) => Operation;

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:455

Operation.beginSponsoringFutureReserves

Create a “begin sponsoring future reserves” operation.

static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation;

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:471

Operation.bumpSequence

This operation bumps sequence number.

static bumpSequence: (opts: BumpSequenceOpts) => Operation;

Parameters

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

Source: src/base/operation.ts:456

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) => Operation;

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:457

Operation.claimClaimableBalance

Create a new claim claimable balance operation.

static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation;

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:460

Operation.clawback

Creates a clawback operation.

static clawback: (opts: ClawbackOpts) => Operation;

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:481

Operation.clawbackClaimableBalance

Creates a clawback operation for a claimable balance.

static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation;

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:461

Operation.createAccount

Create and fund a non-existent account.

static createAccount: (opts: CreateAccountOpts) => Operation;

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:458

Operation.createClaimableBalance

Create a new claimable balance operation.

static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation;

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:459

Operation.createCustomContract

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

The contract’s executable is either the hash of uploaded WASM (wasmHash) or a CAP-85 external executable reference (externalRef), naming an owner contract and the tag under which it publishes the WASM hash. Exactly one of the two must be given.

static createCustomContract: (opts: CreateCustomContractOpts) => Operation;

Parameters

  • optsCreateCustomContractOpts (required) — the set of parameters
    • address: the contract deployer address
    • wasmHash: the SHA-256 hash of the contract WASM you’re deploying
    • externalRef: an external executable reference to deploy from instead, as either {owner, tag} or an ContractExecutableExternalRef
    • 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:493

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) => Operation;

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.
      • n: If opts.price is an object: the price numerator
      • 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:462

Operation.createStellarAssetContract

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

static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation;

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:491

Operation.endSponsoringFutureReserves

Create an “end sponsoring future reserves” operation.

static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation;

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:472

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) => Operation;

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:486

Operation.inflation

This operation generates the inflation.

static inflation: (opts: InflationOpts = {}) => Operation;

Parameters

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

Source: src/base/operation.ts:463

Operation.invokeContractFunction

Returns an operation that invokes a contract function.

static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation;

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:492

Operation.invokeHostFunction

Invokes a single smart contract host function.

static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation;

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:485

Operation.liquidityPoolDeposit

Creates a liquidity pool deposit operation.

static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation;

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.
      • n: If opts.minPrice is an object: the price numerator
      • d: If opts.minPrice is an object: the price denominator
    • maxPrice: Maximum depositA/depositB price.
      • n: If opts.maxPrice is an object: the price numerator
      • 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:483

Operation.liquidityPoolWithdraw

Creates a liquidity pool withdraw operation.

static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation;

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:484

Operation.manageBuyOffer

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

static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation;

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.
      • n: If opts.price is an object: the price numerator
      • 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:466

Operation.manageData

This operation adds data entry to the ledger.

static manageData: (opts: ManageDataOpts) => Operation;

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:464

Operation.manageSellOffer

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

static manageSellOffer: (opts: ManageSellOfferOpts) => Operation;

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.
      • n: If opts.price is an object: the price numerator
      • 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:465

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) => Operation;

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:467

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) => Operation;

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:468

Operation.payment

Create a payment operation.

static payment: (opts: PaymentOpts) => Operation;

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:469

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 = {}) => Operation;

Parameters

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

Source: src/base/operation.ts:487

Operation.revokeAccountSponsorship

Create a “revoke sponsorship” operation for an account.

static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation;

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:473

Operation.revokeClaimableBalanceSponsorship

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

static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation;

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:477

Operation.revokeDataSponsorship

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

static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation;

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:476

Operation.revokeLiquidityPoolSponsorship

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

static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation;

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:479

Operation.revokeOfferSponsorship

Create a “revoke sponsorship” operation for an offer.

static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation;

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:475

Operation.revokeSignerSponsorship

Create a “revoke sponsorship” operation for a signer.

static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation;

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:
      • ed25519PublicKey: (optional) The ed25519 public key of the signer.
      • sha256Hash: (optional) sha256 hash (Uint8Array or hex string).
      • preAuthTx: (optional) Hash (Uint8Array or hex string) of transaction.
      • 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:480

Operation.revokeTrustlineSponsorship

Create a “revoke sponsorship” operation for a trustline.

static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation;

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:474

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>) => Operation;

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.
      • ed25519PublicKey: The ed25519 public key of the signer.
      • sha256Hash: sha256 hash (Uint8Array or hex string) of preimage that will unlock funds. Preimage should be used as signature of future transaction.
      • preAuthTx: Hash (Uint8Array or hex string) of transaction that will unlock funds.
      • ed25519SignedPayload: Signed payload signer (ed25519 public key + raw payload) for atomic transaction signature disclosure.
      • 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:470

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) => Operation;

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
      • authorized: authorize account to perform transactions with its credit
      • authorizedToMaintainLiabilities: authorize account to maintain and reduce liabilities for its credit
      • clawbackEnabled: stop claimable balances on this trustline 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:482

Operation.uploadContractWasm

Returns an operation that uploads WASM for a contract.

static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation;

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:494

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: Operation): T;

Parameters

  • operationOperation (required) — An XDR Operation.

Source: src/base/operation.ts:157

Operation.fromXDRObject(operation)

Deprecated. Use Operation.fromXdrObject instead. Deprecated in version v17.0.0

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

Parameters

  • operationOperation (required)

Source: src/base/operation.ts:144

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;
readonly type: ScIntType;
readonly value: bigint;
toBigInt(): bigint;
toDuration(): ScVal;
toI128(): ScVal;
toI256(): ScVal;
toI64(): ScVal;
toJson(): { type: string; value: string };
toJSON(): { type: string; value: string };
toNumber(): number;
toScVal(): ScVal;
toString(): string;
toTimepoint(): ScVal;
toU128(): ScVal;
toU256(): ScVal;
toU64(): ScVal;
valueOf(): bigint;
}

Example

import { xdr, ScInt, scValToBigInt } from "@stellar/stellar-sdk";
// 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 large value and want to shove it into a contract.
sci = new ScInt(0xdeadcafebabedeadn);
sci.toBigInt() // returns 16045704242794520237n
sci.toNumber() // throws: not in range for Number
// 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 you can specify it directly, rather
// than letting it be interpreted from the value you pass in:
const i = new ScInt(123456789n, { type: "u256" });
// `.value` is the underlying bigint, and each `to*()` hands back a ready
// `xdr.ScVal` — there is nothing further to wrap:
i.value; // 123456789n
const scv = i.toU256(); // xdr.ScVal, ScValType = U256
// The declared type pins the width: a `u256` cannot be re-encoded narrower,
// even when the value itself would fit.
i.toI64(); // throws RangeError: cannot encode u256 as 64 bits

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

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:77

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:340

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:316

scInt.type

readonly type: ScIntType;

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

scInt.value

The underlying bigint value (always exact, untruncated).

readonly value: bigint;

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

scInt.toBigInt()

Converts to a native BigInt.

toBigInt(): bigint;

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

scInt.toDuration()

The integer encoded with ScValType = Duration

toDuration(): ScVal;

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

scInt.toI128()

The integer encoded with ScValType = I128.

toI128(): ScVal;

Throws

  • a RangeError if the value cannot fit in 128 bits

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

scInt.toI256()

The integer encoded with ScValType = I256

toI256(): ScVal;

Throws

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

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

scInt.toI64()

The integer encoded with ScValType = I64.

toI64(): ScVal;

Throws

  • a RangeError if the value cannot fit in 64 bits

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

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:292

scInt.toJSON()

JavaScript-standard JSON.stringify hook. Without it, stringify would enumerate the bigint value field and throw a TypeError.

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

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

scInt.toNumber()

Converts to a native JS number.

toNumber(): number;

Throws

  • a RangeError if the value can’t fit into a Number

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

scInt.toScVal()

The smallest interpretation of the stored value

toScVal(): ScVal;

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

scInt.toString()

Returns the string representation of this integer.

toString(): string;

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

scInt.toTimepoint()

The integer encoded with ScValType = Timepoint

toTimepoint(): ScVal;

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

scInt.toU128()

The integer encoded with ScValType = U128.

toU128(): ScVal;

Throws

  • a RangeError if the value cannot fit in 128 bits

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

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:245

scInt.toU64()

The integer encoded with ScValType = U64

toU64(): ScVal;

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

scInt.valueOf()

Returns the primitive value of this integer.

valueOf(): bigint;

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

TimeoutInfinite

const TimeoutInfinite: 0

See also

Source: src/base/transaction_builder.ts:76

Transaction

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(): Uint8Array;
sign(...keypairs: Keypair[]): void;
signatureBase(): Uint8Array;
signHashX(preimage: string | Uint8Array<ArrayBufferLike>): void;
toEnvelope(): TransactionEnvelope;
toXdr(): string;
toXDR(): string;
}

Source: src/base/transaction.ts:48

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:68

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:223

transaction.fee

The total fee for this transaction, in stroops.

fee: string;

Source: src/base/transaction_base.ts:84

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:188

transaction.memo

The memo attached to this transaction.

memo: Memo<MemoType>;

Source: src/base/transaction.ts:255

transaction.minAccountSequence

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

minAccountSequence: string | undefined;

Source: src/base/transaction.ts:196

transaction.minAccountSequenceAge

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

minAccountSequenceAge: bigint | undefined;

Source: src/base/transaction.ts:204

transaction.minAccountSequenceLedgerGap

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

minAccountSequenceLedgerGap: number | undefined;

Source: src/base/transaction.ts:212

transaction.networkPassphrase

The network passphrase for this transaction.

networkPassphrase: string;

Source: src/base/transaction_base.ts:93

transaction.operations

The list of operations in this transaction.

operations: OperationRecord[];

Source: src/base/transaction.ts:247

transaction.sequence

The sequence number for this transaction.

sequence: string;

Source: src/base/transaction.ts:231

transaction.signatures

The list of signatures for this transaction.

signatures: DecoratedSignature[];

Source: src/base/transaction_base.ts:43

transaction.source

The source account for this transaction.

source: string;

Source: src/base/transaction.ts:239

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:177

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:59

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:204

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:164

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:345

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:137

transaction.hash()

Returns a hash for this transaction, suitable for signing.

hash(): Uint8Array;

Source: src/base/transaction_base.ts:230

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:105

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(): Uint8Array;

Source: src/base/transaction.ts:270

transaction.signHashX(preimage)

Add hashX signer preimage as signature.

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

Parameters

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

Source: src/base/transaction_base.ts:212

transaction.toEnvelope()

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

toEnvelope(): TransactionEnvelope;

Source: src/base/transaction.ts:303

transaction.toXdr()

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

toXdr(): string;

Source: src/base/transaction_base.ts:247

transaction.toXDR()

Deprecated. Use toXdr instead. Deprecated in version v17.0.0

toXDR(): string;

Source: src/base/transaction_base.ts:255

TransactionBuilder

Transaction builder helps constructs a new [`Transaction`](#transaction) using the given [`Account`](#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`](#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`](#operationcreateaccount) and [`Operation.payment`](#operationpayment) 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;
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: Operation[];
sorobanData: SorobanTransactionData | null;
source: TransactionSource;
timebounds: { maxTime?: string | number | Date; minTime?: string | number | Date } | null;
addMemo(memo: Memo): TransactionBuilder;
addOperation(operation: Operation): TransactionBuilder;
addOperationAt(operation: Operation, 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:184

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:205

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)

See also

Source: src/base/transaction_builder.ts:1146

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)

Source: src/base/transaction_builder.ts:313

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:1259

TransactionBuilder.fromXDR(envelope, networkPassphrase)

Deprecated. Use TransactionBuilder.fromXdr instead. Deprecated in version v17.0.0

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

Parameters

  • envelopestring | TransactionEnvelope (required)
  • networkPassphrasestring (required)

Source: src/base/transaction_builder.ts:1278

transactionBuilder.baseFee

baseFee: string;

Source: src/base/transaction_builder.ts:187

transactionBuilder.extraSigners

extraSigners: string[] | null;

Source: src/base/transaction_builder.ts:196

transactionBuilder.ledgerbounds

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

Source: src/base/transaction_builder.ts:192

transactionBuilder.memo

memo: Memo;

Source: src/base/transaction_builder.ts:197

transactionBuilder.minAccountSequence

minAccountSequence: string | null;

Source: src/base/transaction_builder.ts:193

transactionBuilder.minAccountSequenceAge

minAccountSequenceAge: bigint | null;

Source: src/base/transaction_builder.ts:194

transactionBuilder.minAccountSequenceLedgerGap

minAccountSequenceLedgerGap: number | null;

Source: src/base/transaction_builder.ts:195

transactionBuilder.networkPassphrase

networkPassphrase: string | null;

Source: src/base/transaction_builder.ts:198

transactionBuilder.operations

operations: Operation[];

Source: src/base/transaction_builder.ts:186

transactionBuilder.sorobanData

sorobanData: SorobanTransactionData | null;

Source: src/base/transaction_builder.ts:199

transactionBuilder.source

source: TransactionSource;

Source: src/base/transaction_builder.ts:185

transactionBuilder.timebounds

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

Source: src/base/transaction_builder.ts:188

transactionBuilder.addMemo(memo)

Adds a memo to the transaction.

addMemo(memo: Memo): TransactionBuilder;

Parameters

  • memoMemo (required) — Memo object

Source: src/base/transaction_builder.ts:445

transactionBuilder.addOperation(operation)

Adds an operation to the transaction.

addOperation(operation: Operation): TransactionBuilder;

Parameters

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

Source: src/base/transaction_builder.ts:407

transactionBuilder.addOperationAt(operation, index)

Adds an operation to the transaction at a specific index.

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

Parameters

  • operationOperation (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:418

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:754

transactionBuilder.build()

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

build(): Transaction;

Source: src/base/transaction_builder.ts:974

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:436

transactionBuilder.clearOperations()

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

clearOperations(): TransactionBuilder;

Source: src/base/transaction_builder.ts:426

transactionBuilder.hasV2Preconditions()

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

hasV2Preconditions(): boolean;

Source: src/base/transaction_builder.ts:1113

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:689

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:575

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:614

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:636

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:665

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:715

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

Source: src/base/transaction_builder.ts:737

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:526

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 xdr.TimeBounds 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:479

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;
readonly type: ScIntType;
readonly value: bigint;
toBigInt(): bigint;
toDuration(): ScVal;
toI128(): ScVal;
toI256(): ScVal;
toI64(): ScVal;
toJson(): { type: string; value: string };
toJSON(): { type: string; value: string };
toNumber(): number;
toScVal(): ScVal;
toString(): string;
toTimepoint(): ScVal;
toU128(): ScVal;
toU256(): ScVal;
toU64(): ScVal;
valueOf(): bigint;
}

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

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 single integer-like value, or a list of slices in little-endian order (parts[0] is the least-significant slice), matching the legacy LargeInt contract — e.g. new XdrLargeInt("i128", [parts.lo, parts.hi]). Slice width is SIZE[type] / values.length; each slice must fit its width or a RangeError is thrown.

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

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:340

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:316

xdrLargeInt.type

readonly type: ScIntType;

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

xdrLargeInt.value

The underlying bigint value (always exact, untruncated).

readonly value: bigint;

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

xdrLargeInt.toBigInt()

Converts to a native BigInt.

toBigInt(): bigint;

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

xdrLargeInt.toDuration()

The integer encoded with ScValType = Duration

toDuration(): ScVal;

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

xdrLargeInt.toI128()

The integer encoded with ScValType = I128.

toI128(): ScVal;

Throws

  • a RangeError if the value cannot fit in 128 bits

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

xdrLargeInt.toI256()

The integer encoded with ScValType = I256

toI256(): ScVal;

Throws

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

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

xdrLargeInt.toI64()

The integer encoded with ScValType = I64.

toI64(): ScVal;

Throws

  • a RangeError if the value cannot fit in 64 bits

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

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:292

xdrLargeInt.toJSON()

JavaScript-standard JSON.stringify hook. Without it, stringify would enumerate the bigint value field and throw a TypeError.

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

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

xdrLargeInt.toNumber()

Converts to a native JS number.

toNumber(): number;

Throws

  • a RangeError if the value can’t fit into a Number

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

xdrLargeInt.toScVal()

The smallest interpretation of the stored value

toScVal(): ScVal;

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

xdrLargeInt.toString()

Returns the string representation of this integer.

toString(): string;

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

xdrLargeInt.toTimepoint()

The integer encoded with ScValType = Timepoint

toTimepoint(): ScVal;

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

xdrLargeInt.toU128()

The integer encoded with ScValType = U128.

toU128(): ScVal;

Throws

  • a RangeError if the value cannot fit in 128 bits

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

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:245

xdrLargeInt.toU64()

The integer encoded with ScValType = U64

toU64(): ScVal;

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

xdrLargeInt.valueOf()

Returns the primitive value of this integer.

valueOf(): bigint;

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

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:14

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:48

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:32

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:67

getClaimableBalanceIdFromResult

Read the claimable balance ID out of a submitted transaction’s result.

Use this after submission. To derive the ID beforehand, use Transaction.getClaimableBalanceId instead. Both return the balance ID in its 72-character hex form.

Horizon returns the result as base64 in result_xdr, so decode it first with xdr.TransactionResult.fromXdr(result_xdr, "base64"). RPC’s getTransaction already returns a parsed resultXdr.

getClaimableBalanceIdFromResult(result: TransactionResult, opIndex: number): string

Parameters

  • resultTransactionResult (required) — the result of the transaction that ran the CreateClaimableBalance op
  • opIndexnumber (required) — the index of the CreateClaimableBalance op

Throws

  • RangeError for an opIndex that is not an index into the transaction’s operation results
  • TypeError if result is not a transaction result, if the transaction did not succeed, or if the operation at opIndex is not a successful CreateClaimableBalance

See also

Source: src/base/get_claimable_balance_id.ts:75

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

  • a TypeError 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:30

Types

AuthFlag

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

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

AuthFlag

type AuthFlag = typeof AuthFlag[keyof typeof AuthFlag]

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

AuthFlag.clawbackEnabled

type clawbackEnabled = 8

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

AuthFlag.immutable

type immutable = 4

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

AuthFlag.required

type required = 1

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

AuthFlag.revocable

type revocable = 2

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

ExternalExecutableRef

A CAP-85 external executable reference: the contract that owns the executable plus the owner-scoped tag naming it. The tag is an unbounded SCString and may be binary, so it is accepted as raw bytes as well as text. An ContractExecutableExternalRef (e.g. pulled from an existing contract instance) is accepted directly.

type ExternalExecutableRef = ContractExecutableExternalRef | { owner: Address | string; tag: string | Uint8Array }

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

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 = string | null | Uint8Array

Source: src/base/memo.ts:43

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:627

Operation.AllowTrust

type AllowTrust = AllowTrustResult

Source: src/base/operation.ts:626

Operation.BaseOperation

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

Source: src/base/operation.ts:615

Operation.BeginSponsoringFutureReserves

type BeginSponsoringFutureReserves = BeginSponsoringFutureReservesResult

Source: src/base/operation.ts:633

Operation.BumpSequence

type BumpSequence = BumpSequenceResult

Source: src/base/operation.ts:630

Operation.ChangeTrust

type ChangeTrust = ChangeTrustResult

Source: src/base/operation.ts:625

Operation.ClaimClaimableBalance

type ClaimClaimableBalance = ClaimClaimableBalanceResult

Source: src/base/operation.ts:632

Operation.Clawback

type Clawback = ClawbackResult

Source: src/base/operation.ts:645

Operation.ClawbackClaimableBalance

type ClawbackClaimableBalance = ClawbackClaimableBalanceResult

Source: src/base/operation.ts:646

Operation.CreateAccount

type CreateAccount = CreateAccountResult

Source: src/base/operation.ts:617

Operation.CreateClaimableBalance

type CreateClaimableBalance = CreateClaimableBalanceResult

Source: src/base/operation.ts:631

Operation.CreatePassiveSellOffer

type CreatePassiveSellOffer = CreatePassiveSellOfferResult

Source: src/base/operation.ts:621

Operation.EndSponsoringFutureReserves

type EndSponsoringFutureReserves = EndSponsoringFutureReservesResult

Source: src/base/operation.ts:635

Operation.ExtendFootprintTTL

type ExtendFootprintTTL = ExtendFootprintTTLResult

Source: src/base/operation.ts:651

Operation.Inflation

type Inflation = InflationResult

Source: src/base/operation.ts:628

Operation.InvokeHostFunction

type InvokeHostFunction = InvokeHostFunctionResult

Source: src/base/operation.ts:650

Operation.LiquidityPoolDeposit

type LiquidityPoolDeposit = LiquidityPoolDepositResult

Source: src/base/operation.ts:648

Operation.LiquidityPoolWithdraw

type LiquidityPoolWithdraw = LiquidityPoolWithdrawResult

Source: src/base/operation.ts:649

Operation.ManageBuyOffer

type ManageBuyOffer = ManageBuyOfferResult

Source: src/base/operation.ts:623

Operation.ManageData

type ManageData = ManageDataResult

Source: src/base/operation.ts:629

Operation.ManageSellOffer

type ManageSellOffer = ManageSellOfferResult

Source: src/base/operation.ts:622

Operation.PathPaymentStrictReceive

type PathPaymentStrictReceive = PathPaymentStrictReceiveResult

Source: src/base/operation.ts:619

Operation.PathPaymentStrictSend

type PathPaymentStrictSend = PathPaymentStrictSendResult

Source: src/base/operation.ts:620

Operation.Payment

type Payment = PaymentResult

Source: src/base/operation.ts:618

Operation.RestoreFootprint

type RestoreFootprint = RestoreFootprintResult

Source: src/base/operation.ts:652

Operation.RevokeAccountSponsorship

type RevokeAccountSponsorship = RevokeAccountSponsorshipResult

Source: src/base/operation.ts:636

Operation.RevokeClaimableBalanceSponsorship

type RevokeClaimableBalanceSponsorship = RevokeClaimableBalanceSponsorshipResult

Source: src/base/operation.ts:640

Operation.RevokeDataSponsorship

type RevokeDataSponsorship = RevokeDataSponsorshipResult

Source: src/base/operation.ts:639

Operation.RevokeLiquidityPoolSponsorship

type RevokeLiquidityPoolSponsorship = RevokeLiquidityPoolSponsorshipResult

Source: src/base/operation.ts:642

Operation.RevokeOfferSponsorship

type RevokeOfferSponsorship = RevokeOfferSponsorshipResult

Source: src/base/operation.ts:638

Operation.RevokeSignerSponsorship

type RevokeSignerSponsorship = RevokeSignerSponsorshipResult

Source: src/base/operation.ts:644

Operation.RevokeTrustlineSponsorship

type RevokeTrustlineSponsorship = RevokeTrustlineSponsorshipResult

Source: src/base/operation.ts:637

Operation.SetOptions

type SetOptions = SetOptionsResult<Signer>

Source: src/base/operation.ts:624

Operation.SetTrustLineFlags

type SetTrustLineFlags = SetTrustLineFlagsResult

Source: src/base/operation.ts:647

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:365

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:740

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:408

OperationType.AccountMerge

type AccountMerge = "accountMerge"

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

OperationType.AllowTrust

type AllowTrust = "allowTrust"

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

OperationType.BeginSponsoringFutureReserves

type BeginSponsoringFutureReserves = "beginSponsoringFutureReserves"

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

OperationType.BumpSequence

type BumpSequence = "bumpSequence"

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

OperationType.ChangeTrust

type ChangeTrust = "changeTrust"

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

OperationType.ClaimClaimableBalance

type ClaimClaimableBalance = "claimClaimableBalance"

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

OperationType.Clawback

type Clawback = "clawback"

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

OperationType.ClawbackClaimableBalance

type ClawbackClaimableBalance = "clawbackClaimableBalance"

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

OperationType.CreateAccount

type CreateAccount = "createAccount"

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

OperationType.CreateClaimableBalance

type CreateClaimableBalance = "createClaimableBalance"

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

OperationType.CreatePassiveSellOffer

type CreatePassiveSellOffer = "createPassiveSellOffer"

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

OperationType.EndSponsoringFutureReserves

type EndSponsoringFutureReserves = "endSponsoringFutureReserves"

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

OperationType.ExtendFootprintTTL

type ExtendFootprintTTL = "extendFootprintTtl"

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

OperationType.Inflation

type Inflation = "inflation"

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

OperationType.InvokeHostFunction

type InvokeHostFunction = "invokeHostFunction"

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

OperationType.LiquidityPoolDeposit

type LiquidityPoolDeposit = "liquidityPoolDeposit"

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

OperationType.LiquidityPoolWithdraw

type LiquidityPoolWithdraw = "liquidityPoolWithdraw"

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

OperationType.ManageBuyOffer

type ManageBuyOffer = "manageBuyOffer"

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

OperationType.ManageData

type ManageData = "manageData"

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

OperationType.ManageSellOffer

type ManageSellOffer = "manageSellOffer"

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

OperationType.PathPaymentStrictReceive

type PathPaymentStrictReceive = "pathPaymentStrictReceive"

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

OperationType.PathPaymentStrictSend

type PathPaymentStrictSend = "pathPaymentStrictSend"

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

OperationType.Payment

type Payment = "payment"

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

OperationType.RestoreFootprint

type RestoreFootprint = "restoreFootprint"

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

OperationType.RevokeAccountSponsorship

type RevokeAccountSponsorship = "revokeAccountSponsorship"

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

OperationType.RevokeClaimableBalanceSponsorship

type RevokeClaimableBalanceSponsorship = "revokeClaimableBalanceSponsorship"

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

OperationType.RevokeDataSponsorship

type RevokeDataSponsorship = "revokeDataSponsorship"

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

OperationType.RevokeLiquidityPoolSponsorship

type RevokeLiquidityPoolSponsorship = "revokeLiquidityPoolSponsorship"

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

OperationType.RevokeOfferSponsorship

type RevokeOfferSponsorship = "revokeOfferSponsorship"

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

OperationType.RevokeSignerSponsorship

type RevokeSignerSponsorship = "revokeSignerSponsorship"

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

OperationType.RevokeSponsorship

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

type RevokeSponsorship = "revokeSponsorship"

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

OperationType.RevokeTrustlineSponsorship

type RevokeTrustlineSponsorship = "revokeTrustlineSponsorship"

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

OperationType.SetOptions

type SetOptions = "setOptions"

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

OperationType.SetTrustLineFlags

type SetTrustLineFlags = "setTrustLineFlags"

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

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:516

Signer.Ed25519PublicKey

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

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

ed25519PublicKey.ed25519PublicKey

ed25519PublicKey: string;

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

ed25519PublicKey.weight

weight?: number;

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

Signer.Ed25519SignedPayload

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

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

ed25519SignedPayload.ed25519SignedPayload

ed25519SignedPayload: string;

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

ed25519SignedPayload.weight

weight?: number;

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

Signer.PreAuthTx

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

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

preAuthTx.preAuthTx

preAuthTx: Uint8Array;

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

preAuthTx.weight

weight?: number;

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

Signer.Sha256Hash

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

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

sha256Hash.sha256Hash

sha256Hash: Uint8Array;

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

sha256Hash.weight

weight?: number;

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

SorobanFees

Soroban fee parameters for resource-limited transactions.

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

Source: src/base/transaction_builder.ts:81

sorobanFees.instructions

The number of instructions executed by the transaction.

instructions: number;

Source: src/base/transaction_builder.ts:83

sorobanFees.readBytes

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

readBytes: number;

Source: src/base/transaction_builder.ts:85

sorobanFees.resourceFee

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

resourceFee: bigint;

Source: src/base/transaction_builder.ts:89

sorobanFees.writeBytes

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

writeBytes: number;

Source: src/base/transaction_builder.ts:87

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:505

TrustLineFlag.authorize

type authorize = 1

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

TrustLineFlag.authorizeToMaintainLiabilities

type authorizeToMaintainLiabilities = 2

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

TrustLineFlag.deauthorize

type deauthorize = 0

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