# Source: docs/index.md # Stellar JS SDK (js-stellar-sdk)

npm version Weekly Downloads Test Status Ask DeepWiki

`js-stellar-sdk` is a JavaScript library for communicating with a [Stellar Horizon server](https://developers.stellar.org/docs/data/apis/horizon) and [Stellar RPC](https://developers.stellar.org/docs/data/apis/rpc). While primarily intended for applications built on Node.js or in the browser, it can be adapted for use in other environments with some tinkering. The library provides: - a networking layer API for Horizon endpoints (REST-based), - a networking layer for Soroban RPC (JSONRPC-based). - facilities for building and signing transactions, for communicating with a Stellar Horizon instance, and for submitting transactions or querying network history. **Jump to:** - [Installation](/js-stellar-sdk/#installation): details on hitting the ground running - [Usage](/js-stellar-sdk/#usage): links to documentation and a variety of workarounds for non-traditional JavaScript environments - [...with React Native](/js-stellar-sdk/#usage-with-react-native) - [...with Expo](/js-stellar-sdk/#usage-with-expo-managed-workflows) - [...with CloudFlare Workers](/js-stellar-sdk/#usage-with-cloudflare-workers) - [CLI](/js-stellar-sdk/#cli): generate TypeScript bindings for Stellar smart contracts - [Developing](/js-stellar-sdk/#developing): contribute to the project! - [License](/js-stellar-sdk/#license) ## Installation Using npm, pnpm, or yarn to include `stellar-sdk` in your own project: ```shell npm install --save @stellar/stellar-sdk # or pnpm add @stellar/stellar-sdk # or yarn add @stellar/stellar-sdk ``` Then, require or import it in your JavaScript code: ```js var StellarSdk = require("@stellar/stellar-sdk"); // or import * as StellarSdk from "@stellar/stellar-sdk"; ``` (Preferably, you would only import the pieces you need to enable tree-shaking and lower your final bundle sizes.) ### Browsers You can use a CDN: ```html ``` > **Note:** Always make sure that you are using the latest version number. They can be found on the [releases page](https://github.com/stellar/js-stellar-sdk/releases) in GitHub. ### Custom Installation The default bundle uses a native-fetch HTTP client with no axios dependency. If you need the axios transport (for example, to match the behavior of older SDK versions), set the `USE_AXIOS` environment variable to `true` when building. #### Build with Axios ``` pnpm run build:lib:axios ``` This will create `stellar-sdk-axios.js` in `dist/`. Consumers can also import the axios-backed entry from Node via `@stellar/stellar-sdk/axios`. ### Migrating from @stellar/stellar-base `@stellar/stellar-base` is now folded into `@stellar/stellar-sdk`. Its classes and functions are bundled in and re-exported from the top level, so the SDK is the only package you need. This only matters if you import `@stellar/stellar-base` directly. If you depend on `@stellar/stellar-sdk` and never installed the base package separately, skip this section. The fold-in landed in `@stellar/stellar-sdk` v16.0.0; on earlier versions the SDK still depends on the separate base package, so don't remove it there. To migrate: 1. Install `@stellar/stellar-sdk` if you don't already (see [Installation](/js-stellar-sdk/#installation)). 2. Update your imports. The symbols you import keep their names, so a project-wide find and replace of `"@stellar/stellar-base"` with `"@stellar/stellar-sdk"` usually does it: ```js // before import { Keypair, TransactionBuilder, Asset } from "@stellar/stellar-base"; // after import { Keypair, TransactionBuilder, Asset } from "@stellar/stellar-sdk"; ``` 3. Uninstall the base package: ```shell npm uninstall @stellar/stellar-base ``` Don't keep both packages installed. Two copies of the base library cause confusing runtime errors, such as `instanceof` checks failing on values that look correct. ## Versioning and compatibility Always use the latest `@stellar/stellar-sdk`. The Stellar network upgrades its protocol periodically, and an older SDK may fail to decode newer data (for example, newer XDR). You can check the protocol a network currently runs in the `current_protocol_version` field of its Horizon root (for example [horizon.stellar.org](https://horizon.stellar.org/) for Mainnet; Testnet and Futurenet expose their own). These docs and the API reference cover the latest version only. To read docs for an older version, find its Git tag on the [releases page](https://github.com/stellar/js-stellar-sdk/releases) and browse the `docs/` directory at that ref on GitHub. The release notes there mark the breaking changes in each version. ## Usage The usage documentation for this library lives in a handful of places: - across the [Stellar Developer Docs](https://developers.stellar.org), which includes tutorials and examples, and - on the generated [API doc site](https://stellar.github.io/js-stellar-sdk/) — which also publishes [agent-friendly bundles, raw markdown siblings, and a crawler policy](https://stellar.github.io/js-stellar-sdk/agents/) for AI tools. The site's URL, base path, and AI policy values live in [`config/site.ts`](config/site.ts). ### AI agent documentation Agents can use the documentation bundles published on the website: - [`llms.txt`](https://stellar.github.io/js-stellar-sdk/llms.txt) — an index of the guides, reference pages, and other agent-facing docs. - [`llms-full.txt`](https://stellar.github.io/js-stellar-sdk/llms-full.txt) — the full documentation corpus plus the changelog in one text file. These generated bundles are not committed to the repo. To inspect bundles for a local branch, run `pnpm docs:llms`; the generated files are written under `public/` for the website build. You can also refer to: - the [documentation](https://developers.stellar.org/docs/data/horizon) for the Horizon REST API (if using the `Horizon` module) and - the [documentation](https://developers.stellar.org/docs/data/rpc) for Soroban RPC's API (if using the `rpc` module) ### Usage with React Native The SDK works in React Native, but its JavaScript runtime doesn't ship a couple of things the SDK expects from Node. You'll need to provide them in your app's entry file: 1. **A global `Buffer`.** XDR encoding/decoding relies on `Buffer`. Install a polyfill and assign it to `global.Buffer`. 2. **A Web Crypto random source.** `Keypair.random()` and SEP-10 challenge generation call `crypto.getRandomValues()`, which React Native doesn't provide out of the box. Add a polyfill that registers it on the global scope, imported once before any SDK code runs. Modern React Native uses Metro with autolinking, so beyond adding the two polyfills above, no manual native linking or custom resolver config is required. If you use Horizon streaming (`server.…().stream()`), be aware it depends on an `EventSource`, which is now an included dependency and will work in any runtimes that support [fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch), [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream), [TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder), [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL), [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event), [MessageEvent](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent), [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget). React Native apps using the Hermes engine may need to polyfill broken typed array methods such as `subarray`, since this compatibility is no longer provided by `@stellar/js-xdr`. If you run into issues, consider a polyfill such as `@exodus/patch-broken-hermes-typed-arrays`. #### Usage with Expo managed workflows Expo has the same two requirements as React Native above — a global `Buffer` and a `crypto.getRandomValues()` source. Install polyfills for both (use `npx expo install` so versions are matched to your Expo SDK) and import them at the top of your entry point (by default `App.js`) before any SDK code. Once `crypto.getRandomValues()` is available, `Keypair.random()` works normally — the manual `expo-random` workaround from older Expo SDKs is no longer needed. #### Usage with CloudFlare Workers The SDK defaults to a native-`fetch` HTTP client, so Horizon and RPC requests work in the Workers runtime without an HTTP adapter. The things to watch for are: 1. **Node compatibility.** The SDK relies on `Buffer`. Enable the [`nodejs_compat`](https://developers.cloudflare.com/workers/runtime-apis/nodejs/) flag in your `wrangler.toml` so Node built-ins are available. 2. **Streaming.** Horizon's `.stream()` depends on `EventSource`; long-lived streaming connections don't fit the Workers request model well, so prefer polling (`.call()` / `.cursor()`) for Horizon data in a Worker. ## CLI The SDK includes a command-line tool for generating TypeScript bindings from Stellar smart contracts. These bindings provide fully-typed client code with IDE autocompletion and compile-time type checking. ### Running the CLI ```shell # Using npx (no installation required) npx @stellar/stellar-sdk generate [options] # Or if installed globally stellar-js generate [options] ``` ### Generating Bindings You can generate bindings from three different sources: #### From a local WASM file ```shell npx @stellar/stellar-sdk generate \ --wasm ./path/to/wasm_file/my_contract.wasm \ --output-dir ./my-contract-client \ --contract-name my-contract ``` #### From a WASM hash on the network ```shell # testnet, futurenet, and localnet have default RPC URLs npx @stellar/stellar-sdk generate \ --wasm-hash \ --network testnet \ --output-dir ./my-contract-client \ --contract-name my-contract ``` #### From a deployed contract ID ```shell npx @stellar/stellar-sdk generate \ --contract-id CABC...XYZ \ --network testnet \ --output-dir ./my-contract-client ``` #### With custom RPC server options For mainnet or when connecting to RPC servers that require authentication: ```shell # Mainnet requires --rpc-url (no default) npx @stellar/stellar-sdk generate \ --contract-id CABC...XYZ \ --rpc-url https://my-rpc-provider.com \ --network mainnet \ --output-dir ./my-contract-client # With custom timeout and headers for authenticated RPC servers npx @stellar/stellar-sdk generate \ --contract-id CABC...XYZ \ --rpc-url https://my-rpc-server.com \ --network mainnet \ --output-dir ./my-contract-client \ --timeout 30000 \ --headers '{"Authorization": "Bearer my-token"}' # localnet with default RPC URL auto-enables --allow-http npx @stellar/stellar-sdk generate \ --contract-id CABC...XYZ \ --network localnet \ --output-dir ./my-contract-client # When overriding the default URL, you must specify --allow-http if using HTTP npx @stellar/stellar-sdk generate \ --contract-id CABC...XYZ \ --rpc-url http://my-local-server:8000/rpc \ --network localnet \ --output-dir ./my-contract-client \ --allow-http ``` ### CLI Options | Option | Description | | ------------------------ | ----------------------------------------------------------------------------------------------- | | `--wasm ` | Path to a local WASM file | | `--wasm-hash ` | Hex-encoded hash of WASM blob on the network | | `--contract-id ` | Contract ID of a deployed contract | | `--rpc-url ` | Stellar RPC server URL (has defaults for testnet/futurenet/localnet, required for mainnet) | | `--network ` | Network to use: `testnet`, `mainnet`, `futurenet`, or `localnet` (required for network sources) | | `--output-dir ` | Output directory for generated bindings (required) | | `--contract-name ` | Name for the generated package (derived from filename if not provided) | | `--overwrite` | Overwrite existing files in the output directory | | `--allow-http` | Allow insecure HTTP connections to RPC server (default: false) | | `--timeout ` | RPC request timeout in milliseconds | | `--headers ` | Custom headers as JSON object (e.g., `'{"Authorization": "Bearer token"}'`) | #### Default RPC URLs When using `--network`, the CLI provides default RPC URLs for most networks: | Network | Default RPC URL | | ----------- | ------------------------------------------------------------------------------------------------------------------ | | `testnet` | `https://soroban-testnet.stellar.org` | | `futurenet` | `https://rpc-futurenet.stellar.org` | | `localnet` | `http://localhost:8000/rpc` (auto-enables `--allow-http` only when using default URL) | | `mainnet` | None - you must provide `--rpc-url` ([find providers](https://developers.stellar.org/docs/data/rpc/rpc-providers)) | ### Generated Output The CLI generates a complete npm package structure: ``` my-contract-client/ ├── src/ │ ├── index.ts # Barrel exports │ ├── client.ts # Typed Client class with contract methods │ └── types.ts # TypeScript interfaces for contract types ├── package.json ├── tsconfig.json ├── README.md └── .gitignore ``` ### Using Generated Bindings After generating, you can use the bindings in your project: ```typescript import { Client } from "./my-contract-client"; const client = new Client({ contractId: "CABC...XYZ", networkPassphrase: Networks.TESTNET, rpcUrl: "https://soroban-testnet.stellar.org", publicKey: keypair.publicKey(), ...basicNodeSigner(keypair, Networks.TESTNET), }); // Fully typed method calls with IDE autocompletion const result = await client.transfer({ from: "GABC...", to: "GDEF...", amount: 1000n, }); ``` ## Developing So you want to contribute to the library: welcome! Whether you're working on a fork or want to make an upstream request, the dev-test loop is pretty straightforward. 1. Clone the repo: ```shell git clone https://github.com/stellar/js-stellar-sdk.git ``` 2. Install Node Because we support the oldest maintenance version of Node, please install and develop on the version pinned in [`.nvmrc`](.nvmrc) (currently Node 22) so you don't get surprised when your code works locally but breaks in CI. Here's how to install `nvm` if you haven't: https://github.com/creationix/nvm ```shell nvm install ``` If you work on several projects that use different Node versions, you might it helpful to install this automatic version manager: https://github.com/wbyoung/avn 3. Enable Corepack ```shell corepack enable ``` 4. Install dependencies inside js-stellar-sdk folder: ```shell cd js-stellar-sdk pnpm install ``` 5. Observe the project's code style While you're making changes, make sure to run the linter to catch any linting errors (in addition to making sure your text editor supports ESLint) and conform to the project's code style. ```shell pnpm run fmt ``` ### Building You can build the developer version (unoptimized, commented, with source maps, etc.) or the production bundles: ```shell pnpm run build # or pnpm run build:prod ``` ### Testing To run all tests: ```shell pnpm run test ``` To run a specific set of tests: ```shell pnpm run test:node pnpm run test:browser pnpm run test:integration ``` To generate and check the documentation site: ```shell # generate the docs site (reference pages, llms bundles, and the Astro site under dist/site) pnpm run docs # preview the built site in a browser pnpm docs:preview # the preview server prints the local URL (default http://localhost:4321) # for a live-reloading dev server instead, use: pnpm docs:dev ``` ### Publishing For information on how to contribute or publish new versions of this software to `npm`, please refer to our [contribution guide](https://github.com/stellar/js-stellar-sdk/blob/master/CONTRIBUTING.md). ## Miscellaneous ### License js-stellar-sdk is licensed under an Apache-2.0 license. See the [LICENSE](https://github.com/stellar/js-stellar-sdk/blob/master/LICENSE) file for details. # Source: docs/guides/00-migration.md # Migration Guide If you are coming from an earlier version of `@stellar/stellar-sdk`, update the APIs listed below. > **Versioning.** Always run the latest `@stellar/stellar-sdk`; an older SDK may > fail to decode newer network data as the protocol upgrades. These docs cover > the latest version only. See > [Versioning and compatibility](/js-stellar-sdk/#versioning-and-compatibility). ## 16.x.x Breaking changes The 16.x.x release is a major modernization. `@stellar/stellar-base` is folded into the SDK, native `fetch` replaces axios as the default transport, the package is ESM-first, and Node 22 is required. It also lands [Protocol 27](https://stellar.org/blog/foundation-news/stellar-zipper-protocol-27-upgrade-guide) Soroban authorization (`AddressV2`). Most apps only need the [Installation](/js-stellar-sdk/guides/00-migration/#installation-node-22-is-now-required), [Imports](/js-stellar-sdk/guides/00-migration/#imports-the-default-export-was-removed), and [Transport](/js-stellar-sdk/guides/00-migration/#transport-native-fetch-is-now-the-default) changes. Review the transaction, asset, and behavior sections if your code depends on lower-level base types or previously lenient validation. The [Auth](/js-stellar-sdk/guides/00-migration/#auth-protocol-27-readiness) changes only affect code that signs Soroban contract authorization entries. ### Installation: Node 22 is now required The minimum Node version is now `22` (up from `20`). Installing on older Node produces an `EBADENGINE` warning. Two runtime globals are now assumed and are built into Node 22: `fetch` (the default transport) and `crypto.getRandomValues` (used by SEP-10 `buildChallengeTx`, which dropped the `randombytes` dependency). Constrained runtimes such as React Native need polyfills for both. A `.nvmrc` pinned to `v22` is included: ```shell nvm install && nvm use ``` ### Installation: `@stellar/stellar-base` is folded into `@stellar/stellar-sdk` `@stellar/stellar-base` is now bundled into and re-exported from `@stellar/stellar-sdk`, and is no longer a separate dependency. Symbol names are unchanged. If you imported the base package directly, change the import source: ```ts del={1} ins={2} import { Keypair, TransactionBuilder, Asset } from "@stellar/stellar-base" import { Keypair, TransactionBuilder, Asset } from "@stellar/stellar-sdk" ``` Then uninstall it. Keeping both installed causes `instanceof` checks to fail on values that look correct. ```shell npm uninstall @stellar/stellar-base ``` ### Imports: the default export was removed `export default module.exports` was removed from the entry points. Replace any default import with a namespace or named import. ```ts del={1} ins={2,3} import StellarSdk from "@stellar/stellar-sdk" import * as StellarSdk from "@stellar/stellar-sdk" import { Keypair, rpc, contract } from "@stellar/stellar-sdk" ``` ### Imports: build paths moved under `lib/esm` The package is now ESM-first and dual (`"type": "module"`). ESM resolves `lib/esm/`, CommonJS resolves `lib/cjs/`, axios variants resolve under `lib/axios/esm/` and `lib/axios/cjs/`, and type declarations live alongside the ESM output. `require()` still works. If you deep imported a raw build path, it moved. Use the subpath exports instead. ```ts del={1} ins={2} import { Server } from "@stellar/stellar-sdk/lib/rpc/index.js" import { rpc } from "@stellar/stellar-sdk/rpc" ``` Available subpaths: `.`, `./rpc`, `./contract`, `./axios`, `./axios/rpc`, `./axios/contract`, `./http-client/axios`. ### Imports: browser auto-resolution was removed The `package.json` `browser` field and browser export conditions were removed. Bundlers now resolve the package entry to ESM or CJS source instead of auto-substituting the prebuilt UMD bundle. If you need the standalone browser bundle, load it from the explicit `dist/` path. The UMD filenames are unchanged. ### Transport: native `fetch` is now the default The default HTTP client switched from axios to native `fetch` (backed by `feaxios`). Normal Horizon and RPC use needs no change. Code that relied on axios-specific behavior (the axios `config` object, axios error shapes, interceptors, `httpClient.CancelToken`) now gets the fetch client instead. To opt back into axios, import the axios-backed build: ```ts del={1} ins={2} import * as StellarSdk from "@stellar/stellar-sdk" import * as StellarSdk from "@stellar/stellar-sdk/axios" ``` Per module, use `@stellar/stellar-sdk/axios/rpc` and `@stellar/stellar-sdk/axios/contract`. For a self-built browser bundle, build with `USE_AXIOS=true` (`pnpm run build:lib:axios`). ### Removed entrypoints The `no-axios`, `minimal`, and `no-eventsource` subpaths (and each one's `/contract` and `/rpc` variants) were removed. The plain `@stellar/stellar-sdk` import is now fetch-based, so it already provides what `no-axios` and `minimal` used to. ```ts del={1-3} ins={4} import { Horizon } from "@stellar/stellar-sdk/no-axios" import { Horizon } from "@stellar/stellar-sdk/minimal" import { Horizon } from "@stellar/stellar-sdk/no-eventsource" import { Horizon } from "@stellar/stellar-sdk" ``` ### Streaming: `eventsource` upgraded to v4 The `eventsource` dependency jumped from v2 to v4 and is now always bundled (the `USE_EVENTSOURCE=false` build flag and the "Streaming requires eventsource" guard are gone). Re-test Horizon `.stream()` flows. v4 uses spec-compliant `EventTarget` behavior, so exceptions thrown inside `onmessage` or `onerror` handlers now surface as uncaught exceptions instead of being swallowed. Handle errors inside stream callbacks. ### Utilities: `server.serverURL` is now a native `URL` The `serverURL` on [`Horizon.Server`](/js-stellar-sdk/reference/network-horizon/#horizonserver) and [`rpc.Server`](/js-stellar-sdk/reference/network-rpc/#rpcserver) changed from a `urijs` `URI` to the global `URL`. Method calls become property reads. ```ts del={1} ins={2} const host = server.serverURL.hostname() const host = server.serverURL.hostname ``` `URL.protocol` returns the WHATWG form with a trailing colon, so update equality checks. ```ts del={1} ins={2} if (server.serverURL.protocol === "https") { /* ... */ } if (server.serverURL.protocol === "https:") { /* ... */ } ``` The `Server` constructors now require an absolute URL with a scheme. A bare host or scheme-less string throws `TypeError: Invalid URL` at construction time. If you subclass `CallBuilder`, its constructor parameter and `protected url` field are now `URL`, and there is a new `protected setPath(...segments)` helper. ### Transactions: min account sequence age is now `bigint` [`Transaction`](/js-stellar-sdk/reference/core-transactions/#transaction)'s `minAccountSequenceAge` is now a native `bigint`. It is no longer a `number` or an `xdr.UnsignedHyper` object. Search for `minAccountSequenceAge` and `setMinAccountSequenceAge` in your code. Change numeric seconds to `bigint` values when passing them to [`TransactionBuilder.setMinAccountSequenceAge`](/js-stellar-sdk/reference/core-transactions/) or `TransactionBuilderOptions.minAccountSequenceAge`. If you compare a transaction's `minAccountSequenceAge`, compare against a `bigint`. If you set `minAccountSequenceAge: 0n`, the builder now preserves that value instead of coercing it to `null`. Code that checks `hasV2Preconditions()` may see `true` when a zero-age precondition is present. Before: ```ts const builder = new TransactionBuilder(account, { fee, networkPassphrase, minAccountSequenceAge: 60, }) builder.setMinAccountSequenceAge(120) ``` After: ```ts const builder = new TransactionBuilder(account, { fee, networkPassphrase, minAccountSequenceAge: 60n, }) builder.setMinAccountSequenceAge(120n) ``` ### Transactions: type and operation changes Update code that directly types transactions, reads transaction preconditions, mutates transaction internals, or switches on operation types: - Remove generic parameters from `Transaction` type annotations, such as `Transaction>`. - Convert `tx.extraSigners` to StrKey strings before treating it as `string[]`; it is now typed as `xdr.SignerKey[]`. - Stop mutating `TransactionBase.tx`. It returns a defensive copy, so changes to the returned XDR object no longer affect the transaction that will be signed or serialized. - Delete calls to `Operation.isValidAmount()`, `Operation.constructAmountRequirementsError()`, and `Operation.setSourceAccount()`. They are no longer runtime methods on `Operation`. - Replace `operation.type === "revokeSponsorship"` checks with the specific revoke-sponsorship type strings: `"revokeAccountSponsorship"`, `"revokeTrustlineSponsorship"`, `"revokeOfferSponsorship"`, `"revokeDataSponsorship"`, `"revokeClaimableBalanceSponsorship"`, `"revokeLiquidityPoolSponsorship"`, and `"revokeSignerSponsorship"`. Before: ```ts import { Memo, MemoType, Transaction } from "@stellar/stellar-sdk" type TextTransaction = Transaction> const signerKeys: string[] = tx.extraSigners ?? [] switch (operation.type) { case "revokeSponsorship": handleRevokeSponsorship(operation) break } ``` After: ```ts import { SignerKey, Transaction } from "@stellar/stellar-sdk" type TextTransaction = Transaction const signerKeys = tx.extraSigners?.map(SignerKey.encodeSignerKey) ?? [] switch (operation.type) { case "revokeAccountSponsorship": case "revokeTrustlineSponsorship": case "revokeOfferSponsorship": case "revokeDataSponsorship": case "revokeClaimableBalanceSponsorship": case "revokeLiquidityPoolSponsorship": case "revokeSignerSponsorship": handleRevokeSponsorship(operation) break } ``` ### Assets, keys, and signing helpers [`Asset.code`](/js-stellar-sdk/reference/core-assets/#assetcode) and [`Asset.issuer`](/js-stellar-sdk/reference/core-assets/#assetissuer) are now `readonly`. Construct a new `Asset` instead of mutating either field. `Asset.issuer` is typed as `string | undefined`, because native assets do not have an issuer. [`Keypair.rawSecretKey()`](/js-stellar-sdk/reference/core-keys/#keypairrawsecretkey) now throws `Error("no secret seed available")` on public-key-only keypairs instead of returning `undefined`. Two exports were removed: - `FastSigning` was removed. Signing now goes through `@noble/ed25519`. - `TransactionI` was removed. Use `TransactionBase` instead. ### Utilities: `BigNumber.DEBUG` removed `bignumber.js` was bumped from v9 to v11, and the SDK now exports a strict `.clone()`d instance. The introspection flag moved. ```ts del={1} ins={2} if (BigNumber.DEBUG) { /* ... */ } if (BigNumber.config().STRICT) { /* ... */ } ``` Amount and price helpers (`fromXDRAmount`, `toXDRPrice`, `getAmountInLumens`) inherit upstream v10/v11 behavior. The v11 behavior that changed most for SDK callers is that a high-precision JavaScript `number` passed as an amount or price no longer throws for having more than 15 significant digits; it is rounded to floating-point precision. Pass such values as strings or `bigint` to avoid quiet precision loss. A `BigNumber` from your own `bignumber.js` install is a different class, so `instanceof` can fail across the boundary. ### TypeScript: corrected declarations may affect compile-time checks The TypeScript declarations now match runtime behavior more closely: - `CreateInvocation.token` was renamed to `CreateInvocation.asset`. - `ScIntType` adds `"timepoint"` and `"duration"`; update exhaustive switches. - `XdrLargeInt.getType()` returns `ScIntType | undefined` instead of a raw lowercased string. Non-integer types return `undefined`. - `SorobanDataBuilder.fromXDR` returns `xdr.SorobanTransactionData`. - `SetOptions.clearFlags` and `SetOptions.setFlags` accept arbitrary numeric bitmasks through `AuthFlags`, so combined flags no longer need a cast. - The ignored `supportMuxing` parameter was removed from the `decodeAddressToMuxedAccount` and `encodeMuxedAccountToAddress` declarations. ### Behavior: stricter ed25519 verification The ed25519 backend swapped to `@noble/ed25519` v3. [`Keypair`](/js-stellar-sdk/reference/core-keys/#keypair)'s `random`, `sign`, `verify`, and `generate` keep the same API and `Buffer` return types, but v3 verification is stricter about non-canonical and malleable signatures. Edge-case signatures that previously verified may now be rejected. ### Behavior: stellar.toml parser swapped to `smol-toml` SEP-1 resolution now uses a stricter TOML 1.0 parser. The parsed shape is generally the same, but it accepts and rejects different inputs and throws different error messages, which propagate into the rejected promise / `StellarTomlResolveError`. ### Behavior: stricter validation and parsing Several APIs now reject invalid input that older versions accepted or partially parsed: - `toXDRPrice` rejects zero, negative, `NaN`, and `Infinity` numeric prices before reaching `best_r()`. Zero denominators are rejected too. - Constructors and operation builders validate more strictly: `MuxedAccount` validates uint64 IDs, `Claimant` rejects falsy destinations, `Account` rejects `NaN` sequences, `Memo` is immutable and throws on invalid types, `Memo.id()` rejects non-plain-digit strings, `allow_trust` requires `authorize`, `setTrustLineFlags` requires boolean flag values, and `Asset.getAssetType()` throws for unknown types instead of returning `"unknown"`. - `TransactionBuilder.build()` throws on total-fee overflow past `uint32` max, `cloneFrom()` throws on zero-operation inputs, and the constructor rejects negative or inverted `timebounds` and `ledgerbounds`. - `Operation.setOptions()` rejects malformed numeric strings such as `"123abc"` for flag, weight, and threshold fields instead of parsing only the leading digits. - `nativeToScVal` bounds-checks `u32` and `i32` values and rejects malformed numeric strings. `XdrLargeInt.toI128()` and `toI256()` reject unsigned values outside the signed range instead of silently flipping the sign bit. - `XdrLargeInt` and `ScInt` built from an array of limbs now decode correctly. Code that relied on the old nested-array bug will see different values. ### Behavior: recent RPC and simulation response fixes The following fixes landed shortly before v16. They are listed here because they are observable when upgrading from older 15.x releases to v16. Several fixes change observable behavior: - [`rpc.Server.getLatestLedger()`](/js-stellar-sdk/reference/network-rpc/#servergetlatestledger) now includes `closeTime`, `headerXdr`, and `metadataXdr`, with the XDR fields parsed into objects rather than base64. - A `parseSuccessful` precedence bug that silently dropped simulation results and state changes is fixed, so they now appear in the parsed response. - `pollTransaction` now runs the configured number of attempts (it previously ran one fewer). - `maxRedirects` and `maxContentLength` are now enforced on the default client (they were no-ops before), tightening the SSRF and DoS guards used by `StellarToml.Resolver.resolve` and `FederationServer`. ### Dependencies: removed transitive packages If your code reached through the SDK for any of these, declare them yourself now: `@stellar/stellar-base`, `urijs`, `@noble/curves`, `sha.js`, `randombytes`, `toml`. ### Auth: Protocol 27 readiness Protocol 27 ([CAP-71](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0071.md)) adds two address-bound Soroban credential types, `AddressV2` and `AddressWithDelegates`. This only affects code that signs Soroban authorization entries or inspects their credential arms. Depending on the network and RPC simulation behavior, authorization entries may contain either the legacy `ADDRESS` credential or the newer `ADDRESS_V2` credential. Both are valid for SDK signing flows that use the helpers below. SDK-driven signing ([`contract.Client`](/js-stellar-sdk/reference/contracts-client/#contractclient), [`basicNodeSigner`](/js-stellar-sdk/reference/contracts-client/#contractbasicnodesigner), [`authorizeEntry`](/js-stellar-sdk/reference/core-soroban-primitives/#authorizeentry), [`signAuthEntries`](/js-stellar-sdk/reference/contracts-client/#contractassembledtransaction)) is forward-compatible with no code change: it signs whichever credential simulation returns. The entries below break only code that reads the credential arm or builds the signature payload by hand. For the full walkthrough of signing Soroban authorization entries, see [Authorize a Contract Call](/js-stellar-sdk/guides/07-contract-auth/). ### Auth: `authorizeInvocation` now returns `AddressV2` [`authorizeInvocation`](/js-stellar-sdk/reference/core-soroban-primitives/#authorizeinvocation) now takes a single params object and builds `SOROBAN_CREDENTIALS_ADDRESS_V2` entries instead of legacy `ADDRESS`. Read the result with `.addressV2()`. ```ts del={1-4} ins={5-8} const entry = await authorizeInvocation( signer, validUntilLedgerSeq, invocation, publicKey, networkPassphrase, ) const addr = entry.credentials().address() const entry = await authorizeInvocation({ signer, validUntilLedgerSeq, invocation, networkPassphrase, publicKey, }) const addr = entry.credentials().addressV2() ``` ### Auth: build the signing payload with `buildAuthorizationEntryPreimage` Code that reconstructs the authorization payload by hand hardcodes the legacy `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION`. That is wrong for `AddressV2`, which signs the address-bound `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS`. Use the new [`buildAuthorizationEntryPreimage`](/js-stellar-sdk/reference/core-soroban-primitives/#buildauthorizationentrypreimage), which picks the right payload from the entry's own credential type, so the same code is correct on `ADDRESS` today and `AddressV2` when simulation returns the newer credential. ```ts del={1-8} ins={9} const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorization( new xdr.HashIdPreimageSorobanAuthorization({ networkId: hash(Buffer.from(networkPassphrase)), nonce: credentials.nonce(), invocation: entry.rootInvocation(), signatureExpirationLedger: validUntil, }), ) const preimage = buildAuthorizationEntryPreimage(entry, validUntil, networkPassphrase) const signature = keypair.sign(hash(preimage.toXDR())) ``` Simpler still, hand the whole entry to `authorizeEntry`, which builds, signs, verifies, and writes the signature back: ```ts const signed = await authorizeEntry(entry, keypair, validUntil, networkPassphrase) ``` ### Auth: `authorizeEntry` is stricter and gains a `forAddress` parameter `authorizeEntry` now handles `ADDRESS`, `ADDRESS_V2`, and `ADDRESS_WITH_DELEGATES`, short-circuits only for an explicit source-account credential, and throws `unsupported credential type` for other non-address credentials. It no longer defaults `networkPassphrase` to `Networks.FUTURENET`, so pass the network passphrase explicitly at every call site. It also gained an optional 5th parameter, `forAddress`, that routes the signature to a specific node (the top-level account or a nested delegate) for delegated auth. Existing four-argument calls are unaffected if they already pass `networkPassphrase`. ```ts ins={2} authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphrase) // unchanged authorizeEntry(entry, signer, validUntilLedgerSeq, networkPassphrase, forAddress) ``` For delegated authorization (`ADDRESS_WITH_DELEGATES`, CAP-71-01), build the wrapper with [`buildWithDelegatesEntry`](/js-stellar-sdk/reference/core-soroban-primitives/#buildwithdelegatesentry) (it sorts each delegate array by address and rejects duplicates, as the protocol requires), then route each signer's signature with `forAddress`. Every signer signs the same payload, bound to the top-level address. ### Auth: closed export surface The auth module's wildcard re-export was replaced with an explicit allow-list. The package root now exports exactly `authorizeEntry`, `authorizeInvocation`, `buildAuthorizationEntryPreimage`, `buildWithDelegatesEntry`, and the types `SigningCallback`, `AuthorizeInvocationParams`, `DelegateSignature`, `BuildWithDelegatesParams`. Anything else imported from the auth module (notably `getAddressCredentials`, now internal) no longer resolves. ### Earlier 15.x deprecation: `BalanceResponse.revocable` On [`BalanceResponse`](/js-stellar-sdk/reference/network-rpc/#rpcapibalanceresponse), use `authorizedToMaintainLiabilities`, which reflects the correct trustline flag semantics. ```ts del={1} ins={2} const flag = balance.revocable const flag = balance.authorizedToMaintainLiabilities ``` ### Deprecated: bare `Buffer` return from `SigningCallback` A custom [`SigningCallback`](/js-stellar-sdk/reference/core-soroban-primitives/#signingcallback) passed to `authorizeEntry` should return `{ signature, publicKey }`. The bare `Buffer` return is deprecated. ```ts del={1} ins={2-5} const signAuthEntry = async (preimage) => keypair.sign(hash(preimage.toXDR())) const signAuthEntry = async (preimage) => ({ signature: keypair.sign(hash(preimage.toXDR())), publicKey: keypair.publicKey(), }) ``` # Source: docs/guides/00-protocol-27-soroban-auth.md # Protocol 27: Soroban authorization migration Protocol 27 ([CAP-71](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0071.md)) reworks how Soroban authorization entries are signed. If you let the SDK build and sign your entries end to end — `authorizeInvocation()`, or `AssembledTransaction.signAuthEntries()` / `contract.Client` — the upgrade is mostly transparent and you can skim this guide. This guide is for the other case: **you hand-craft `SorobanAuthorizationEntry` values and/or compute the signature payload yourself.** Those code paths need changes, because the bytes you sign are different now. ## What changed, in one paragraph Before P27, an address credential's signature committed to the network, nonce, invocation, and expiration — but **not** to the address being authorized. P27 adds a new signature payload that **binds the address into the signed bytes**, and two new credential types that use it: `SOROBAN_CREDENTIALS_ADDRESS_V2` (same shape as the old `ADDRESS`, address-bound payload) and `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` (an account plus a tree of delegate signers, all signing that same shared, address-bound payload). The old `SOROBAN_CREDENTIALS_ADDRESS` type and its non-address-bound payload still exist for backwards compatibility, but new entries should use `ADDRESS_V2`. ## The four credential types | Type | Value | Signature payload | Notes | |------|-------|-------------------|-------| | `SOROBAN_CREDENTIALS_SOURCE_ACCOUNT` | 0 | — (covered by tx envelope) | unchanged | | `SOROBAN_CREDENTIALS_ADDRESS` | 1 | `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION` (legacy, **not** address-bound) | still valid; pre-P27 behavior | | `SOROBAN_CREDENTIALS_ADDRESS_V2` | 2 | `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS` (**address-bound**) | new default for `authorizeInvocation()` | | `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` | 3 | `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS` (bound to the **top-level** address) | account + delegate tree | `ADDRESS_V2` carries exactly the same fields as `ADDRESS` (`SorobanAddressCredentials`: address, nonce, `signatureExpirationLedger`, signature). The only thing that changes is which preimage you hash and sign. ## The core change: the signature payload is address-bound This is the part that breaks hand-rolled signers. The payload for `ADDRESS_V2` (and `ADDRESS_WITH_DELEGATES`) is a different `HashIdPreimage` variant with an extra `address` field, so it hashes to different bytes than the legacy payload. **Before (legacy `ADDRESS`):** ```js import { hash, xdr } from '@stellar/stellar-sdk'; // entry - the unsigned SorobanAuthorizationEntry to authorize, e.g. // one returned by `simulateTransaction` or built by hand // keypair - the Keypair that authorizes the invocation // validUntil - ledger sequence the signature is valid until (exclusive) // networkPassphrase - e.g. Networks.PUBLIC / Networks.TESTNET function signAuthEntry(entry, keypair, validUntil, networkPassphrase) { // pre-P27 entries carry their address credentials on the ADDRESS arm const addressCreds = entry.credentials().address(); // commit the expiration onto the credentials *before* building the payload, // so the signed hash and the submitted credentials agree on it addressCreds.signatureExpirationLedger(validUntil); // legacy payload: commits to network, nonce, invocation, expiration — // but NOT the address being authorized const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorization( new xdr.HashIdPreimageSorobanAuthorization({ networkId: hash(Buffer.from(networkPassphrase)), nonce: addressCreds.nonce(), invocation: entry.rootInvocation(), signatureExpirationLedger: validUntil, }), ); const signature = keypair.sign(hash(preimage.toXDR())); // write the signature back onto the credentials (see `encodeSignature` below) addressCreds.signature(encodeSignature(keypair.publicKey(), signature)); return entry; } ``` **After (address-bound, for `ADDRESS_V2` / `ADDRESS_WITH_DELEGATES`):** ```js import { hash, xdr } from '@stellar/stellar-sdk'; function signAuthEntry(entry, keypair, validUntil, networkPassphrase) { // P27 entries carry the same SorobanAddressCredentials struct, but on the // ADDRESS_V2 arm — read it with `.addressV2()`, not `.address()` const addressCreds = entry.credentials().addressV2(); addressCreds.signatureExpirationLedger(validUntil); // address-bound payload: the WithAddress variant adds an `address` field, // so it hashes to different bytes than the legacy payload above const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorizationWithAddress( new xdr.HashIdPreimageSorobanAuthorizationWithAddress({ networkId: hash(Buffer.from(networkPassphrase)), nonce: addressCreds.nonce(), invocation: entry.rootInvocation(), address: addressCreds.address(), // ← NEW: address committed into the payload signatureExpirationLedger: validUntil, }), ); const signature = keypair.sign(hash(preimage.toXDR())); addressCreds.signature(encodeSignature(keypair.publicKey(), signature)); return entry; } ``` If you sign the *legacy* payload for an `ADDRESS_V2` entry, the network reconstructs the *address-bound* payload from the credentials, the hashes don't match, and the entry is rejected. ### Recommended: stop hand-rolling this entirely If you have a local `Keypair` (or anything with a `.sign(Buffer)` method), all of the above — choosing the arm, setting the expiration, building the right payload, signing, verifying, and writing the signature back — is exactly what `authorizeEntry()` already does. It handles all three credential types, so the same call keeps working as you move entries from `ADDRESS` to `ADDRESS_V2`: ```js import { authorizeEntry } from '@stellar/stellar-sdk'; const signed = await authorizeEntry( entry, // any address-based SorobanAuthorizationEntry keypair, // Keypair, or a SigningCallback (see below) validUntil, // expiration ledger sequence networkPassphrase, ); ``` If your signer lives elsewhere — a hardware wallet, a browser extension, a remote signing service — you only need the bytes to sign. Use `buildAuthorizationEntryPreimage()`, which picks the correct preimage variant for the entry's credential type (legacy for `ADDRESS`, address-bound for `ADDRESS_V2` and `ADDRESS_WITH_DELEGATES`): ```js import { buildAuthorizationEntryPreimage, hash } from '@stellar/stellar-sdk'; const preimage = buildAuthorizationEntryPreimage( entry, validUntil, networkPassphrase, ); const payload = hash(preimage.toXDR()); // hand these bytes to your external signer ``` You can also hand the whole thing to `authorizeEntry()` via a `SigningCallback`, which receives the `HashIdPreimage` directly so you can inspect what you're signing rather than signing a bare hash. ## The signature value itself is unchanged Only the *payload* changed; the structure you write into the credential's `signature` field is exactly as before — an `scvVec` of a map keyed by the `public_key` and `signature` symbols. This is the `encodeSignature` helper the two examples above call: ```js import { nativeToScVal, StrKey, xdr } from '@stellar/stellar-sdk'; // publicKey - the signer's G... address (string) // signature - the raw signature over `hash(preimage.toXDR())` (Buffer) function encodeSignature(publicKey, signature) { const sigScVal = nativeToScVal( { public_key: StrKey.decodeEd25519PublicKey(publicKey), signature, }, { type: { public_key: ['symbol', null], signature: ['symbol', null], }, }, ); return xdr.ScVal.scvVec([sigScVal]); } ``` ## Reading credentials off an entry The accessor depends on the arm. If you used to read `credentials().address()` unconditionally, that throws on a `V2` entry. Switch on the credential type: ```js import { xdr } from '@stellar/stellar-sdk'; function addressCredentials(credentials) { switch (credentials.switch().value) { case xdr.SorobanCredentialsType.sorobanCredentialsAddress().value: return credentials.address(); case xdr.SorobanCredentialsType.sorobanCredentialsAddressV2().value: return credentials.addressV2(); case xdr.SorobanCredentialsType .sorobanCredentialsAddressWithDelegates().value: return credentials.addressWithDelegates().addressCredentials(); default: return null; // source-account credentials carry no address payload } } ``` `SorobanAddressCredentials` is the same struct in all three arms, so once you've unwrapped it the `.address()`, `.nonce()`, `.signatureExpirationLedger()`, and `.signature()` accessors work identically. ## `authorizeInvocation()` now produces `ADDRESS_V2` `authorizeInvocation()` builds `SOROBAN_CREDENTIALS_ADDRESS_V2` instead of the legacy `SOROBAN_CREDENTIALS_ADDRESS`. The signing is transparent — you still pass a `Keypair` or a `SigningCallback` — but two things follow: - **Read the result with `.addressV2()`**, not `.address()`: ```js const entry = await authorizeInvocation({ signer, validUntilLedgerSeq, invocation, networkPassphrase, publicKey, // required when `signer` is a callback }); const addr = entry.credentials().addressV2(); // ← was .address() ``` - **The entries are only valid on protocol 27+.** If you assert on the credential type, or target a pre-P27 network, account for the new type. If you specifically need a legacy `ADDRESS` entry, build it by hand with `xdr.SorobanCredentials.sorobanCredentialsAddress(...)` and sign the legacy payload (or just call `buildAuthorizationEntryPreimage()`, which detects the `ADDRESS` arm and returns the legacy preimage). `authorizeEntry()` already handles all three credential types and selects the correct payload internally, so existing `authorizeEntry()` call sites keep working unchanged. ## New: delegated signing (`ADDRESS_WITH_DELEGATES`) [CAP-71](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0071.md) also adds delegated authorization: an account can authorize an invocation through a tree of delegate signers rather than (or in addition to) its own signature. Like multisig, which accounts use delegation is client-side policy — simulation never emits this variant on its own, so you assemble it. Two pieces make this work: 1. **`buildWithDelegatesEntry()`** wraps an `ADDRESS`/`ADDRESS_V2` entry into an `ADDRESS_WITH_DELEGATES` entry, attaching the delegate tree. It sorts each delegate array ascending by address and rejects duplicates, as the protocol requires — do not hand-sort. 2. **`authorizeEntry(..., forAddress)`** signs the shared payload and writes the signature into the node whose address matches `forAddress` (the top-level account or any nested delegate), instead of always the top level. ```js import { buildWithDelegatesEntry, authorizeEntry } from '@stellar/stellar-sdk'; // Start from an ADDRESS_V2 entry (e.g. one returned by simulation) and attach // the delegate set. The top-level signature defaults to scvVoid, which is valid // for an account that authorizes purely through its delegates. let entry = buildWithDelegatesEntry({ entry: simEntry, // ADDRESS or ADDRESS_V2 validUntilLedgerSeq, delegates: [ { address: delegateA.publicKey() }, { address: delegateB.publicKey(), nestedDelegates: [{ address: delegateC.publicKey() }], }, ], }); // Every signer signs the SAME payload — bound to the *top-level* address, not // their own. `forAddress` just routes each signature into the right node. entry = await authorizeEntry( entry, delegateA, validUntilLedgerSeq, networkPassphrase, delegateA.publicKey(), ); entry = await authorizeEntry( entry, delegateB, validUntilLedgerSeq, networkPassphrase, delegateB.publicKey(), ); entry = await authorizeEntry( entry, delegateC, validUntilLedgerSeq, networkPassphrase, delegateC.publicKey(), ); ``` Each `authorizeEntry()` call clones the entry it's given, so chaining preserves the signatures already written. `forAddress` must match a node actually present in the entry, or the call throws. If you drive signing entirely yourself, build the shared payload once with `buildAuthorizationEntryPreimage(entry, ...)` (it's bound to the top-level address for every signer), hand the hash to each delegate, and write the resulting `scvVec` signature into each delegate node directly. Remember the ordering and de-duplication rules per delegate array if you construct the XDR by hand. ## Quick checklist - [ ] Replace any hand-built `envelopeTypeSorobanAuthorization` preimage with `buildAuthorizationEntryPreimage()` (or switch to `envelopeTypeSorobanAuthorizationWithAddress` and include `address`) for `ADDRESS_V2` entries. - [ ] Update reads of `credentials().address()` to handle the `addressV2()` and `addressWithDelegates()` arms. - [ ] Update `authorizeInvocation()` result reads from `.address()` to `.addressV2()`, and confirm you're targeting a protocol 27+ network. - [ ] For delegated auth, use `buildWithDelegatesEntry()` + `authorizeEntry(..., forAddress)` rather than building the wrapper XDR by hand. # Source: docs/guides/01-connect-and-fund.md # Connect and Fund an Account This guide takes you from nothing to a funded testnet account you can build on. It is for anyone making their first call with `@stellar/stellar-sdk`. Everything here runs against testnet, so it costs nothing and is safe to repeat. ## Create a keypair A [keypair](/js-stellar-sdk/reference/core-keys/#keypair) is an account's identity. The public key is the account's address (it starts with `G`) and the secret key signs transactions (it starts with `S`). Never share or commit a secret key. ```ts import { Keypair } from "@stellar/stellar-sdk"; const keypair = Keypair.random(); keypair.publicKey(); // "G..." (share this) keypair.secret(); // "S..." (keep this private) ``` A keypair holds no funds and does not exist on the network until an account is funded for that public key (see [Fund a new account](/js-stellar-sdk/guides/01-connect-and-fund/#fund-a-new-account)). Store the secret, not the keypair object. Rebuild the keypair when you need it: ```ts const keypair = Keypair.fromSecret(secret); ``` ## Choose a network Every transaction is signed for exactly one [network](https://developers.stellar.org/docs/networks), identified by its passphrase. Use the passphrase that matches where you are submitting so a signature from one network cannot be replayed on another. ```ts import { Networks } from "@stellar/stellar-sdk"; Networks.TESTNET; // "Test SDF Network ; September 2015" Networks.PUBLIC; // "Public Global Stellar Network ; September 2015" ``` Start on `TESTNET`. Switch to `PUBLIC` only when you are ready to use real funds. ## Connect to Horizon and RPC The SDK talks to two services, and which one you need depends on the task. - **[Horizon](https://developers.stellar.org/docs/data/apis/horizon)** serves account, balance, payment, and history data and accepts classic transactions (payments, trustlines, and other non-contract operations). Use it for accounts, balances, and payments. - **[RPC](https://developers.stellar.org/docs/data/apis/rpc)** is the gateway for smart contracts (Soroban): simulate and send contract calls. Use it when you invoke contracts. ```ts import { Horizon, rpc } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); const rpcServer = new rpc.Server("https://soroban-testnet.stellar.org"); ``` This guide only needs Horizon. The RPC connection is shown so you know where contract work begins. For the full client API, see [`Horizon.Server`](/js-stellar-sdk/reference/network-horizon/#horizonserver) and [`rpc.Server`](/js-stellar-sdk/reference/network-rpc/#rpcserver) in the reference. ## Fund a new account On testnet, friendbot creates and funds a new account for free, seeding it with 10,000 XLM. There is no friendbot on the public network, where accounts are funded by an existing account. ```ts await horizon.friendbot(keypair.publicKey()).call(); ``` This call throws if the account already exists or friendbot is rate-limited. Funding a brand-new `Keypair.random()` avoids the "already exists" case, so wrap it in a `try/catch` to handle the rest. Once funded, the account exists on the ledger. Load it to read its balances. `loadAccount` throws `NotFoundError` if the account is not on the ledger yet, which is how the SDK signals that funding has not gone through: ```ts const account = await horizon.loadAccount(keypair.publicKey()); const xlm = account.balances.find((b) => b.asset_type === "native"); account.accountId(); // the funded public key xlm?.balance; // its XLM balance, as a string ``` ## Put it together The snippets above build on each other. Here is the whole flow as one runnable script. The blocks share the same `keypair` and `horizon`, and `console.log` prints the results so you can see them when you run the file: ```ts import { Keypair, Horizon } from "@stellar/stellar-sdk"; async function main() { const keypair = Keypair.random(); const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); console.log("Public key:", keypair.publicKey()); // On testnet, friendbot creates and funds the account for free. try { await horizon.friendbot(keypair.publicKey()).call(); } catch (e) { // Thrown if the account already exists or friendbot is rate-limited. console.error("Funding failed:", e); return; } // Throws NotFoundError if the account is not on the ledger yet. const account = await horizon.loadAccount(keypair.publicKey()); const xlm = account.balances.find((b) => b.asset_type === "native"); console.log("XLM balance:", xlm?.balance); } main().catch(console.error); ``` You now have a funded account and a connection to the network. From here you can send your first payment. # Source: docs/guides/02-send-a-payment.md # Send a Payment This guide sends a payment from one account to another: build a transaction, sign it, and submit it to the network. It is the core write flow every app needs. ## Prerequisites - A funded source account and its keypair. If you do not have one, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - The examples run on testnet, so they are free and safe to repeat. ## Build the transaction A payment is one operation inside a transaction. Load the source account for its current sequence number (the per-account counter Stellar uses to order transactions), then build a transaction with a single [`Operation.payment`](/js-stellar-sdk/reference/core-transactions/#operationpayment). Here `source` is your funded keypair from [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/), and `destinationId` is the recipient's public key (a `G...` string): ```ts import { Horizon, TransactionBuilder, Operation, Asset, Networks, BASE_FEE, } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); const account = await horizon.loadAccount(source.publicKey()); const tx = new TransactionBuilder(account, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }) .addOperation( Operation.payment({ destination: destinationId, asset: Asset.native(), amount: "100", }), ) .setTimeout(30) .build(); ``` `fee` is the *maximum* per-operation fee you're willing to pay, in stroops (`BASE_FEE` is 100; one XLM is ten million stroops). It's a cap, not a fixed charge — the network only deducts what it actually needs at submission time, so a high `fee` (say, 5 XLM) makes the transaction more likely to be included when the network is busy without meaning all 5 XLM gets spent. `amount` is a string in whole units (`"100"` is 100 XLM). The destination must already exist on the network; to create and fund a brand-new account, use `Operation.createAccount` instead. ## Sign and submit A built transaction is unsigned. Sign it with the source account's keypair, then submit it to Horizon: ```ts tx.sign(source); const result = await horizon.submitTransaction(tx); result.hash; // the transaction hash result.successful; // true when it was applied ``` If submission fails, Horizon returns the error in the rejected promise, so wrap the call in `try/catch` to inspect the failure. See [Handle Errors](/js-stellar-sdk/guides/05-handle-errors/) for reading result codes and Horizon's error responses. ## Add a memo Many services (exchanges, custodians) require a memo to route a payment. Add a [`Memo`](/js-stellar-sdk/reference/core-transactions/#memo) to the builder chain before `.build()`: ```ts import { Memo } from "@stellar/stellar-sdk"; // ...the same builder as above, with one more line in the chain: .addMemo(Memo.text("invoice-42")) ``` ## Send an issued asset To send an issued asset instead of XLM, pass an [`Asset`](/js-stellar-sdk/reference/core-assets/#asset) built from its code and the issuer account's public key (`issuerId`). Everything else is the same: ```ts const usd = new Asset("USD", issuerId); Operation.payment({ destination: destinationId, asset: usd, amount: "100" }); ``` The destination must already trust this asset, otherwise the payment fails. Setting up an issuer and trustlines is covered in [Issue an Asset](/js-stellar-sdk/guides/03-issue-an-asset/). ## Put it together The whole native-payment flow as one runnable script. It funds a throwaway `source` and `destination` with friendbot so the example runs end to end; in your app, `source` is your existing funded account and `destination` is any account that already exists: ```ts import { Keypair, Horizon, TransactionBuilder, Operation, Asset, Memo, Networks, BASE_FEE, } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); async function main() { const source = Keypair.random(); const destination = Keypair.random(); await Promise.all([ horizon.friendbot(source.publicKey()).call(), horizon.friendbot(destination.publicKey()).call(), ]); const account = await horizon.loadAccount(source.publicKey()); const tx = new TransactionBuilder(account, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }) .addOperation( Operation.payment({ destination: destination.publicKey(), asset: Asset.native(), amount: "100", }), ) .addMemo(Memo.text("thanks!")) .setTimeout(30) .build(); tx.sign(source); const result = await horizon.submitTransaction(tx); console.log("Submitted:", result.hash, "successful:", result.successful); } main().catch(console.error); ``` You can now move value on the network. Next, learn to issue your own asset and set up trustlines. # Source: docs/guides/03-issue-an-asset.md # Issue an Asset On Stellar a Stellar asset is just a code (like `ASTRO`) plus the public key of the account that issues it. There is no contract to deploy: you "create" it by sending it from its issuing account. This is one of two token types on Stellar: the ledger-native **Stellar asset** covered here, versus **contract tokens** built on Soroban smart contracts. See [Stellar Assets and Contract Tokens](https://developers.stellar.org/docs/tokens) for when to use which. This guide sets up the issuer/distributor pattern, establishes a trustline, and issues the asset. ## Prerequisites - Two funded accounts: an **issuer** and a **distributor**. If you need them, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - Everything runs on testnet, so it is free and safe to repeat. ## The issuer/distributor pattern Use two accounts. The **issuer** defines the asset and creates supply; the **distributor** holds the supply and hands it out to users. Keeping them separate is the standard practice: once issued, you can lock the issuer (remove its signing weight with [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions)) to fix the supply permanently, while the distributor keeps operating. ```ts import { Asset } from "@stellar/stellar-sdk"; // The asset is its code plus the issuer's public key. const astro = new Asset("ASTRO", issuer.publicKey()); ``` The code is 1 to 12 characters and the issuer is the account whose keypair you control. See [`Asset`](/js-stellar-sdk/reference/core-assets/#asset) in the reference. ## Trust the asset An account can only hold an asset it has chosen to trust. The distributor adds a **trustline** with [`Operation.changeTrust`](/js-stellar-sdk/reference/core-transactions/#operationchangetrust), signed by the distributor: ```ts import { Horizon, TransactionBuilder, Operation, Networks, BASE_FEE, } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); const account = await horizon.loadAccount(distributor.publicKey()); const tx = new TransactionBuilder(account, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }) .addOperation(Operation.changeTrust({ asset: astro })) .setTimeout(30) .build(); tx.sign(distributor); await horizon.submitTransaction(tx); ``` Pass `limit` to cap how much the account will hold (`changeTrust({ asset: astro, limit: "5000" })`); amounts and limits are strings, and omitting `limit` defaults to the maximum. Setting `limit: "0"` removes the trustline. Each trustline also reserves about 0.5 XLM of the account's balance, so the distributor needs a little XLM beyond the reserve (friendbot-funded testnet accounts have plenty). ## Issue it With the trustline in place, the issuer puts the asset into circulation by sending it to the distributor. That is an ordinary payment (see [Send a Payment](/js-stellar-sdk/guides/02-send-a-payment/)), signed by the issuer: ```ts const issuerAccount = await horizon.loadAccount(issuer.publicKey()); const issueTx = new TransactionBuilder(issuerAccount, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }) .addOperation( Operation.payment({ destination: distributor.publicKey(), asset: astro, amount: "1000", }), ) .setTimeout(30) .build(); issueTx.sign(issuer); await horizon.submitTransaction(issueTx); ``` The distributor now holds 1000 ASTRO, and 1000 ASTRO exists on the network. If a submission is rejected (for example the distributor never added the trustline), [Handle Errors](/js-stellar-sdk/guides/05-handle-errors/) shows how to read the result codes. ## Put it together The whole flow as one runnable script. It funds a throwaway issuer and distributor so the example runs end to end; in your app, replace the `Keypair.random()` calls with your real keypairs and drop the friendbot funding: ```ts import { Keypair, Horizon, TransactionBuilder, Operation, Asset, Networks, BASE_FEE, } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); async function submit(source: Keypair, build: (b: TransactionBuilder) => void) { const account = await horizon.loadAccount(source.publicKey()); const builder = new TransactionBuilder(account, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }); build(builder); const tx = builder.setTimeout(30).build(); tx.sign(source); return horizon.submitTransaction(tx); } async function main() { const issuer = Keypair.random(); const distributor = Keypair.random(); await Promise.all([ horizon.friendbot(issuer.publicKey()).call(), horizon.friendbot(distributor.publicKey()).call(), ]); const astro = new Asset("ASTRO", issuer.publicKey()); // Distributor trusts the asset, then the issuer sends it. await submit(distributor, (b) => b.addOperation(Operation.changeTrust({ asset: astro })), ); await submit(issuer, (b) => b.addOperation( Operation.payment({ destination: distributor.publicKey(), asset: astro, amount: "1000", }), ), ); const account = await horizon.loadAccount(distributor.publicKey()); const line = account.balances.find( (b) => "asset_code" in b && b.asset_code === "ASTRO", ); console.log("ASTRO balance:", line?.balance); } main().catch(console.error); ``` You now have your own asset in circulation. From here you can distribute it to users, who each add their own trustline first. # Source: docs/guides/04-query-and-stream.md # Query and Stream This guide reads data from [Horizon](https://developers.stellar.org/docs/data/apis/horizon): query an account's payment history, page through large result sets, and stream new records as they happen. It is all read-only, so no keypairs or signing are involved. ## Prerequisites - An account ID (a `G...` public key) with some history to look at. Any existing account works; to make one, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - The examples use testnet. ## Run a query Horizon data is reached through **call builders**. You start one from the server (for example [`server.payments()`](/js-stellar-sdk/reference/network-horizon/#serverpayments)), narrow it with filters, then call `.call()` to run the request. The result is a page of records: ```ts import { Horizon } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); const page = await horizon.payments().forAccount(accountId).call(); for (const payment of page.records) { console.log(payment.type, payment.id); } ``` The same pattern works for other endpoints on [`Horizon.Server`](/js-stellar-sdk/reference/network-horizon/#horizonserver): `horizon.operations()`, `horizon.effects()`, `horizon.transactions()`, `horizon.trades()`, and more. Most expose `.forAccount(id)` and similar filters. ## Page through results Horizon returns results in pages. Control them with `.limit()` (page size, up to 200), `.order()` (`"asc"` or `"desc"`), and `.cursor()` (start after a given paging token). Each page carries `.next()` and `.prev()` to fetch the adjacent page using the embedded cursor: ```ts let page = await horizon .payments() .forAccount(accountId) .order("desc") .limit(20) .call(); while (page.records.length > 0) { for (const payment of page.records) { console.log(payment.id); } // next() returns an empty page once history is exhausted, ending the loop. page = await page.next(); } ``` Each record's `paging_token` is the cursor you would pass to `.cursor()` to resume later. ## Stream live updates Instead of polling, open a [stream](https://developers.stellar.org/docs/data/apis/horizon/api-reference/structure/streaming). `.stream()` keeps a long-lived **Server-Sent Events (SSE)** connection open (the server pushes records over it) and calls `onmessage` for each record. Existing records are replayed first; pass `cursor("now")` to receive only new ones. `.stream()` returns a function that closes the connection: ```ts const close = horizon .payments() .forAccount(accountId) .cursor("now") .stream({ onmessage: (payment) => console.log("new payment:", payment.type), onerror: (e) => console.error("stream error:", e), }); // Later, stop listening: close(); ``` ## Put it together A runnable script: fund a throwaway account (which gives it one payment record), list its payments, then stream new ones for a while. Because the stream uses `cursor("now")`, it prints only when a *new* payment arrives, so you may see no stream output. To watch `onmessage` fire, send a payment to the account from another terminal (see [Send a Payment](/js-stellar-sdk/guides/02-send-a-payment/)). Either way the script exits after 30 seconds. ```ts import { Keypair, Horizon } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); async function main() { const account = Keypair.random(); await horizon.friendbot(account.publicKey()).call(); const accountId = account.publicKey(); // Read recent payments. const page = await horizon .payments() .forAccount(accountId) .order("desc") .limit(10) .call(); for (const payment of page.records) { console.log(payment.type, payment.id); } // Watch for new payments; stop after 30 seconds. const close = horizon.payments().forAccount(accountId).cursor("now").stream({ onmessage: (payment) => console.log("new payment:", payment.type), onerror: (e) => console.error("stream error:", e), }); setTimeout(close, 30000); } main().catch(console.error); ``` You can now read history and react to it live. The same call builders back most of what an app needs to display from the network. Reads can still fail (a missing account, a malformed request); [Handle Errors](/js-stellar-sdk/guides/05-handle-errors/) covers catching those. # Source: docs/guides/05-handle-errors.md # Handle Errors Network calls fail: a transaction is rejected, an account does not exist, a request is malformed. This guide shows how to read those errors so you can react to them. It builds on [Send a Payment](/js-stellar-sdk/guides/02-send-a-payment/). ## Prerequisites - A funded account to submit from. If you need one, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - The examples run on testnet, so they are free and safe to repeat. ## Errors are rejected promises Every SDK call that hits the network returns a promise that rejects on failure, so wrap calls in `try/catch` (or use `.catch`): ```ts try { const result = await horizon.submitTransaction(tx); } catch (error) { // inspect the error (below) } ``` ## Read a transaction's result codes When a submission fails, Horizon explains why with **result codes**: one for the transaction and one per operation. A failed submission rejects with the underlying HTTP error, and the codes are under `response.data.extras`: ```ts try { await horizon.submitTransaction(tx); } catch (error: any) { const codes = error.response?.data?.extras?.result_codes; console.error("transaction:", codes?.transaction); // e.g. "tx_failed" console.error("operations:", codes?.operations); // e.g. ["op_underfunded"] } ``` Common codes you will see (full list in [Result Codes](https://developers.stellar.org/docs/data/apis/horizon/api-reference/errors/result-codes)): - **Transaction-level:** `tx_failed` (an operation failed), `tx_bad_seq` (wrong sequence number, often a stale loaded account), `tx_insufficient_fee`, `tx_too_late` (the time bound passed). - **Operation-level:** `op_underfunded` (not enough balance), `op_no_destination` (the destination account does not exist), `op_no_trust` (the destination has no trustline for the asset), `op_low_reserve` (would drop below the minimum balance). ## Inspect the full error For debugging, log the whole error body. Horizon returns a [problem-details](https://developers.stellar.org/docs/data/apis/horizon/api-reference/errors) object at `response.data` with `type`, `title`, `status`, `detail`, and `extras`: ```ts try { await horizon.submitTransaction(tx); } catch (error: any) { console.error(error.response?.data ?? error); } ``` ## Catch a missing account Reads throw typed SDK errors. Loading an account that does not exist rejects with [`NotFoundError`](/js-stellar-sdk/reference/errors/#notfounderror), so you can branch on it: ```ts import { NotFoundError } from "@stellar/stellar-sdk"; try { const account = await horizon.loadAccount(accountId); } catch (error) { if (error instanceof NotFoundError) { console.error("That account does not exist yet (fund it first)."); } else { throw error; } } ``` `NotFoundError` is one of the SDK's network errors; `BadRequestError` (malformed request) and `BadResponseError` are others, all extending `NetworkError`. ## Put it together A runnable script that triggers both failures and handles them: ```ts import { Keypair, Horizon, TransactionBuilder, Operation, Asset, Networks, BASE_FEE, NotFoundError, } from "@stellar/stellar-sdk"; const horizon = new Horizon.Server("https://horizon-testnet.stellar.org"); async function main() { const sender = Keypair.random(); await horizon.friendbot(sender.publicKey()).call(); const account = await horizon.loadAccount(sender.publicKey()); // Pay an account that does not exist -> the transaction fails. const tx = new TransactionBuilder(account, { fee: BASE_FEE, networkPassphrase: Networks.TESTNET, }) .addOperation( Operation.payment({ destination: Keypair.random().publicKey(), asset: Asset.native(), amount: "1", }), ) .setTimeout(30) .build(); tx.sign(sender); try { await horizon.submitTransaction(tx); } catch (error: any) { const codes = error.response?.data?.extras?.result_codes; console.error("failed:", codes?.transaction, codes?.operations); } // Loading a non-existent account throws NotFoundError. try { await horizon.loadAccount(Keypair.random().publicKey()); } catch (error) { if (error instanceof NotFoundError) { console.error("account not found"); } } } main().catch(console.error); ``` With result codes and typed errors, you can tell the difference between a bad request, a missing resource, and a transaction the network rejected, and respond to each. # Source: docs/guides/06-invoke-a-contract.md # Invoke a Contract This guide calls a method on a deployed Soroban contract from JavaScript. You will connect over RPC, **preview** a call for free with simulation, then **sign and send** it to change on-chain state. Everything runs on testnet, so it is free and safe to repeat. ## Prerequisites - A funded testnet account and its keypair. If you need one, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - A deployed contract and its contract ID (a `C...` string). This guide uses the **increment** contract. Deploying is a one-time setup with a different toolchain (the Stellar CLI and Rust): follow Stellar's [Deploy the Increment Contract](https://developers.stellar.org/docs/build/smart-contracts/getting-started/deploy-increment-contract) tutorial once (about 20 to 30 minutes), then paste the contract ID it prints into `contractId` below. You will not touch the CLI again in this guide. Generating a typed client from a contract is covered later in the series. - The examples use testnet RPC at `https://soroban-testnet.stellar.org`. ## Connect and load the contract Contracts are reached over [Soroban RPC](https://developers.stellar.org/docs/data/apis/rpc), not Horizon, so this guide connects over RPC instead of using the `Horizon.Server` from earlier guides. Build a [`contract.Client`](/js-stellar-sdk/reference/contracts-client/#contractclient) from your deployed contract ID. The client reads the contract's interface from the network, which is what lets you call its methods by name: ```ts import { contract, Keypair, Networks } from "@stellar/stellar-sdk"; const rpcUrl = "https://soroban-testnet.stellar.org"; const networkPassphrase = Networks.TESTNET; const { signTransaction } = contract.basicNodeSigner(keypair, networkPassphrase); const client = await contract.Client.from({ contractId, rpcUrl, networkPassphrase, publicKey: keypair.publicKey(), signTransaction, }); ``` Here `keypair` is your funded account from [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/) and `contractId` is your deployed contract's `C...` ID. Because the client is built from the live contract at runtime, its methods are **not typed**: TypeScript does not know `client.increment` exists, so calls below use `(client as any)`. A fully typed client comes from generating bindings, covered later in the series. ## Preview a call with simulation Calling a contract method does not send anything yet: it builds a transaction and **simulates** it. The RPC server runs the call against the current ledger state and returns the result without committing anything, so a preview is free and needs no signature. Read the predicted return value from [`tx.result`](/js-stellar-sdk/reference/contracts-client/#contractassembledtransaction): ```ts const tx = await (client as any).increment(); tx.result; // the value the call would return; nothing has been sent ``` Nothing changed on-chain: simulate again and you get the same answer. A read-only method (one that does not change state) stops here. `tx.isReadCall` is `true`, and `tx.result` is your final answer with no signing or fee, because a read touches no state and needs no authorization. `increment` does change state, so `tx.isReadCall` is `false` and this is only a preview. To apply it, you sign and send. ## Sign and send to apply it To apply the state change, sign and send the transaction. The signer is the [`basicNodeSigner`](/js-stellar-sdk/reference/contracts-client/#contractbasicnodesigner) you passed to the client (a simple Node signer for scripts and tests; a browser app swaps in a wallet such as Freighter). `signAndSend` submits the transaction and waits for the network, returning a [`SentTransaction`](/js-stellar-sdk/reference/contracts-client/#contractsenttransaction) whose `result` is the value the contract returned on-chain: ```ts const sent = await tx.signAndSend(); sent.result; // the applied result; send again and the counter advances ``` If a method depends on contract state that has expired, pass `restore: true` in the method options and simulation will restore it before the call; see [State Archival](https://developers.stellar.org/docs/learn/encyclopedia/storage/state-archival). ## Put it together The whole flow as one runnable script. Set `contractId` to your deployed increment contract (see Prerequisites); the script funds a throwaway source account with friendbot so it runs end to end. In your app, replace the `Keypair.random()` call with your existing funded keypair. ```ts import { contract, rpc, Keypair, Networks } from "@stellar/stellar-sdk"; const rpcUrl = "https://soroban-testnet.stellar.org"; const networkPassphrase = Networks.TESTNET; const contractId = "C..."; // your deployed increment contract (see Prerequisites) async function main() { const server = new rpc.Server(rpcUrl); const keypair = Keypair.random(); const { signTransaction } = contract.basicNodeSigner( keypair, networkPassphrase, ); try { // Fund a throwaway account to invoke from (the RPC-side friendbot). await server.fundAddress(keypair.publicKey()); const client = await contract.Client.from({ contractId, rpcUrl, networkPassphrase, publicKey: keypair.publicKey(), signTransaction, }); // Preview the call for free with simulation. const tx = await (client as any).increment(); console.log("preview:", tx.result); // Sign and send to apply it on-chain. const sent = await tx.signAndSend(); console.log("applied:", sent.result); } catch (e) { console.error("Invocation failed:", e); } } main().catch(console.error); ``` You can now read from and write to a deployed contract from JavaScript. Next, learn to [authorize calls that more than one account must sign](/js-stellar-sdk/guides/07-contract-auth/). # Source: docs/guides/07-contract-auth.md # Authorize a Contract Call Some contract calls must be authorized by an account other than the one sending the transaction: a token `transfer` the sender does not own, a withdrawal from a smart wallet, a payment routed through x402 or MPP. This guide signs that authorization, using the path that stays correct as Stellar moves to its new credential, **AddressV2**, which writes the signer's address into the signed bytes (it is "address-bound"). Everything runs on testnet, so it is free and safe to repeat. ## What this guide is for This guide is for code that **signs Soroban contract authorization entries itself** by building the signature payload by hand: smart wallets, custom signers, and integrations like x402 or MPP. That is the one kind of code AddressV2 affects. It is **not** for: - **Classic Stellar apps** (payments, trustlines, no contract calls). AddressV2 does not touch classic transaction signing, so nothing here applies to you. - **Apps that let the SDK sign their contract calls** (the [`contract.Client`](/js-stellar-sdk/reference/contracts-client/#contractclient) flow from [Invoke a Contract](/js-stellar-sdk/guides/06-invoke-a-contract/), [`basicNodeSigner`](/js-stellar-sdk/reference/contracts-client/#contractbasicnodesigner), [`authorizeEntry`](/js-stellar-sdk/reference/core-soroban-primitives/#authorizeentry), or [`authorizeInvocation`](/js-stellar-sdk/reference/core-soroban-primitives/#authorizeinvocation)). **Bump to the Protocol 27 SDK and change nothing.** Those paths build the correct payload for whichever credential they are handed, so they sign `ADDRESS` today and `AddressV2` after the flip with no code change. > **What Protocol 27 changes.** Protocol 27 introduces `AddressV2`, an > address-bound Soroban authorization credential > ([CAP-0071-02](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0071-02.md)). > Once Protocol 27 is live on a network (testnet first), Stellar Core accepts > `AddressV2`. But RPC simulation still hands you the legacy `ADDRESS` credential > by default; that default flips to `AddressV2` at Protocol 28 (see the > [Protocol 27 upgrade guide](https://stellar.org/blog/foundation-news/stellar-zipper-protocol-27-upgrade-guide)). > The signing path here builds the correct payload from whichever credential an > entry carries, so the same code is right on today's `ADDRESS` and on `AddressV2` > after the flip, with no change from you. It is verified against the Protocol 27 > SDK: unit tests prove the same call signs both credentials, and a live testnet > test runs the delegated path end to end. ## Two signatures, not one An invoke transaction can carry two kinds of signature, and AddressV2 touches only one of them. The **envelope signature** is the transaction source signing the whole transaction hash with `tx.sign(keypair)`, the same call as in [Send a Payment](/js-stellar-sdk/guides/02-send-a-payment/). It authorizes the source to submit the transaction and pay its fee, and it covers the `InvokeHostFunction` operation itself. AddressV2 does not change it. The **authorization signature** is separate. Contracts mark the parts of a call that need consent by calling `require_auth()` on an address. Each such address gets its own authorization entry (a `SorobanAuthorizationEntry`): a small signed object that approves this one invocation. If that address is the transaction source, the envelope signature already covers it and there is nothing extra to do. If it is a different account, that account signs its own authorization entry, and that entry's payload is the only thing AddressV2 changes. This guide is about that second signature. | | Envelope signature | Authorization-entry signature | |---|---|---| | Who signs | the transaction source (plus classic multisig signers) | each address a contract calls `require_auth` on, when it is not the source | | What it signs | the transaction hash (the whole tx, including the invoke op) | one invocation, per authorizing address | | API | `tx.sign` / `signTransaction` | `signAuthEntries`, `authorizeEntry` | | AddressV2 | unchanged | payload becomes address-bound | AddressV2 lives only in the authorization-entry payload, and only for an address that is not the transaction source. A source-account authorization carries no separate signature, so it is unaffected. ## Prerequisites - A funded testnet account and its keypair. If you need one, see [Connect and Fund an Account](/js-stellar-sdk/guides/01-connect-and-fund/). - A second funded account whose authorization a call requires (the examples call it `signer`). - A deployed contract with a method that calls `require_auth` on an address argument. The examples use the Stellar [Auth example contract](https://developers.stellar.org/docs/build/smart-contracts/example-contracts/auth) (`increment(user, value)` calls `user.require_auth()`). Deploying is a one-time setup with the Stellar CLI, the same path as [Invoke a Contract](/js-stellar-sdk/guides/06-invoke-a-contract/). - You have read [Invoke a Contract](/js-stellar-sdk/guides/06-invoke-a-contract/); this guide builds on its `contract.Client` flow and does not repeat it. ## Sign a non-source authorization entry When a call requires another account's authorization, simulation returns an authorization entry that account must sign. Build the transaction as in [Invoke a Contract](/js-stellar-sdk/guides/06-invoke-a-contract/), then ask which accounts still need to sign: ```ts const tx = await (client as any).increment({ user: signer.publicKey(), value: 1 }); tx.needsNonInvokerSigningBy(); // [signer.publicKey()] ``` Awaiting the method call simulates it, which is what populates the authorization entries; `needsNonInvokerSigningBy` then reads them back, skipping source-account credentials because the envelope covers those. Delegate the signing to the SDK with [`signAuthEntries`](/js-stellar-sdk/reference/contracts-client/#contractassembledtransaction) and a `signAuthEntry` callback. [`basicNodeSigner`](/js-stellar-sdk/reference/contracts-client/#contractbasicnodesigner) is the simple Node signer (a browser app swaps in a wallet such as Freighter): ```ts const { signAuthEntry } = contract.basicNodeSigner(signer, networkPassphrase); await tx.signAuthEntries({ address: signer.publicKey(), signAuthEntry }); const sent = await tx.signAndSend(); ``` `basicNodeSigner` signs the exact payload the SDK builds, so the same call is correct on either credential. ## If you sign the payload yourself If you build and sign the authorization payload yourself, here is the one change to make. In the snippets below, `entry` is one of the authorization entries off the built transaction (the ones `needsNonInvokerSigningBy` flagged), `validUntil` is a future ledger sequence (for example `(await server.getLatestLedger()).sequence + 100`), and `hash`, `authorizeEntry`, and `buildAuthorizationEntryPreimage` import from `@stellar/stellar-sdk`. **Before.** Code that reconstructs the payload by hand hardcodes the legacy, non-address-bound credential. It is silently fine on today's `ADDRESS` entry, but the moment an entry is `AddressV2` (the Protocol 28 flip) it signs the wrong bytes and the network rejects it. A latent bug: ```ts // ❌ Before: hardcodes the legacy ENVELOPE_TYPE_SOROBAN_AUTHORIZATION payload. const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorization( new xdr.HashIdPreimageSorobanAuthorization({ networkId: hash(Buffer.from(networkPassphrase)), nonce: credentials.nonce(), invocation: entry.rootInvocation(), signatureExpirationLedger: validUntil, }), ); const signature = keypair.sign(hash(preimage.toXDR())); ``` **After.** Swap the hand-built preimage for [`buildAuthorizationEntryPreimage`](/js-stellar-sdk/reference/core-soroban-primitives/#buildauthorizationentrypreimage), which reads the entry's credential type and builds the matching payload. The signing line is unchanged, and the same code is now correct on both `ADDRESS` and `AddressV2`: ```ts // ✅ After: picks the right payload from the entry's own credential type. const preimage = buildAuthorizationEntryPreimage(entry, validUntil, networkPassphrase); const signature = keypair.sign(hash(preimage.toXDR())); ``` Better still, drop the preimage step entirely and hand the whole entry to [`authorizeEntry`](/js-stellar-sdk/reference/core-soroban-primitives/#authorizeentry), which builds the payload, signs it, verifies it, and writes the signature back: ```ts // ✅ Even simpler: authorizeEntry does the whole thing. const signed = await authorizeEntry(entry, keypair, validUntil, networkPassphrase); ``` For a custom signer that is not a `Keypair`, pass a `SigningCallback` to `authorizeEntry`. It receives the full `xdr.HashIdPreimage`, so it can inspect what it signs, and it should return `{ signature, publicKey }` (the bare `Buffer` return is deprecated). ## Why one call covers both `buildAuthorizationEntryPreimage` reads the entry's credential type and builds the matching payload: the legacy `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION` for `ADDRESS`, and the address-bound `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS` for `AddressV2`. (AddressV2 is CAP-0071-02; it reuses the address-bound envelope introduced for custom accounts in [CAP-0071-01](https://github.com/stellar/stellar-protocol/blob/master/core/cap-0071-01.md), which is why both CAPs appear here.) You call one function either way, so the flip from `ADDRESS` to `AddressV2` needs no code change from you. AddressV2 exists to close a narrow gap. The legacy payload commits to the network, nonce, invocation, and expiration, but not to the signer's address. If two accounts share a private key, a signature made for one could be replayed against the other. AddressV2 binds the address into the signed bytes, which closes that gap. The gap is narrow (it needs accounts that share keys), which is why `ADDRESS` stays valid and Core accepts both. ## Put it together The whole flow as one runnable script. It funds a throwaway source account and a separate `signer` account, builds a call that requires the signer's authorization, signs that entry with `basicNodeSigner`, and submits. Set `contractId` to your deployed Auth contract (see Prerequisites). ```ts import { contract, rpc, Keypair, Networks } from "@stellar/stellar-sdk"; const rpcUrl = "https://soroban-testnet.stellar.org"; const networkPassphrase = Networks.TESTNET; const contractId = "C..."; // your deployed Auth contract (see Prerequisites) async function main() { const server = new rpc.Server(rpcUrl); // The transaction source (signs the envelope) and a separate account whose // authorization the call requires. const source = Keypair.random(); const signer = Keypair.random(); try { await server.fundAddress(source.publicKey()); await server.fundAddress(signer.publicKey()); const { signTransaction } = contract.basicNodeSigner( source, networkPassphrase, ); const client = await contract.Client.from({ contractId, rpcUrl, networkPassphrase, publicKey: source.publicKey(), signTransaction, }); // A call that requires `signer` (not the source) to authorize it. const tx = await (client as any).increment({ user: signer.publicKey(), value: 1, }); console.log("needs signing by:", tx.needsNonInvokerSigningBy()); // Sign that entry as `signer`. basicNodeSigner signs the payload the SDK // builds, so this is correct on whichever credential the network returns. const { signAuthEntry } = contract.basicNodeSigner( signer, networkPassphrase, ); await tx.signAuthEntries({ address: signer.publicKey(), signAuthEntry }); const sent = await tx.signAndSend(); console.log("applied:", sent.result); } catch (e) { console.error("Authorized call failed:", e); } } main().catch(console.error); ``` You can now authorize a contract call that more than one account must sign, and your signer is correct on both credentials, on today's `ADDRESS` and after the Protocol 28 flip to `AddressV2`. Custom accounts can also delegate authorization to a tree of signers (`ADDRESS_WITH_DELEGATES`, also from CAP-0071-01); that advanced flow is covered separately. Next, learn to convert between JavaScript values and Soroban types. # Source: docs/reference/core-keys.md # Core / Keys ## Keypair `Keypair` represents public (and secret) keys of the account. Currently `Keypair` only supports ed25519 but in a future this class can be abstraction layer for other public-key signature systems. Use more convenient methods to create `Keypair` object: * [`Keypair.fromPublicKey`](/js-stellar-sdk/reference/core-keys/#keypairfrompublickeypublickey) * [`Keypair.fromSecret`](/js-stellar-sdk/reference/core-keys/#keypairfromsecretsecret) * [`Keypair.random`](/js-stellar-sdk/reference/core-keys/#keypairrandom) ```ts class Keypair { constructor(keys: { publicKey?: string | Buffer; secretKey: string | Buffer; type: "ed25519" } | { publicKey: string | Buffer; type: "ed25519" }); static fromPublicKey(publicKey: string): Keypair; static fromRawEd25519Seed(rawSeed: Buffer): Keypair; static fromSecret(secret: string): Keypair; static master(networkPassphrase: string): Keypair; static random(): Keypair; readonly type: "ed25519"; canSign(): boolean; publicKey(): string; rawPublicKey(): Buffer; rawSecretKey(): Buffer; secret(): string; sign(data: Buffer): Buffer; signatureHint(): Buffer; signDecorated(data: Buffer): DecoratedSignature; signPayloadDecorated(data: Buffer): DecoratedSignature; verify(data: Buffer, signature: Buffer): boolean; xdrAccountId(): PublicKey; xdrMuxedAccount(id?: string): MuxedAccount; xdrPublicKey(): PublicKey; } ``` **Source:** [src/base/keypair.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L21) ### `new Keypair(keys)` ```ts constructor(keys: { publicKey?: string | Buffer; secretKey: string | Buffer; type: "ed25519" } | { publicKey: string | Buffer; type: "ed25519" }); ``` **Parameters** - **`keys`** — `{ publicKey?: string | Buffer; secretKey: string | Buffer; type: "ed25519" } | { publicKey: string | Buffer; type: "ed25519" }` (required) — at least one of keys must be provided. - `type`: public-key signature system name (currently only `ed25519` keys are supported) - `publicKey`: raw public key - `secretKey`: raw secret key (32-byte secret seed in ed25519) **Source:** [src/base/keypair.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L33) ### `Keypair.fromPublicKey(publicKey)` Creates a new `Keypair` object from public key. ```ts static fromPublicKey(publicKey: string): Keypair; ``` **Parameters** - **`publicKey`** — `string` (required) — public key (ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA`) **Source:** [src/base/keypair.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L115) ### `Keypair.fromRawEd25519Seed(rawSeed)` Creates a new `Keypair` object from ed25519 secret key seed raw bytes. ```ts static fromRawEd25519Seed(rawSeed: Buffer): Keypair; ``` **Parameters** - **`rawSeed`** — `Buffer` (required) — raw 32-byte ed25519 secret key seed **Source:** [src/base/keypair.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L93) ### `Keypair.fromSecret(secret)` Creates a new `Keypair` instance from secret. This can either be secret key or secret seed depending on underlying public-key signature system. Currently `Keypair` only supports ed25519. ```ts static fromSecret(secret: string): Keypair; ``` **Parameters** - **`secret`** — `string` (required) — secret key (ex. `SDAK....`) **Source:** [src/base/keypair.ts:83](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L83) ### `Keypair.master(networkPassphrase)` Returns `Keypair` object representing network master key. ```ts static master(networkPassphrase: string): Keypair; ``` **Parameters** - **`networkPassphrase`** — `string` (required) — passphrase of the target stellar network (e.g. "Public Global Stellar Network ; September 2015") **Source:** [src/base/keypair.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L101) ### `Keypair.random()` Create a random `Keypair` object. ```ts static random(): Keypair; ``` **Source:** [src/base/keypair.ts:127](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L127) ### `keypair.type` ```ts readonly type: "ed25519"; ``` **Source:** [src/base/keypair.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L22) ### `keypair.canSign()` Returns `true` if this `Keypair` object contains secret key and can sign. ```ts canSign(): boolean; ``` **Source:** [src/base/keypair.ts:226](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L226) ### `keypair.publicKey()` Returns public key associated with this `Keypair` object. ```ts publicKey(): string; ``` **Source:** [src/base/keypair.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L188) ### `keypair.rawPublicKey()` Returns raw public key bytes ```ts rawPublicKey(): Buffer; ``` **Source:** [src/base/keypair.ts:171](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L171) ### `keypair.rawSecretKey()` Returns raw secret key bytes. ```ts rawSecretKey(): Buffer; ``` **Throws** - if no secret seed is available **Source:** [src/base/keypair.ts:216](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L216) ### `keypair.secret()` Returns secret key associated with this `Keypair` object. The secret key is encoded in Stellar format (e.g., `SDAK....`). ```ts secret(): string; ``` **Throws** - if no secret key is available **Source:** [src/base/keypair.ts:199](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L199) ### `keypair.sign(data)` Signs data. ```ts sign(data: Buffer): Buffer; ``` **Parameters** - **`data`** — `Buffer` (required) — data to sign **Throws** - if no secret key is available **Source:** [src/base/keypair.ts:236](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L236) ### `keypair.signatureHint()` Returns the signature hint for this keypair. The hint is the last 4 bytes of the account ID XDR representation. ```ts signatureHint(): Buffer; ``` **Source:** [src/base/keypair.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L179) ### `keypair.signDecorated(data)` Returns the decorated signature (hint+sig) for arbitrary data. The returned structure can be added directly to a transaction envelope. ```ts signDecorated(data: Buffer): DecoratedSignature; ``` **Parameters** - **`data`** — `Buffer` (required) — arbitrary data to sign **See also** - TransactionBase.addDecoratedSignature **Source:** [src/base/keypair.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L267) ### `keypair.signPayloadDecorated(data)` Returns the raw decorated signature (hint+sig) for a signed payload signer. The hint is defined as the last 4 bytes of the signer key XORed with last 4 bytes of the payload (zero-left-padded if necessary). ```ts signPayloadDecorated(data: Buffer): DecoratedSignature; ``` **Parameters** - **`data`** — `Buffer` (required) — data to both sign and treat as the payload **See also** - - https://github.com/stellar/stellar-protocol/blob/master/core/cap-0040.md#signature-hint - TransactionBase.addDecoratedSignature **Source:** [src/base/keypair.ts:285](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L285) ### `keypair.verify(data, signature)` Verifies if `signature` for `data` is valid. ```ts verify(data: Buffer, signature: Buffer): boolean; ``` **Parameters** - **`data`** — `Buffer` (required) — signed data - **`signature`** — `Buffer` (required) — signature to verify **Source:** [src/base/keypair.ts:250](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L250) ### `keypair.xdrAccountId()` Returns this public key as an xdr.AccountId. ```ts xdrAccountId(): PublicKey; ``` **Source:** [src/base/keypair.ts:133](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L133) ### `keypair.xdrMuxedAccount(id)` Creates a `xdr.MuxedAccount` object from the public key. You will get a different type of muxed account depending on whether or not you pass an ID. ```ts xdrMuxedAccount(id?: string): MuxedAccount; ``` **Parameters** - **`id`** — `string` (optional) — (optional) stringified integer indicating the underlying muxed ID of the new account object **Source:** [src/base/keypair.ts:151](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L151) ### `keypair.xdrPublicKey()` Returns this public key as an xdr.PublicKey. ```ts xdrPublicKey(): PublicKey; ``` **Source:** [src/base/keypair.ts:138](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/keypair.ts#L138) ## SignerKey A container class with helpers to convert between signer keys (`xdr.SignerKey`) and `StrKey`s. It's primarily used for manipulating the `extraSigners` precondition on a `Transaction`. ```ts class SignerKey { constructor(); static decodeAddress(address: string): SignerKey; static encodeSignerKey(signerKey: SignerKey): string; } ``` **See also** - `TransactionBuilder.setExtraSigners` **Source:** [src/base/signerkey.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/signerkey.ts#L19) ### `new SignerKey()` ```ts constructor(); ``` ### `SignerKey.decodeAddress(address)` Decodes a StrKey address into an xdr.SignerKey instance. Only ED25519 public keys (G...), pre-auth transactions (T...), hashes (H...), and signed payloads (P...) can be signer keys. ```ts static decodeAddress(address: string): SignerKey; ``` **Parameters** - **`address`** — `string` (required) — a StrKey-encoded signer address **Source:** [src/base/signerkey.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/signerkey.ts#L28) ### `SignerKey.encodeSignerKey(signerKey)` Encodes a signer key into its StrKey equivalent. ```ts static encodeSignerKey(signerKey: SignerKey): string; ``` **Parameters** - **`signerKey`** — `SignerKey` (required) — the signer **Source:** [src/base/signerkey.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/signerkey.ts#L63) ## StrKey StrKey is a helper class that allows encoding and decoding Stellar keys to/from strings, i.e. between their binary (Buffer, xdr.PublicKey, etc.) and string (i.e. "GABCD...", etc.) representations. ```ts class StrKey { constructor(); static types: Record; static decodeClaimableBalance(address: string): Buffer; static decodeContract(address: string): Buffer; static decodeEd25519PublicKey(data: string): Buffer; static decodeEd25519SecretSeed(address: string): Buffer; static decodeLiquidityPool(address: string): Buffer; static decodeMed25519PublicKey(address: string): Buffer; static decodePreAuthTx(address: string): Buffer; static decodeSha256Hash(address: string): Buffer; static decodeSignedPayload(address: string): Buffer; static encodeClaimableBalance(data: Buffer): string; static encodeContract(data: Buffer): string; static encodeEd25519PublicKey(data: Buffer): string; static encodeEd25519SecretSeed(data: Buffer): string; static encodeLiquidityPool(data: Buffer): string; static encodeMed25519PublicKey(data: Buffer): string; static encodePreAuthTx(data: Buffer): string; static encodeSha256Hash(data: Buffer): string; static encodeSignedPayload(data: Buffer): string; static getVersionByteForPrefix(address: string): VersionByteName | undefined; static isValidClaimableBalance(address: string): boolean; static isValidContract(address: string): boolean; static isValidEd25519PublicKey(publicKey: string): boolean; static isValidEd25519SecretSeed(seed: string): boolean; static isValidLiquidityPool(address: string): boolean; static isValidMed25519PublicKey(publicKey: string): boolean; static isValidSignedPayload(address: string): boolean; } ``` **Source:** [src/base/strkey.ts:54](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L54) ### `new StrKey()` ```ts constructor(); ``` ### `StrKey.types` ```ts static types: Record; ``` **Source:** [src/base/strkey.ts:55](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L55) ### `StrKey.decodeClaimableBalance(address)` Decodes strkey claimable balance (B...) to raw data. ```ts static decodeClaimableBalance(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — balance to decode **Source:** [src/base/strkey.ts:245](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L245) ### `StrKey.decodeContract(address)` Decodes strkey contract (C...) to raw data. ```ts static decodeContract(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — address to decode **Source:** [src/base/strkey.ts:218](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L218) ### `StrKey.decodeEd25519PublicKey(data)` Decodes strkey ed25519 public key to raw data. If the parameter is a muxed account key ("M..."), this will only encode it as a basic Ed25519 key (as if in "G..." format). ```ts static decodeEd25519PublicKey(data: string): Buffer; ``` **Parameters** - **`data`** — `string` (required) — "G..." (or "M...") key representation to decode **Source:** [src/base/strkey.ts:74](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L74) ### `StrKey.decodeEd25519SecretSeed(address)` Decodes strkey ed25519 seed to raw data. ```ts static decodeEd25519SecretSeed(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — data to decode **Source:** [src/base/strkey.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L101) ### `StrKey.decodeLiquidityPool(address)` Decodes strkey liquidity pool (L...) to raw data. ```ts static decodeLiquidityPool(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — address to decode **Source:** [src/base/strkey.ts:272](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L272) ### `StrKey.decodeMed25519PublicKey(address)` Decodes strkey med25519 public key to raw data. ```ts static decodeMed25519PublicKey(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — data to decode **Source:** [src/base/strkey.ts:128](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L128) ### `StrKey.decodePreAuthTx(address)` Decodes strkey PreAuthTx to raw data. ```ts static decodePreAuthTx(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — data to decode **Source:** [src/base/strkey.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L155) ### `StrKey.decodeSha256Hash(address)` Decodes strkey sha256 hash to raw data. ```ts static decodeSha256Hash(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — data to decode **Source:** [src/base/strkey.ts:173](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L173) ### `StrKey.decodeSignedPayload(address)` Decodes strkey signed payload (P...) to raw data. ```ts static decodeSignedPayload(address: string): Buffer; ``` **Parameters** - **`address`** — `string` (required) — address to decode **Source:** [src/base/strkey.ts:191](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L191) ### `StrKey.encodeClaimableBalance(data)` Encodes raw data to strkey claimable balance (B...). ```ts static encodeClaimableBalance(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:236](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L236) ### `StrKey.encodeContract(data)` Encodes raw data to strkey contract (C...). ```ts static encodeContract(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:209](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L209) ### `StrKey.encodeEd25519PublicKey(data)` Encodes `data` to strkey ed25519 public key. ```ts static encodeEd25519PublicKey(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — raw data to encode **Source:** [src/base/strkey.ts:62](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L62) ### `StrKey.encodeEd25519SecretSeed(data)` Encodes data to strkey ed25519 seed. ```ts static encodeEd25519SecretSeed(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:92](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L92) ### `StrKey.encodeLiquidityPool(data)` Encodes raw data to strkey liquidity pool (L...). ```ts static encodeLiquidityPool(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L263) ### `StrKey.encodeMed25519PublicKey(data)` Encodes data to strkey med25519 public key. ```ts static encodeMed25519PublicKey(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:119](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L119) ### `StrKey.encodePreAuthTx(data)` Encodes data to strkey preAuthTx. ```ts static encodePreAuthTx(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:146](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L146) ### `StrKey.encodeSha256Hash(data)` Encodes data to strkey sha256 hash. ```ts static encodeSha256Hash(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L164) ### `StrKey.encodeSignedPayload(data)` Encodes raw data to strkey signed payload (P...). ```ts static encodeSignedPayload(data: Buffer): string; ``` **Parameters** - **`data`** — `Buffer` (required) — data to encode **Source:** [src/base/strkey.ts:182](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L182) ### `StrKey.getVersionByteForPrefix(address)` Returns the strkey type based on the prefix of the given strkey address, or undefined if the prefix is invalid. ```ts static getVersionByteForPrefix(address: string): VersionByteName | undefined; ``` **Parameters** - **`address`** — `string` (required) — the strkey address to check **Source:** [src/base/strkey.ts:291](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L291) ### `StrKey.isValidClaimableBalance(address)` Checks validity of alleged claimable balance (B...) strkey address. ```ts static isValidClaimableBalance(address: string): boolean; ``` **Parameters** - **`address`** — `string` (required) — balance to check **Source:** [src/base/strkey.ts:254](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L254) ### `StrKey.isValidContract(address)` Checks validity of alleged contract (C...) strkey address. ```ts static isValidContract(address: string): boolean; ``` **Parameters** - **`address`** — `string` (required) — signer key to check **Source:** [src/base/strkey.ts:227](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L227) ### `StrKey.isValidEd25519PublicKey(publicKey)` Returns true if the given Stellar public key is a valid ed25519 public key. ```ts static isValidEd25519PublicKey(publicKey: string): boolean; ``` **Parameters** - **`publicKey`** — `string` (required) — public key to check **Source:** [src/base/strkey.ts:83](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L83) ### `StrKey.isValidEd25519SecretSeed(seed)` Returns true if the given Stellar secret key is a valid ed25519 secret seed. ```ts static isValidEd25519SecretSeed(seed: string): boolean; ``` **Parameters** - **`seed`** — `string` (required) — seed to check **Source:** [src/base/strkey.ts:110](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L110) ### `StrKey.isValidLiquidityPool(address)` Checks validity of alleged liquidity pool (L...) strkey address. ```ts static isValidLiquidityPool(address: string): boolean; ``` **Parameters** - **`address`** — `string` (required) — pool to check **Source:** [src/base/strkey.ts:281](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L281) ### `StrKey.isValidMed25519PublicKey(publicKey)` Returns true if the given Stellar public key is a valid med25519 public key. ```ts static isValidMed25519PublicKey(publicKey: string): boolean; ``` **Parameters** - **`publicKey`** — `string` (required) — public key to check **Source:** [src/base/strkey.ts:137](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L137) ### `StrKey.isValidSignedPayload(address)` Checks validity of alleged signed payload (P...) strkey address. ```ts static isValidSignedPayload(address: string): boolean; ``` **Parameters** - **`address`** — `string` (required) — signer key to check **Source:** [src/base/strkey.ts:200](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/strkey.ts#L200) ## sign Signs data using an Ed25519 secret key. ```ts sign(data: Buffer, rawSecret: Uint8Array | Buffer): Buffer ``` **Parameters** - **`data`** — `Buffer` (required) — the data to sign - **`rawSecret`** — `Uint8Array | Buffer` (required) — the raw Ed25519 secret key **Source:** [src/base/signing.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/signing.ts#L20) ## verify Verifies an Ed25519 signature against the given data and public key. ```ts verify(data: Buffer, signature: Buffer, rawPublicKey: Uint8Array | Buffer): boolean ``` **Parameters** - **`data`** — `Buffer` (required) — the original signed data - **`signature`** — `Buffer` (required) — the signature to verify - **`rawPublicKey`** — `Uint8Array | Buffer` (required) — the raw Ed25519 public key **Source:** [src/base/signing.ts:31](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/signing.ts#L31) # Source: docs/reference/core-assets.md # Core / Assets ## Asset Asset class represents an asset, either the native asset (`XLM`) or an asset code / issuer account ID pair. An asset describes an asset code and issuer pair. In the case of the native asset XLM, the issuer will be undefined. ```ts class Asset { constructor(code: string, issuer?: string); static compare(assetA: Asset, assetB: Asset): -1 | 0 | 1; static fromOperation(assetXdr: Asset): Asset; static native(): Asset; readonly code: string; readonly issuer: string | undefined; contractId(networkPassphrase: string): string; equals(asset: Asset): boolean; getAssetType(): AssetType; getCode(): string; getIssuer(): string | undefined; getRawAssetType(): AssetType; isNative(): boolean; toChangeTrustXDRObject(): ChangeTrustAsset; toString(): string; toTrustLineXDRObject(): TrustLineAsset; toXDRObject(): Asset; } ``` **Source:** [src/base/asset.ts:46](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L46) ### `new Asset(code, issuer)` ```ts constructor(code: string, issuer?: string); ``` **Parameters** - **`code`** — `string` (required) — The asset code. - **`issuer`** — `string` (optional) — The account ID of the issuer. **Source:** [src/base/asset.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L56) ### `Asset.compare(assetA, assetB)` Compares two assets according to the criteria: 1. First compare the type (`native < alphanum4 < alphanum12`). 2. If the types are equal, compare the assets codes. 3. If the asset codes are equal, compare the issuers. ```ts static compare(assetA: Asset, assetB: Asset): -1 | 0 | 1; ``` **Parameters** - **`assetA`** — `Asset` (required) — the first asset - **`assetB`** — `Asset` (required) — the second asset **Source:** [src/base/asset.ts:288](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L288) ### `Asset.fromOperation(assetXdr)` Returns an asset object from its XDR object representation. ```ts static fromOperation(assetXdr: Asset): Asset; ``` **Parameters** - **`assetXdr`** — `Asset` (required) — The asset xdr object. **Source:** [src/base/asset.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L90) ### `Asset.native()` Returns an asset object for the native asset. ```ts static native(): Asset; ``` **Source:** [src/base/asset.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L82) ### `asset.code` The asset code. ```ts readonly code: string; ``` **Source:** [src/base/asset.ts:48](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L48) ### `asset.issuer` The account ID of the issuer. Undefined for the native asset. ```ts readonly issuer: string | undefined; ``` **Source:** [src/base/asset.ts:50](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L50) ### `asset.contractId(networkPassphrase)` Returns the would-be contract ID (`C...` format) for this asset on a given network. ```ts contractId(networkPassphrase: string): string; ``` **Parameters** - **`networkPassphrase`** — `string` (required) — indicates which network the contract ID should refer to, since every network will have a unique ID for the same contract (see `Networks` for options) **Warning:** This makes no guarantee that this contract actually *exists*. **Source:** [src/base/asset.ts:143](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L143) ### `asset.equals(asset)` Returns true if this asset equals the given asset. ```ts equals(asset: Asset): boolean; ``` **Parameters** - **`asset`** — `Asset` (required) — Asset to compare **Source:** [src/base/asset.ts:261](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L261) ### `asset.getAssetType()` ```ts getAssetType(): AssetType; ``` **Throws** - Throws `Error` if asset type is unsupported. **See also** - [Assets concept](https://developers.stellar.org/docs/glossary/assets/) Returns the asset type. Can be one of following types: - `native`, - `credit_alphanum4`, - `credit_alphanum12` **Source:** [src/base/asset.ts:219](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L219) ### `asset.getCode()` Returns the asset code ```ts getCode(): string; ``` **Source:** [src/base/asset.ts:196](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L196) ### `asset.getIssuer()` Returns the asset issuer ```ts getIssuer(): string | undefined; ``` **Source:** [src/base/asset.ts:203](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L203) ### `asset.getRawAssetType()` Returns the raw XDR representation of the asset type ```ts getRawAssetType(): AssetType; ``` **Source:** [src/base/asset.ts:237](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L237) ### `asset.isNative()` Returns true if this asset object is the native asset. ```ts isNative(): boolean; ``` **Source:** [src/base/asset.ts:252](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L252) ### `asset.toChangeTrustXDRObject()` Returns the xdr.ChangeTrustAsset object for this asset. ```ts toChangeTrustXDRObject(): ChangeTrustAsset; ``` **Source:** [src/base/asset.ts:122](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L122) ### `asset.toString()` Returns a string representation of this asset. Native assets return `"native"`. Non-native assets return `"code:issuer"`. ```ts toString(): string; ``` **Source:** [src/base/asset.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L270) ### `asset.toTrustLineXDRObject()` Returns the xdr.TrustLineAsset object for this asset. ```ts toTrustLineXDRObject(): TrustLineAsset; ``` **Source:** [src/base/asset.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L129) ### `asset.toXDRObject()` Returns the xdr.Asset object for this asset. ```ts toXDRObject(): Asset; ``` **Source:** [src/base/asset.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L115) ## AssetType ```ts const AssetType: { readonly credit12: "credit_alphanum12"; readonly credit4: "credit_alphanum4"; readonly liquidityPoolShares: "liquidity_pool_shares"; readonly native: "native" } ``` **Source:** [src/base/asset.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L7) ## Claimant Claimant class represents an xdr.Claimant The claim predicate is optional, it defaults to unconditional if none is specified. ```ts class Claimant { constructor(destination: string, predicate?: ClaimPredicate); static fromXDR(claimantXdr: Claimant): Claimant; static predicateAnd(left: ClaimPredicate, right: ClaimPredicate): ClaimPredicate; static predicateBeforeAbsoluteTime(absBefore: string): ClaimPredicate; static predicateBeforeRelativeTime(seconds: string): ClaimPredicate; static predicateNot(predicate: ClaimPredicate): ClaimPredicate; static predicateOr(left: ClaimPredicate, right: ClaimPredicate): ClaimPredicate; static predicateUnconditional(): ClaimPredicate; destination: string; predicate: ClaimPredicate; toXDRObject(): Claimant; } ``` **Source:** [src/base/claimant.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L10) ### `new Claimant(destination, predicate)` ```ts constructor(destination: string, predicate?: ClaimPredicate); ``` **Parameters** - **`destination`** — `string` (required) — The destination account ID. - **`predicate`** — `ClaimPredicate` (optional) — The claim predicate. **Source:** [src/base/claimant.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L18) ### `Claimant.fromXDR(claimantXdr)` Returns a claimant object from its XDR object representation. ```ts static fromXDR(claimantXdr: Claimant): Claimant; ``` **Parameters** - **`claimantXdr`** — `Claimant` (required) — The claimant xdr object. **Source:** [src/base/claimant.ts:124](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L124) ### `Claimant.predicateAnd(left, right)` Returns an `and` claim predicate ```ts static predicateAnd(left: ClaimPredicate, right: ClaimPredicate): ClaimPredicate; ``` **Parameters** - **`left`** — `ClaimPredicate` (required) — an xdr.ClaimPredicate - **`right`** — `ClaimPredicate` (required) — an xdr.ClaimPredicate **Source:** [src/base/claimant.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L45) ### `Claimant.predicateBeforeAbsoluteTime(absBefore)` Returns a `BeforeAbsoluteTime` claim predicate This predicate will be fulfilled if the closing time of the ledger that includes the CreateClaimableBalance operation is less than this (absolute) Unix timestamp (expressed in seconds). ```ts static predicateBeforeAbsoluteTime(absBefore: string): ClaimPredicate; ``` **Parameters** - **`absBefore`** — `string` (required) — Unix epoch (in seconds) as a string **Source:** [src/base/claimant.ts:99](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L99) ### `Claimant.predicateBeforeRelativeTime(seconds)` Returns a `BeforeRelativeTime` claim predicate This predicate will be fulfilled if the closing time of the ledger that includes the CreateClaimableBalance operation plus this relative time delta (in seconds) is less than the current time. ```ts static predicateBeforeRelativeTime(seconds: string): ClaimPredicate; ``` **Parameters** - **`seconds`** — `string` (required) — seconds since closeTime of the ledger in which the ClaimableBalanceEntry was created (as string) **Source:** [src/base/claimant.ts:114](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L114) ### `Claimant.predicateNot(predicate)` Returns a `not` claim predicate ```ts static predicateNot(predicate: ClaimPredicate): ClaimPredicate; ``` **Parameters** - **`predicate`** — `ClaimPredicate` (required) — an xdr.ClaimPredicate **Source:** [src/base/claimant.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L82) ### `Claimant.predicateOr(left, right)` Returns an `or` claim predicate ```ts static predicateOr(left: ClaimPredicate, right: ClaimPredicate): ClaimPredicate; ``` **Parameters** - **`left`** — `ClaimPredicate` (required) — an xdr.ClaimPredicate - **`right`** — `ClaimPredicate` (required) — an xdr.ClaimPredicate **Source:** [src/base/claimant.ts:64](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L64) ### `Claimant.predicateUnconditional()` Returns an unconditional claim predicate ```ts static predicateUnconditional(): ClaimPredicate; ``` **Source:** [src/base/claimant.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L36) ### `claimant.destination` The destination account ID. ```ts destination: string; ``` **Source:** [src/base/claimant.ts:153](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L153) ### `claimant.predicate` The claim predicate. ```ts predicate: ClaimPredicate; ``` **Source:** [src/base/claimant.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L164) ### `claimant.toXDRObject()` Returns the xdr object for this claimant. ```ts toXDRObject(): Claimant; ``` **Source:** [src/base/claimant.ts:141](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/claimant.ts#L141) ## LiquidityPoolAsset LiquidityPoolAsset class represents a liquidity pool trustline change. ```ts class LiquidityPoolAsset { constructor(assetA: Asset, assetB: Asset, fee: number); static fromOperation(ctAssetXdr: ChangeTrustAsset): LiquidityPoolAsset; assetA: Asset; assetB: Asset; fee: number; equals(other: LiquidityPoolAsset): boolean; getAssetType(): "liquidity_pool_shares"; getLiquidityPoolParameters(): ConstantProduct; toString(): string; toXDRObject(): ChangeTrustAsset; } ``` **Source:** [src/base/liquidity_pool_asset.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L12) ### `new LiquidityPoolAsset(assetA, assetB, fee)` ```ts constructor(assetA: Asset, assetB: Asset, fee: number); ``` **Parameters** - **`assetA`** — `Asset` (required) — The first asset in the Pool, it must respect the rule `assetA < assetB`. See `Asset.compare` for more details on how assets are sorted. - **`assetB`** — `Asset` (required) — The second asset in the Pool, it must respect the rule `assetA < assetB`. See `Asset.compare` for more details on how assets are sorted. - **`fee`** — `number` (required) — The liquidity pool fee. For now the only fee supported is `30`. **Source:** [src/base/liquidity_pool_asset.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L22) ### `LiquidityPoolAsset.fromOperation(ctAssetXdr)` Returns a liquidity pool asset object from its XDR ChangeTrustAsset object representation. ```ts static fromOperation(ctAssetXdr: ChangeTrustAsset): LiquidityPoolAsset; ``` **Parameters** - **`ctAssetXdr`** — `ChangeTrustAsset` (required) — The asset XDR object. **Source:** [src/base/liquidity_pool_asset.ts:50](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L50) ### `liquidityPoolAsset.assetA` ```ts assetA: Asset; ``` **Source:** [src/base/liquidity_pool_asset.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L13) ### `liquidityPoolAsset.assetB` ```ts assetB: Asset; ``` **Source:** [src/base/liquidity_pool_asset.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L14) ### `liquidityPoolAsset.fee` ```ts fee: number; ``` **Source:** [src/base/liquidity_pool_asset.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L15) ### `liquidityPoolAsset.equals(other)` Returns true if this liquidity pool asset equals the given one. ```ts equals(other: LiquidityPoolAsset): boolean; ``` **Parameters** - **`other`** — `LiquidityPoolAsset` (required) — the LiquidityPoolAsset to compare **Source:** [src/base/liquidity_pool_asset.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L116) ### `liquidityPoolAsset.getAssetType()` Returns the asset type, always `"liquidity_pool_shares"`. ```ts getAssetType(): "liquidity_pool_shares"; ``` **See also** - [Assets concept](https://developers.stellar.org/docs/glossary/assets/) **Source:** [src/base/liquidity_pool_asset.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L107) ### `liquidityPoolAsset.getLiquidityPoolParameters()` Returns liquidity pool parameters. ```ts getLiquidityPoolParameters(): ConstantProduct; ``` **Source:** [src/base/liquidity_pool_asset.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L93) ### `liquidityPoolAsset.toString()` Returns a string representation in `liquidity_pool:` format. ```ts toString(): string; ``` **Source:** [src/base/liquidity_pool_asset.ts:125](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L125) ### `liquidityPoolAsset.toXDRObject()` Returns the `xdr.ChangeTrustAsset` object for this liquidity pool asset. Note: To convert from an ``Asset`` to `xdr.ChangeTrustAsset` please refer to the ``Asset.toChangeTrustXDRObject`` method. ```ts toXDRObject(): ChangeTrustAsset; ``` **Source:** [src/base/liquidity_pool_asset.ts:75](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_asset.ts#L75) ## LiquidityPoolFeeV18 ```ts const LiquidityPoolFeeV18: 30 ``` **Source:** [src/base/get_liquidity_pool_id.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L22) ## LiquidityPoolId LiquidityPoolId class represents the asset referenced by a trustline to a liquidity pool. ```ts class LiquidityPoolId { constructor(liquidityPoolId: string); static fromOperation(tlAssetXdr: TrustLineAsset): LiquidityPoolId; liquidityPoolId: string; equals(asset: LiquidityPoolId): boolean; getAssetType(): "liquidity_pool_shares"; getLiquidityPoolId(): string; toString(): string; toXDRObject(): TrustLineAsset; } ``` **Source:** [src/base/liquidity_pool_id.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L7) ### `new LiquidityPoolId(liquidityPoolId)` ```ts constructor(liquidityPoolId: string); ``` **Parameters** - **`liquidityPoolId`** — `string` (required) — The ID of the liquidity pool in string 'hex'. **Source:** [src/base/liquidity_pool_id.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L13) ### `LiquidityPoolId.fromOperation(tlAssetXdr)` Returns a liquidity pool ID object from its xdr.TrustLineAsset representation. ```ts static fromOperation(tlAssetXdr: TrustLineAsset): LiquidityPoolId; ``` **Parameters** - **`tlAssetXdr`** — `TrustLineAsset` (required) — The asset XDR object. **Source:** [src/base/liquidity_pool_id.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L28) ### `liquidityPoolId.liquidityPoolId` ```ts liquidityPoolId: string; ``` **Source:** [src/base/liquidity_pool_id.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L8) ### `liquidityPoolId.equals(asset)` Returns true if this liquidity pool ID equals the given one. ```ts equals(asset: LiquidityPoolId): boolean; ``` **Parameters** - **`asset`** — `LiquidityPoolId` (required) — LiquidityPoolId to compare. **Source:** [src/base/liquidity_pool_id.ts:77](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L77) ### `liquidityPoolId.getAssetType()` Returns the asset type, always `"liquidity_pool_shares"`. ```ts getAssetType(): "liquidity_pool_shares"; ``` **See also** - [Assets concept](https://developers.stellar.org/docs/glossary/assets/) **Source:** [src/base/liquidity_pool_id.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L68) ### `liquidityPoolId.getLiquidityPoolId()` Returns the liquidity pool ID as a hex string. ```ts getLiquidityPoolId(): string; ``` **Source:** [src/base/liquidity_pool_id.ts:59](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L59) ### `liquidityPoolId.toString()` Returns a string representation of this liquidity pool ID. ```ts toString(): string; ``` **Source:** [src/base/liquidity_pool_id.ts:84](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L84) ### `liquidityPoolId.toXDRObject()` Returns the `xdr.TrustLineAsset` object for this liquidity pool ID. Note: To convert from ``Asset`` to `xdr.TrustLineAsset` please refer to the ``Asset.toTrustLineXDRObject`` method. ```ts toXDRObject(): TrustLineAsset; ``` **Source:** [src/base/liquidity_pool_id.ts:48](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/liquidity_pool_id.ts#L48) ## getLiquidityPoolId Computes the Pool ID for the given assets, fee and pool type. Returns the raw Pool ID buffer, which can be stringified with `toString('hex')`. ```ts getLiquidityPoolId(liquidityPoolType: "constant_product", liquidityPoolParameters: ConstantProduct): Buffer ``` **Parameters** - **`liquidityPoolType`** — `"constant_product"` (required) — A string representing the liquidity pool type. - **`liquidityPoolParameters`** — `ConstantProduct` (required) — The liquidity pool parameters. - `assetA`: The first asset in the Pool, it must respect the rule `assetA < assetB`. - `assetB`: The second asset in the Pool, it must respect the rule `assetA < assetB`. - `fee`: The liquidity pool fee. For now the only fee supported is `30`. **See also** - [stellar-core getPoolID](https://github.com/stellar/stellar-core/blob/9f3a48c6a8f1aa77b6043a055d0638661f718080/src/ledger/test/LedgerTxnTests.cpp#L3746-L3751) **Source:** [src/base/get_liquidity_pool_id.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L38) ## Types ### AssetType ```ts type AssetType = typeof AssetType[keyof typeof AssetType] ``` **Source:** [src/base/asset.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L7) ### AssetType.credit12 ```ts type credit12 = "credit_alphanum12" ``` **Source:** [src/base/asset.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L20) ### AssetType.credit4 ```ts type credit4 = "credit_alphanum4" ``` **Source:** [src/base/asset.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L19) ### AssetType.liquidityPoolShares ```ts type liquidityPoolShares = "liquidity_pool_shares" ``` **Source:** [src/base/asset.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L21) ### AssetType.native ```ts type native = "native" ``` **Source:** [src/base/asset.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/asset.ts#L18) ### LiquidityPoolParameters ```ts type LiquidityPoolParameters = LiquidityPoolParameters.ConstantProduct ``` **Source:** [src/base/get_liquidity_pool_id.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L12) ### LiquidityPoolParameters.ConstantProduct ```ts interface ConstantProduct { assetA: Asset; assetB: Asset; fee: number; } ``` **Source:** [src/base/get_liquidity_pool_id.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L13) #### `constantProduct.assetA` ```ts assetA: Asset; ``` **Source:** [src/base/get_liquidity_pool_id.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L14) #### `constantProduct.assetB` ```ts assetB: Asset; ``` **Source:** [src/base/get_liquidity_pool_id.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L15) #### `constantProduct.fee` ```ts fee: number; ``` **Source:** [src/base/get_liquidity_pool_id.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L16) ### LiquidityPoolType ```ts type LiquidityPoolType = LiquidityPoolType.constantProduct ``` **Source:** [src/base/get_liquidity_pool_id.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L7) ### LiquidityPoolType.constantProduct ```ts type constantProduct = "constant_product" ``` **Source:** [src/base/get_liquidity_pool_id.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/get_liquidity_pool_id.ts#L8) # Source: docs/reference/core-transactions.md # 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](https://developers.stellar.org/docs/glossary/accounts/) for more information about how accounts work in Stellar. ```ts class Account implements TransactionSource { constructor(accountId: string, sequence: string); accountId(): string; incrementSequenceNumber(): void; sequenceNumber(): string; } ``` **Source:** [src/base/account.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/account.ts#L16) ### `new Account(accountId, sequence)` ```ts constructor(accountId: string, sequence: string); ``` **Parameters** - **`accountId`** — `string` (required) — ID of the account (ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA`). If you provide a muxed account address, this will throw; use `MuxedAccount` instead. - **`sequence`** — `string` (required) — current sequence number of the account **Source:** [src/base/account.ts:27](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/account.ts#L27) ### `account.accountId()` Returns Stellar account ID, ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA`. ```ts accountId(): string; ``` **Source:** [src/base/account.ts:58](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/account.ts#L58) ### `account.incrementSequenceNumber()` Increments sequence number in this object by one. ```ts incrementSequenceNumber(): void; ``` **Source:** [src/base/account.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/account.ts#L72) ### `account.sequenceNumber()` Returns sequence number for the account as a string ```ts sequenceNumber(): string; ``` **Source:** [src/base/account.ts:65](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/account.ts#L65) ## AuthClawbackEnabledFlag When set using [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions) option, then any trustlines created by this account can have a ClawbackOp operation submitted for the corresponding asset. ```ts const AuthClawbackEnabledFlag: number ``` **See also** - [Account flags](https://developers.stellar.org/docs/glossary/accounts/#flags) **Source:** [src/base/operation.ts:83](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L83) ## AuthImmutableFlag When set using [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions) option, then none of the authorization flags can be set and the account can never be deleted. ```ts const AuthImmutableFlag: number ``` **See also** - [Account flags](https://developers.stellar.org/docs/glossary/accounts/#flags) **Source:** [src/base/operation.ts:74](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L74) ## AuthRequiredFlag When set using [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions) option, requires the issuing account to give other accounts permission before they can hold the issuing account’s credit. ```ts const AuthRequiredFlag: number ``` **See also** - [Account flags](https://developers.stellar.org/docs/glossary/accounts/#flags) **Source:** [src/base/operation.ts:60](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L60) ## AuthRevocableFlag When set using [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions) option, allows the issuing account to revoke its credit held by other accounts. ```ts const AuthRevocableFlag: number ``` **See also** - [Account flags](https://developers.stellar.org/docs/glossary/accounts/#flags) **Source:** [src/base/operation.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L67) ## 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. ```ts const BASE_FEE: "100" ``` **See also** - [Fees](https://developers.stellar.org/docs/glossary/fees/) **Source:** [src/base/transaction_builder.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L39) ## 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. ```ts class FeeBumpTransaction { constructor(envelope: string | TransactionEnvelope, networkPassphrase: string); fee: string; readonly feeSource: string; readonly innerTransaction: Transaction; networkPassphrase: string; readonly operations: OperationRecord[]; signatures: DecoratedSignature[]; tx: TTx; addDecoratedSignature(signature: DecoratedSignature): void; addSignature(publicKey: string = "", signature: string = ""): void; getKeypairSignature(keypair: Keypair): string; hash(): Buffer; sign(...keypairs: Keypair[]): void; signatureBase(): Buffer; signHashX(preimage: string | Buffer): void; toEnvelope(): TransactionEnvelope; toXDR(): string; } ``` **Source:** [src/base/fee_bump_transaction.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L17) ### `new FeeBumpTransaction(envelope, networkPassphrase)` ```ts constructor(envelope: string | TransactionEnvelope, networkPassphrase: string); ``` **Parameters** - **`envelope`** — `string | TransactionEnvelope` (required) — transaction envelope object or base64 encoded string. - **`networkPassphrase`** — `string` (required) — passphrase of the target Stellar network (e.g. "Public Global Stellar Network ; September 2015"). **Source:** [src/base/fee_bump_transaction.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L26) ### `feeBumpTransaction.fee` The total fee for this transaction, in stroops. ```ts fee: string; ``` **Source:** [src/base/transaction_base.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L76) ### `feeBumpTransaction.feeSource` The account paying the fee for this transaction. ```ts readonly feeSource: string; ``` **Source:** [src/base/fee_bump_transaction.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L78) ### `feeBumpTransaction.innerTransaction` The inner transaction that this fee bump wraps. ```ts readonly innerTransaction: Transaction; ``` **Source:** [src/base/fee_bump_transaction.ts:64](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L64) ### `feeBumpTransaction.networkPassphrase` The network passphrase for this transaction. ```ts networkPassphrase: string; ``` **Source:** [src/base/transaction_base.ts:85](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L85) ### `feeBumpTransaction.operations` The operations from the inner transaction. ```ts readonly operations: OperationRecord[]; ``` **Source:** [src/base/fee_bump_transaction.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L71) ### `feeBumpTransaction.signatures` The list of signatures for this transaction. ```ts signatures: DecoratedSignature[]; ``` **Source:** [src/base/transaction_base.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L35) ### `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. ```ts tx: TTx; ``` **Throws** - if the internal transaction is not a recognized XDR type **Source:** [src/base/transaction_base.ts:51](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L51) ### `feeBumpTransaction.addDecoratedSignature(signature)` Add a decorated signature directly to the transaction envelope. ```ts addDecoratedSignature(signature: DecoratedSignature): void; ``` **Parameters** - **`signature`** — `DecoratedSignature` (required) — raw signature to add **See also** - - Keypair.signDecorated - Keypair.signPayloadDecorated **Source:** [src/base/transaction_base.ts:196](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L196) ### `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`](/js-stellar-sdk/reference/core-transactions/#transactiongetkeypairsignaturekeypair) to sign the transaction. - They should send you back their `publicKey` and the `signature` string from [`getKeypairSignature`](/js-stellar-sdk/reference/core-transactions/#transactiongetkeypairsignaturekeypair), both of which you pass to this function. ```ts addSignature(publicKey: string = "", signature: string = ""): void; ``` **Parameters** - **`publicKey`** — `string` (optional) (default: `""`) — the public key of the signer - **`signature`** — `string` (optional) (default: `""`) — the base64 value of the signature XDR **Source:** [src/base/transaction_base.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L156) ### `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`](/js-stellar-sdk/reference/core-transactions/#transactionaddsignaturepublickey-signature) 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: ```javascript // `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. ```ts getKeypairSignature(keypair: Keypair): string; ``` **Parameters** - **`keypair`** — `Keypair` (required) — Keypair of signer **Source:** [src/base/transaction_base.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L129) ### `feeBumpTransaction.hash()` Returns a hash for this transaction, suitable for signing. ```ts hash(): Buffer; ``` **Source:** [src/base/transaction_base.ts:222](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L222) ### `feeBumpTransaction.sign(keypairs)` Signs the transaction with the given `Keypair`. ```ts sign(...keypairs: Keypair[]): void; ``` **Parameters** - **`...keypairs`** — `Keypair[]` (required) — Keypairs of signers **Source:** [src/base/transaction_base.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L97) ### `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. ```ts signatureBase(): Buffer; ``` **Source:** [src/base/fee_bump_transaction.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L90) ### `feeBumpTransaction.signHashX(preimage)` Add `hashX` signer preimage as signature. ```ts signHashX(preimage: string | Buffer): void; ``` **Parameters** - **`preimage`** — `string | Buffer` (required) — preimage of hash used as signer **Source:** [src/base/transaction_base.ts:204](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L204) ### `feeBumpTransaction.toEnvelope()` To envelope returns a xdr.TransactionEnvelope which can be submitted to the network. ```ts toEnvelope(): TransactionEnvelope; ``` **Source:** [src/base/fee_bump_transaction.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/fee_bump_transaction.ts#L107) ### `feeBumpTransaction.toXDR()` Returns the transaction envelope as a base64-encoded XDR string. ```ts toXDR(): string; ``` **Source:** [src/base/transaction_base.ts:239](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L239) ## Int128 ```ts class Int128 extends LargeInt { constructor(...args: (string | number | bigint)[]); static MAX_VALUE: LargeInt; static MIN_VALUE: LargeInt; static defineIntBoundaries(): void; static fromString(value: string): LargeInt; static isValid(value: unknown): boolean; readonly size: number; readonly unsigned: boolean; slice(chunkSize: number): bigint[]; toBigInt(): bigint; toString(): string; } ``` **Source:** [src/base/numbers/int128.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int128.ts#L3) ### `new Int128(args)` Construct a signed 128-bit integer that can be XDR-encoded. ```ts constructor(...args: (string | number | bigint)[]); ``` **Parameters** - **`...args`** — `(string | number | bigint)[]` (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits) **Source:** [src/base/numbers/int128.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int128.ts#L10) ### `Int128.MAX_VALUE` ```ts static MAX_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L14) ### `Int128.MIN_VALUE` ```ts static MIN_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L13) ### `Int128.defineIntBoundaries()` ```ts static defineIntBoundaries(): void; ``` **Source:** [types/stellar__js-xdr/index.d.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L12) ### `Int128.fromString(value)` ```ts static fromString(value: string): LargeInt; ``` **Parameters** - **`value`** — `string` (required) **Source:** [types/stellar__js-xdr/index.d.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L16) ### `Int128.isValid(value)` ```ts static isValid(value: unknown): boolean; ``` **Parameters** - **`value`** — `unknown` (required) **Source:** [types/stellar__js-xdr/index.d.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L15) ### `int128.size` ```ts readonly size: number; ``` **Source:** [src/base/numbers/int128.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int128.ts#L18) ### `int128.unsigned` ```ts readonly unsigned: boolean; ``` **Source:** [src/base/numbers/int128.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int128.ts#L14) ### `int128.slice(chunkSize)` ```ts slice(chunkSize: number): bigint[]; ``` **Parameters** - **`chunkSize`** — `number` (required) **Source:** [types/stellar__js-xdr/index.d.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L21) ### `int128.toBigInt()` ```ts toBigInt(): bigint; ``` **Source:** [types/stellar__js-xdr/index.d.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L19) ### `int128.toString()` ```ts toString(): string; ``` **Source:** [types/stellar__js-xdr/index.d.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L20) ## Int256 ```ts class Int256 extends LargeInt { constructor(...args: (string | number | bigint)[]); static MAX_VALUE: LargeInt; static MIN_VALUE: LargeInt; static defineIntBoundaries(): void; static fromString(value: string): LargeInt; static isValid(value: unknown): boolean; readonly size: number; readonly unsigned: boolean; slice(chunkSize: number): bigint[]; toBigInt(): bigint; toString(): string; } ``` **Source:** [src/base/numbers/int256.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int256.ts#L3) ### `new Int256(args)` Construct a signed 256-bit integer that can be XDR-encoded. ```ts constructor(...args: (string | number | bigint)[]); ``` **Parameters** - **`...args`** — `(string | number | bigint)[]` (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits) **Source:** [src/base/numbers/int256.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int256.ts#L10) ### `Int256.MAX_VALUE` ```ts static MAX_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L14) ### `Int256.MIN_VALUE` ```ts static MIN_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L13) ### `Int256.defineIntBoundaries()` ```ts static defineIntBoundaries(): void; ``` **Source:** [types/stellar__js-xdr/index.d.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L12) ### `Int256.fromString(value)` ```ts static fromString(value: string): LargeInt; ``` **Parameters** - **`value`** — `string` (required) **Source:** [types/stellar__js-xdr/index.d.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L16) ### `Int256.isValid(value)` ```ts static isValid(value: unknown): boolean; ``` **Parameters** - **`value`** — `unknown` (required) **Source:** [types/stellar__js-xdr/index.d.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L15) ### `int256.size` ```ts readonly size: number; ``` **Source:** [src/base/numbers/int256.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int256.ts#L18) ### `int256.unsigned` ```ts readonly unsigned: boolean; ``` **Source:** [src/base/numbers/int256.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/int256.ts#L14) ### `int256.slice(chunkSize)` ```ts slice(chunkSize: number): bigint[]; ``` **Parameters** - **`chunkSize`** — `number` (required) **Source:** [types/stellar__js-xdr/index.d.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L21) ### `int256.toBigInt()` ```ts toBigInt(): bigint; ``` **Source:** [types/stellar__js-xdr/index.d.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L19) ### `int256.toString()` ```ts toString(): string; ``` **Source:** [types/stellar__js-xdr/index.d.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L20) ## Memo `Memo` represents memos attached to transactions. ```ts class Memo { constructor(type: "none", value?: null); static fromXDRObject(object: Memo): Memo; static hash(hash: string | Buffer): Memo<"hash">; static id(id: string): Memo<"id">; static none(): Memo<"none">; static return(hash: string | Buffer): Memo<"return">; static text(text: string): Memo<"text">; type: T; value: MemoTypeToValue; toXDRObject(): Memo; } ``` **See also** - [Transactions concept](https://developers.stellar.org/docs/glossary/transactions/) **Source:** [src/base/memo.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L63) ### `new Memo(type, value)` ```ts constructor(type: "none", value?: null); ``` **Parameters** - **`type`** — `"none"` (required) - **`value`** — `null` (optional) **Source:** [src/base/memo.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L67) ### `Memo.fromXDRObject(object)` Returns `Memo` from XDR memo object. ```ts static fromXDRObject(object: Memo): Memo; ``` **Parameters** - **`object`** — `Memo` (required) — XDR memo object **Source:** [src/base/memo.ts:302](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L302) ### `Memo.hash(hash)` Creates and returns a `MemoHash` memo. ```ts static hash(hash: string | Buffer): Memo<"hash">; ``` **Parameters** - **`hash`** — `string | Buffer` (required) — 32 byte hash or hex encoded string **Source:** [src/base/memo.ts:260](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L260) ### `Memo.id(id)` Creates and returns a `MemoID` memo. ```ts static id(id: string): Memo<"id">; ``` **Parameters** - **`id`** — `string` (required) — 64-bit number represented as a string **Source:** [src/base/memo.ts:251](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L251) ### `Memo.none()` Returns an empty memo (`MemoNone`). ```ts static none(): Memo<"none">; ``` **Source:** [src/base/memo.ts:233](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L233) ### `Memo.return(hash)` Creates and returns a `MemoReturn` memo. ```ts static return(hash: string | Buffer): Memo<"return">; ``` **Parameters** - **`hash`** — `string | Buffer` (required) — 32 byte hash or hex encoded string **Source:** [src/base/memo.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L269) ### `Memo.text(text)` Creates and returns a `MemoText` memo. ```ts static text(text: string): Memo<"text">; ``` **Parameters** - **`text`** — `string` (required) — memo text **Source:** [src/base/memo.ts:242](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L242) ### `memo.type` Contains memo type: `MemoNone`, `MemoID`, `MemoText`, `MemoHash` or `MemoReturn` ```ts type: T; ``` **Source:** [src/base/memo.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L107) ### `memo.value` Contains memo value: * `null` for `MemoNone`, * `string` for `MemoID`, * `Buffer` for `MemoText` after decoding using `fromXDRObject`, original value otherwise, * `Buffer` for `MemoHash`, `MemoReturn`. ```ts value: MemoTypeToValue; ``` **Source:** [src/base/memo.ts:122](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L122) ### `memo.toXDRObject()` Returns XDR memo object. ```ts toXDRObject(): Memo; ``` **Source:** [src/base/memo.ts:276](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L276) ## MemoHash Type of `Memo`. ```ts const MemoHash: "hash" ``` **Source:** [src/base/memo.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L21) ## MemoID Type of `Memo`. ```ts const MemoID: "id" ``` **Source:** [src/base/memo.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L13) ## MemoNone Type of `Memo`. ```ts const MemoNone: "none" ``` **Source:** [src/base/memo.ts:9](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L9) ## MemoReturn Type of `Memo`. ```ts const MemoReturn: "return" ``` **Source:** [src/base/memo.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L25) ## MemoText Type of `Memo`. ```ts const MemoText: "text" ``` **Source:** [src/base/memo.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L17) ## MuxedAccount Represents a muxed account for transactions and operations. A muxed (or *multiplexed*) account (defined rigorously in [CAP-27](https://stellar.org/protocol/cap-27) and briefly in [SEP-23](https://stellar.org/protocol/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`. ```ts class MuxedAccount implements TransactionSource { constructor(baseAccount: Account, id: string); static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount; accountId(): string; baseAccount(): Account; equals(otherMuxedAccount: MuxedAccount): boolean; id(): string; incrementSequenceNumber(): void; sequenceNumber(): string; setId(id: string): MuxedAccount; toXDRObject(): MuxedAccount; } ``` **See also** - https://developers.stellar.org/docs/glossary/muxed-accounts/ **Source:** [src/base/muxed_account.ts:60](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L60) ### `new MuxedAccount(baseAccount, id)` ```ts constructor(baseAccount: Account, id: string); ``` **Parameters** - **`baseAccount`** — `Account` (required) — the `Account` instance representing the underlying G... address - **`id`** — `string` (required) — a stringified uint64 value that represents the ID of the muxed account **Source:** [src/base/muxed_account.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L72) ### `MuxedAccount.fromAddress(mAddress, sequenceNum)` Parses an M-address into a MuxedAccount object. ```ts static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount; ``` **Parameters** - **`mAddress`** — `string` (required) — an M-address to transform - **`sequenceNum`** — `string` (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](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L96) ### `muxedAccount.accountId()` Returns the M-address representing this account's (G-address, ID). ```ts accountId(): string; ``` **Source:** [src/base/muxed_account.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L115) ### `muxedAccount.baseAccount()` Returns the underlying account object shared among all muxed accounts with this Stellar address. ```ts baseAccount(): Account; ``` **Source:** [src/base/muxed_account.ts:108](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L108) ### `muxedAccount.equals(otherMuxedAccount)` Checks whether two muxed accounts are equal by comparing their M-addresses. ```ts equals(otherMuxedAccount: MuxedAccount): boolean; ``` **Parameters** - **`otherMuxedAccount`** — `MuxedAccount` (required) — the MuxedAccount to compare against **Source:** [src/base/muxed_account.ts:171](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L171) ### `muxedAccount.id()` Returns the uint64 ID of this muxed account as a string. ```ts id(): string; ``` **Source:** [src/base/muxed_account.ts:122](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L122) ### `muxedAccount.incrementSequenceNumber()` Increments the underlying account's sequence number by one. ```ts incrementSequenceNumber(): void; ``` **Source:** [src/base/muxed_account.ts:154](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L154) ### `muxedAccount.sequenceNumber()` Returns the stringified sequence number for the underlying account. ```ts sequenceNumber(): string; ``` **Source:** [src/base/muxed_account.ts:147](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L147) ### `muxedAccount.setId(id)` Updates the muxed account's ID, regenerating the M-address accordingly. ```ts setId(id: string): MuxedAccount; ``` **Parameters** - **`id`** — `string` (required) — a stringified uint64 value to set as the new muxed account ID **Source:** [src/base/muxed_account.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L131) ### `muxedAccount.toXDRObject()` Returns the XDR object representing this muxed account's G-address and uint64 ID. ```ts toXDRObject(): MuxedAccount; ``` **Source:** [src/base/muxed_account.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/muxed_account.ts#L162) ## Operation `Operation` class represents [operations](https://developers.stellar.org/docs/glossary/operations/) in Stellar network. Use one of static methods to create operations: * [`Operation.createAccount`](/js-stellar-sdk/reference/core-transactions/#operationcreateaccount) * [`Operation.payment`](/js-stellar-sdk/reference/core-transactions/#operationpayment) * [`Operation.pathPaymentStrictReceive`](/js-stellar-sdk/reference/core-transactions/#operationpathpaymentstrictreceive) * [`Operation.pathPaymentStrictSend`](/js-stellar-sdk/reference/core-transactions/#operationpathpaymentstrictsend) * [`Operation.manageSellOffer`](/js-stellar-sdk/reference/core-transactions/#operationmanageselloffer) * [`Operation.manageBuyOffer`](/js-stellar-sdk/reference/core-transactions/#operationmanagebuyoffer) * [`Operation.createPassiveSellOffer`](/js-stellar-sdk/reference/core-transactions/#operationcreatepassiveselloffer) * [`Operation.setOptions`](/js-stellar-sdk/reference/core-transactions/#operationsetoptions) * [`Operation.changeTrust`](/js-stellar-sdk/reference/core-transactions/#operationchangetrust) * [`Operation.allowTrust`](/js-stellar-sdk/reference/core-transactions/#operationallowtrust) * [`Operation.accountMerge`](/js-stellar-sdk/reference/core-transactions/#operationaccountmerge) * [`Operation.inflation`](/js-stellar-sdk/reference/core-transactions/#operationinflation) * [`Operation.manageData`](/js-stellar-sdk/reference/core-transactions/#operationmanagedata) * [`Operation.bumpSequence`](/js-stellar-sdk/reference/core-transactions/#operationbumpsequence) * [`Operation.createClaimableBalance`](/js-stellar-sdk/reference/core-transactions/#operationcreateclaimablebalance) * [`Operation.claimClaimableBalance`](/js-stellar-sdk/reference/core-transactions/#operationclaimclaimablebalance) * [`Operation.beginSponsoringFutureReserves`](/js-stellar-sdk/reference/core-transactions/#operationbeginsponsoringfuturereserves) * [`Operation.endSponsoringFutureReserves`](/js-stellar-sdk/reference/core-transactions/#operationendsponsoringfuturereserves) * [`Operation.revokeAccountSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokeaccountsponsorship) * [`Operation.revokeTrustlineSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevoketrustlinesponsorship) * [`Operation.revokeOfferSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokeoffersponsorship) * [`Operation.revokeDataSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokedatasponsorship) * [`Operation.revokeClaimableBalanceSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokeclaimablebalancesponsorship) * [`Operation.revokeLiquidityPoolSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokeliquiditypoolsponsorship) * [`Operation.revokeSignerSponsorship`](/js-stellar-sdk/reference/core-transactions/#operationrevokesignersponsorship) * [`Operation.clawback`](/js-stellar-sdk/reference/core-transactions/#operationclawback) * [`Operation.clawbackClaimableBalance`](/js-stellar-sdk/reference/core-transactions/#operationclawbackclaimablebalance) * [`Operation.setTrustLineFlags`](/js-stellar-sdk/reference/core-transactions/#operationsettrustlineflags) * [`Operation.liquidityPoolDeposit`](/js-stellar-sdk/reference/core-transactions/#operationliquiditypooldeposit) * [`Operation.liquidityPoolWithdraw`](/js-stellar-sdk/reference/core-transactions/#operationliquiditypoolwithdraw) * [`Operation.invokeHostFunction`](/js-stellar-sdk/reference/core-transactions/#operationinvokehostfunction), which has the following additional "pseudo-operations" that make building host functions easier: - [`Operation.createStellarAssetContract`](/js-stellar-sdk/reference/core-transactions/#operationcreatestellarassetcontract) - [`Operation.invokeContractFunction`](/js-stellar-sdk/reference/core-transactions/#operationinvokecontractfunction) - [`Operation.createCustomContract`](/js-stellar-sdk/reference/core-transactions/#operationcreatecustomcontract) - [`Operation.uploadContractWasm`](/js-stellar-sdk/reference/core-transactions/#operationuploadcontractwasm) * `Operation.extendFootprintTtlOp` * [`Operation.restoreFootprint`](/js-stellar-sdk/reference/core-transactions/#operationrestorefootprint) ```ts class Operation { constructor(); static accountMerge: (opts: AccountMergeOpts) => Operation2; static allowTrust: (opts: AllowTrustOpts) => Operation2; static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation2; static bumpSequence: (opts: BumpSequenceOpts) => Operation2; static changeTrust: (opts: ChangeTrustOpts) => Operation2; static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation2; static clawback: (opts: ClawbackOpts) => Operation2; static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation2; static createAccount: (opts: CreateAccountOpts) => Operation2; static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation2; static createCustomContract: (opts: CreateCustomContractOpts) => Operation2; static createPassiveSellOffer: (opts: CreatePassiveSellOfferOpts) => Operation2; static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation2; static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation2; static extendFootprintTtl: (opts: ExtendFootprintTtlOpts) => Operation2; static inflation: (opts: InflationOpts = {}) => Operation2; static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation2; static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation2; static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation2; static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation2; static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation2; static manageData: (opts: ManageDataOpts) => Operation2; static manageSellOffer: (opts: ManageSellOfferOpts) => Operation2; static pathPaymentStrictReceive: (opts: PathPaymentStrictReceiveOpts) => Operation2; static pathPaymentStrictSend: (opts: PathPaymentStrictSendOpts) => Operation2; static payment: (opts: PaymentOpts) => Operation2; static restoreFootprint: (opts: RestoreFootprintOpts = {}) => Operation2; static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation2; static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation2; static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation2; static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation2; static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation2; static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation2; static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation2; static setOptions: (opts: SetOptionsOpts) => Operation2>; static setTrustLineFlags: (opts: SetTrustLineFlagsOpts) => Operation2; static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation2; static fromXDRObject(operation: Operation2): T; } ``` **Source:** [src/base/operation.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L131) ### `new Operation()` ```ts constructor(); ``` ### `Operation.accountMerge` Transfers native balance to destination account. ```ts static accountMerge: (opts: AccountMergeOpts) => Operation2; ``` **Parameters** - **`opts`** — `AccountMergeOpts` (required) — options object - `destination`: destination to merge the source account into - `source`: operation source account (defaults to transaction source) **Source:** [src/base/operation.ts:436](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L436) ### `Operation.allowTrust` **Deprecated.** since v5.0 An "allow trust" operation authorizes another account to hold your account's credit for a given asset. ```ts static allowTrust: (opts: AllowTrustOpts) => Operation2; ``` **Parameters** - **`opts`** — `AllowTrustOpts` (required) — Options object - `trustor`: The trusting account (the one being authorized) - `assetCode`: The asset code being authorized. - `authorize`: `1` to authorize, `2` to authorize to maintain liabilities, and `0` to deauthorize. - `source`: The source account (defaults to transaction source). **Source:** [src/base/operation.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L437) ### `Operation.beginSponsoringFutureReserves` Create a "begin sponsoring future reserves" operation. ```ts static beginSponsoringFutureReserves: (opts: BeginSponsoringFutureReservesOpts) => Operation2; ``` **Parameters** - **`opts`** — `BeginSponsoringFutureReservesOpts` (required) — Options object - `sponsoredId`: The sponsored account id. - `source`: The source account for the operation. Defaults to the transaction's source account. **Example** ```ts const op = Operation.beginSponsoringFutureReserves({ sponsoredId: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' }); ``` **Source:** [src/base/operation.ts:453](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L453) ### `Operation.bumpSequence` This operation bumps sequence number. ```ts static bumpSequence: (opts: BumpSequenceOpts) => Operation2; ``` **Parameters** - **`opts`** — `BumpSequenceOpts` (required) — Options object - `bumpTo`: Sequence number to bump to. - `source`: The optional source account. **Source:** [src/base/operation.ts:438](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L438) ### `Operation.changeTrust` A "change trust" operation adds, removes, or updates a trust line for a given asset from the source account to another. ```ts static changeTrust: (opts: ChangeTrustOpts) => Operation2; ``` **Parameters** - **`opts`** — `ChangeTrustOpts` (required) — Options object - `asset`: The asset for the trust line. - `limit`: The limit for the asset, defaults to max int64. If the limit is set to "0" it deletes the trustline. - `source`: The source account (defaults to transaction source). **Source:** [src/base/operation.ts:439](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L439) ### `Operation.claimClaimableBalance` Create a new claim claimable balance operation. ```ts static claimClaimableBalance: (opts: ClaimClaimableBalanceOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `ClaimClaimableBalanceOpts` (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** ```ts const op = Operation.claimClaimableBalance({ balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be', }); ``` **Source:** [src/base/operation.ts:442](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L442) ### `Operation.clawback` Creates a clawback operation. ```ts static clawback: (opts: ClawbackOpts) => Operation2; ``` **Parameters** - **`opts`** — `ClawbackOpts` (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** - https://github.com/stellar/stellar-protocol/blob/master/core/cap-0035.md#clawback-operation **Source:** [src/base/operation.ts:463](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L463) ### `Operation.clawbackClaimableBalance` Creates a clawback operation for a claimable balance. ```ts static clawbackClaimableBalance: (opts: ClawbackClaimableBalanceOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `ClawbackClaimableBalanceOpts` (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** ```ts const op = Operation.clawbackClaimableBalance({ balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be', }); ``` **See also** - https://github.com/stellar/stellar-protocol/blob/master/core/cap-0035.md#clawback-claimable-balance-operation **Source:** [src/base/operation.ts:443](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L443) ### `Operation.createAccount` Create and fund a non-existent account. ```ts static createAccount: (opts: CreateAccountOpts) => Operation2; ``` **Parameters** - **`opts`** — `CreateAccountOpts` (required) — Options object - `destination`: Destination account ID to create an account for. - `startingBalance`: Amount in XLM the account should be funded for. Must be greater than the `reserve balance amount`. - `source`: The source account for the payment. Defaults to the transaction's source account. **Source:** [src/base/operation.ts:440](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L440) ### `Operation.createClaimableBalance` Create a new claimable balance operation. ```ts static createClaimableBalance: (opts: CreateClaimableBalanceOpts) => Operation2; ``` **Parameters** - **`opts`** — `CreateClaimableBalanceOpts` (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** ```ts const asset = new Asset( 'USD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' ); const amount = '100.0000000'; const claimants = [ new Claimant( 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', Claimant.predicateBeforeAbsoluteTime("4102444800000") ) ]; const op = Operation.createClaimableBalance({ asset, amount, claimants }); ``` **Source:** [src/base/operation.ts:441](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L441) ### `Operation.createCustomContract` Returns an operation that creates a custom WASM contract and atomically invokes its constructor. ```ts static createCustomContract: (opts: CreateCustomContractOpts) => Operation2; ``` **Parameters** - **`opts`** — `CreateCustomContractOpts` (required) — the set of parameters - `address`: the contract uploader address - `wasmHash`: the SHA-256 hash of the contract WASM you're uploading - `constructorArgs`: the optional parameters to pass to the constructor - `salt`: an optional, 32-byte salt to distinguish deployment instances - `auth`: an optional list outlining the tree of authorizations required for the call - `source`: an optional source account **See also** - https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function **Source:** [src/base/operation.ts:475](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L475) ### `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. ```ts static createPassiveSellOffer: (opts: CreatePassiveSellOfferOpts) => Operation2; ``` **Parameters** - **`opts`** — `CreatePassiveSellOfferOpts` (required) — Options object - `selling`: What you're selling. - `buying`: What you're buying. - `amount`: The total amount you're selling. If 0, deletes the offer. - `price`: Price of 1 unit of `selling` in terms of `buying`. - `price.n`: If `opts.price` is an object: the price numerator - `price.d`: If `opts.price` is an object: the price denominator - `source`: The source account (defaults to transaction source). **Throws** - when the best rational approximation of `price` cannot be found. **Source:** [src/base/operation.ts:444](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L444) ### `Operation.createStellarAssetContract` Returns an operation that wraps a Stellar asset into a token contract. ```ts static createStellarAssetContract: (opts: CreateStellarAssetContractOpts) => Operation2; ``` **Parameters** - **`opts`** — `CreateStellarAssetContractOpts` (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** - - https://stellar.org/protocol/sep-11#alphanum4-alphanum12 - https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions - https://soroban.stellar.org/docs/advanced-tutorials/stellar-asset-contract - Operation.invokeHostFunction **Source:** [src/base/operation.ts:473](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L473) ### `Operation.endSponsoringFutureReserves` Create an "end sponsoring future reserves" operation. ```ts static endSponsoringFutureReserves: (opts: EndSponsoringFutureReservesOpts = {}) => Operation2; ``` **Parameters** - **`opts`** — `EndSponsoringFutureReservesOpts` (optional) (default: `{}`) — Options object - `source`: The source account for the operation. Defaults to the transaction's source account. **Example** ```ts const op = Operation.endSponsoringFutureReserves(); ``` **Source:** [src/base/operation.ts:454](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L454) ### `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`. ```ts static extendFootprintTtl: (opts: ExtendFootprintTtlOpts) => Operation2; ``` **Parameters** - **`opts`** — `ExtendFootprintTtlOpts` (required) — object holding operation parameters - `extendTo`: the minimum TTL that all the entries in the read-only footprint will have - `source`: an optional source account **Source:** [src/base/operation.ts:468](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L468) ### `Operation.inflation` This operation generates the inflation. ```ts static inflation: (opts: InflationOpts = {}) => Operation2; ``` **Parameters** - **`opts`** — `InflationOpts` (optional) (default: `{}`) — Options object - `source`: The optional source account. **Source:** [src/base/operation.ts:445](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L445) ### `Operation.invokeContractFunction` Returns an operation that invokes a contract function. ```ts static invokeContractFunction: (opts: InvokeContractFunctionOpts) => Operation2; ``` **Parameters** - **`opts`** — `InvokeContractFunctionOpts` (required) — the set of parameters - `contract`: a strkey-fied contract address (`C...`) - `function`: the name of the contract fn to invoke - `args`: parameters to pass to the function invocation - `auth`: an optional list outlining the tree of authorizations required for the call - `source`: an optional source account **See also** - - Operation.invokeHostFunction - Contract.call - Address **Source:** [src/base/operation.ts:474](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L474) ### `Operation.invokeHostFunction` Invokes a single smart contract host function. ```ts static invokeHostFunction: (opts: InvokeHostFunctionOpts) => Operation2; ``` **Parameters** - **`opts`** — `InvokeHostFunctionOpts` (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** - - https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function - Operation.invokeContractFunction - Operation.createCustomContract - Operation.createStellarAssetContract - Operation.uploadContractWasm - Contract.call **Source:** [src/base/operation.ts:467](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L467) ### `Operation.liquidityPoolDeposit` Creates a liquidity pool deposit operation. ```ts static liquidityPoolDeposit: (opts: LiquidityPoolDepositOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `LiquidityPoolDepositOpts` (optional) (default: `...`) — Options object - `liquidityPoolId`: The liquidity pool ID. - `maxAmountA`: Maximum amount of first asset to deposit. - `maxAmountB`: Maximum amount of second asset to deposit. - `minPrice`: Minimum depositA/depositB price. - `minPrice.n`: If `opts.minPrice` is an object: the price numerator - `minPrice.d`: If `opts.minPrice` is an object: the price denominator - `maxPrice`: Maximum depositA/depositB price. - `maxPrice.n`: If `opts.maxPrice` is an object: the price numerator - `maxPrice.d`: If `opts.maxPrice` is an object: the price denominator - `source`: The source account for the operation. Defaults to the transaction's source account. **See also** - https://developers.stellar.org/docs/start/list-of-operations/#liquidity-pool-deposit **Source:** [src/base/operation.ts:465](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L465) ### `Operation.liquidityPoolWithdraw` Creates a liquidity pool withdraw operation. ```ts static liquidityPoolWithdraw: (opts: LiquidityPoolWithdrawOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `LiquidityPoolWithdrawOpts` (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** - https://developers.stellar.org/docs/start/list-of-operations/#liquidity-pool-withdraw **Source:** [src/base/operation.ts:466](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L466) ### `Operation.manageBuyOffer` Returns a XDR ManageBuyOfferOp. A "manage buy offer" operation creates, updates, or deletes a buy offer. ```ts static manageBuyOffer: (opts: ManageBuyOfferOpts) => Operation2; ``` **Parameters** - **`opts`** — `ManageBuyOfferOpts` (required) — Options object - `selling`: What you're selling. - `buying`: What you're buying. - `buyAmount`: The total amount you're buying. If 0, deletes the offer. - `price`: Price of 1 unit of `buying` in terms of `selling`. - `price.n`: If `opts.price` is an object: the price numerator - `price.d`: If `opts.price` is an object: the price denominator - `offerId`: If `0`, will create a new offer (default). Otherwise, edits an existing offer. - `source`: The source account (defaults to transaction source). **Throws** - when the best rational approximation of `price` cannot be found. **Source:** [src/base/operation.ts:448](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L448) ### `Operation.manageData` This operation adds data entry to the ledger. ```ts static manageData: (opts: ManageDataOpts) => Operation2; ``` **Parameters** - **`opts`** — `ManageDataOpts` (required) — Options object - `name`: The name of the data entry. - `value`: The value of the data entry. - `source`: The optional source account. **Source:** [src/base/operation.ts:446](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L446) ### `Operation.manageSellOffer` Returns a XDR ManageSellOfferOp. A "manage sell offer" operation creates, updates, or deletes an offer. ```ts static manageSellOffer: (opts: ManageSellOfferOpts) => Operation2; ``` **Parameters** - **`opts`** — `ManageSellOfferOpts` (required) — Options object - `selling`: What you're selling. - `buying`: What you're buying. - `amount`: The total amount you're selling. If 0, deletes the offer. - `price`: Price of 1 unit of `selling` in terms of `buying`. - `price.n`: If `opts.price` is an object: the price numerator - `price.d`: If `opts.price` is an object: the price denominator - `offerId`: If `0`, will create a new offer (default). Otherwise, edits an existing offer. - `source`: The source account (defaults to transaction source). **Throws** - when the best rational approximation of `price` cannot be found. **Source:** [src/base/operation.ts:447](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L447) ### `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. ```ts static pathPaymentStrictReceive: (opts: PathPaymentStrictReceiveOpts) => Operation2; ``` **Parameters** - **`opts`** — `PathPaymentStrictReceiveOpts` (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** - https://developers.stellar.org/docs/start/list-of-operations/#path-payment-strict-receive **Source:** [src/base/operation.ts:449](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L449) ### `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. ```ts static pathPaymentStrictSend: (opts: PathPaymentStrictSendOpts) => Operation2; ``` **Parameters** - **`opts`** — `PathPaymentStrictSendOpts` (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** - https://developers.stellar.org/docs/start/list-of-operations/#path-payment-strict-send **Source:** [src/base/operation.ts:450](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L450) ### `Operation.payment` Create a payment operation. ```ts static payment: (opts: PaymentOpts) => Operation2; ``` **Parameters** - **`opts`** — `PaymentOpts` (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** - https://developers.stellar.org/docs/start/list-of-operations/#payment **Source:** [src/base/operation.ts:451](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L451) ### `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`. ```ts static restoreFootprint: (opts: RestoreFootprintOpts = {}) => Operation2; ``` **Parameters** - **`opts`** — `RestoreFootprintOpts` (optional) (default: `{}`) — an optional set of parameters - `source`: an optional source account **Source:** [src/base/operation.ts:469](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L469) ### `Operation.revokeAccountSponsorship` Create a "revoke sponsorship" operation for an account. ```ts static revokeAccountSponsorship: (opts: RevokeAccountSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeAccountSponsorshipOpts` (optional) (default: `...`) — Options object - `account`: The sponsored account ID. - `source`: The source account for the operation. Defaults to the transaction's source account. **Example** ```ts const op = Operation.revokeAccountSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' }); ``` **Source:** [src/base/operation.ts:455](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L455) ### `Operation.revokeClaimableBalanceSponsorship` Create a "revoke sponsorship" operation for a claimable balance. ```ts static revokeClaimableBalanceSponsorship: (opts: RevokeClaimableBalanceSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeClaimableBalanceSponsorshipOpts` (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** ```ts const op = Operation.revokeClaimableBalanceSponsorship({ balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be', }); ``` **Source:** [src/base/operation.ts:459](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L459) ### `Operation.revokeDataSponsorship` Create a "revoke sponsorship" operation for a data entry. ```ts static revokeDataSponsorship: (opts: RevokeDataSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeDataSponsorshipOpts` (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** ```ts const op = Operation.revokeDataSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7', name: 'foo' }); ``` **Source:** [src/base/operation.ts:458](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L458) ### `Operation.revokeLiquidityPoolSponsorship` Creates a "revoke sponsorship" operation for a liquidity pool. ```ts static revokeLiquidityPoolSponsorship: (opts: RevokeLiquidityPoolSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeLiquidityPoolSponsorshipOpts` (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** ```ts const op = Operation.revokeLiquidityPoolSponsorship({ liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7', }); ``` **Source:** [src/base/operation.ts:461](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L461) ### `Operation.revokeOfferSponsorship` Create a "revoke sponsorship" operation for an offer. ```ts static revokeOfferSponsorship: (opts: RevokeOfferSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeOfferSponsorshipOpts` (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** ```ts const op = Operation.revokeOfferSponsorship({ seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7', offerId: '1234' }); ``` **Source:** [src/base/operation.ts:457](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L457) ### `Operation.revokeSignerSponsorship` Create a "revoke sponsorship" operation for a signer. ```ts static revokeSignerSponsorship: (opts: RevokeSignerSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeSignerSponsorshipOpts` (optional) (default: `...`) — Options object - `account`: The account ID where the signer sponsorship is being removed from. - `signer`: The signer whose sponsorship is being removed. Exactly one of the following must be set: - `signer.ed25519PublicKey`: (optional) The ed25519 public key of the signer. - `signer.sha256Hash`: (optional) sha256 hash (Buffer or hex string). - `signer.preAuthTx`: (optional) Hash (Buffer or hex string) of transaction. - `signer.ed25519SignedPayload`: (optional) Signed payload signer (StrKey P... address). - `source`: The source account for the operation. Defaults to the transaction's source account. **Example** ```ts const op = Operation.revokeSignerSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7', signer: { ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' } }) ``` **Source:** [src/base/operation.ts:462](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L462) ### `Operation.revokeTrustlineSponsorship` Create a "revoke sponsorship" operation for a trustline. ```ts static revokeTrustlineSponsorship: (opts: RevokeTrustlineSponsorshipOpts = ...) => Operation2; ``` **Parameters** - **`opts`** — `RevokeTrustlineSponsorshipOpts` (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** ```ts const op = Operation.revokeTrustlineSponsorship({ account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7', asset: new StellarBase.LiquidityPoolId( 'USDUSD', 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7' ) }); ``` **Source:** [src/base/operation.ts:456](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L456) ### `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: - [`AuthRequiredFlag`](/js-stellar-sdk/reference/core-transactions/#authrequiredflag) - [`AuthRevocableFlag`](/js-stellar-sdk/reference/core-transactions/#authrevocableflag) - [`AuthImmutableFlag`](/js-stellar-sdk/reference/core-transactions/#authimmutableflag) - [`AuthClawbackEnabledFlag`](/js-stellar-sdk/reference/core-transactions/#authclawbackenabledflag) It's possible to set/clear multiple flags at once using logical or. ```ts static setOptions: (opts: SetOptionsOpts) => Operation2>; ``` **Parameters** - **`opts`** — `SetOptionsOpts` (required) — Options object - `inflationDest`: Set this account ID as the account's inflation destination. - `clearFlags`: Bitmap integer for which account flags to clear. - `setFlags`: Bitmap integer for which account flags to set. - `masterWeight`: The master key weight. - `lowThreshold`: The sum weight for the low threshold. - `medThreshold`: The sum weight for the medium threshold. - `highThreshold`: The sum weight for the high threshold. - `signer`: Add or remove a signer from the account. The signer is deleted if the weight is 0. Only one of `ed25519PublicKey`, `sha256Hash`, `preAuthTx` should be defined. - `signer.ed25519PublicKey`: The ed25519 public key of the signer. - `signer.sha256Hash`: sha256 hash (Buffer or hex string) of preimage that will unlock funds. Preimage should be used as signature of future transaction. - `signer.preAuthTx`: Hash (Buffer or hex string) of transaction that will unlock funds. - `signer.ed25519SignedPayload`: Signed payload signer (ed25519 public key + raw payload) for atomic transaction signature disclosure. - `signer.weight`: The weight of the new signer (0 to delete or 1-255) - `homeDomain`: sets the home domain used for reverse federation lookup. - `source`: The source account (defaults to transaction source). **See also** - [Account flags](https://developers.stellar.org/docs/glossary/accounts/#flags) **Source:** [src/base/operation.ts:452](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L452) ### `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). ```ts static setTrustLineFlags: (opts: SetTrustLineFlagsOpts) => Operation2; ``` **Parameters** - **`opts`** — `SetTrustLineFlagsOpts` (required) — Options object - `trustor`: the account whose trustline this is - `asset`: the asset on the trustline - `flags`: the set of flags to modify - `flags.authorized`: authorize account to perform transactions with its credit - `flags.authorizedToMaintainLiabilities`: authorize account to maintain and reduce liabilities for its credit - `flags.clawbackEnabled`: stop claimable balances on this trustlines from having clawbacks enabled (this flag can only be set to false!) - `source`: The source account for the operation. Defaults to the transaction's source account. **See also** - - https://github.com/stellar/stellar-protocol/blob/master/core/cap-0035.md#set-trustline-flags-operation - https://developers.stellar.org/docs/start/list-of-operations/#set-options **Source:** [src/base/operation.ts:464](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L464) ### `Operation.uploadContractWasm` Returns an operation that uploads WASM for a contract. ```ts static uploadContractWasm: (opts: UploadContractWasmOpts) => Operation2; ``` **Parameters** - **`opts`** — `UploadContractWasmOpts` (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** - https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function **Source:** [src/base/operation.ts:476](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L476) ### `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). ```ts static fromXDRObject(operation: Operation2): T; ``` **Parameters** - **`operation`** — `Operation2` (required) — An XDR Operation. **Source:** [src/base/operation.ts:139](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L139) ## ScInt Provides an easier way to manipulate large numbers for Stellar operations. You can instantiate this "**s**mart **c**ontract 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()`. ```ts class ScInt extends XdrLargeInt { constructor(value: string | number | bigint, opts?: { type?: ScIntType; [key: string]: unknown }); static getType(scvType: string): ScIntType | undefined; static isType(type: string): type is ScIntType; int: LargeInt; type: ScIntType; toBigInt(): bigint; toDuration(): ScVal; toI128(): ScVal; toI256(): ScVal; toI64(): ScVal; toJSON(): { type: string; value: string }; toNumber(): number; toScVal(): ScVal; toString(): string; toTimepoint(): ScVal; toU128(): ScVal; toU256(): ScVal; toU64(): ScVal; valueOf(): unknown; } ``` **Example** ```ts import { xdr, ScInt, scValToBigInt } from "@stellar/stellar-base"; // You have an ScVal from a contract and want to parse it into JS native. const value = xdr.ScVal.fromXDR(someXdr, "base64"); const bigi = scValToBigInt(value); // grab it as a BigInt let sci = new ScInt(bigi); sci.toNumber(); // gives native JS type (w/ size check) sci.toBigInt(); // gives the native BigInt value sci.toU64(); // gives ScValType-specific XDR constructs (with size checks) // You have a number and want to shove it into a contract. sci = new ScInt(0xdeadcafebabe); sci.toBigInt() // returns 244838016400062n sci.toNumber() // throws: too large // Pass any to e.g. a Contract.call(), conversion happens automatically // regardless of the initial type. const scValU128 = sci.toU128(); const scValI256 = sci.toI256(); const scValU64 = sci.toU64(); // Lots of ways to initialize: new ScInt("123456789123456789") new ScInt(123456789123456789n); new ScInt(1n << 140n); new ScInt(-42); new ScInt(scValToBigInt(scValU128)); // from above // If you know the type ahead of time (accessing `.raw` is faster than // conversions), you can specify the type directly (otherwise, it's // interpreted from the numbers you pass in): const i = new ScInt(123456789n, { type: "u256" }); // For example, you can use the underlying `sdk.U256` and convert it to an // `xdr.ScVal` directly like so: const scv = new xdr.ScVal.scvU256(i.raw); // Or reinterpret it as a different type (size permitting): const scv = i.toI64(); ``` **Source:** [src/base/numbers/sc_int.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/sc_int.ts#L63) ### `new ScInt(value, opts)` ```ts constructor(value: string | number | bigint, opts?: { type?: ScIntType; [key: string]: unknown }); ``` **Parameters** - **`value`** — `string | number | bigint` (required) — a single, integer-like value which will be interpreted in the smallest appropriate XDR type supported by Stellar (64, 128, or 256 bit integer values). signed values are supported, though they are sanity-checked against `opts.type`. if you need 32-bit values, you can construct them directly without needing this wrapper, e.g. `xdr.ScVal.scvU32(1234)`. - **`opts`** — `{ type?: ScIntType; [key: string]: unknown }` (optional) — an optional object controlling optional parameters - `type`: specify a type ('i64', 'u64', 'i128', 'u128', 'i256', or 'u256') to override the default type selection. If not specified, the smallest type that fits the value is used. **Source:** [src/base/numbers/sc_int.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/sc_int.ts#L76) ### `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') ```ts static getType(scvType: string): ScIntType | undefined; ``` **Parameters** - **`scvType`** — `string` (required) — the `xdr.ScValType` as a string **Returns** the corresponding `ScIntType` if it's an integer type, or `undefined` if it's not an integer type **Source:** [src/base/numbers/xdr_large_int.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L322) ### `ScInt.isType(type)` Returns true if the given string is a valid XDR large integer type name. ```ts static isType(type: string): type is ScIntType; ``` **Parameters** - **`type`** — `string` (required) **Source:** [src/base/numbers/xdr_large_int.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L298) ### `scInt.int` ```ts int: LargeInt; ``` **Source:** [src/base/numbers/xdr_large_int.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L36) ### `scInt.type` ```ts type: ScIntType; ``` **Source:** [src/base/numbers/xdr_large_int.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L37) ### `scInt.toBigInt()` Converts to a native BigInt. ```ts toBigInt(): bigint; ``` **Source:** [src/base/numbers/xdr_large_int.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L116) ### `scInt.toDuration()` The integer encoded with `ScValType = Duration` ```ts toDuration(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:152](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L152) ### `scInt.toI128()` The integer encoded with `ScValType = I128`. ```ts toI128(): ScVal; ``` **Throws** - if the value cannot fit in 128 bits **Source:** [src/base/numbers/xdr_large_int.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L164) ### `scInt.toI256()` The integer encoded with `ScValType = I256` ```ts toI256(): ScVal; ``` **Throws** - if the value cannot fit in a signed 256-bit integer **Source:** [src/base/numbers/xdr_large_int.ts:204](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L204) ### `scInt.toI64()` The integer encoded with `ScValType = I64`. ```ts toI64(): ScVal; ``` **Throws** - if the value cannot fit in 64 bits **Source:** [src/base/numbers/xdr_large_int.ts:125](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L125) ### `scInt.toJSON()` Returns a JSON-friendly representation with `value` and `type` fields. ```ts toJSON(): { type: string; value: string }; ``` **Source:** [src/base/numbers/xdr_large_int.ts:284](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L284) ### `scInt.toNumber()` Converts to a native JS number. ```ts toNumber(): number; ``` **Throws** - if the value can't fit into a Number **Source:** [src/base/numbers/xdr_large_int.ts:103](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L103) ### `scInt.toScVal()` The smallest interpretation of the stored value ```ts toScVal(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:247](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L247) ### `scInt.toString()` Returns the string representation of this integer. ```ts toString(): string; ``` **Source:** [src/base/numbers/xdr_large_int.ts:279](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L279) ### `scInt.toTimepoint()` The integer encoded with `ScValType = Timepoint` ```ts toTimepoint(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:144](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L144) ### `scInt.toU128()` The integer encoded with `ScValType = U128`. ```ts toU128(): ScVal; ``` **Throws** - if the value cannot fit in 128 bits **Source:** [src/base/numbers/xdr_large_int.ts:187](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L187) ### `scInt.toU256()` The integer encoded with `ScValType = U256` Note: No size check needed - U256 is the largest unsigned type. ```ts toU256(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:229](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L229) ### `scInt.toU64()` The integer encoded with `ScValType = U64` ```ts toU64(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:136](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L136) ### `scInt.valueOf()` Returns the primitive value of this integer. ```ts valueOf(): unknown; ``` **Source:** [src/base/numbers/xdr_large_int.ts:274](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L274) ## TimeoutInfinite ```ts const TimeoutInfinite: 0 ``` **See also** - - `TransactionBuilder.setTimeout` - [Timeout](https://developers.stellar.org/api/resources/transactions/post/) **Source:** [src/base/transaction_builder.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L45) ## Transaction Use `TransactionBuilder` to build a transaction object. If you have an object or base64-encoded string of the transaction envelope XDR, use `TransactionBuilder.fromXDR`. Once a Transaction has been created, its attributes and operations should not be changed. You should only add signatures (using `Transaction.sign`) to a Transaction object before submitting to the network or forwarding on to additional signers. ```ts class Transaction { constructor(envelope: string | TransactionEnvelope, networkPassphrase: string); extraSigners: SignerKey[] | undefined; fee: string; ledgerBounds: { maxLedger: number; minLedger: number } | undefined; memo: Memo; minAccountSequence: string | undefined; minAccountSequenceAge: bigint | undefined; minAccountSequenceLedgerGap: number | undefined; networkPassphrase: string; operations: OperationRecord[]; sequence: string; signatures: DecoratedSignature[]; source: string; timeBounds: { maxTime: string; minTime: string } | undefined; tx: TTx; addDecoratedSignature(signature: DecoratedSignature): void; addSignature(publicKey: string = "", signature: string = ""): void; getClaimableBalanceId(opIndex: number): string; getKeypairSignature(keypair: Keypair): string; hash(): Buffer; sign(...keypairs: Keypair[]): void; signatureBase(): Buffer; signHashX(preimage: string | Buffer): void; toEnvelope(): TransactionEnvelope; toXDR(): string; } ``` **Source:** [src/base/transaction.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L25) ### `new Transaction(envelope, networkPassphrase)` ```ts constructor(envelope: string | TransactionEnvelope, networkPassphrase: string); ``` **Parameters** - **`envelope`** — `string | TransactionEnvelope` (required) — transaction envelope object or base64 encoded string - **`networkPassphrase`** — `string` (required) — passphrase of the target stellar network (e.g. "Public Global Stellar Network ; September 2015") **Source:** [src/base/transaction.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L45) ### `transaction.extraSigners` Array of extra signers as XDR objects; use `SignerKey.encodeSignerKey` to convert to StrKey strings. ```ts extraSigners: SignerKey[] | undefined; ``` **Source:** [src/base/transaction.ts:199](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L199) ### `transaction.fee` The total fee for this transaction, in stroops. ```ts fee: string; ``` **Source:** [src/base/transaction_base.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L76) ### `transaction.ledgerBounds` The ledger bounds for this transaction, with `minLedger` (uint32) and `maxLedger` (uint32, or 0 for no upper bound). ```ts ledgerBounds: { maxLedger: number; minLedger: number } | undefined; ``` **Source:** [src/base/transaction.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L164) ### `transaction.memo` The memo attached to this transaction. ```ts memo: Memo; ``` **Source:** [src/base/transaction.ts:231](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L231) ### `transaction.minAccountSequence` The minimum account sequence (64-bit, as a string). ```ts minAccountSequence: string | undefined; ``` **Source:** [src/base/transaction.ts:172](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L172) ### `transaction.minAccountSequenceAge` The minimum account sequence age (64-bit number of seconds). ```ts minAccountSequenceAge: bigint | undefined; ``` **Source:** [src/base/transaction.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L180) ### `transaction.minAccountSequenceLedgerGap` The minimum account sequence ledger gap (32-bit number of ledgers). ```ts minAccountSequenceLedgerGap: number | undefined; ``` **Source:** [src/base/transaction.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L188) ### `transaction.networkPassphrase` The network passphrase for this transaction. ```ts networkPassphrase: string; ``` **Source:** [src/base/transaction_base.ts:85](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L85) ### `transaction.operations` The list of operations in this transaction. ```ts operations: OperationRecord[]; ``` **Source:** [src/base/transaction.ts:223](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L223) ### `transaction.sequence` The sequence number for this transaction. ```ts sequence: string; ``` **Source:** [src/base/transaction.ts:207](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L207) ### `transaction.signatures` The list of signatures for this transaction. ```ts signatures: DecoratedSignature[]; ``` **Source:** [src/base/transaction_base.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L35) ### `transaction.source` The source account for this transaction. ```ts source: string; ``` **Source:** [src/base/transaction.ts:215](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L215) ### `transaction.timeBounds` The time bounds for this transaction, with `minTime` and `maxTime` as 64-bit unix timestamps (strings). ```ts timeBounds: { maxTime: string; minTime: string } | undefined; ``` **Source:** [src/base/transaction.ts:153](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L153) ### `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. ```ts tx: TTx; ``` **Throws** - if the internal transaction is not a recognized XDR type **Source:** [src/base/transaction_base.ts:51](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L51) ### `transaction.addDecoratedSignature(signature)` Add a decorated signature directly to the transaction envelope. ```ts addDecoratedSignature(signature: DecoratedSignature): void; ``` **Parameters** - **`signature`** — `DecoratedSignature` (required) — raw signature to add **See also** - - Keypair.signDecorated - Keypair.signPayloadDecorated **Source:** [src/base/transaction_base.ts:196](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L196) ### `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`](/js-stellar-sdk/reference/core-transactions/#transactiongetkeypairsignaturekeypair) to sign the transaction. - They should send you back their `publicKey` and the `signature` string from [`getKeypairSignature`](/js-stellar-sdk/reference/core-transactions/#transactiongetkeypairsignaturekeypair), both of which you pass to this function. ```ts addSignature(publicKey: string = "", signature: string = ""): void; ``` **Parameters** - **`publicKey`** — `string` (optional) (default: `""`) — the public key of the signer - **`signature`** — `string` (optional) (default: `""`) — the base64 value of the signature XDR **Source:** [src/base/transaction_base.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L156) ### `transaction.getClaimableBalanceId(opIndex)` Calculate the claimable balance ID for an operation within the transaction. ```ts getClaimableBalanceId(opIndex: number): string; ``` **Parameters** - **`opIndex`** — `number` (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** - https://github.com/stellar/go/blob/d712346e61e288d450b0c08038c158f8848cc3e4/txnbuild/transaction.go#L392-L435 **Source:** [src/base/transaction.ts:321](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L321) ### `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`](/js-stellar-sdk/reference/core-transactions/#transactionaddsignaturepublickey-signature) 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: ```javascript // `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. ```ts getKeypairSignature(keypair: Keypair): string; ``` **Parameters** - **`keypair`** — `Keypair` (required) — Keypair of signer **Source:** [src/base/transaction_base.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L129) ### `transaction.hash()` Returns a hash for this transaction, suitable for signing. ```ts hash(): Buffer; ``` **Source:** [src/base/transaction_base.ts:222](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L222) ### `transaction.sign(keypairs)` Signs the transaction with the given `Keypair`. ```ts sign(...keypairs: Keypair[]): void; ``` **Parameters** - **`...keypairs`** — `Keypair[]` (required) — Keypairs of signers **Source:** [src/base/transaction_base.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L97) ### `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. ```ts signatureBase(): Buffer; ``` **Source:** [src/base/transaction.ts:246](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L246) ### `transaction.signHashX(preimage)` Add `hashX` signer preimage as signature. ```ts signHashX(preimage: string | Buffer): void; ``` **Parameters** - **`preimage`** — `string | Buffer` (required) — preimage of hash used as signer **Source:** [src/base/transaction_base.ts:204](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L204) ### `transaction.toEnvelope()` To envelope returns a xdr.TransactionEnvelope which can be submitted to the network. ```ts toEnvelope(): TransactionEnvelope; ``` **Source:** [src/base/transaction.ts:279](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction.ts#L279) ### `transaction.toXDR()` Returns the transaction envelope as a base64-encoded XDR string. ```ts toXDR(): string; ``` **Source:** [src/base/transaction_base.ts:239](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_base.ts#L239) ## TransactionBuilder

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

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

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

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

``` var transaction = new TransactionBuilder(source, { fee, networkPassphrase: Networks.TESTNET }) .addOperation(Operation.createAccount({ destination: destinationA, startingBalance: "20" })) // <- funds and creates destinationA .addOperation(Operation.payment({ destination: destinationB, amount: "100", asset: Asset.native() })) // <- sends 100 XLM to destinationB .setTimeout(30) .build(); transaction.sign(sourceKeypair); ``` ```ts 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 = {}): TransactionBuilder; static fromXDR(envelope: string | TransactionEnvelope, networkPassphrase: string): Transaction | FeeBumpTransaction; baseFee: string; extraSigners: string[] | null; ledgerbounds: { maxLedger?: number; minLedger?: number } | null; memo: Memo; minAccountSequence: string | null; minAccountSequenceAge: bigint | null; minAccountSequenceLedgerGap: number | null; networkPassphrase: string | null; operations: Operation2[]; sorobanData: SorobanTransactionData | null; source: TransactionSource; timebounds: { maxTime?: string | number | Date; minTime?: string | number | Date } | null; addMemo(memo: Memo): TransactionBuilder; addOperation(operation: Operation2): TransactionBuilder; addOperationAt(operation: Operation2, index: number): TransactionBuilder; addSacTransferOperation(destination: string, asset: Asset, amount: string | bigint, sorobanFees?: SorobanFees): TransactionBuilder; build(): Transaction; clearOperationAt(index: number): TransactionBuilder; clearOperations(): TransactionBuilder; hasV2Preconditions(): boolean; setExtraSigners(extraSigners: string[]): TransactionBuilder; setLedgerbounds(minLedger: number, maxLedger: number): TransactionBuilder; setMinAccountSequence(minAccountSequence: string): TransactionBuilder; setMinAccountSequenceAge(durationInSeconds: bigint): TransactionBuilder; setMinAccountSequenceLedgerGap(gap: number): TransactionBuilder; setNetworkPassphrase(networkPassphrase: string): TransactionBuilder; setSorobanData(sorobanData: string | SorobanTransactionData): TransactionBuilder; setTimebounds(minEpochOrDate: number | Date, maxEpochOrDate: number | Date): TransactionBuilder; setTimeout(timeoutSeconds: number): TransactionBuilder; } ``` **Source:** [src/base/transaction_builder.ts:153](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L153) ### `new TransactionBuilder(sourceAccount, opts)` ```ts constructor(sourceAccount: TransactionSource, opts: TransactionBuilderOptions = ...); ``` **Parameters** - **`sourceAccount`** — `TransactionSource` (required) — source account for this transaction - **`opts`** — `TransactionBuilderOptions` (optional) (default: `...`) — options object (see `TransactionBuilderOptions`) **Source:** [src/base/transaction_builder.ts:174](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L174) ### `TransactionBuilder.buildFeeBumpTransaction(feeSource, baseFee, innerTx, networkPassphrase)` Builds a `FeeBumpTransaction`, enabling you to resubmit an existing transaction with a higher fee. ```ts static buildFeeBumpTransaction(feeSource: string | Keypair, baseFee: string, innerTx: Transaction, networkPassphrase: string): FeeBumpTransaction; ``` **Parameters** - **`feeSource`** — `string | 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`) - **`baseFee`** — `string` (required) — max fee willing to pay per operation in inner transaction (**in stroops**) - **`innerTx`** — `Transaction` (required) — `Transaction` to be bumped by the fee bump transaction - **`networkPassphrase`** — `string` (required) — passphrase of the target Stellar network (e.g. "Public Global Stellar Network ; September 2015", see `Networks`) TODO: Alongside the next major version bump, this type signature can be changed to be less awkward: accept a MuxedAccount as the `feeSource` rather than a keypair or string. Your fee-bump amount should be `>= 10x` the original fee. **See also** - https://developers.stellar.org/docs/glossary/fee-bumps/#replace-by-fee **Source:** [src/base/transaction_builder.ts:1092](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L1092) ### `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). ```ts static cloneFrom(tx: Transaction, opts: Partial = {}): TransactionBuilder; ``` **Parameters** - **`tx`** — `Transaction` (required) — a "template" transaction to clone exactly - **`opts`** — `Partial` (optional) (default: `{}`) — additional options to override the clone, e.g. `{fee: '1000'}` will override the existing base fee derived from `tx` (see the `TransactionBuilder` constructor for detailed options) **Warning:** This does not clone the transaction's `xdr.SorobanTransactionData` (if applicable), use `SorobanDataBuilder` and `TransactionBuilder.setSorobanData` as needed, instead. TODO: This cannot clone `FeeBumpTransaction`s, yet. **Source:** [src/base/transaction_builder.ts:281](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L281) ### `TransactionBuilder.fromXDR(envelope, networkPassphrase)` Build a `Transaction` or `FeeBumpTransaction` from an xdr.TransactionEnvelope. ```ts static fromXDR(envelope: string | TransactionEnvelope, networkPassphrase: string): Transaction | FeeBumpTransaction; ``` **Parameters** - **`envelope`** — `string | TransactionEnvelope` (required) — The transaction envelope object or base64 encoded string. - **`networkPassphrase`** — `string` (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:1203](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L1203) ### `transactionBuilder.baseFee` ```ts baseFee: string; ``` **Source:** [src/base/transaction_builder.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L156) ### `transactionBuilder.extraSigners` ```ts extraSigners: string[] | null; ``` **Source:** [src/base/transaction_builder.ts:165](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L165) ### `transactionBuilder.ledgerbounds` ```ts ledgerbounds: { maxLedger?: number; minLedger?: number } | null; ``` **Source:** [src/base/transaction_builder.ts:161](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L161) ### `transactionBuilder.memo` ```ts memo: Memo; ``` **Source:** [src/base/transaction_builder.ts:166](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L166) ### `transactionBuilder.minAccountSequence` ```ts minAccountSequence: string | null; ``` **Source:** [src/base/transaction_builder.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L162) ### `transactionBuilder.minAccountSequenceAge` ```ts minAccountSequenceAge: bigint | null; ``` **Source:** [src/base/transaction_builder.ts:163](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L163) ### `transactionBuilder.minAccountSequenceLedgerGap` ```ts minAccountSequenceLedgerGap: number | null; ``` **Source:** [src/base/transaction_builder.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L164) ### `transactionBuilder.networkPassphrase` ```ts networkPassphrase: string | null; ``` **Source:** [src/base/transaction_builder.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L167) ### `transactionBuilder.operations` ```ts operations: Operation2[]; ``` **Source:** [src/base/transaction_builder.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L155) ### `transactionBuilder.sorobanData` ```ts sorobanData: SorobanTransactionData | null; ``` **Source:** [src/base/transaction_builder.ts:168](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L168) ### `transactionBuilder.source` ```ts source: TransactionSource; ``` **Source:** [src/base/transaction_builder.ts:154](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L154) ### `transactionBuilder.timebounds` ```ts timebounds: { maxTime?: string | number | Date; minTime?: string | number | Date } | null; ``` **Source:** [src/base/transaction_builder.ts:157](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L157) ### `transactionBuilder.addMemo(memo)` Adds a memo to the transaction. ```ts addMemo(memo: Memo): TransactionBuilder; ``` **Parameters** - **`memo`** — `Memo` (required) — `Memo` object **Source:** [src/base/transaction_builder.ts:394](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L394) ### `transactionBuilder.addOperation(operation)` Adds an operation to the transaction. ```ts addOperation(operation: Operation2): TransactionBuilder; ``` **Parameters** - **`operation`** — `Operation2` (required) — The xdr operation object, use `Operation` static methods. **Source:** [src/base/transaction_builder.ts:356](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L356) ### `transactionBuilder.addOperationAt(operation, index)` Adds an operation to the transaction at a specific index. ```ts addOperationAt(operation: Operation2, index: number): TransactionBuilder; ``` **Parameters** - **`operation`** — `Operation2` (required) — The xdr operation object to add, use `Operation` static methods. - **`index`** — `number` (required) — The index at which to insert the operation. **Source:** [src/base/transaction_builder.ts:367](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L367) ### `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. ```ts addSacTransferOperation(destination: string, asset: Asset, amount: string | bigint, sorobanFees?: SorobanFees): TransactionBuilder; ``` **Parameters** - **`destination`** — `string` (required) — the address of the recipient of the SAC transfer (should be a valid Stellar address or contract ID) - **`asset`** — `Asset` (required) — the SAC asset to be transferred - **`amount`** — `string | 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" - **`sorobanFees`** — `SorobanFees` (optional) — optional Soroban fees for the transaction to override the default fees used **Source:** [src/base/transaction_builder.ts:701](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L701) ### `transactionBuilder.build()` Builds the transaction and increments the source account's sequence number by 1. ```ts build(): Transaction; ``` **Source:** [src/base/transaction_builder.ts:921](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L921) ### `transactionBuilder.clearOperationAt(index)` Removes the operation at the specified index from the transaction. ```ts clearOperationAt(index: number): TransactionBuilder; ``` **Parameters** - **`index`** — `number` (required) — The index of the operation to remove. **Source:** [src/base/transaction_builder.ts:385](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L385) ### `transactionBuilder.clearOperations()` Removes the operations from the builder (useful when cloning). ```ts clearOperations(): TransactionBuilder; ``` **Source:** [src/base/transaction_builder.ts:375](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L375) ### `transactionBuilder.hasV2Preconditions()` Checks whether any v2 preconditions have been set on this builder. ```ts hasV2Preconditions(): boolean; ``` **Source:** [src/base/transaction_builder.ts:1060](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L1060) ### `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. ```ts setExtraSigners(extraSigners: string[]): TransactionBuilder; ``` **Parameters** - **`extraSigners`** — `string[]` (required) — required extra signers (as `StrKey`s) **Source:** [src/base/transaction_builder.ts:636](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L636) ### `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. ```ts setLedgerbounds(minLedger: number, maxLedger: number): TransactionBuilder; ``` **Parameters** - **`minLedger`** — `number` (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. - **`maxLedger`** — `number` (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:524](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L524) ### `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. ```ts setMinAccountSequence(minAccountSequence: string): TransactionBuilder; ``` **Parameters** - **`minAccountSequence`** — `string` (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:561](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L561) ### `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. ```ts setMinAccountSequenceAge(durationInSeconds: bigint): TransactionBuilder; ``` **Parameters** - **`durationInSeconds`** — `bigint` (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:583](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L583) ### `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. ```ts setMinAccountSequenceLedgerGap(gap: number): TransactionBuilder; ``` **Parameters** - **`gap`** — `number` (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:612](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L612) ### `transactionBuilder.setNetworkPassphrase(networkPassphrase)` Set network passphrase for the Transaction that will be built. ```ts setNetworkPassphrase(networkPassphrase: string): TransactionBuilder; ``` **Parameters** - **`networkPassphrase`** — `string` (required) — passphrase of the target Stellar network (e.g. "Public Global Stellar Network ; September 2015"). **Source:** [src/base/transaction_builder.ts:662](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L662) ### `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. ```ts setSorobanData(sorobanData: string | SorobanTransactionData): TransactionBuilder; ``` **Parameters** - **`sorobanData`** — `string | SorobanTransactionData` (required) — the `xdr.SorobanTransactionData` as a raw xdr object or a base64 string to be decoded **See also** - `SorobanDataBuilder` **Source:** [src/base/transaction_builder.ts:684](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L684) ### `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. ```ts setTimebounds(minEpochOrDate: number | Date, maxEpochOrDate: number | Date): TransactionBuilder; ``` **Parameters** - **`minEpochOrDate`** — `number | 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. - **`maxEpochOrDate`** — `number | 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:475](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L475) ### `transactionBuilder.setTimeout(timeoutSeconds)` Sets a timeout precondition on the transaction. Because of the distributed nature of the Stellar network it is possible that the status of your transaction will be determined after a long time if the network is highly congested. If you want to be sure to receive the status of the transaction within a given period you should set the time bounds with `maxTime` on the transaction (this is what `setTimeout` does internally; if there's `minTime` set but no `maxTime` it will be added). A call to `TransactionBuilder.setTimeout` is **required** if Transaction does not have `max_time` set. If you don't want to set timeout, use `TimeoutInfinite`. In general you should set `TimeoutInfinite` only in smart contracts. Please note that Horizon may still return 504 Gateway Timeout error, even for short timeouts. In such case you need to resubmit the same transaction again without making any changes to receive a status. This method is using the machine system time (UTC), make sure it is set correctly. ```ts setTimeout(timeoutSeconds: number): TransactionBuilder; ``` **Parameters** - **`timeoutSeconds`** — `number` (required) — Number of seconds the transaction is good. Can't be negative. If the value is `TimeoutInfinite`, the transaction is good indefinitely. **See also** - - `TimeoutInfinite` - https://developers.stellar.org/docs/tutorials/handling-errors/ **Source:** [src/base/transaction_builder.ts:428](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L428) ## Uint128 ```ts class Uint128 extends LargeInt { constructor(...args: (string | number | bigint)[]); static MAX_VALUE: LargeInt; static MIN_VALUE: LargeInt; static defineIntBoundaries(): void; static fromString(value: string): LargeInt; static isValid(value: unknown): boolean; readonly size: number; readonly unsigned: boolean; slice(chunkSize: number): bigint[]; toBigInt(): bigint; toString(): string; } ``` **Source:** [src/base/numbers/uint128.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint128.ts#L3) ### `new Uint128(args)` Construct an unsigned 128-bit integer that can be XDR-encoded. ```ts constructor(...args: (string | number | bigint)[]); ``` **Parameters** - **`...args`** — `(string | number | bigint)[]` (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits) **Source:** [src/base/numbers/uint128.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint128.ts#L10) ### `Uint128.MAX_VALUE` ```ts static MAX_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L14) ### `Uint128.MIN_VALUE` ```ts static MIN_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L13) ### `Uint128.defineIntBoundaries()` ```ts static defineIntBoundaries(): void; ``` **Source:** [types/stellar__js-xdr/index.d.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L12) ### `Uint128.fromString(value)` ```ts static fromString(value: string): LargeInt; ``` **Parameters** - **`value`** — `string` (required) **Source:** [types/stellar__js-xdr/index.d.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L16) ### `Uint128.isValid(value)` ```ts static isValid(value: unknown): boolean; ``` **Parameters** - **`value`** — `unknown` (required) **Source:** [types/stellar__js-xdr/index.d.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L15) ### `uint128.size` ```ts readonly size: number; ``` **Source:** [src/base/numbers/uint128.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint128.ts#L18) ### `uint128.unsigned` ```ts readonly unsigned: boolean; ``` **Source:** [src/base/numbers/uint128.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint128.ts#L14) ### `uint128.slice(chunkSize)` ```ts slice(chunkSize: number): bigint[]; ``` **Parameters** - **`chunkSize`** — `number` (required) **Source:** [types/stellar__js-xdr/index.d.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L21) ### `uint128.toBigInt()` ```ts toBigInt(): bigint; ``` **Source:** [types/stellar__js-xdr/index.d.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L19) ### `uint128.toString()` ```ts toString(): string; ``` **Source:** [types/stellar__js-xdr/index.d.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L20) ## Uint256 ```ts class Uint256 extends LargeInt { constructor(...args: (string | number | bigint)[]); static MAX_VALUE: LargeInt; static MIN_VALUE: LargeInt; static defineIntBoundaries(): void; static fromString(value: string): LargeInt; static isValid(value: unknown): boolean; readonly size: number; readonly unsigned: boolean; slice(chunkSize: number): bigint[]; toBigInt(): bigint; toString(): string; } ``` **Source:** [src/base/numbers/uint256.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint256.ts#L3) ### `new Uint256(args)` Construct an unsigned 256-bit integer that can be XDR-encoded. ```ts constructor(...args: (string | number | bigint)[]); ``` **Parameters** - **`...args`** — `(string | number | bigint)[]` (required) — one or more slices to encode in big-endian format (i.e. earlier elements are higher bits) **Source:** [src/base/numbers/uint256.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint256.ts#L10) ### `Uint256.MAX_VALUE` ```ts static MAX_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L14) ### `Uint256.MIN_VALUE` ```ts static MIN_VALUE: LargeInt; ``` **Source:** [types/stellar__js-xdr/index.d.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L13) ### `Uint256.defineIntBoundaries()` ```ts static defineIntBoundaries(): void; ``` **Source:** [types/stellar__js-xdr/index.d.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L12) ### `Uint256.fromString(value)` ```ts static fromString(value: string): LargeInt; ``` **Parameters** - **`value`** — `string` (required) **Source:** [types/stellar__js-xdr/index.d.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L16) ### `Uint256.isValid(value)` ```ts static isValid(value: unknown): boolean; ``` **Parameters** - **`value`** — `unknown` (required) **Source:** [types/stellar__js-xdr/index.d.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L15) ### `uint256.size` ```ts readonly size: number; ``` **Source:** [src/base/numbers/uint256.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint256.ts#L18) ### `uint256.unsigned` ```ts readonly unsigned: boolean; ``` **Source:** [src/base/numbers/uint256.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/uint256.ts#L14) ### `uint256.slice(chunkSize)` ```ts slice(chunkSize: number): bigint[]; ``` **Parameters** - **`chunkSize`** — `number` (required) **Source:** [types/stellar__js-xdr/index.d.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L21) ### `uint256.toBigInt()` ```ts toBigInt(): bigint; ``` **Source:** [types/stellar__js-xdr/index.d.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L19) ### `uint256.toString()` ```ts toString(): string; ``` **Source:** [types/stellar__js-xdr/index.d.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/types/stellar__js-xdr/index.d.ts#L20) ## 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. ```ts class XdrLargeInt { constructor(type: ScIntType, values: XdrLargeIntValues); static getType(scvType: string): ScIntType | undefined; static isType(type: string): type is ScIntType; int: LargeInt; type: ScIntType; toBigInt(): bigint; toDuration(): ScVal; toI128(): ScVal; toI256(): ScVal; toI64(): ScVal; toJSON(): { type: string; value: string }; toNumber(): number; toScVal(): ScVal; toString(): string; toTimepoint(): ScVal; toU128(): ScVal; toU256(): ScVal; toU64(): ScVal; valueOf(): unknown; } ``` **Source:** [src/base/numbers/xdr_large_int.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L35) ### `new XdrLargeInt(type, values)` ```ts constructor(type: ScIntType, values: XdrLargeIntValues); ``` **Parameters** - **`type`** — `ScIntType` (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`) - **`values`** — `XdrLargeIntValues` (required) — a list of integer-like values interpreted in big-endian order **Source:** [src/base/numbers/xdr_large_int.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L45) ### `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') ```ts static getType(scvType: string): ScIntType | undefined; ``` **Parameters** - **`scvType`** — `string` (required) — the `xdr.ScValType` as a string **Returns** the corresponding `ScIntType` if it's an integer type, or `undefined` if it's not an integer type **Source:** [src/base/numbers/xdr_large_int.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L322) ### `XdrLargeInt.isType(type)` Returns true if the given string is a valid XDR large integer type name. ```ts static isType(type: string): type is ScIntType; ``` **Parameters** - **`type`** — `string` (required) **Source:** [src/base/numbers/xdr_large_int.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L298) ### `xdrLargeInt.int` ```ts int: LargeInt; ``` **Source:** [src/base/numbers/xdr_large_int.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L36) ### `xdrLargeInt.type` ```ts type: ScIntType; ``` **Source:** [src/base/numbers/xdr_large_int.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L37) ### `xdrLargeInt.toBigInt()` Converts to a native BigInt. ```ts toBigInt(): bigint; ``` **Source:** [src/base/numbers/xdr_large_int.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L116) ### `xdrLargeInt.toDuration()` The integer encoded with `ScValType = Duration` ```ts toDuration(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:152](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L152) ### `xdrLargeInt.toI128()` The integer encoded with `ScValType = I128`. ```ts toI128(): ScVal; ``` **Throws** - if the value cannot fit in 128 bits **Source:** [src/base/numbers/xdr_large_int.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L164) ### `xdrLargeInt.toI256()` The integer encoded with `ScValType = I256` ```ts toI256(): ScVal; ``` **Throws** - if the value cannot fit in a signed 256-bit integer **Source:** [src/base/numbers/xdr_large_int.ts:204](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L204) ### `xdrLargeInt.toI64()` The integer encoded with `ScValType = I64`. ```ts toI64(): ScVal; ``` **Throws** - if the value cannot fit in 64 bits **Source:** [src/base/numbers/xdr_large_int.ts:125](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L125) ### `xdrLargeInt.toJSON()` Returns a JSON-friendly representation with `value` and `type` fields. ```ts toJSON(): { type: string; value: string }; ``` **Source:** [src/base/numbers/xdr_large_int.ts:284](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L284) ### `xdrLargeInt.toNumber()` Converts to a native JS number. ```ts toNumber(): number; ``` **Throws** - if the value can't fit into a Number **Source:** [src/base/numbers/xdr_large_int.ts:103](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L103) ### `xdrLargeInt.toScVal()` The smallest interpretation of the stored value ```ts toScVal(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:247](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L247) ### `xdrLargeInt.toString()` Returns the string representation of this integer. ```ts toString(): string; ``` **Source:** [src/base/numbers/xdr_large_int.ts:279](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L279) ### `xdrLargeInt.toTimepoint()` The integer encoded with `ScValType = Timepoint` ```ts toTimepoint(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:144](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L144) ### `xdrLargeInt.toU128()` The integer encoded with `ScValType = U128`. ```ts toU128(): ScVal; ``` **Throws** - if the value cannot fit in 128 bits **Source:** [src/base/numbers/xdr_large_int.ts:187](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L187) ### `xdrLargeInt.toU256()` The integer encoded with `ScValType = U256` Note: No size check needed - U256 is the largest unsigned type. ```ts toU256(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:229](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L229) ### `xdrLargeInt.toU64()` The integer encoded with `ScValType = U64` ```ts toU64(): ScVal; ``` **Source:** [src/base/numbers/xdr_large_int.ts:136](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L136) ### `xdrLargeInt.valueOf()` Returns the primitive value of this integer. ```ts valueOf(): unknown; ``` **Source:** [src/base/numbers/xdr_large_int.ts:274](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L274) ## cereal ```ts const cereal: { XdrReader: typeof XdrReader; XdrWriter: typeof XdrWriter } ``` **Source:** [src/base/jsxdr.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/jsxdr.ts#L7) ## 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. ```ts decodeAddressToMuxedAccount(address: string): MuxedAccount ``` **Parameters** - **`address`** — `string` (required) — G... or M... address to encode into XDR **Source:** [src/base/util/decode_encode_muxed_account.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/util/decode_encode_muxed_account.ts#L13) ## encodeMuxedAccount Transform a Stellar address (G...) and an ID into its XDR representation. ```ts encodeMuxedAccount(address: string, id: string): MuxedAccount ``` **Parameters** - **`address`** — `string` (required) — a Stellar G... address - **`id`** — `string` (required) — a Uint64 ID represented as a string **Source:** [src/base/util/decode_encode_muxed_account.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/util/decode_encode_muxed_account.ts#L52) ## 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. ```ts encodeMuxedAccountToAddress(muxedAccount: MuxedAccount): string ``` **Parameters** - **`muxedAccount`** — `MuxedAccount` (required) — raw account to stringify **See also** - https://stellar.org/protocol/sep-23 **Source:** [src/base/util/decode_encode_muxed_account.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/util/decode_encode_muxed_account.ts#L33) ## extractBaseAddress Extracts the underlying base (G...) address from an M-address. ```ts extractBaseAddress(address: string): string ``` **Parameters** - **`address`** — `string` (required) — an account address (either M... or G...) **Source:** [src/base/util/decode_encode_muxed_account.ts:74](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/util/decode_encode_muxed_account.ts#L74) ## 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`. ```ts scValToBigInt(scv: ScVal): bigint ``` **Parameters** - **`scv`** — `ScVal` (required) — the XDR smart contract value to convert **Throws** - if the `scv` input value doesn't represent an integer **Example** ```ts let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal let bigi = scValToBigInt(scv); new ScInt(bigi); // if you don't care about types, and new XdrLargeInt('i128', bigi); // if you do ``` **Source:** [src/base/numbers/index.ts:31](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/index.ts#L31) ## Types ### AuthFlag ```ts type AuthFlag = { readonly clawbackEnabled: 8; readonly immutable: 4; readonly required: 1; readonly revocable: 2 } ``` **Source:** [src/base/operations/types.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L431) ### AuthFlag ```ts type AuthFlag = typeof AuthFlag[keyof typeof AuthFlag] ``` **Source:** [src/base/operations/types.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L431) ### AuthFlag.clawbackEnabled ```ts type clawbackEnabled = 8 ``` **Source:** [src/base/operations/types.ts:444](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L444) ### AuthFlag.immutable ```ts type immutable = 4 ``` **Source:** [src/base/operations/types.ts:443](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L443) ### AuthFlag.required ```ts type required = 1 ``` **Source:** [src/base/operations/types.ts:441](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L441) ### AuthFlag.revocable ```ts type revocable = 2 ``` **Source:** [src/base/operations/types.ts:442](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L442) ### MemoType ```ts type MemoType = MemoTypeHash | MemoTypeID | MemoTypeNone | MemoTypeReturn | MemoTypeText ``` **Source:** [src/base/memo.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L33) ### MemoType.Hash ```ts type Hash = MemoTypeHash ``` **Source:** [src/base/memo.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L37) ### MemoType.ID ```ts type ID = MemoTypeID ``` **Source:** [src/base/memo.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L35) ### MemoType.None ```ts type None = MemoTypeNone ``` **Source:** [src/base/memo.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L34) ### MemoType.Return ```ts type Return = MemoTypeReturn ``` **Source:** [src/base/memo.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L38) ### MemoType.Text ```ts type Text = MemoTypeText ``` **Source:** [src/base/memo.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L36) ### MemoTypeHash ```ts type MemoTypeHash = typeof MemoHash ``` **Source:** [src/base/memo.ts:30](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L30) ### MemoTypeID ```ts type MemoTypeID = typeof MemoID ``` **Source:** [src/base/memo.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L28) ### MemoTypeNone ```ts type MemoTypeNone = typeof MemoNone ``` **Source:** [src/base/memo.ts:27](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L27) ### MemoTypeReturn ```ts type MemoTypeReturn = typeof MemoReturn ``` **Source:** [src/base/memo.ts:31](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L31) ### MemoTypeText ```ts type MemoTypeText = typeof MemoText ``` **Source:** [src/base/memo.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L29) ### MemoValue ```ts type MemoValue = Buffer | string | null ``` **Source:** [src/base/memo.ts:47](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/memo.ts#L47) ### 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` ```ts enum Networks ``` **Source:** [src/base/network.ts:9](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/network.ts#L9) ### Operation.AccountMerge ```ts type AccountMerge = AccountMergeResult ``` **Source:** [src/base/operation.ts:613](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L613) ### Operation.AllowTrust ```ts type AllowTrust = AllowTrustResult ``` **Source:** [src/base/operation.ts:612](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L612) ### Operation.BaseOperation ```ts type BaseOperation = _BaseOperation ``` **Source:** [src/base/operation.ts:601](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L601) ### Operation.BeginSponsoringFutureReserves ```ts type BeginSponsoringFutureReserves = BeginSponsoringFutureReservesResult ``` **Source:** [src/base/operation.ts:619](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L619) ### Operation.BumpSequence ```ts type BumpSequence = BumpSequenceResult ``` **Source:** [src/base/operation.ts:616](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L616) ### Operation.ChangeTrust ```ts type ChangeTrust = ChangeTrustResult ``` **Source:** [src/base/operation.ts:611](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L611) ### Operation.ClaimClaimableBalance ```ts type ClaimClaimableBalance = ClaimClaimableBalanceResult ``` **Source:** [src/base/operation.ts:618](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L618) ### Operation.Clawback ```ts type Clawback = ClawbackResult ``` **Source:** [src/base/operation.ts:631](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L631) ### Operation.ClawbackClaimableBalance ```ts type ClawbackClaimableBalance = ClawbackClaimableBalanceResult ``` **Source:** [src/base/operation.ts:632](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L632) ### Operation.CreateAccount ```ts type CreateAccount = CreateAccountResult ``` **Source:** [src/base/operation.ts:603](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L603) ### Operation.CreateClaimableBalance ```ts type CreateClaimableBalance = CreateClaimableBalanceResult ``` **Source:** [src/base/operation.ts:617](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L617) ### Operation.CreatePassiveSellOffer ```ts type CreatePassiveSellOffer = CreatePassiveSellOfferResult ``` **Source:** [src/base/operation.ts:607](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L607) ### Operation.EndSponsoringFutureReserves ```ts type EndSponsoringFutureReserves = EndSponsoringFutureReservesResult ``` **Source:** [src/base/operation.ts:621](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L621) ### Operation.ExtendFootprintTTL ```ts type ExtendFootprintTTL = ExtendFootprintTTLResult ``` **Source:** [src/base/operation.ts:637](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L637) ### Operation.Inflation ```ts type Inflation = InflationResult ``` **Source:** [src/base/operation.ts:614](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L614) ### Operation.InvokeHostFunction ```ts type InvokeHostFunction = InvokeHostFunctionResult ``` **Source:** [src/base/operation.ts:636](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L636) ### Operation.LiquidityPoolDeposit ```ts type LiquidityPoolDeposit = LiquidityPoolDepositResult ``` **Source:** [src/base/operation.ts:634](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L634) ### Operation.LiquidityPoolWithdraw ```ts type LiquidityPoolWithdraw = LiquidityPoolWithdrawResult ``` **Source:** [src/base/operation.ts:635](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L635) ### Operation.ManageBuyOffer ```ts type ManageBuyOffer = ManageBuyOfferResult ``` **Source:** [src/base/operation.ts:609](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L609) ### Operation.ManageData ```ts type ManageData = ManageDataResult ``` **Source:** [src/base/operation.ts:615](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L615) ### Operation.ManageSellOffer ```ts type ManageSellOffer = ManageSellOfferResult ``` **Source:** [src/base/operation.ts:608](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L608) ### Operation.PathPaymentStrictReceive ```ts type PathPaymentStrictReceive = PathPaymentStrictReceiveResult ``` **Source:** [src/base/operation.ts:605](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L605) ### Operation.PathPaymentStrictSend ```ts type PathPaymentStrictSend = PathPaymentStrictSendResult ``` **Source:** [src/base/operation.ts:606](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L606) ### Operation.Payment ```ts type Payment = PaymentResult ``` **Source:** [src/base/operation.ts:604](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L604) ### Operation.RestoreFootprint ```ts type RestoreFootprint = RestoreFootprintResult ``` **Source:** [src/base/operation.ts:638](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L638) ### Operation.RevokeAccountSponsorship ```ts type RevokeAccountSponsorship = RevokeAccountSponsorshipResult ``` **Source:** [src/base/operation.ts:622](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L622) ### Operation.RevokeClaimableBalanceSponsorship ```ts type RevokeClaimableBalanceSponsorship = RevokeClaimableBalanceSponsorshipResult ``` **Source:** [src/base/operation.ts:626](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L626) ### Operation.RevokeDataSponsorship ```ts type RevokeDataSponsorship = RevokeDataSponsorshipResult ``` **Source:** [src/base/operation.ts:625](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L625) ### Operation.RevokeLiquidityPoolSponsorship ```ts type RevokeLiquidityPoolSponsorship = RevokeLiquidityPoolSponsorshipResult ``` **Source:** [src/base/operation.ts:628](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L628) ### Operation.RevokeOfferSponsorship ```ts type RevokeOfferSponsorship = RevokeOfferSponsorshipResult ``` **Source:** [src/base/operation.ts:624](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L624) ### Operation.RevokeSignerSponsorship ```ts type RevokeSignerSponsorship = RevokeSignerSponsorshipResult ``` **Source:** [src/base/operation.ts:630](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L630) ### Operation.RevokeTrustlineSponsorship ```ts type RevokeTrustlineSponsorship = RevokeTrustlineSponsorshipResult ``` **Source:** [src/base/operation.ts:623](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L623) ### Operation.SetOptions ```ts type SetOptions = SetOptionsResult ``` **Source:** [src/base/operation.ts:610](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L610) ### Operation.SetTrustLineFlags ```ts type SetTrustLineFlags = SetTrustLineFlagsResult ``` **Source:** [src/base/operation.ts:633](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operation.ts#L633) ### OperationOptions ```ts type OperationOptions = AccountMergeOpts | AllowTrustOpts | BeginSponsoringFutureReservesOpts | BumpSequenceOpts | ChangeTrustOpts | ClaimClaimableBalanceOpts | ClawbackClaimableBalanceOpts | ClawbackOpts | CreateAccountOpts | CreateClaimableBalanceOpts | CreateCustomContractOpts | CreatePassiveSellOfferOpts | CreateStellarAssetContractOpts | EndSponsoringFutureReservesOpts | ExtendFootprintTtlOpts | InflationOpts | InvokeContractFunctionOpts | InvokeHostFunctionOpts | LiquidityPoolDepositOpts | LiquidityPoolWithdrawOpts | ManageBuyOfferOpts | ManageDataOpts | ManageSellOfferOpts | PathPaymentStrictReceiveOpts | PathPaymentStrictSendOpts | PaymentOpts | RestoreFootprintOpts | RevokeAccountSponsorshipOpts | RevokeClaimableBalanceSponsorshipOpts | RevokeDataSponsorshipOpts | RevokeLiquidityPoolSponsorshipOpts | RevokeOfferSponsorshipOpts | RevokeSignerSponsorshipOpts | RevokeTrustlineSponsorshipOpts | SetOptionsOpts | SetTrustLineFlagsOpts | UploadContractWasmOpts ``` **Source:** [src/base/operations/types.ts:311](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L311) ### OperationRecord Union of all possible operation objects returned by Operation.fromXDRObject. ```ts 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 | SetTrustLineFlagsResult ``` **Source:** [src/base/operations/types.ts:686](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L686) ### OperationType ```ts type OperationType = OperationType.AccountMerge | OperationType.AllowTrust | OperationType.BeginSponsoringFutureReserves | OperationType.BumpSequence | OperationType.ChangeTrust | OperationType.ClaimClaimableBalance | OperationType.Clawback | OperationType.ClawbackClaimableBalance | OperationType.CreateAccount | OperationType.CreateClaimableBalance | OperationType.CreatePassiveSellOffer | OperationType.EndSponsoringFutureReserves | OperationType.ExtendFootprintTTL | OperationType.Inflation | OperationType.InvokeHostFunction | OperationType.LiquidityPoolDeposit | OperationType.LiquidityPoolWithdraw | OperationType.ManageBuyOffer | OperationType.ManageData | OperationType.ManageSellOffer | OperationType.PathPaymentStrictReceive | OperationType.PathPaymentStrictSend | OperationType.Payment | OperationType.RestoreFootprint | OperationType.RevokeAccountSponsorship | OperationType.RevokeClaimableBalanceSponsorship | OperationType.RevokeDataSponsorship | OperationType.RevokeLiquidityPoolSponsorship | OperationType.RevokeOfferSponsorship | OperationType.RevokeSignerSponsorship | OperationType.RevokeTrustlineSponsorship | OperationType.SetOptions | OperationType.SetTrustLineFlags ``` **Source:** [src/base/operations/types.ts:354](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L354) ### OperationType.AccountMerge ```ts type AccountMerge = "accountMerge" ``` **Source:** [src/base/operations/types.ts:365](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L365) ### OperationType.AllowTrust ```ts type AllowTrust = "allowTrust" ``` **Source:** [src/base/operations/types.ts:364](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L364) ### OperationType.BeginSponsoringFutureReserves ```ts type BeginSponsoringFutureReserves = "beginSponsoringFutureReserves" ``` **Source:** [src/base/operations/types.ts:371](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L371) ### OperationType.BumpSequence ```ts type BumpSequence = "bumpSequence" ``` **Source:** [src/base/operations/types.ts:368](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L368) ### OperationType.ChangeTrust ```ts type ChangeTrust = "changeTrust" ``` **Source:** [src/base/operations/types.ts:363](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L363) ### OperationType.ClaimClaimableBalance ```ts type ClaimClaimableBalance = "claimClaimableBalance" ``` **Source:** [src/base/operations/types.ts:370](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L370) ### OperationType.Clawback ```ts type Clawback = "clawback" ``` **Source:** [src/base/operations/types.ts:383](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L383) ### OperationType.ClawbackClaimableBalance ```ts type ClawbackClaimableBalance = "clawbackClaimableBalance" ``` **Source:** [src/base/operations/types.ts:384](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L384) ### OperationType.CreateAccount ```ts type CreateAccount = "createAccount" ``` **Source:** [src/base/operations/types.ts:355](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L355) ### OperationType.CreateClaimableBalance ```ts type CreateClaimableBalance = "createClaimableBalance" ``` **Source:** [src/base/operations/types.ts:369](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L369) ### OperationType.CreatePassiveSellOffer ```ts type CreatePassiveSellOffer = "createPassiveSellOffer" ``` **Source:** [src/base/operations/types.ts:359](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L359) ### OperationType.EndSponsoringFutureReserves ```ts type EndSponsoringFutureReserves = "endSponsoringFutureReserves" ``` **Source:** [src/base/operations/types.ts:372](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L372) ### OperationType.ExtendFootprintTTL ```ts type ExtendFootprintTTL = "extendFootprintTtl" ``` **Source:** [src/base/operations/types.ts:389](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L389) ### OperationType.Inflation ```ts type Inflation = "inflation" ``` **Source:** [src/base/operations/types.ts:366](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L366) ### OperationType.InvokeHostFunction ```ts type InvokeHostFunction = "invokeHostFunction" ``` **Source:** [src/base/operations/types.ts:388](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L388) ### OperationType.LiquidityPoolDeposit ```ts type LiquidityPoolDeposit = "liquidityPoolDeposit" ``` **Source:** [src/base/operations/types.ts:386](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L386) ### OperationType.LiquidityPoolWithdraw ```ts type LiquidityPoolWithdraw = "liquidityPoolWithdraw" ``` **Source:** [src/base/operations/types.ts:387](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L387) ### OperationType.ManageBuyOffer ```ts type ManageBuyOffer = "manageBuyOffer" ``` **Source:** [src/base/operations/types.ts:361](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L361) ### OperationType.ManageData ```ts type ManageData = "manageData" ``` **Source:** [src/base/operations/types.ts:367](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L367) ### OperationType.ManageSellOffer ```ts type ManageSellOffer = "manageSellOffer" ``` **Source:** [src/base/operations/types.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L360) ### OperationType.PathPaymentStrictReceive ```ts type PathPaymentStrictReceive = "pathPaymentStrictReceive" ``` **Source:** [src/base/operations/types.ts:357](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L357) ### OperationType.PathPaymentStrictSend ```ts type PathPaymentStrictSend = "pathPaymentStrictSend" ``` **Source:** [src/base/operations/types.ts:358](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L358) ### OperationType.Payment ```ts type Payment = "payment" ``` **Source:** [src/base/operations/types.ts:356](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L356) ### OperationType.RestoreFootprint ```ts type RestoreFootprint = "restoreFootprint" ``` **Source:** [src/base/operations/types.ts:390](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L390) ### OperationType.RevokeAccountSponsorship ```ts type RevokeAccountSponsorship = "revokeAccountSponsorship" ``` **Source:** [src/base/operations/types.ts:375](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L375) ### OperationType.RevokeClaimableBalanceSponsorship ```ts type RevokeClaimableBalanceSponsorship = "revokeClaimableBalanceSponsorship" ``` **Source:** [src/base/operations/types.ts:379](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L379) ### OperationType.RevokeDataSponsorship ```ts type RevokeDataSponsorship = "revokeDataSponsorship" ``` **Source:** [src/base/operations/types.ts:378](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L378) ### OperationType.RevokeLiquidityPoolSponsorship ```ts type RevokeLiquidityPoolSponsorship = "revokeLiquidityPoolSponsorship" ``` **Source:** [src/base/operations/types.ts:381](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L381) ### OperationType.RevokeOfferSponsorship ```ts type RevokeOfferSponsorship = "revokeOfferSponsorship" ``` **Source:** [src/base/operations/types.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L377) ### OperationType.RevokeSignerSponsorship ```ts type RevokeSignerSponsorship = "revokeSignerSponsorship" ``` **Source:** [src/base/operations/types.ts:382](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L382) ### OperationType.RevokeSponsorship **Deprecated.** Never emitted by fromXDRObject — use the specific Revoke* types instead. ```ts type RevokeSponsorship = "revokeSponsorship" ``` **Source:** [src/base/operations/types.ts:374](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L374) ### OperationType.RevokeTrustlineSponsorship ```ts type RevokeTrustlineSponsorship = "revokeTrustlineSponsorship" ``` **Source:** [src/base/operations/types.ts:376](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L376) ### OperationType.SetOptions ```ts type SetOptions = "setOptions" ``` **Source:** [src/base/operations/types.ts:362](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L362) ### OperationType.SetTrustLineFlags ```ts type SetTrustLineFlags = "setTrustLineFlags" ``` **Source:** [src/base/operations/types.ts:385](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L385) ### ScIntType ```ts type ScIntType = "duration" | "i64" | "i128" | "i256" | "timepoint" | "u64" | "u128" | "u256" ``` **Source:** [src/base/numbers/xdr_large_int.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/numbers/xdr_large_int.ts#L18) ### Signer ```ts type Signer = Signer.Ed25519PublicKey | Signer.Ed25519SignedPayload | Signer.PreAuthTx | Signer.Sha256Hash ``` **Source:** [src/base/operations/types.ts:462](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L462) ### Signer.Ed25519PublicKey ```ts interface Ed25519PublicKey { ed25519PublicKey: string; weight?: number; } ``` **Source:** [src/base/operations/types.ts:463](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L463) #### `ed25519PublicKey.ed25519PublicKey` ```ts ed25519PublicKey: string; ``` **Source:** [src/base/operations/types.ts:464](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L464) #### `ed25519PublicKey.weight` ```ts weight?: number; ``` **Source:** [src/base/operations/types.ts:465](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L465) ### Signer.Ed25519SignedPayload ```ts interface Ed25519SignedPayload { ed25519SignedPayload: string; weight?: number; } ``` **Source:** [src/base/operations/types.ts:475](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L475) #### `ed25519SignedPayload.ed25519SignedPayload` ```ts ed25519SignedPayload: string; ``` **Source:** [src/base/operations/types.ts:476](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L476) #### `ed25519SignedPayload.weight` ```ts weight?: number; ``` **Source:** [src/base/operations/types.ts:477](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L477) ### Signer.PreAuthTx ```ts interface PreAuthTx { preAuthTx: Buffer; weight?: number; } ``` **Source:** [src/base/operations/types.ts:471](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L471) #### `preAuthTx.preAuthTx` ```ts preAuthTx: Buffer; ``` **Source:** [src/base/operations/types.ts:472](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L472) #### `preAuthTx.weight` ```ts weight?: number; ``` **Source:** [src/base/operations/types.ts:473](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L473) ### Signer.Sha256Hash ```ts interface Sha256Hash { sha256Hash: Buffer; weight?: number; } ``` **Source:** [src/base/operations/types.ts:467](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L467) #### `sha256Hash.sha256Hash` ```ts sha256Hash: Buffer; ``` **Source:** [src/base/operations/types.ts:468](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L468) #### `sha256Hash.weight` ```ts weight?: number; ``` **Source:** [src/base/operations/types.ts:469](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L469) ### SorobanFees Soroban fee parameters for resource-limited transactions. ```ts interface SorobanFees { instructions: number; readBytes: number; resourceFee: bigint; writeBytes: number; } ``` **Source:** [src/base/transaction_builder.ts:50](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L50) #### `sorobanFees.instructions` The number of instructions executed by the transaction. ```ts instructions: number; ``` **Source:** [src/base/transaction_builder.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L52) #### `sorobanFees.readBytes` The number of bytes read from the ledger by the transaction. ```ts readBytes: number; ``` **Source:** [src/base/transaction_builder.ts:54](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L54) #### `sorobanFees.resourceFee` The fee to be paid for the transaction, in stroops. ```ts resourceFee: bigint; ``` **Source:** [src/base/transaction_builder.ts:58](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L58) #### `sorobanFees.writeBytes` The number of bytes written to the ledger by the transaction. ```ts writeBytes: number; ``` **Source:** [src/base/transaction_builder.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_builder.ts#L56) ### 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. ```ts interface TransactionSource { accountId(): string; incrementSequenceNumber(): void; sequenceNumber(): string; } ``` **Source:** [src/base/transaction_source.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_source.ts#L17) #### `transactionSource.accountId()` The source account's address — a `G…` account address or, for a muxed source, its `M…` address. ```ts accountId(): string; ``` **Source:** [src/base/transaction_source.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_source.ts#L22) #### `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. ```ts incrementSequenceNumber(): void; ``` **Source:** [src/base/transaction_source.ts:32](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_source.ts#L32) #### `transactionSource.sequenceNumber()` The current sequence number, as a string. ```ts sequenceNumber(): string; ``` **Source:** [src/base/transaction_source.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/transaction_source.ts#L25) ### TrustLineFlag ```ts type TrustLineFlag = TrustLineFlag.authorize | TrustLineFlag.authorizeToMaintainLiabilities | TrustLineFlag.deauthorize ``` **Source:** [src/base/operations/types.ts:451](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L451) ### TrustLineFlag.authorize ```ts type authorize = 1 ``` **Source:** [src/base/operations/types.ts:453](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L453) ### TrustLineFlag.authorizeToMaintainLiabilities ```ts type authorizeToMaintainLiabilities = 2 ``` **Source:** [src/base/operations/types.ts:454](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L454) ### TrustLineFlag.deauthorize ```ts type deauthorize = 0 ``` **Source:** [src/base/operations/types.ts:452](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/operations/types.ts#L452) # Source: docs/reference/core-xdr.md # Core / XDR ## hash Computes the SHA-256 hash of the given data. ```ts hash(data: string | Buffer): Buffer ``` **Parameters** - **`data`** — `string | Buffer` (required) — the data to hash **Source:** [src/base/hashing.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/hashing.ts#L8) # Source: docs/reference/core-soroban-primitives.md # Core / Soroban Primitives ## Address ```ts class Address { constructor(address: string); static account(buffer: Buffer): Address; static claimableBalance(buffer: Buffer): Address; static contract(buffer: Buffer): Address; static fromScAddress(scAddress: ScAddress): Address; static fromScVal(scVal: ScVal): Address; static fromString(address: string): Address; static liquidityPool(buffer: Buffer): Address; static muxedAccount(buffer: Buffer): Address; readonly type: AddressType; toBuffer(): Buffer; toScAddress(): ScAddress; toScVal(): ScVal; toString(): string; } ``` **Source:** [src/base/address.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L20) ### `new Address(address)` ```ts constructor(address: string); ``` **Parameters** - **`address`** — `string` (required) — a `StrKey` of the address value **Source:** [src/base/address.ts:27](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L27) ### `Address.account(buffer)` Creates a new account Address object from a buffer of raw bytes. ```ts static account(buffer: Buffer): Address; ``` **Parameters** - **`buffer`** — `Buffer` (required) — The bytes of an address to parse. **Source:** [src/base/address.ts:62](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L62) ### `Address.claimableBalance(buffer)` Creates a new claimable balance Address object from a buffer of raw bytes. ```ts static claimableBalance(buffer: Buffer): Address; ``` **Parameters** - **`buffer`** — `Buffer` (required) — The bytes of a claimable balance ID to parse. **Source:** [src/base/address.ts:80](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L80) ### `Address.contract(buffer)` Creates a new contract Address object from a buffer of raw bytes. ```ts static contract(buffer: Buffer): Address; ``` **Parameters** - **`buffer`** — `Buffer` (required) — The bytes of an address to parse. **Source:** [src/base/address.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L71) ### `Address.fromScAddress(scAddress)` Convert this from an xdr.ScAddress type ```ts static fromScAddress(scAddress: ScAddress): Address; ``` **Parameters** - **`scAddress`** — `ScAddress` (required) — The xdr.ScAddress type to parse **Source:** [src/base/address.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L116) ### `Address.fromScVal(scVal)` Convert this from an xdr.ScVal type. ```ts static fromScVal(scVal: ScVal): Address; ``` **Parameters** - **`scVal`** — `ScVal` (required) — The xdr.ScVal type to parse **Source:** [src/base/address.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L107) ### `Address.fromString(address)` Parses a string and returns an Address object. ```ts static fromString(address: string): Address; ``` **Parameters** - **`address`** — `string` (required) — The address to parse. ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA` **Source:** [src/base/address.ts:53](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L53) ### `Address.liquidityPool(buffer)` Creates a new liquidity pool Address object from a buffer of raw bytes. ```ts static liquidityPool(buffer: Buffer): Address; ``` **Parameters** - **`buffer`** — `Buffer` (required) — The bytes of an LP ID to parse. **Source:** [src/base/address.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L89) ### `Address.muxedAccount(buffer)` Creates a new muxed account Address object from a buffer of raw bytes. ```ts static muxedAccount(buffer: Buffer): Address; ``` **Parameters** - **`buffer`** — `Buffer` (required) — The bytes of an address to parse. **Source:** [src/base/address.ts:98](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L98) ### `address.type` Return the type of this address. ```ts readonly type: AddressType; ``` **Source:** [src/base/address.ts:219](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L219) ### `address.toBuffer()` Return the raw public key bytes for this address. ```ts toBuffer(): Buffer; ``` **Source:** [src/base/address.ts:212](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L212) ### `address.toScAddress()` Convert this Address to an xdr.ScAddress type. ```ts toScAddress(): ScAddress; ``` **Source:** [src/base/address.ts:174](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L174) ### `address.toScVal()` Convert this Address to an xdr.ScVal type. ```ts toScVal(): ScVal; ``` **Source:** [src/base/address.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L167) ### `address.toString()` Serialize an address to string. ```ts toString(): string; ``` **Source:** [src/base/address.ts:147](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/address.ts#L147) ## Contract Create a new Contract object. `Contract` represents a single contract in the Stellar network, embodying the interface of the contract. See [Contracts](https://soroban.stellar.org/docs/learn/interacting-with-contracts) for more information about how contracts work in Stellar. ```ts class Contract { constructor(contractId: string); address(): Address; call(method: string, ...params: ScVal[]): Operation2; contractId(): string; getFootprint(): LedgerKey; toString(): string; } ``` **Source:** [src/base/contract.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L14) ### `new Contract(contractId)` ```ts constructor(contractId: string); ``` **Parameters** - **`contractId`** — `string` (required) — ID of the contract (ex. `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`). **Source:** [src/base/contract.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L21) ### `contract.address()` Returns the wrapped address of this contract. ```ts address(): Address; ``` **Source:** [src/base/contract.ts:44](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L44) ### `contract.call(method, params)` Returns an operation that will invoke this contract call. ```ts call(method: string, ...params: ScVal[]): Operation2; ``` **Parameters** - **`method`** — `string` (required) — name of the method to call - **`...params`** — `ScVal[]` (required) — arguments to pass to the method, as an array of xdr.ScVal **See also** - - Operation.invokeHostFunction - Operation.invokeContractFunction - Operation.createCustomContract - Operation.createStellarAssetContract - Operation.uploadContractWasm **Source:** [src/base/contract.ts:60](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L60) ### `contract.contractId()` Returns Stellar contract ID as a strkey, ex. `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`. ```ts contractId(): string; ``` **Source:** [src/base/contract.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L34) ### `contract.getFootprint()` Returns the read-only footprint entries necessary for any invocations to this contract, for convenience when manually adding it to your transaction's overall footprint or doing bump/restore operations. ```ts getFootprint(): LedgerKey; ``` **Source:** [src/base/contract.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L76) ### `contract.toString()` Returns the ID as a strkey (C...). ```ts toString(): string; ``` **Source:** [src/base/contract.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/contract.ts#L39) ## Soroban Helper class to assist with formatting and parsing token amounts. ```ts class Soroban { constructor(); static formatTokenAmount(amount: string, decimals: number): string; static parseTokenAmount(value: string, decimals: number): string; } ``` **Source:** [src/base/soroban.ts:2](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/soroban.ts#L2) ### `new Soroban()` ```ts constructor(); ``` ### `Soroban.formatTokenAmount(amount, decimals)` Given a whole number smart contract amount of a token and an amount of decimal places (if the token has any), it returns a "display" value. All arithmetic inside the contract is performed on integers to avoid potential precision and consistency issues of floating-point. ```ts static formatTokenAmount(amount: string, decimals: number): string; ``` **Parameters** - **`amount`** — `string` (required) — the token amount you want to display - **`decimals`** — `number` (required) — specify how many decimal places a token has **Throws** - if the given amount has a decimal point already **Example** ```ts formatTokenAmount("123000", 4) === "12.3"; formatTokenAmount("123000", 3) === "123.0"; formatTokenAmount("123", 3) === "0.123"; ``` **Source:** [src/base/soroban.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/soroban.ts#L21) ### `Soroban.parseTokenAmount(value, decimals)` Parse a token amount to use it on smart contract This function takes the display value and its decimals (if the token has any) and returns a string that'll be used within the smart contract. Returns the whole number token amount represented by the display value with the decimal places shifted over. ```ts static parseTokenAmount(value: string, decimals: number): string; ``` **Parameters** - **`value`** — `string` (required) — the token amount you want to use on a smart contract which you've been displaying in a UI - **`decimals`** — `number` (required) — the number of decimal places expected in the display value (different than the "actual" number, because suffix zeroes might not be present) **Example** ```ts const displayValueAmount = "123.4560" const parsedAmtForSmartContract = parseTokenAmount(displayValueAmount, 5); parsedAmtForSmartContract === "12345600" ``` **Source:** [src/base/soroban.ts:77](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/soroban.ts#L77) ## SorobanDataBuilder Supports building `xdr.SorobanTransactionData` structures with various items set to specific values. This is recommended for when you are building `Operation.extendFootprintTtl` / `Operation.restoreFootprint` operations and need to `TransactionBuilder.setSorobanData` to avoid (re)building the entire data structure from scratch. ```ts class SorobanDataBuilder { constructor(sorobanData?: string | Uint8Array | Buffer | SorobanTransactionData); static fromXDR(data: string | Uint8Array | Buffer): SorobanTransactionData; appendFootprint(readOnly: LedgerKey[], readWrite: LedgerKey[]): SorobanDataBuilder; build(): SorobanTransactionData; getFootprint(): LedgerFootprint; getReadOnly(): LedgerKey[]; getReadWrite(): LedgerKey[]; setFootprint(readOnly?: LedgerKey[] | null, readWrite?: LedgerKey[] | null): SorobanDataBuilder; setReadOnly(readOnly?: LedgerKey[]): SorobanDataBuilder; setReadWrite(readWrite?: LedgerKey[]): SorobanDataBuilder; setResourceFee(fee: IntLike): SorobanDataBuilder; setResources(cpuInstrs: number, diskReadBytes: number, writeBytes: number): SorobanDataBuilder; } ``` **Example** ```ts // You want to use an existing data blob but override specific parts. const newData = new SorobanDataBuilder(existing) .setReadOnly(someLedgerKeys) .setResourceFee("1000") .build(); // You want an instance from scratch const newData = new SorobanDataBuilder() .setFootprint([someLedgerKey], []) .setResourceFee("1000") .build(); ``` **Source:** [src/base/sorobandata_builder.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L29) ### `new SorobanDataBuilder(sorobanData)` ```ts constructor(sorobanData?: string | Uint8Array | Buffer | SorobanTransactionData); ``` **Parameters** - **`sorobanData`** — `string | Uint8Array | Buffer | SorobanTransactionData` (optional) — either a base64-encoded string that represents an `xdr.SorobanTransactionData` instance or an XDR instance itself (it will be copied); if omitted or "falsy" (e.g. an empty string), it starts with an empty instance **Source:** [src/base/sorobandata_builder.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L38) ### `SorobanDataBuilder.fromXDR(data)` Decodes and builds a `xdr.SorobanTransactionData` instance. ```ts static fromXDR(data: string | Uint8Array | Buffer): SorobanTransactionData; ``` **Parameters** - **`data`** — `string | Uint8Array | Buffer` (required) — raw input to decode **Source:** [src/base/sorobandata_builder.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L71) ### `sorobanDataBuilder.appendFootprint(readOnly, readWrite)` Appends the given ledger keys to the existing storage access footprint. ```ts appendFootprint(readOnly: LedgerKey[], readWrite: LedgerKey[]): SorobanDataBuilder; ``` **Parameters** - **`readOnly`** — `LedgerKey[]` (required) — read-only keys to add - **`readWrite`** — `LedgerKey[]` (required) — read-write keys to add **Source:** [src/base/sorobandata_builder.ts:119](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L119) ### `sorobanDataBuilder.build()` Returns a copy of the final data structure. ```ts build(): SorobanTransactionData; ``` **Source:** [src/base/sorobandata_builder.ts:186](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L186) ### `sorobanDataBuilder.getFootprint()` Returns the storage access pattern. ```ts getFootprint(): LedgerFootprint; ``` **Source:** [src/base/sorobandata_builder.ts:205](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L205) ### `sorobanDataBuilder.getReadOnly()` Returns the read-only storage access pattern. ```ts getReadOnly(): LedgerKey[]; ``` **Source:** [src/base/sorobandata_builder.ts:195](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L195) ### `sorobanDataBuilder.getReadWrite()` Returns the read-write storage access pattern. ```ts getReadWrite(): LedgerKey[]; ``` **Source:** [src/base/sorobandata_builder.ts:200](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L200) ### `sorobanDataBuilder.setFootprint(readOnly, readWrite)` Sets the storage access footprint to be a certain set of ledger keys. You can also set each field explicitly via `SorobanDataBuilder.setReadOnly` and `SorobanDataBuilder.setReadWrite` or add to the existing footprint via `SorobanDataBuilder.appendFootprint`. Passing `null|undefined` to either parameter will IGNORE the existing values. If you want to clear them, pass `[]`, instead. ```ts setFootprint(readOnly?: LedgerKey[] | null, readWrite?: LedgerKey[] | null): SorobanDataBuilder; ``` **Parameters** - **`readOnly`** — `LedgerKey[] | null` (optional) — the set of ledger keys to set in the read-only portion of the transaction's `sorobanData`, or `null | undefined` to keep the existing keys - **`readWrite`** — `LedgerKey[] | null` (optional) — the set of ledger keys to set in the read-write portion of the transaction's `sorobanData`, or `null | undefined` to keep the existing keys **Source:** [src/base/sorobandata_builder.ts:143](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L143) ### `sorobanDataBuilder.setReadOnly(readOnly)` Sets the read-only keys in the access footprint. ```ts setReadOnly(readOnly?: LedgerKey[]): SorobanDataBuilder; ``` **Parameters** - **`readOnly`** — `LedgerKey[]` (optional) — read-only keys in the access footprint **Source:** [src/base/sorobandata_builder.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L162) ### `sorobanDataBuilder.setReadWrite(readWrite)` Sets the read-write keys in the access footprint. ```ts setReadWrite(readWrite?: LedgerKey[]): SorobanDataBuilder; ``` **Parameters** - **`readWrite`** — `LedgerKey[]` (optional) — read-write keys in the access footprint **Source:** [src/base/sorobandata_builder.ts:175](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L175) ### `sorobanDataBuilder.setResourceFee(fee)` Sets the resource fee portion of the Soroban data. ```ts setResourceFee(fee: IntLike): SorobanDataBuilder; ``` **Parameters** - **`fee`** — `IntLike` (required) — the resource fee to set (int64) **Source:** [src/base/sorobandata_builder.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L86) ### `sorobanDataBuilder.setResources(cpuInstrs, diskReadBytes, writeBytes)` Sets up the resource metrics. You should almost NEVER need this, as its often generated / provided to you by transaction simulation/preflight from a Soroban RPC server. ```ts setResources(cpuInstrs: number, diskReadBytes: number, writeBytes: number): SorobanDataBuilder; ``` **Parameters** - **`cpuInstrs`** — `number` (required) — number of CPU instructions - **`diskReadBytes`** — `number` (required) — number of bytes being read from disk - **`writeBytes`** — `number` (required) — number of bytes being written to disk/memory **Source:** [src/base/sorobandata_builder.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L101) ## authorizeEntry Actually authorizes an existing authorization entry using the given credentials and expiration details, returning a signed copy. This "fills out" the authorization entry with a signature, indicating to the `Operation.invokeHostFunction` its attached to that: - a particular identity (i.e. signing `Keypair` or other signer) - approving the execution of an invocation tree (i.e. a simulation-acquired `xdr.SorobanAuthorizedInvocation` or otherwise built) - on a particular network (uniquely identified by its passphrase, see `Networks`) - until a particular ledger sequence is reached. This one lets you pass either a `Keypair` (or, more accurately, anything with a `sign(Buffer): Buffer` method) or a callback function (see `SigningCallback`) to handle signing the envelope hash. ```ts authorizeEntry(entry: SorobanAuthorizationEntry, signer: Keypair | SigningCallback, validUntilLedgerSeq: number, networkPassphrase: string, forAddress?: string): Promise ``` **Parameters** - **`entry`** — `SorobanAuthorizationEntry` (required) — an unsigned authorization entry - **`signer`** — `Keypair | SigningCallback` (required) — either a `Keypair` instance or a function which takes a `xdr.HashIdPreimageSorobanAuthorization` input payload and returns EITHER (a) an object containing a `signature` of the hash of the raw payload bytes as a Buffer-like and a `publicKey` string representing who just created this signature, or (b) just the naked signature of the hash of the raw payload bytes (where the signing key is implied to be the address in the `entry`). The latter option (b) is JUST for backwards compatibility and will be removed in the future. - **`validUntilLedgerSeq`** — `number` (required) — the (exclusive) future ledger sequence number until which this authorization entry should be valid (if `currentLedgerSeq==validUntil`, this is expired) - **`networkPassphrase`** — `string` (required) — the network passphrase is incorporated into the signature (see `Networks` for options) If using the `SigningCallback` variation, the signer is assumed to be the entry's credential address unless you use the variant that returns the object. - **`forAddress`** — `string` (optional) — which credential node the signature should be written to. Only relevant for `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES`, where a single entry can be signed by the top-level account and/or any of its (possibly nested) delegates. Per CAP-71-01 every one of these signers signs the *same* payload (bound to the top-level address), so the signature produced here is written to whichever node(s) carry `forAddress`. When omitted, the signature is written to the top-level credentials, which preserves the behavior for `SOROBAN_CREDENTIALS_ADDRESS` / `SOROBAN_CREDENTIALS_ADDRESS_V2` and for accounts whose signing key differs from the credential address (e.g. multisig). **Example** ```ts import { SorobanRpc, Transaction, Networks, authorizeEntry } from '@stellar/stellar-sdk'; // Assume signPayloadCallback is a well-formed signing callback. // // It might, for example, pop up a modal from a browser extension, send the // transaction to a third-party service for signing, or just do simple // signing via Keypair like it does here: function signPayloadCallback(payload) { return signer.sign(hash(payload.toXDR())); } function multiPartyAuth( server: SorobanRpc.Server, // assume this involves multi-party auth tx: Transaction, ) { return server .simulateTransaction(tx) .then((simResult) => { tx.operations[0].auth.map(entry => authorizeEntry( entry, signPayloadCallback, currentLedger + 1000, Networks.TESTNET) ); return server.prepareTransaction(tx, simResult); }) .then((preppedTx) => { preppedTx.sign(source); return server.sendTransaction(preppedTx); }); } ``` **See also** - authorizeInvocation **Source:** [src/base/auth.ts:134](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L134) ## authorizeInvocation ```ts authorizeInvocation(params: AuthorizeInvocationParams): Promise ``` **Parameters** - **`params`** — `AuthorizeInvocationParams` (required) **Source:** [src/base/auth.ts:280](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L280) ## buildAuthorizationEntryPreimage Builds the `xdr.HashIdPreimage` whose hash a signer must sign to authorize `entry`. This is the low-level signature payload used by `authorizeEntry`, exposed for callers that drive signing themselves — most notably for `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES`, where the client (not simulation) decides which delegates sign and how. For `SOROBAN_CREDENTIALS_ADDRESS` this is the legacy, non-address-bound `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION` preimage. For `SOROBAN_CREDENTIALS_ADDRESS_V2` and `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` it is the address-bound `ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS` preimage (CAP-71). For the delegates variant this single payload — bound to the *top-level* address — is what the top-level account and every (nested) delegate each sign. To get the raw bytes to sign, hash the XDR: `hash(preimage.toXDR())`. ```ts buildAuthorizationEntryPreimage(entry: SorobanAuthorizationEntry, validUntilLedgerSeq: number, networkPassphrase: string): HashIdPreimage ``` **Parameters** - **`entry`** — `SorobanAuthorizationEntry` (required) — the authorization entry to build the payload for - **`validUntilLedgerSeq`** — `number` (required) — the expiration ledger committed into the payload (must match the `signatureExpirationLedger` on the credentials you submit) - **`networkPassphrase`** — `string` (required) — the network passphrase mixed into the payload **Throws** - `Error` if `entry` carries source-account or otherwise non-address credentials **Source:** [src/base/auth.ts:340](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L340) ## buildInvocationTree Turns a raw invocation tree into a human-readable format. This is designed to make the invocation tree easier to understand in order to inform users about the side-effects of their contract calls. This will help make informed decisions about whether or not a particular invocation will result in what you expect it to. ```ts buildInvocationTree(root: SorobanAuthorizedInvocation): InvocationTree ``` **Parameters** - **`root`** — `SorobanAuthorizedInvocation` (required) — the raw XDR of the invocation, likely acquired from transaction simulation. this is either from the `Operation.invokeHostFunction` itself (the `func` field), or from the authorization entries (`xdr.SorobanAuthorizationEntry`, the `rootInvocation` field) **Example** Here, we show a browser modal after simulating an arbitrary transaction, `tx`, which we assume has an `Operation.invokeHostFunction` inside of it: ```ts import { Server, buildInvocationTree } from '@stellar/stellar-sdk'; const s = new Server("fill in accordingly"); s.simulateTransaction(tx).then( (resp: SorobanRpc.SimulateTransactionResponse) => { if (SorobanRpc.isSuccessfulSim(resp) && resp.result) { // bold assumption: there's a valid result with an auth entry const auth = resp.result.auth; if (auth && auth.length > 0) { alert( "You are authorizing the following invocation:\n" + JSON.stringify( buildInvocationTree(auth[0].rootInvocation()), null, 2 ) ); } } } ); ``` **Source:** [src/base/invocation.ts:120](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L120) ## buildWithDelegatesEntry Builds a `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` authorization entry by wrapping the address credentials of an existing `ADDRESS`/`ADDRESS_V2` entry (e.g. one returned by simulation) together with a caller-provided set of delegate signers. Simulation never emits the delegates variant on its own — which accounts use delegated authentication is account-specific policy known only to the client (much like a multisig policy). This helper just assembles the wrapper XDR; you supply the delegate tree (addresses and, optionally, signatures). To produce the signatures, build the shared payload with `buildAuthorizationEntryPreimage` on the returned entry and sign it, or fill each node afterwards with `authorizeEntry` (passing the signer's address as `forAddress`). Each delegates array (the top-level set and every `nestedDelegates`) is sorted by address in ascending order, and duplicate addresses within an array are rejected, as the protocol requires (CAP-71-01) — otherwise the host rejects the entry. ```ts buildWithDelegatesEntry(params: BuildWithDelegatesParams): SorobanAuthorizationEntry ``` **Parameters** - **`params`** — `BuildWithDelegatesParams` (required) — see `BuildWithDelegatesParams` **Throws** - `Error` if `entry` is not an `ADDRESS`/`ADDRESS_V2` entry, or if any delegates array contains a duplicate address. **Source:** [src/base/auth.ts:450](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L450) ## humanizeEvents Converts raw diagnostic or contract events into something with a flatter, human-readable, and understandable structure. Each element in the returned list has the following properties: - `type`: one of `'system'`, `'contract'`, `'diagnostic'` - `contractId`: optionally, a `C...` encoded strkey - `topics`: a list of `scValToNative` invocations on the topics - `data`: a `scValToNative` invocation on the raw event data ```ts humanizeEvents(events: ContractEvent[] | DiagnosticEvent[]): SorobanEvent[] ``` **Parameters** - **`events`** — `ContractEvent[] | DiagnosticEvent[]` (required) — either contract events or diagnostic events to parse into a friendly format **Source:** [src/base/events.ts:48](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/events.ts#L48) ## nativeToScVal Attempts to convert native types into smart contract values (`xdr.ScVal`). Provides conversions from smart contract XDR values (`xdr.ScVal`) to native JavaScript types. The conversions are as follows: - `xdr.ScVal` → passthrough - `null` / `undefined` → `scvVoid` - `string` → `scvString` (a copy is made) - `UintArray8` → `scvBytes` (a copy is made) - `boolean` → `scvBool` - `number` / `bigint` → the smallest possible XDR integer type that will fit the input value (if you want a specific type, use `ScInt`) - `Address` or `Contract` → `scvAddress` (for contracts and public keys) - `Array` → `scvVec` after attempting to convert each item of type `T` to an `xdr.ScVal` (recursively). note that all values must be the same type! - `object` → `scvMap` after attempting to convert each key and value to an `xdr.ScVal` (recursively). note that there is no restriction on types matching anywhere (unlike arrays) When passing an integer-like native value, you can also optionally specify a type which will force a particular interpretation of that value. Note that not all type specifications are compatible with all `ScVal`s, e.g. `toScVal("a string", {type: "i256"})` will throw. ```ts nativeToScVal(val: unknown, opts: NativeToScValOpts = {}): ScVal ``` **Parameters** - **`val`** — `unknown` (required) — a native (or convertible) input value to wrap - **`opts`** — `NativeToScValOpts` (optional) (default: `{}`) — an optional set of hints around the type of conversion you'd like to see - `type`: there is different behavior for different input types for `val`: - when `val` is an integer-like type (i.e. number|bigint), this will be forwarded to `ScInt` or forced to be u32/i32. - when `val` is an array type, this is forwarded to the recursion - when `val` is an object type (key-value entries), this should be an object in which each key has a pair of types (to represent forced types for the key and the value), where `null` (or a missing entry) indicates the default interpretation(s) (refer to the examples, below) - when `val` is a string type, this can be 'string' or 'symbol' to force a particular interpretation of `val`. - when `val` is a bytes-like type, this can be 'string', 'symbol', or 'bytes' to force a particular interpretation As a simple example, `nativeToScVal("hello", {type: 'symbol'})` will return an `scvSymbol`, whereas without the type it would have been an `scvString`. **Throws** - if... - there are arrays with more than one type in them - there are values that do not have a sensible conversion (e.g. random XDR types, custom classes) - the type of the input object (or some inner value of said object) cannot be determined (via `typeof`) - the type you specified (via `opts.type`) is incompatible with the value you passed in (`val`), e.g. `nativeToScVal("a string", { type: 'i128' })`, though this does not apply for types that ignore `opts` (e.g. addresses). **Example** ```ts nativeToScVal(1000); // gives ScValType === scvU64 nativeToScVal(1000n); // gives ScValType === scvU64 nativeToScVal(1n << 100n); // gives ScValType === scvU128 nativeToScVal(1000, { type: 'u32' }); // gives ScValType === scvU32 nativeToScVal(1000, { type: 'i125' }); // gives ScValType === scvI256 nativeToScVal("a string"); // gives ScValType === scvString nativeToScVal("a string", { type: 'symbol' }); // gives scvSymbol nativeToScVal(new Uint8Array(5)); // scvBytes nativeToScVal(new Uint8Array(5), { type: 'symbol' }); // scvSymbol nativeToScVal(null); // scvVoid nativeToScVal(true); // scvBool nativeToScVal([1, 2, 3]); // gives scvVec with each element as scvU64 nativeToScVal([1, 2, 3], { type: 'i128' }); // scvVec nativeToScVal([1, '2'], { type: ['i128', 'symbol'] }); // scvVec with diff types nativeToScVal([1, '2', 3], { type: ['i128', 'symbol'] }); // scvVec with diff types, using the default when omitted nativeToScVal({ 'hello': 1, 'world': [ true, false ] }, { type: { 'hello': [ 'symbol', 'i128' ], } }) // gives scvMap with entries: [ // [ scvSymbol, scvI128 ], // [ scvString, scvArray ] // ] ``` **Example** ```ts import { nativeToScVal, scValToNative, ScInt, xdr } from '@stellar/stellar-base'; let gigaMap = { bool: true, void: null, u32: xdr.ScVal.scvU32(1), i32: xdr.ScVal.scvI32(1), u64: 1n, i64: -1n, u128: new ScInt(1).toU128(), i128: new ScInt(1).toI128(), u256: new ScInt(1).toU256(), i256: new ScInt(1).toI256(), map: { arbitrary: 1n, nested: 'values', etc: false }, vec: ['same', 'type', 'list'], vec: ['diff', 1, 'type', 2, 'list'], }; // then, simply: let scv = nativeToScVal(gigaMap); // scv.switch() == xdr.ScValType.scvMap() // then... someContract.call("method", scv); // Similarly, the inverse should work: scValToNative(scv) == gigaMap; // true ``` **See also** - scValToNative **Source:** [src/base/scval.ts:161](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/scval.ts#L161) ## scValToNative Given a smart contract value, attempt to convert it to a native type. Possible conversions include: - `void` → `null` - `u32`, `i32` → `number` - `u64`, `i64`, `u128`, `i128`, `u256`, `i256`, `timepoint`, `duration` → `bigint` - `vec` → `Array` of any of the above (via recursion) - `map` → key-value object of any of the above (via recursion) - `bool` → `boolean` - `bytes` → `Uint8Array` - `symbol` → `string` - `string` → `string` IF the underlying buffer can be decoded as ascii/utf8, `Uint8Array` of the raw contents in any error case If no viable conversion can be determined, this just "unwraps" the smart value to return its underlying XDR value. ```ts scValToNative(scv: ScVal): any ``` **Parameters** - **`scv`** — `ScVal` (required) — the input smart contract value **See also** - nativeToScVal **Source:** [src/base/scval.ts:375](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/scval.ts#L375) ## scvSortedMap Build a sorted ScVal map from unsorted entries, sorted by key. ```ts scvSortedMap(items: ScMapEntry[]): ScVal ``` **Parameters** - **`items`** — `ScMapEntry[]` (required) — the unsorted map entries **Source:** [src/base/scval.ts:487](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/scval.ts#L487) ## walkInvocationTree Executes a callback function on each node in the tree until stopped. Nodes are walked in a depth-first order. Returning `false` from the callback stops further depth exploration at that node, but it does not stop the walk in a "global" view. ```ts walkInvocationTree(root: SorobanAuthorizedInvocation, callback: InvocationWalker): void ``` **Parameters** - **`root`** — `SorobanAuthorizedInvocation` (required) — the tree to explore - **`callback`** — `InvocationWalker` (required) — the callback to execute for each node **Source:** [src/base/invocation.ts:229](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L229) ## Types ### AuthorizeInvocationParams This builds an entry from scratch, allowing you to express authorization as a function of: - a particular identity (i.e. signing `Keypair` or other signer) - approving the execution of an invocation tree (i.e. a simulation-acquired `xdr.SorobanAuthorizedInvocation` or otherwise built) - on a particular network (uniquely identified by its passphrase, see `Networks`) - until a particular ledger sequence is reached. This is in contrast to `authorizeEntry`, which signs an existing entry. ```ts interface AuthorizeInvocationParams { invocation: SorobanAuthorizedInvocation; networkPassphrase: string; publicKey?: string; signer: Keypair | SigningCallback; validUntilLedgerSeq: number; } ``` **See also** - authorizeEntry **Source:** [src/base/auth.ts:272](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L272) #### `authorizeInvocationParams.invocation` ```ts invocation: SorobanAuthorizedInvocation; ``` **Source:** [src/base/auth.ts:275](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L275) #### `authorizeInvocationParams.networkPassphrase` ```ts networkPassphrase: string; ``` **Source:** [src/base/auth.ts:276](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L276) #### `authorizeInvocationParams.publicKey` ```ts publicKey?: string; ``` **Source:** [src/base/auth.ts:277](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L277) #### `authorizeInvocationParams.signer` ```ts signer: Keypair | SigningCallback; ``` **Source:** [src/base/auth.ts:273](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L273) #### `authorizeInvocationParams.validUntilLedgerSeq` ```ts validUntilLedgerSeq: number; ``` **Source:** [src/base/auth.ts:274](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L274) ### BuildWithDelegatesParams Parameters for `buildWithDelegatesEntry`. ```ts interface BuildWithDelegatesParams { delegates: DelegateSignature[]; entry: SorobanAuthorizationEntry; signature?: ScVal; validUntilLedgerSeq: number; } ``` **Source:** [src/base/auth.ts:408](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L408) #### `buildWithDelegatesParams.delegates` the delegate signers to attach. ```ts delegates: DelegateSignature[]; ``` **Source:** [src/base/auth.ts:418](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L418) #### `buildWithDelegatesParams.entry` an existing `SOROBAN_CREDENTIALS_ADDRESS` or `SOROBAN_CREDENTIALS_ADDRESS_V2` entry — typically one returned by simulation — whose address credentials should be wrapped. ```ts entry: SorobanAuthorizationEntry; ``` **Source:** [src/base/auth.ts:414](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L414) #### `buildWithDelegatesParams.signature` the top-level account's signature. Defaults to `scvVoid`, which is valid for accounts that authorize purely via delegated signers (CAP-71-01). ```ts signature?: ScVal; ``` **Source:** [src/base/auth.ts:423](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L423) #### `buildWithDelegatesParams.validUntilLedgerSeq` the expiration ledger sequence stored on the top-level credentials. ```ts validUntilLedgerSeq: number; ``` **Source:** [src/base/auth.ts:416](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L416) ### CreateInvocation Details about a contract creation invocation. - `type` indicates if this creation was a custom contract (`'wasm'`) or a wrapping of an existing Stellar asset (`'sac'`) - `asset` is set when `type=='sac'`, containing the canonical `Asset` being wrapped by this Stellar Asset Contract - `wasm` is set when `type=='wasm'`, containing additional creation parameters ```ts interface CreateInvocation { asset?: string; type: "sac" | "wasm"; wasm?: WasmCreateDetails; } ``` **Source:** [src/base/invocation.ts:23](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L23) #### `createInvocation.asset` ```ts asset?: string; ``` **Source:** [src/base/invocation.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L25) #### `createInvocation.type` ```ts type: "sac" | "wasm"; ``` **Source:** [src/base/invocation.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L24) #### `createInvocation.wasm` ```ts wasm?: WasmCreateDetails; ``` **Source:** [src/base/invocation.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L26) ### DelegateSignature A delegate signer to attach to a `SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES` entry via `buildWithDelegatesEntry`. ```ts interface DelegateSignature { address: string; nestedDelegates?: DelegateSignature[]; signature?: ScVal; } ``` **Source:** [src/base/auth.ts:394](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L394) #### `delegateSignature.address` the delegate's address (`G…` account or `C…` contract). ```ts address: string; ``` **Source:** [src/base/auth.ts:396](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L396) #### `delegateSignature.nestedDelegates` signers this delegate in turn delegates to (recursive). ```ts nestedDelegates?: DelegateSignature[]; ``` **Source:** [src/base/auth.ts:404](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L404) #### `delegateSignature.signature` the delegate's signature value. Defaults to a `scvVoid` placeholder, which you can fill afterwards with `authorizeEntry` (passing this address as `forAddress`) or by editing the entry directly. ```ts signature?: ScVal; ``` **Source:** [src/base/auth.ts:402](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L402) ### ExecuteInvocation Details about a contract function execution invocation. - `source` is the strkey of the contract (`C...`) being invoked - `function` is the name of the function being invoked - `args` are the natively-represented parameters to the function invocation (see `scValToNative` for rules on how they're represented as JS types) ```ts interface ExecuteInvocation { args: any[]; function: string; source: string; } ``` **Source:** [src/base/invocation.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L37) #### `executeInvocation.args` ```ts args: any[]; ``` **Source:** [src/base/invocation.ts:41](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L41) #### `executeInvocation.function` ```ts function: string; ``` **Source:** [src/base/invocation.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L39) #### `executeInvocation.source` ```ts source: string; ``` **Source:** [src/base/invocation.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L38) ### IntLike ```ts type IntLike = bigint | number | string ``` **Source:** [src/base/sorobandata_builder.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/sorobandata_builder.ts#L3) ### InvocationTree A node in the invocation tree. - `type` is the type of invocation occurring, either contract creation or host function execution - `args` are the parameters to the invocation, depending on the type - `invocations` are any sub-invocations that may occur as a result of this invocation (i.e. a tree of call stacks) ```ts interface InvocationTree { args: CreateInvocation | ExecuteInvocation; invocations: InvocationTree[]; type: "create" | "execute"; } ``` **Source:** [src/base/invocation.ts:53](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L53) #### `invocationTree.args` ```ts args: CreateInvocation | ExecuteInvocation; ``` **Source:** [src/base/invocation.ts:55](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L55) #### `invocationTree.invocations` ```ts invocations: InvocationTree[]; ``` **Source:** [src/base/invocation.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L56) #### `invocationTree.type` ```ts type: "create" | "execute"; ``` **Source:** [src/base/invocation.ts:54](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L54) ### InvocationWalker A callback used when walking an invocation tree. Returning exactly `false` is a hint to stop exploring deeper from this node; other return values are ignored. ```ts type InvocationWalker = (node: xdr.SorobanAuthorizedInvocation, depth: number, parent?: xdr.SorobanAuthorizedInvocation) => boolean | null | void ``` **Source:** [src/base/invocation.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L71) ### NativeToScValOpts ```ts interface NativeToScValOpts { type?: ScValType | ScValMapTypeSpec | ScValType | null[]; } ``` **Source:** [src/base/scval.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/scval.ts#L18) #### `nativeToScValOpts.type` ```ts type?: ScValType | ScValMapTypeSpec | ScValType | null[]; ``` **Source:** [src/base/scval.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/scval.ts#L19) ### SigningCallback A callback for signing an XDR structure representing all of the details necessary to authorize an invocation tree. ```ts type SigningCallback = (preimage: xdr.HashIdPreimage) => Promise ``` **Source:** [src/base/auth.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/auth.ts#L35) ### WasmCreateDetails ```ts interface WasmCreateDetails { address: string; constructorArgs?: any[]; hash: string; salt: string; } ``` **Source:** [src/base/invocation.ts:6](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L6) #### `wasmCreateDetails.address` ```ts address: string; ``` **Source:** [src/base/invocation.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L8) #### `wasmCreateDetails.constructorArgs` ```ts constructorArgs?: any[]; ``` **Source:** [src/base/invocation.ts:11](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L11) #### `wasmCreateDetails.hash` ```ts hash: string; ``` **Source:** [src/base/invocation.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L7) #### `wasmCreateDetails.salt` ```ts salt: string; ``` **Source:** [src/base/invocation.ts:9](https://github.com/stellar/js-stellar-sdk/blob/main/src/base/invocation.ts#L9) # Source: docs/reference/network-horizon.md # Network / Horizon ## Horizon.AccountResponse Do not create this object directly, use `Horizon.Server#loadAccount`. Returns information and links relating to a single account. The balances section in the returned JSON will also list all the trust lines this account has set up. It also contains `BaseAccount` object and exposes it's methods so can be used in `TransactionBuilder`. ```ts class AccountResponse implements TransactionSource { constructor(response: AccountRecord); readonly account_id: string; readonly balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; readonly data: (options: { value: string }) => Promise<{ value: string }>; readonly data_attr: Record; readonly effects: CallCollectionFunction; readonly flags: Flags; readonly home_domain?: string; readonly id: string; readonly inflation_destination?: string; readonly last_modified_ledger: number; readonly last_modified_time: string; readonly num_sponsored: number; readonly num_sponsoring: number; readonly offers: CallCollectionFunction; readonly operations: CallCollectionFunction; readonly paging_token: string; readonly payments: CallCollectionFunction; sequence: string; readonly sequence_ledger?: number; readonly sequence_time?: string; readonly signers: AccountRecordSigners[]; readonly sponsor?: string; readonly subentry_count: number; readonly thresholds: AccountThresholds; readonly trades: CallCollectionFunction; readonly transactions: CallCollectionFunction; accountId(): string; incrementSequenceNumber(): void; sequenceNumber(): string; } ``` **See also** - `Account Details` **Source:** [src/horizon/account_response.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L19) ### `new AccountResponse(response)` ```ts constructor(response: AccountRecord); ``` **Parameters** - **`response`** — `AccountRecord` (required) **Source:** [src/horizon/account_response.ts:50](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L50) ### `accountResponse.account_id` ```ts readonly account_id: string; ``` **Source:** [src/horizon/account_response.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L22) ### `accountResponse.balances` ```ts readonly balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; ``` **Source:** [src/horizon/account_response.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L33) ### `accountResponse.data` ```ts readonly data: (options: { value: string }) => Promise<{ value: string }>; ``` **Parameters** - **`options`** — `{ value: string }` (required) **Source:** [src/horizon/account_response.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L38) ### `accountResponse.data_attr` ```ts readonly data_attr: Record; ``` **Source:** [src/horizon/account_response.ts:41](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L41) ### `accountResponse.effects` ```ts readonly effects: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:42](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L42) ### `accountResponse.flags` ```ts readonly flags: Flags; ``` **Source:** [src/horizon/account_response.ts:32](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L32) ### `accountResponse.home_domain` ```ts readonly home_domain?: string; ``` **Source:** [src/horizon/account_response.ts:27](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L27) ### `accountResponse.id` ```ts readonly id: string; ``` **Source:** [src/horizon/account_response.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L20) ### `accountResponse.inflation_destination` ```ts readonly inflation_destination?: string; ``` **Source:** [src/horizon/account_response.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L28) ### `accountResponse.last_modified_ledger` ```ts readonly last_modified_ledger: number; ``` **Source:** [src/horizon/account_response.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L29) ### `accountResponse.last_modified_time` ```ts readonly last_modified_time: string; ``` **Source:** [src/horizon/account_response.ts:30](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L30) ### `accountResponse.num_sponsored` ```ts readonly num_sponsored: number; ``` **Source:** [src/horizon/account_response.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L36) ### `accountResponse.num_sponsoring` ```ts readonly num_sponsoring: number; ``` **Source:** [src/horizon/account_response.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L35) ### `accountResponse.offers` ```ts readonly offers: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:43](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L43) ### `accountResponse.operations` ```ts readonly operations: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:44](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L44) ### `accountResponse.paging_token` ```ts readonly paging_token: string; ``` **Source:** [src/horizon/account_response.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L21) ### `accountResponse.payments` ```ts readonly payments: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L45) ### `accountResponse.sequence` ```ts sequence: string; ``` **Source:** [src/horizon/account_response.ts:23](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L23) ### `accountResponse.sequence_ledger` ```ts readonly sequence_ledger?: number; ``` **Source:** [src/horizon/account_response.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L24) ### `accountResponse.sequence_time` ```ts readonly sequence_time?: string; ``` **Source:** [src/horizon/account_response.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L25) ### `accountResponse.signers` ```ts readonly signers: AccountRecordSigners[]; ``` **Source:** [src/horizon/account_response.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L34) ### `accountResponse.sponsor` ```ts readonly sponsor?: string; ``` **Source:** [src/horizon/account_response.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L37) ### `accountResponse.subentry_count` ```ts readonly subentry_count: number; ``` **Source:** [src/horizon/account_response.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L26) ### `accountResponse.thresholds` ```ts readonly thresholds: AccountThresholds; ``` **Source:** [src/horizon/account_response.ts:31](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L31) ### `accountResponse.trades` ```ts readonly trades: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:46](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L46) ### `accountResponse.transactions` ```ts readonly transactions: CallCollectionFunction; ``` **Source:** [src/horizon/account_response.ts:47](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L47) ### `accountResponse.accountId()` Get Stellar account public key ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA` ```ts accountId(): string; ``` **Returns** accountId **Source:** [src/horizon/account_response.ts:85](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L85) ### `accountResponse.incrementSequenceNumber()` Increments sequence number in this object by one. ```ts incrementSequenceNumber(): void; ``` **Source:** [src/horizon/account_response.ts:100](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L100) ### `accountResponse.sequenceNumber()` Get the current sequence number ```ts sequenceNumber(): string; ``` **Returns** sequenceNumber **Source:** [src/horizon/account_response.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/account_response.ts#L93) ## Horizon.SERVER_TIME_MAP keep a local map of server times (export this purely for testing purposes) each entry will map the server domain to the last-known time and the local time it was recorded, ex: ```ts const SERVER_TIME_MAP: Record ``` **Example** ```ts "horizon-testnet.stellar.org": { serverTime: 1552513039, localTimeRecorded: 1552513052 } ``` **Source:** [src/horizon/horizon_axios_client.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_axios_client.ts#L33) ## Horizon.Server Server handles the network connection to a [Horizon](https://developers.stellar.org/docs/data/horizon) instance and exposes an interface for requests to that instance. ```ts class Server { constructor(serverURL: string, opts: Options = {}); readonly httpClient: HttpClient; readonly serverURL: URL; accounts(): AccountCallBuilder; assets(): AssetsCallBuilder; checkMemoRequired(transaction: Transaction | FeeBumpTransaction): Promise; claimableBalances(): ClaimableBalanceCallBuilder; effects(): EffectCallBuilder; feeStats(): Promise; fetchBaseFee(): Promise; fetchTimebounds(seconds: number, _isRetry: boolean = false): Promise; friendbot(address: string): FriendbotBuilder; ledgers(): LedgerCallBuilder; liquidityPools(): LiquidityPoolCallBuilder; loadAccount(accountId: string): Promise; offers(): OfferCallBuilder; operations(): OperationCallBuilder; orderbook(selling: Asset, buying: Asset): OrderbookCallBuilder; payments(): PaymentCallBuilder; root(): Promise; strictReceivePaths(source: string | Asset[], destinationAsset: Asset, destinationAmount: string): PathCallBuilder; strictSendPaths(sourceAsset: Asset, sourceAmount: string, destination: string | Asset[]): PathCallBuilder; submitAsyncTransaction(transaction: Transaction | FeeBumpTransaction, opts: SubmitTransactionOptions = ...): Promise; submitTransaction(transaction: Transaction | FeeBumpTransaction, opts: SubmitTransactionOptions = ...): Promise; tradeAggregation(base: Asset, counter: Asset, start_time: number, end_time: number, resolution: number, offset: number): TradeAggregationCallBuilder; trades(): TradesCallBuilder; transactions(): TransactionCallBuilder; } ``` **Source:** [src/horizon/server.ts:70](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L70) ### `new Server(serverURL, opts)` ```ts constructor(serverURL: string, opts: Options = {}); ``` **Parameters** - **`serverURL`** — `string` (required) - **`opts`** — `Options` (optional) (default: `{}`) **Source:** [src/horizon/server.ts:95](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L95) ### `server.httpClient` HTTP client instance for making requests to Horizon. Exposes interceptors, defaults, and other configuration options. ```ts readonly httpClient: HttpClient; ``` **Example** ```ts // Add authentication header server.httpClient.defaults.headers['Authorization'] = 'Bearer token'; // Add request interceptor server.httpClient.interceptors.request.use((config) => { console.log('Request:', config.url); return config; }); ``` **Source:** [src/horizon/server.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L94) ### `server.serverURL` Horizon Server URL (ex. `https://horizon-testnet.stellar.org`) TODO: Solve `this.serverURL`. ```ts readonly serverURL: URL; ``` **Source:** [src/horizon/server.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L76) ### `server.accounts()` ```ts accounts(): AccountCallBuilder; ``` **Returns** New `AccountCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `accountId(id: string): CallBuilder` — Returns information and links relating to a single account. - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAsset(asset: Asset): this` — This endpoint filters all accounts who are trustees to an asset. - `forLiquidityPool(id: string): this` — This endpoint filters accounts holding a trustline to the given liquidity pool. - `forSigner(id: string): this` — This endpoint filters accounts by signer account. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `sponsor(id: string): this` — This endpoint filters accounts where the given account is sponsoring the account or any of its sub-entries.. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:601](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L601) ### `server.assets()` Get a new `AssetsCallBuilder` instance configured with the current Horizon server configuration. ```ts assets(): AssetsCallBuilder; ``` **Returns** New AssetsCallBuilder instance **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forCode(value: string): AssetsCallBuilder` — This endpoint filters all assets by the asset code. - `forIssuer(value: string): AssetsCallBuilder` — This endpoint filters all assets by the asset issuer. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:783](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L783) ### `server.checkMemoRequired(transaction)` Check if any of the destination accounts requires a memo. This function implements a memo required check as defined in [SEP-29](https://stellar.org/protocol/sep-29). It will load each account which is the destination and check if it has the data field `config.memo_required` set to `"MQ=="`. Each account is checked sequentially instead of loading multiple accounts at the same time from Horizon. ```ts checkMemoRequired(transaction: Transaction | FeeBumpTransaction): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — The transaction to check. **Returns** - If any of the destination account requires a memo, the promise will throw `AccountRequiresMemoError`. **See also** - `SEP-29: Account Memo Requirements` **Source:** [src/horizon/server.ts:849](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L849) ### `server.claimableBalances()` ```ts claimableBalances(): ClaimableBalanceCallBuilder; ``` **Returns** New `ClaimableBalanceCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `asset(asset: Asset): this` — Returns all claimable balances which provide a balance for the given asset. - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `claimableBalance(claimableBalanceId: string): CallBuilder` — The claimable balance details endpoint provides information on a single claimable balance. - `claimant(claimant: string): this` — Returns all claimable balances which can be claimed by the given account ID. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `sponsor(sponsor: string): this` — Returns all claimable balances which are sponsored by the given account ID. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:608](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L608) ### `server.effects()` ```ts effects(): EffectCallBuilder; ``` **Returns** New `EffectCallBuilder` instance configured with the current Horizon server configuration **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(accountId: string): this` — This endpoint represents all effects that changed a given account. - `forLedger(sequence: string | number): this` — Effects are the specific ways that the ledger was changed by any operation. - `forLiquidityPool(poolId: string): this` — This endpoint represents all effects involving a particular liquidity pool. - `forOperation(operationId: string): this` — This endpoint represents all effects that occurred as a result of a given operation. - `forTransaction(transactionId: string): this` — This endpoint represents all effects that occurred as a result of a given transaction. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:765](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L765) ### `server.feeStats()` Fetch the fee stats endpoint. ```ts feeStats(): Promise; ``` **Returns** Promise that resolves to the fee stats returned by Horizon. **See also** - `Fee Stats` **Source:** [src/horizon/server.ts:204](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L204) ### `server.fetchBaseFee()` Fetch the base fee. Since this hits the server, if the server call fails, you might get an error. You should be prepared to use a default value if that happens! ```ts fetchBaseFee(): Promise; ``` **Returns** Promise that resolves to the base fee. **Source:** [src/horizon/server.ts:193](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L193) ### `server.fetchTimebounds(seconds, _isRetry)` Get timebounds for N seconds from now, when you're creating a transaction with `TransactionBuilder`. By default, `TransactionBuilder` uses the current local time, but your machine's local time could be different from Horizon's. This gives you more assurance that your timebounds will reflect what you want. Note that this will generate your timebounds when you **init the transaction**, not when you build or submit the transaction! So give yourself enough time to get the transaction built and signed before submitting. ```ts fetchTimebounds(seconds: number, _isRetry: boolean = false): Promise; ``` **Parameters** - **`seconds`** — `number` (required) — Number of seconds past the current time to wait. - **`_isRetry`** — `boolean` (optional) (default: `false`) — (optional) True if this is a retry. Only set this internally! This is to avoid a scenario where Horizon is horking up the wrong date. **Returns** Promise that resolves a `Timebounds` object (with the shape `{ minTime: 0, maxTime: N }`) that you can set the `timebounds` option to. **Example** ```ts const transaction = new StellarSdk.TransactionBuilder(accountId, { fee: await StellarSdk.Server.fetchBaseFee(), timebounds: await StellarSdk.Server.fetchTimebounds(100) }) .addOperation(operation) // normally we would need to call setTimeout here, but setting timebounds // earlier does the trick! .build(); ``` **Source:** [src/horizon/server.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L155) ### `server.friendbot(address)` ```ts friendbot(address: string): FriendbotBuilder; ``` **Parameters** - **`address`** — `string` (required) — The Stellar ID that you want Friendbot to send lumens to **Returns** New `FriendbotBuilder` instance configured with the current Horizon server configuration **Chainable methods** - `call(): Promise` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:774](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L774) ### `server.ledgers()` ```ts ledgers(): LedgerCallBuilder; ``` **Returns** New `LedgerCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `ledger(sequence: string | number): this` — Provides information on a single ledger. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:615](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L615) ### `server.liquidityPools()` ```ts liquidityPools(): LiquidityPoolCallBuilder; ``` **Returns** New `LiquidityPoolCallBuilder` object configured to the current Horizon server settings. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(id: string): this` — Retrieves all pools an account is participating in. - `forAssets(...assets: Asset[]): this` — Filters out pools whose reserves don't exactly match these assets. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `liquidityPoolId(id: string): CallBuilder` — Retrieves a specific liquidity pool by ID. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:680](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L680) ### `server.loadAccount(accountId)` Fetches an account's most current state in the ledger, then creates and returns an `AccountResponse` object. ```ts loadAccount(accountId: string): Promise; ``` **Parameters** - **`accountId`** — `string` (required) — The account to load. **Returns** Returns a promise to the `AccountResponse` object with populated sequence number. **Source:** [src/horizon/server.ts:796](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L796) ### `server.offers()` People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the offers on the DEX. You can query all offers for account using the function `.accountId`. ```ts offers(): OfferCallBuilder; ``` **Returns** New `OfferCallBuilder` object **Example** ```ts server.offers() .forAccount(accountId).call() .then(function(offers) { console.log(offers); }); ``` **Chainable methods** - `buying(asset: Asset): this` — Returns all offers buying an asset. - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(id: string): this` — Returns all offers where the given account is involved. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `offer(offerId: string): CallBuilder` — The offer details endpoint provides information on a single offer. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `seller(seller: string): this` — This endpoint filters offers where the given account is the seller. - `selling(asset: Asset): this` — Returns all offers selling an asset. - `sponsor(id: string): this` — This endpoint filters offers where the given account is sponsoring the offer entry. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:642](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L642) ### `server.operations()` ```ts operations(): OperationCallBuilder; ``` **Returns** New `OperationCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(accountId: string): this` — This endpoint represents all operations that were included in valid transactions that affected a particular account. - `forClaimableBalance(claimableBalanceId: string): this` — This endpoint represents all operations that reference a given claimable_balance. - `forLedger(sequence: string | number): this` — This endpoint returns all operations that occurred in a given ledger. - `forLiquidityPool(poolId: string): this` — This endpoint represents all operations involving a particular liquidity pool. - `forTransaction(transactionId: string): this` — This endpoint represents all operations that are part of a given transaction. - `includeFailed(value: boolean): this` — Adds a parameter defining whether to include failed transactions. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `operation(operationId: string): CallBuilder` — The operation details endpoint provides information on a single operation. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:672](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L672) ### `server.orderbook(selling, buying)` ```ts orderbook(selling: Asset, buying: Asset): OrderbookCallBuilder; ``` **Parameters** - **`selling`** — `Asset` (required) — Asset being sold - **`buying`** — `Asset` (required) — Asset being bought **Returns** New `OrderbookCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `call(): Promise` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:651](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L651) ### `server.payments()` ```ts payments(): PaymentCallBuilder; ``` **Returns** New `PaymentCallBuilder` instance configured with the current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(accountId: string): this` — This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver. - `forLedger(sequence: string | number): this` — This endpoint represents all payment operations that are part of a valid transactions in a given ledger. - `forTransaction(transactionId: string): this` — This endpoint represents all payment operations that are part of a given transaction. - `includeFailed(value: boolean): this` — Adds a parameter defining whether to include failed transactions. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:757](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L757) ### `server.root()` Fetch the Horizon server's root endpoint. ```ts root(): Promise; ``` **Returns** Promise that resolves to the root endpoint returned by Horizon. **Source:** [src/horizon/server.ts:217](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L217) ### `server.strictReceivePaths(source, destinationAsset, destinationAmount)` The Stellar Network allows payments to be made between assets through path payments. A strict receive path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee). A strict receive path search is specified using: * The destination address. * The source address or source assets. * The asset and amount that the destination account should receive. As part of the search, horizon will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search's amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount. If a list of assets is passed as the source, horizon will find any payment paths from those source assets to the desired destination asset. ```ts strictReceivePaths(source: string | Asset[], destinationAsset: Asset, destinationAmount: string): PathCallBuilder; ``` **Parameters** - **`source`** — `string | Asset[]` (required) — The sender's account ID or a list of assets. Any returned path will use a source that the sender can hold. - **`destinationAsset`** — `Asset` (required) — The destination asset. - **`destinationAmount`** — `string` (required) — The amount, denominated in the destination asset, that any returned path should be able to satisfy. **Returns** New `StrictReceivePathCallBuilder` object configured with the current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:710](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L710) ### `server.strictSendPaths(sourceAsset, sourceAmount, destination)` The Stellar Network allows payments to be made between assets through path payments. A strict send path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee). A strict send path search is specified using: The asset and amount that is being sent. The destination account or the destination assets. ```ts strictSendPaths(sourceAsset: Asset, sourceAmount: string, destination: string | Asset[]): PathCallBuilder; ``` **Parameters** - **`sourceAsset`** — `Asset` (required) — The asset to be sent. - **`sourceAmount`** — `string` (required) — The amount, denominated in the source asset, that any returned path should be able to satisfy. - **`destination`** — `string | Asset[]` (required) — The destination account or the destination assets. **Returns** New `StrictSendPathCallBuilder` object configured with the current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:739](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L739) ### `server.submitAsyncTransaction(transaction, opts)` Submits an asynchronous transaction to the network. Unlike the synchronous version, which blocks and waits for the transaction to be ingested in Horizon, this endpoint relays the response from core directly back to the user. By default, this function calls `HorizonServer.checkMemoRequired`, you can skip this check by setting the option `skipMemoRequiredCheck` to `true`. ```ts submitAsyncTransaction(transaction: Transaction | FeeBumpTransaction, opts: SubmitTransactionOptions = ...): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — The transaction to submit. - **`opts`** — `SubmitTransactionOptions` (optional) (default: `...`) — (optional) Options object - `skipMemoRequiredCheck` (optional): Allow skipping memo required check, default: `false`. See [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md). **Returns** Promise that resolves or rejects with response from horizon. **See also** - [Submit-Async-Transaction](https://developers.stellar.org/docs/data/horizon/api-reference/resources/submit-async-transaction) **Source:** [src/horizon/server.ts:559](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L559) ### `server.submitTransaction(transaction, opts)` Submits a transaction to the network. By default this function calls `Horizon.Server.checkMemoRequired`, you can skip this check by setting the option `skipMemoRequiredCheck` to `true`. If you submit any number of `manageOffer` operations, this will add an attribute to the response that will help you analyze what happened with your offers. For example, you'll want to examine `offerResults` to add affordances like these to your app: - If `wasImmediatelyFilled` is true, then no offer was created. So if you normally watch the `Server.offers` endpoint for offer updates, you instead need to check `Server.trades` to find the result of this filled offer. - If `wasImmediatelyDeleted` is true, then the offer you submitted was deleted without reaching the orderbook or being matched (possibly because your amounts were rounded down to zero). So treat the just-submitted offer request as if it never happened. - If `wasPartiallyFilled` is true, you can tell the user that `amountBought` or `amountSold` have already been transferred. ```ts submitTransaction(transaction: Transaction | FeeBumpTransaction, opts: SubmitTransactionOptions = ...): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — The transaction to submit. - **`opts`** — `SubmitTransactionOptions` (optional) (default: `...`) — (optional) Options object - `skipMemoRequiredCheck` (optional): Allow skipping memo required check, default: `false`. See [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md). **Returns** Promise that resolves or rejects with response from horizon. **Example** ```ts const res = { ...response, offerResults: [ { // Exact ordered list of offers that executed, with the exception // that the last one may not have executed entirely. offersClaimed: [ sellerId: String, offerId: String, assetSold: { type: 'native|credit_alphanum4|credit_alphanum12', // these are only present if the asset is not native assetCode: String, issuer: String, }, // same shape as assetSold assetBought: {} ], // What effect your manageOffer op had effect: "manageOfferCreated|manageOfferUpdated|manageOfferDeleted", // Whether your offer immediately got matched and filled wasImmediatelyFilled: Boolean, // Whether your offer immediately got deleted, if for example the order was too small wasImmediatelyDeleted: Boolean, // Whether the offer was partially, but not completely, filled wasPartiallyFilled: Boolean, // The full requested amount of the offer is open for matching isFullyOpen: Boolean, // The total amount of tokens bought / sold during transaction execution amountBought: Number, amountSold: Number, // if the offer was created, updated, or partially filled, this is // the outstanding offer currentOffer: { offerId: String, amount: String, price: { n: String, d: String, }, selling: { type: 'native|credit_alphanum4|credit_alphanum12', // these are only present if the asset is not native assetCode: String, issuer: String, }, // same as `selling` buying: {}, }, // the index of this particular operation in the op stack operationIndex: Number } ] } ``` **See also** - `Submit a Transaction` **Source:** [src/horizon/server.ts:328](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L328) ### `server.tradeAggregation(base, counter, start_time, end_time, resolution, offset)` ```ts tradeAggregation(base: Asset, counter: Asset, start_time: number, end_time: number, resolution: number, offset: number): TradeAggregationCallBuilder; ``` **Parameters** - **`base`** — `Asset` (required) — base asset - **`counter`** — `Asset` (required) — counter asset - **`start_time`** — `number` (required) — lower time boundary represented as millis since epoch - **`end_time`** — `number` (required) — upper time boundary represented as millis since epoch - **`resolution`** — `number` (required) — segment duration as millis since epoch. *Supported values are 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000). - **`offset`** — `number` (required) — segments can be offset using this parameter. Expressed in milliseconds. *Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours. Returns new `TradeAggregationCallBuilder` object configured with the current Horizon server configuration. **Returns** New TradeAggregationCallBuilder instance **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:813](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L813) ### `server.trades()` Returns ```ts trades(): TradesCallBuilder; ``` **Returns** New `TradesCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(accountId: string): this` — Filter trades for a specific account - `forAssetPair(base: Asset, counter: Asset): this` — Filter trades for a specific asset pair (orderbook) - `forLiquidityPool(liquidityPoolId: string): this` — Filter trades for a specific liquidity pool - `forOffer(offerId: string): this` — Filter trades for a specific offer - `forType(tradeType: TradeType): this` — Filter trades by a specific type. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. **Source:** [src/horizon/server.ts:665](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L665) ### `server.transactions()` ```ts transactions(): TransactionCallBuilder; ``` **Returns** New `TransactionCallBuilder` object configured by a current Horizon server configuration. **Chainable methods** - `call(): Promise>` — Triggers a HTTP request using this builder's current configuration. - `cursor(cursor: string): this` — Sets `cursor` parameter for the current call. - `forAccount(accountId: string): this` — This endpoint represents all transactions that affected a given account. - `forClaimableBalance(claimableBalanceId: string): this` — This endpoint represents all transactions that reference a given claimable_balance. - `forLedger(sequence: string | number): this` — This endpoint represents all transactions in a given ledger. - `forLiquidityPool(poolId: string): this` — This endpoint represents all transactions involving a particular liquidity pool. - `includeFailed(value: boolean): this` — Adds a parameter defining whether to include failed transactions. - `join(include: "transactions"): this` — Sets `join` parameter for the current call. - `limit(recordsNumber: number): this` — Sets `limit` parameter for the current call. - `order(direction: "asc" | "desc"): this` — Sets `order` parameter for the current call. - `stream(options: EventSourceOptions = {}): () => void` — Creates an EventSource that listens for incoming messages from the server. - `transaction(transactionId: string): CallBuilder` — The transaction details endpoint provides information on a single transaction. **Source:** [src/horizon/server.ts:622](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L622) ## Horizon.ServerApi.EffectType ```ts const EffectType: typeof EffectType ``` **Source:** [src/horizon/server_api.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L86) ## Horizon.getCurrentServerTime Given a hostname, get the current time of that server (i.e., use the last- recorded server time and offset it by the time since then.) If there IS no recorded server time, or it's been 5 minutes since the last, return null. ```ts getCurrentServerTime(hostname: string): number | null ``` **Parameters** - **`hostname`** — `string` (required) — Hostname of a Horizon server. **Returns** The UNIX timestamp (in seconds, not milliseconds) representing the current time on that server, or `null` if we don't have a record of that time. **Source:** [src/horizon/horizon_axios_client.ts:96](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_axios_client.ts#L96) ## Types ### Horizon.HorizonApi.AccountMergeOperationResponse ```ts interface AccountMergeOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; into: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: accountMerge; type_i: accountMerge; } ``` **Source:** [src/horizon/horizon_api.ts:416](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L416) #### `accountMergeOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `accountMergeOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `accountMergeOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `accountMergeOperationResponse.into` ```ts into: string; ``` **Source:** [src/horizon/horizon_api.ts:420](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L420) #### `accountMergeOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `accountMergeOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `accountMergeOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `accountMergeOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `accountMergeOperationResponse.type` ```ts type: accountMerge; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `accountMergeOperationResponse.type_i` ```ts type_i: accountMerge; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.AccountResponse ```ts interface AccountResponse extends BaseResponse<"transactions" | "operations" | "payments" | "effects" | "offers" | "trades" | "data"> { _links: { data: ResponseLink; effects: ResponseLink; offers: ResponseLink; operations: ResponseLink; payments: ResponseLink; self: ResponseLink; trades: ResponseLink; transactions: ResponseLink }; account_id: string; balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; data: { [key: string]: string }; flags: Flags; id: string; last_modified_ledger: number; last_modified_time: string; num_sponsored: number; num_sponsoring: number; paging_token: string; sequence: string; sequence_ledger?: number; sequence_time?: string; signers: AccountSigner[]; sponsor?: string; subentry_count: number; thresholds: AccountThresholds; } ``` **Source:** [src/horizon/horizon_api.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L167) #### `accountResponse._links` ```ts _links: { data: ResponseLink; effects: ResponseLink; offers: ResponseLink; operations: ResponseLink; payments: ResponseLink; self: ResponseLink; trades: ResponseLink; transactions: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `accountResponse.account_id` ```ts account_id: string; ``` **Source:** [src/horizon/horizon_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L178) #### `accountResponse.balances` ```ts balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; ``` **Source:** [src/horizon/horizon_api.ts:187](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L187) #### `accountResponse.data` ```ts data: { [key: string]: string }; ``` **Source:** [src/horizon/horizon_api.ts:189](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L189) #### `accountResponse.flags` ```ts flags: Flags; ``` **Source:** [src/horizon/horizon_api.ts:186](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L186) #### `accountResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:176](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L176) #### `accountResponse.last_modified_ledger` ```ts last_modified_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:184](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L184) #### `accountResponse.last_modified_time` ```ts last_modified_time: string; ``` **Source:** [src/horizon/horizon_api.ts:185](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L185) #### `accountResponse.num_sponsored` ```ts num_sponsored: number; ``` **Source:** [src/horizon/horizon_api.ts:194](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L194) #### `accountResponse.num_sponsoring` ```ts num_sponsoring: number; ``` **Source:** [src/horizon/horizon_api.ts:193](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L193) #### `accountResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L177) #### `accountResponse.sequence` ```ts sequence: string; ``` **Source:** [src/horizon/horizon_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L179) #### `accountResponse.sequence_ledger` ```ts sequence_ledger?: number; ``` **Source:** [src/horizon/horizon_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L180) #### `accountResponse.sequence_time` ```ts sequence_time?: string; ``` **Source:** [src/horizon/horizon_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L181) #### `accountResponse.signers` ```ts signers: AccountSigner[]; ``` **Source:** [src/horizon/horizon_api.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L188) #### `accountResponse.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/horizon_api.ts:192](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L192) #### `accountResponse.subentry_count` ```ts subentry_count: number; ``` **Source:** [src/horizon/horizon_api.ts:182](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L182) #### `accountResponse.thresholds` ```ts thresholds: AccountThresholds; ``` **Source:** [src/horizon/horizon_api.ts:183](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L183) ### Horizon.HorizonApi.AccountSigner ```ts interface AccountSigner { key: string; sponsor?: string; type: string; weight: number; } ``` **Source:** [src/horizon/horizon_api.ts:161](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L161) #### `accountSigner.key` ```ts key: string; ``` **Source:** [src/horizon/horizon_api.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L162) #### `accountSigner.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/horizon_api.ts:165](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L165) #### `accountSigner.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L164) #### `accountSigner.weight` ```ts weight: number; ``` **Source:** [src/horizon/horizon_api.ts:163](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L163) ### Horizon.HorizonApi.AccountThresholds ```ts interface AccountThresholds { high_threshold: number; low_threshold: number; med_threshold: number; } ``` **Source:** [src/horizon/horizon_api.ts:150](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L150) #### `accountThresholds.high_threshold` ```ts high_threshold: number; ``` **Source:** [src/horizon/horizon_api.ts:153](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L153) #### `accountThresholds.low_threshold` ```ts low_threshold: number; ``` **Source:** [src/horizon/horizon_api.ts:151](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L151) #### `accountThresholds.med_threshold` ```ts med_threshold: number; ``` **Source:** [src/horizon/horizon_api.ts:152](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L152) ### Horizon.HorizonApi.AllowTrustOperationResponse ```ts interface AllowTrustOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code: string; asset_issuer: string; asset_type: AssetType; authorize: boolean; authorize_to_maintain_liabilities: boolean; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; trustee: string; trustor: string; type: allowTrust; type_i: allowTrust; } ``` **Source:** [src/horizon/horizon_api.ts:404](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L404) #### `allowTrustOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `allowTrustOperationResponse.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:409](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L409) #### `allowTrustOperationResponse.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:410](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L410) #### `allowTrustOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:408](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L408) #### `allowTrustOperationResponse.authorize` ```ts authorize: boolean; ``` **Source:** [src/horizon/horizon_api.ts:411](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L411) #### `allowTrustOperationResponse.authorize_to_maintain_liabilities` ```ts authorize_to_maintain_liabilities: boolean; ``` **Source:** [src/horizon/horizon_api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L412) #### `allowTrustOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `allowTrustOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `allowTrustOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `allowTrustOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `allowTrustOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `allowTrustOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `allowTrustOperationResponse.trustee` ```ts trustee: string; ``` **Source:** [src/horizon/horizon_api.ts:413](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L413) #### `allowTrustOperationResponse.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:414](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L414) #### `allowTrustOperationResponse.type` ```ts type: allowTrust; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `allowTrustOperationResponse.type_i` ```ts type_i: allowTrust; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.AssetAccounts ```ts interface AssetAccounts { authorized: number; authorized_to_maintain_liabilities: number; unauthorized: number; } ``` **Source:** [src/horizon/horizon_api.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L129) #### `assetAccounts.authorized` ```ts authorized: number; ``` **Source:** [src/horizon/horizon_api.ts:130](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L130) #### `assetAccounts.authorized_to_maintain_liabilities` ```ts authorized_to_maintain_liabilities: number; ``` **Source:** [src/horizon/horizon_api.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L131) #### `assetAccounts.unauthorized` ```ts unauthorized: number; ``` **Source:** [src/horizon/horizon_api.ts:132](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L132) ### Horizon.HorizonApi.AssetBalances ```ts interface AssetBalances { authorized: string; authorized_to_maintain_liabilities: string; unauthorized: string; } ``` **Source:** [src/horizon/horizon_api.ts:134](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L134) #### `assetBalances.authorized` ```ts authorized: string; ``` **Source:** [src/horizon/horizon_api.ts:135](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L135) #### `assetBalances.authorized_to_maintain_liabilities` ```ts authorized_to_maintain_liabilities: string; ``` **Source:** [src/horizon/horizon_api.ts:136](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L136) #### `assetBalances.unauthorized` ```ts unauthorized: string; ``` **Source:** [src/horizon/horizon_api.ts:137](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L137) ### Horizon.HorizonApi.BalanceChange ```ts interface BalanceChange { amount: string; asset_code?: string; asset_issuer?: string; asset_type: string; destination_muxed_id?: string; from: string; to: string; type: string; } ``` **Source:** [src/horizon/horizon_api.ts:556](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L556) #### `balanceChange.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:564](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L564) #### `balanceChange.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:558](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L558) #### `balanceChange.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:559](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L559) #### `balanceChange.asset_type` ```ts asset_type: string; ``` **Source:** [src/horizon/horizon_api.ts:557](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L557) #### `balanceChange.destination_muxed_id` ```ts destination_muxed_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:565](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L565) #### `balanceChange.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:562](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L562) #### `balanceChange.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:563](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L563) #### `balanceChange.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:561](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L561) ### Horizon.HorizonApi.BalanceLine ```ts type BalanceLine = T extends AssetType.native ? BalanceLineNative : T extends (AssetType.credit4 | AssetType.credit12) ? BalanceLineAsset : T extends AssetType.liquidityPoolShares ? BalanceLineLiquidityPool : BalanceLineNative | BalanceLineAsset | BalanceLineLiquidityPool ``` **Source:** [src/horizon/horizon_api.ts:120](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L120) ### Horizon.HorizonApi.BalanceLineAsset ```ts interface BalanceLineAsset { asset_code: string; asset_issuer: string; asset_type: T; balance: string; buying_liabilities: string; is_authorized: boolean; is_authorized_to_maintain_liabilities: boolean; is_clawback_enabled: boolean; last_modified_ledger: number; limit: string; selling_liabilities: string; sponsor?: string; } ``` **Source:** [src/horizon/horizon_api.ts:102](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L102) #### `balanceLineAsset.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:110](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L110) #### `balanceLineAsset.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:111](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L111) #### `balanceLineAsset.asset_type` ```ts asset_type: T; ``` **Source:** [src/horizon/horizon_api.ts:109](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L109) #### `balanceLineAsset.balance` ```ts balance: string; ``` **Source:** [src/horizon/horizon_api.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L107) #### `balanceLineAsset.buying_liabilities` ```ts buying_liabilities: string; ``` **Source:** [src/horizon/horizon_api.ts:112](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L112) #### `balanceLineAsset.is_authorized` ```ts is_authorized: boolean; ``` **Source:** [src/horizon/horizon_api.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L115) #### `balanceLineAsset.is_authorized_to_maintain_liabilities` ```ts is_authorized_to_maintain_liabilities: boolean; ``` **Source:** [src/horizon/horizon_api.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L116) #### `balanceLineAsset.is_clawback_enabled` ```ts is_clawback_enabled: boolean; ``` **Source:** [src/horizon/horizon_api.ts:117](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L117) #### `balanceLineAsset.last_modified_ledger` ```ts last_modified_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:114](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L114) #### `balanceLineAsset.limit` ```ts limit: string; ``` **Source:** [src/horizon/horizon_api.ts:108](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L108) #### `balanceLineAsset.selling_liabilities` ```ts selling_liabilities: string; ``` **Source:** [src/horizon/horizon_api.ts:113](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L113) #### `balanceLineAsset.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/horizon_api.ts:118](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L118) ### Horizon.HorizonApi.BalanceLineLiquidityPool ```ts interface BalanceLineLiquidityPool { asset_type: "liquidity_pool_shares"; balance: string; is_authorized: boolean; is_authorized_to_maintain_liabilities: boolean; is_clawback_enabled: boolean; last_modified_ledger: number; limit: string; liquidity_pool_id: string; sponsor?: string; } ``` **Source:** [src/horizon/horizon_api.ts:91](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L91) #### `balanceLineLiquidityPool.asset_type` ```ts asset_type: "liquidity_pool_shares"; ``` **Source:** [src/horizon/horizon_api.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L93) #### `balanceLineLiquidityPool.balance` ```ts balance: string; ``` **Source:** [src/horizon/horizon_api.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L94) #### `balanceLineLiquidityPool.is_authorized` ```ts is_authorized: boolean; ``` **Source:** [src/horizon/horizon_api.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L97) #### `balanceLineLiquidityPool.is_authorized_to_maintain_liabilities` ```ts is_authorized_to_maintain_liabilities: boolean; ``` **Source:** [src/horizon/horizon_api.ts:98](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L98) #### `balanceLineLiquidityPool.is_clawback_enabled` ```ts is_clawback_enabled: boolean; ``` **Source:** [src/horizon/horizon_api.ts:99](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L99) #### `balanceLineLiquidityPool.last_modified_ledger` ```ts last_modified_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:96](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L96) #### `balanceLineLiquidityPool.limit` ```ts limit: string; ``` **Source:** [src/horizon/horizon_api.ts:95](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L95) #### `balanceLineLiquidityPool.liquidity_pool_id` ```ts liquidity_pool_id: string; ``` **Source:** [src/horizon/horizon_api.ts:92](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L92) #### `balanceLineLiquidityPool.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/horizon_api.ts:100](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L100) ### Horizon.HorizonApi.BalanceLineNative ```ts interface BalanceLineNative { asset_type: "native"; balance: string; buying_liabilities: string; selling_liabilities: string; } ``` **Source:** [src/horizon/horizon_api.ts:85](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L85) #### `balanceLineNative.asset_type` ```ts asset_type: "native"; ``` **Source:** [src/horizon/horizon_api.ts:87](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L87) #### `balanceLineNative.balance` ```ts balance: string; ``` **Source:** [src/horizon/horizon_api.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L86) #### `balanceLineNative.buying_liabilities` ```ts buying_liabilities: string; ``` **Source:** [src/horizon/horizon_api.ts:88](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L88) #### `balanceLineNative.selling_liabilities` ```ts selling_liabilities: string; ``` **Source:** [src/horizon/horizon_api.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L89) ### Horizon.HorizonApi.BaseOperationResponse ```ts interface BaseOperationResponse extends BaseResponse<"succeeds" | "precedes" | "effects" | "transaction"> { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: T; type_i: TI; } ``` **Source:** [src/horizon/horizon_api.ts:259](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L259) #### `baseOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `baseOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `baseOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `baseOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `baseOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `baseOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `baseOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `baseOperationResponse.type` ```ts type: T; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `baseOperationResponse.type_i` ```ts type_i: TI; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.BaseResponse ```ts interface BaseResponse { _links: { [key in string]: ResponseLink }; } ``` **Source:** [src/horizon/horizon_api.ts:9](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L9) #### `baseResponse._links` ```ts _links: { [key in string]: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) ### Horizon.HorizonApi.BeginSponsoringFutureReservesOperationResponse ```ts interface BeginSponsoringFutureReservesOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; paging_token: string; source_account: string; sponsored_id: string; transaction_hash: string; transaction_successful: boolean; type: beginSponsoringFutureReserves; type_i: beginSponsoringFutureReserves; } ``` **Source:** [src/horizon/horizon_api.ts:470](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L470) #### `beginSponsoringFutureReservesOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `beginSponsoringFutureReservesOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `beginSponsoringFutureReservesOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `beginSponsoringFutureReservesOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `beginSponsoringFutureReservesOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `beginSponsoringFutureReservesOperationResponse.sponsored_id` ```ts sponsored_id: string; ``` **Source:** [src/horizon/horizon_api.ts:474](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L474) #### `beginSponsoringFutureReservesOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `beginSponsoringFutureReservesOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `beginSponsoringFutureReservesOperationResponse.type` ```ts type: beginSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `beginSponsoringFutureReservesOperationResponse.type_i` ```ts type_i: beginSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.BumpFootprintExpirationOperationResponse ```ts interface BumpFootprintExpirationOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; ledgers_to_expire: number; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: bumpFootprintExpiration; type_i: bumpFootprintExpiration; } ``` **Source:** [src/horizon/horizon_api.ts:582](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L582) #### `bumpFootprintExpirationOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `bumpFootprintExpirationOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `bumpFootprintExpirationOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `bumpFootprintExpirationOperationResponse.ledgers_to_expire` ```ts ledgers_to_expire: number; ``` **Source:** [src/horizon/horizon_api.ts:586](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L586) #### `bumpFootprintExpirationOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `bumpFootprintExpirationOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `bumpFootprintExpirationOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `bumpFootprintExpirationOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `bumpFootprintExpirationOperationResponse.type` ```ts type: bumpFootprintExpiration; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `bumpFootprintExpirationOperationResponse.type_i` ```ts type_i: bumpFootprintExpiration; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.BumpSequenceOperationResponse ```ts interface BumpSequenceOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; bump_to: string; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: bumpSequence; type_i: bumpSequence; } ``` **Source:** [src/horizon/horizon_api.ts:433](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L433) #### `bumpSequenceOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `bumpSequenceOperationResponse.bump_to` ```ts bump_to: string; ``` **Source:** [src/horizon/horizon_api.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L437) #### `bumpSequenceOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `bumpSequenceOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `bumpSequenceOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `bumpSequenceOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `bumpSequenceOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `bumpSequenceOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `bumpSequenceOperationResponse.type` ```ts type: bumpSequence; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `bumpSequenceOperationResponse.type_i` ```ts type_i: bumpSequence; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.ChangeTrustOperationResponse ```ts interface ChangeTrustOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code?: string; asset_issuer?: string; asset_type: "credit_alphanum4" | "credit_alphanum12" | "liquidity_pool_shares"; created_at: string; id: string; limit: string; liquidity_pool_id?: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; trustee?: string; trustor: string; type: changeTrust; type_i: changeTrust; } ``` **Source:** [src/horizon/horizon_api.ts:389](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L389) #### `changeTrustOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `changeTrustOperationResponse.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:397](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L397) #### `changeTrustOperationResponse.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:398](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L398) #### `changeTrustOperationResponse.asset_type` ```ts asset_type: "credit_alphanum4" | "credit_alphanum12" | "liquidity_pool_shares"; ``` **Source:** [src/horizon/horizon_api.ts:393](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L393) #### `changeTrustOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `changeTrustOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `changeTrustOperationResponse.limit` ```ts limit: string; ``` **Source:** [src/horizon/horizon_api.ts:402](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L402) #### `changeTrustOperationResponse.liquidity_pool_id` ```ts liquidity_pool_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:399](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L399) #### `changeTrustOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `changeTrustOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `changeTrustOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `changeTrustOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `changeTrustOperationResponse.trustee` ```ts trustee?: string; ``` **Source:** [src/horizon/horizon_api.ts:400](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L400) #### `changeTrustOperationResponse.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:401](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L401) #### `changeTrustOperationResponse.type` ```ts type: changeTrust; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `changeTrustOperationResponse.type_i` ```ts type_i: changeTrust; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.ClaimClaimableBalanceOperationResponse ```ts interface ClaimClaimableBalanceOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; balance_id: string; claimant: string; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: claimClaimableBalance; type_i: claimClaimableBalance; } ``` **Source:** [src/horizon/horizon_api.ts:462](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L462) #### `claimClaimableBalanceOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `claimClaimableBalanceOperationResponse.balance_id` ```ts balance_id: string; ``` **Source:** [src/horizon/horizon_api.ts:466](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L466) #### `claimClaimableBalanceOperationResponse.claimant` ```ts claimant: string; ``` **Source:** [src/horizon/horizon_api.ts:467](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L467) #### `claimClaimableBalanceOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `claimClaimableBalanceOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `claimClaimableBalanceOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `claimClaimableBalanceOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `claimClaimableBalanceOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `claimClaimableBalanceOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `claimClaimableBalanceOperationResponse.type` ```ts type: claimClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `claimClaimableBalanceOperationResponse.type_i` ```ts type_i: claimClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.Claimant ```ts interface Claimant { destination: string; predicate: Predicate; } ``` **Source:** [src/horizon/horizon_api.ts:447](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L447) #### `claimant.destination` ```ts destination: string; ``` **Source:** [src/horizon/horizon_api.ts:448](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L448) #### `claimant.predicate` ```ts predicate: Predicate; ``` **Source:** [src/horizon/horizon_api.ts:449](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L449) ### Horizon.HorizonApi.ClawbackClaimableBalanceOperationResponse ```ts interface ClawbackClaimableBalanceOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; balance_id: string; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: clawbackClaimableBalance; type_i: clawbackClaimableBalance; } ``` **Source:** [src/horizon/horizon_api.ts:511](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L511) #### `clawbackClaimableBalanceOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `clawbackClaimableBalanceOperationResponse.balance_id` ```ts balance_id: string; ``` **Source:** [src/horizon/horizon_api.ts:515](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L515) #### `clawbackClaimableBalanceOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `clawbackClaimableBalanceOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `clawbackClaimableBalanceOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `clawbackClaimableBalanceOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `clawbackClaimableBalanceOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `clawbackClaimableBalanceOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `clawbackClaimableBalanceOperationResponse.type` ```ts type: clawbackClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `clawbackClaimableBalanceOperationResponse.type_i` ```ts type_i: clawbackClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.ClawbackOperationResponse ```ts interface ClawbackOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code: string; asset_issuer: string; asset_type: AssetType; created_at: string; from: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: clawback; type_i: clawback; } ``` **Source:** [src/horizon/horizon_api.ts:500](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L500) #### `clawbackOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `clawbackOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:508](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L508) #### `clawbackOperationResponse.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:505](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L505) #### `clawbackOperationResponse.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:506](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L506) #### `clawbackOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:504](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L504) #### `clawbackOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `clawbackOperationResponse.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:507](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L507) #### `clawbackOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `clawbackOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `clawbackOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `clawbackOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `clawbackOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `clawbackOperationResponse.type` ```ts type: clawback; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `clawbackOperationResponse.type_i` ```ts type_i: clawback; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.CreateAccountOperationResponse ```ts interface CreateAccountOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; account: string; created_at: string; funder: string; id: string; paging_token: string; source_account: string; starting_balance: string; transaction_hash: string; transaction_successful: boolean; type: createAccount; type_i: createAccount; } ``` **Source:** [src/horizon/horizon_api.ts:272](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L272) #### `createAccountOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `createAccountOperationResponse.account` ```ts account: string; ``` **Source:** [src/horizon/horizon_api.ts:276](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L276) #### `createAccountOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `createAccountOperationResponse.funder` ```ts funder: string; ``` **Source:** [src/horizon/horizon_api.ts:277](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L277) #### `createAccountOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `createAccountOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `createAccountOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `createAccountOperationResponse.starting_balance` ```ts starting_balance: string; ``` **Source:** [src/horizon/horizon_api.ts:278](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L278) #### `createAccountOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `createAccountOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `createAccountOperationResponse.type` ```ts type: createAccount; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `createAccountOperationResponse.type_i` ```ts type_i: createAccount; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.CreateClaimableBalanceOperationResponse ```ts interface CreateClaimableBalanceOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset: string; claimants: Claimant[]; created_at: string; id: string; paging_token: string; source_account: string; sponsor: string; transaction_hash: string; transaction_successful: boolean; type: createClaimableBalance; type_i: createClaimableBalance; } ``` **Source:** [src/horizon/horizon_api.ts:452](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L452) #### `createClaimableBalanceOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `createClaimableBalanceOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:457](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L457) #### `createClaimableBalanceOperationResponse.asset` ```ts asset: string; ``` **Source:** [src/horizon/horizon_api.ts:456](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L456) #### `createClaimableBalanceOperationResponse.claimants` ```ts claimants: Claimant[]; ``` **Source:** [src/horizon/horizon_api.ts:459](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L459) #### `createClaimableBalanceOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `createClaimableBalanceOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `createClaimableBalanceOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `createClaimableBalanceOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `createClaimableBalanceOperationResponse.sponsor` ```ts sponsor: string; ``` **Source:** [src/horizon/horizon_api.ts:458](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L458) #### `createClaimableBalanceOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `createClaimableBalanceOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `createClaimableBalanceOperationResponse.type` ```ts type: createClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `createClaimableBalanceOperationResponse.type_i` ```ts type_i: createClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.DepositLiquidityOperationResponse ```ts interface DepositLiquidityOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; liquidity_pool_id: string; max_price: string; max_price_r: PriceRShorthand; min_price: string; min_price_r: PriceRShorthand; paging_token: string; reserves_deposited: Reserve[]; reserves_max: Reserve[]; shares_received: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: liquidityPoolDeposit; type_i: liquidityPoolDeposit; } ``` **Source:** [src/horizon/horizon_api.ts:533](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L533) #### `depositLiquidityOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `depositLiquidityOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `depositLiquidityOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `depositLiquidityOperationResponse.liquidity_pool_id` ```ts liquidity_pool_id: string; ``` **Source:** [src/horizon/horizon_api.ts:537](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L537) #### `depositLiquidityOperationResponse.max_price` ```ts max_price: string; ``` **Source:** [src/horizon/horizon_api.ts:541](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L541) #### `depositLiquidityOperationResponse.max_price_r` ```ts max_price_r: PriceRShorthand; ``` **Source:** [src/horizon/horizon_api.ts:542](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L542) #### `depositLiquidityOperationResponse.min_price` ```ts min_price: string; ``` **Source:** [src/horizon/horizon_api.ts:539](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L539) #### `depositLiquidityOperationResponse.min_price_r` ```ts min_price_r: PriceRShorthand; ``` **Source:** [src/horizon/horizon_api.ts:540](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L540) #### `depositLiquidityOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `depositLiquidityOperationResponse.reserves_deposited` ```ts reserves_deposited: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:543](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L543) #### `depositLiquidityOperationResponse.reserves_max` ```ts reserves_max: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:538](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L538) #### `depositLiquidityOperationResponse.shares_received` ```ts shares_received: string; ``` **Source:** [src/horizon/horizon_api.ts:544](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L544) #### `depositLiquidityOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `depositLiquidityOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `depositLiquidityOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `depositLiquidityOperationResponse.type` ```ts type: liquidityPoolDeposit; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `depositLiquidityOperationResponse.type_i` ```ts type_i: liquidityPoolDeposit; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.EndSponsoringFutureReservesOperationResponse ```ts interface EndSponsoringFutureReservesOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; begin_sponsor: string; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: endSponsoringFutureReserves; type_i: endSponsoringFutureReserves; } ``` **Source:** [src/horizon/horizon_api.ts:477](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L477) #### `endSponsoringFutureReservesOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `endSponsoringFutureReservesOperationResponse.begin_sponsor` ```ts begin_sponsor: string; ``` **Source:** [src/horizon/horizon_api.ts:481](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L481) #### `endSponsoringFutureReservesOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `endSponsoringFutureReservesOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `endSponsoringFutureReservesOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `endSponsoringFutureReservesOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `endSponsoringFutureReservesOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `endSponsoringFutureReservesOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `endSponsoringFutureReservesOperationResponse.type` ```ts type: endSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `endSponsoringFutureReservesOperationResponse.type_i` ```ts type_i: endSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.ErrorResponseData ```ts type ErrorResponseData = ErrorResponseData.RateLimitExceeded | ErrorResponseData.InternalServerError | ErrorResponseData.TransactionFailed ``` **Source:** [src/horizon/horizon_api.ts:630](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L630) ### Horizon.HorizonApi.ErrorResponseData.Base ```ts interface Base { details: string; instance: string; status: number; title: string; type: string; } ``` **Source:** [src/horizon/horizon_api.ts:636](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L636) #### `base.details` ```ts details: string; ``` **Source:** [src/horizon/horizon_api.ts:640](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L640) #### `base.instance` ```ts instance: string; ``` **Source:** [src/horizon/horizon_api.ts:641](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L641) #### `base.status` ```ts status: number; ``` **Source:** [src/horizon/horizon_api.ts:637](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L637) #### `base.title` ```ts title: string; ``` **Source:** [src/horizon/horizon_api.ts:638](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L638) #### `base.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:639](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L639) ### Horizon.HorizonApi.ErrorResponseData.InternalServerError ```ts interface InternalServerError extends Base { details: string; instance: string; status: 500; title: "Internal Server Error"; type: string; } ``` **Source:** [src/horizon/horizon_api.ts:648](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L648) #### `internalServerError.details` ```ts details: string; ``` **Source:** [src/horizon/horizon_api.ts:640](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L640) #### `internalServerError.instance` ```ts instance: string; ``` **Source:** [src/horizon/horizon_api.ts:641](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L641) #### `internalServerError.status` ```ts status: 500; ``` **Source:** [src/horizon/horizon_api.ts:649](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L649) #### `internalServerError.title` ```ts title: "Internal Server Error"; ``` **Source:** [src/horizon/horizon_api.ts:650](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L650) #### `internalServerError.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:639](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L639) ### Horizon.HorizonApi.ErrorResponseData.RateLimitExceeded ```ts interface RateLimitExceeded extends Base { details: string; instance: string; status: 429; title: "Rate Limit Exceeded"; type: string; } ``` **Source:** [src/horizon/horizon_api.ts:644](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L644) #### `rateLimitExceeded.details` ```ts details: string; ``` **Source:** [src/horizon/horizon_api.ts:640](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L640) #### `rateLimitExceeded.instance` ```ts instance: string; ``` **Source:** [src/horizon/horizon_api.ts:641](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L641) #### `rateLimitExceeded.status` ```ts status: 429; ``` **Source:** [src/horizon/horizon_api.ts:645](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L645) #### `rateLimitExceeded.title` ```ts title: "Rate Limit Exceeded"; ``` **Source:** [src/horizon/horizon_api.ts:646](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L646) #### `rateLimitExceeded.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:639](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L639) ### Horizon.HorizonApi.ErrorResponseData.TransactionFailed ```ts interface TransactionFailed extends Base { details: string; extras: TransactionFailedExtras; instance: string; status: 400; title: "Transaction Failed"; type: string; } ``` **Source:** [src/horizon/horizon_api.ts:652](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L652) #### `transactionFailed.details` ```ts details: string; ``` **Source:** [src/horizon/horizon_api.ts:640](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L640) #### `transactionFailed.extras` ```ts extras: TransactionFailedExtras; ``` **Source:** [src/horizon/horizon_api.ts:655](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L655) #### `transactionFailed.instance` ```ts instance: string; ``` **Source:** [src/horizon/horizon_api.ts:641](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L641) #### `transactionFailed.status` ```ts status: 400; ``` **Source:** [src/horizon/horizon_api.ts:653](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L653) #### `transactionFailed.title` ```ts title: "Transaction Failed"; ``` **Source:** [src/horizon/horizon_api.ts:654](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L654) #### `transactionFailed.type` ```ts type: string; ``` **Source:** [src/horizon/horizon_api.ts:639](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L639) ### Horizon.HorizonApi.FeeBumpTransactionResponse ```ts interface FeeBumpTransactionResponse { hash: string; signatures: string[]; } ``` **Source:** [src/horizon/horizon_api.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L29) #### `feeBumpTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:30](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L30) #### `feeBumpTransactionResponse.signatures` ```ts signatures: string[]; ``` **Source:** [src/horizon/horizon_api.ts:31](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L31) ### Horizon.HorizonApi.FeeDistribution ```ts interface FeeDistribution { max: string; min: string; mode: string; p10: string; p20: string; p30: string; p40: string; p50: string; p60: string; p70: string; p80: string; p90: string; p95: string; p99: string; } ``` **Source:** [src/horizon/horizon_api.ts:606](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L606) #### `feeDistribution.max` ```ts max: string; ``` **Source:** [src/horizon/horizon_api.ts:607](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L607) #### `feeDistribution.min` ```ts min: string; ``` **Source:** [src/horizon/horizon_api.ts:608](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L608) #### `feeDistribution.mode` ```ts mode: string; ``` **Source:** [src/horizon/horizon_api.ts:609](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L609) #### `feeDistribution.p10` ```ts p10: string; ``` **Source:** [src/horizon/horizon_api.ts:610](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L610) #### `feeDistribution.p20` ```ts p20: string; ``` **Source:** [src/horizon/horizon_api.ts:611](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L611) #### `feeDistribution.p30` ```ts p30: string; ``` **Source:** [src/horizon/horizon_api.ts:612](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L612) #### `feeDistribution.p40` ```ts p40: string; ``` **Source:** [src/horizon/horizon_api.ts:613](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L613) #### `feeDistribution.p50` ```ts p50: string; ``` **Source:** [src/horizon/horizon_api.ts:614](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L614) #### `feeDistribution.p60` ```ts p60: string; ``` **Source:** [src/horizon/horizon_api.ts:615](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L615) #### `feeDistribution.p70` ```ts p70: string; ``` **Source:** [src/horizon/horizon_api.ts:616](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L616) #### `feeDistribution.p80` ```ts p80: string; ``` **Source:** [src/horizon/horizon_api.ts:617](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L617) #### `feeDistribution.p90` ```ts p90: string; ``` **Source:** [src/horizon/horizon_api.ts:618](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L618) #### `feeDistribution.p95` ```ts p95: string; ``` **Source:** [src/horizon/horizon_api.ts:619](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L619) #### `feeDistribution.p99` ```ts p99: string; ``` **Source:** [src/horizon/horizon_api.ts:620](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L620) ### Horizon.HorizonApi.FeeStatsResponse ```ts interface FeeStatsResponse { fee_charged: FeeDistribution; last_ledger: string; last_ledger_base_fee: string; ledger_capacity_usage: string; max_fee: FeeDistribution; } ``` **Source:** [src/horizon/horizon_api.ts:622](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L622) #### `feeStatsResponse.fee_charged` ```ts fee_charged: FeeDistribution; ``` **Source:** [src/horizon/horizon_api.ts:626](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L626) #### `feeStatsResponse.last_ledger` ```ts last_ledger: string; ``` **Source:** [src/horizon/horizon_api.ts:623](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L623) #### `feeStatsResponse.last_ledger_base_fee` ```ts last_ledger_base_fee: string; ``` **Source:** [src/horizon/horizon_api.ts:624](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L624) #### `feeStatsResponse.ledger_capacity_usage` ```ts ledger_capacity_usage: string; ``` **Source:** [src/horizon/horizon_api.ts:625](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L625) #### `feeStatsResponse.max_fee` ```ts max_fee: FeeDistribution; ``` **Source:** [src/horizon/horizon_api.ts:627](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L627) ### Horizon.HorizonApi.Flags ```ts interface Flags { auth_clawback_enabled: boolean; auth_immutable: boolean; auth_required: boolean; auth_revocable: boolean; } ``` **Source:** [src/horizon/horizon_api.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L155) #### `flags.auth_clawback_enabled` ```ts auth_clawback_enabled: boolean; ``` **Source:** [src/horizon/horizon_api.ts:159](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L159) #### `flags.auth_immutable` ```ts auth_immutable: boolean; ``` **Source:** [src/horizon/horizon_api.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L156) #### `flags.auth_required` ```ts auth_required: boolean; ``` **Source:** [src/horizon/horizon_api.ts:157](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L157) #### `flags.auth_revocable` ```ts auth_revocable: boolean; ``` **Source:** [src/horizon/horizon_api.ts:158](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L158) ### Horizon.HorizonApi.InflationOperationResponse ```ts interface InflationOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: inflation; type_i: inflation; } ``` **Source:** [src/horizon/horizon_api.ts:422](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L422) #### `inflationOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `inflationOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `inflationOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `inflationOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `inflationOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `inflationOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `inflationOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `inflationOperationResponse.type` ```ts type: inflation; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `inflationOperationResponse.type_i` ```ts type_i: inflation; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.InnerTransactionResponse ```ts interface InnerTransactionResponse { hash: string; max_fee: string; signatures: string[]; } ``` **Source:** [src/horizon/horizon_api.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L34) #### `innerTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L35) #### `innerTransactionResponse.max_fee` ```ts max_fee: string; ``` **Source:** [src/horizon/horizon_api.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L37) #### `innerTransactionResponse.signatures` ```ts signatures: string[]; ``` **Source:** [src/horizon/horizon_api.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L36) ### Horizon.HorizonApi.InvokeHostFunctionOperationResponse ```ts interface InvokeHostFunctionOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; address: string; asset_balance_changes: BalanceChange[]; created_at: string; function: string; id: string; paging_token: string; parameters: { type: string; value: string }[]; salt: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: invokeHostFunction; type_i: invokeHostFunction; } ``` **Source:** [src/horizon/horizon_api.ts:568](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L568) #### `invokeHostFunctionOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `invokeHostFunctionOperationResponse.address` ```ts address: string; ``` **Source:** [src/horizon/horizon_api.ts:577](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L577) #### `invokeHostFunctionOperationResponse.asset_balance_changes` ```ts asset_balance_changes: BalanceChange[]; ``` **Source:** [src/horizon/horizon_api.ts:579](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L579) #### `invokeHostFunctionOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `invokeHostFunctionOperationResponse.function` ```ts function: string; ``` **Source:** [src/horizon/horizon_api.ts:572](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L572) #### `invokeHostFunctionOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `invokeHostFunctionOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `invokeHostFunctionOperationResponse.parameters` ```ts parameters: { type: string; value: string }[]; ``` **Source:** [src/horizon/horizon_api.ts:573](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L573) #### `invokeHostFunctionOperationResponse.salt` ```ts salt: string; ``` **Source:** [src/horizon/horizon_api.ts:578](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L578) #### `invokeHostFunctionOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `invokeHostFunctionOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `invokeHostFunctionOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `invokeHostFunctionOperationResponse.type` ```ts type: invokeHostFunction; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `invokeHostFunctionOperationResponse.type_i` ```ts type_i: invokeHostFunction; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.LiquidityPoolType ```ts enum LiquidityPoolType ``` **Source:** [src/horizon/horizon_api.ts:197](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L197) ### Horizon.HorizonApi.ManageDataOperationResponse ```ts interface ManageDataOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; name: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: manageData; type_i: manageData; value: Buffer; } ``` **Source:** [src/horizon/horizon_api.ts:426](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L426) #### `manageDataOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `manageDataOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `manageDataOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `manageDataOperationResponse.name` ```ts name: string; ``` **Source:** [src/horizon/horizon_api.ts:430](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L430) #### `manageDataOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `manageDataOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `manageDataOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `manageDataOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `manageDataOperationResponse.type` ```ts type: manageData; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `manageDataOperationResponse.type_i` ```ts type_i: manageData; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) #### `manageDataOperationResponse.value` ```ts value: Buffer; ``` **Source:** [src/horizon/horizon_api.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L431) ### Horizon.HorizonApi.ManageOfferOperationResponse ```ts interface ManageOfferOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; buying_asset_code?: string; buying_asset_issuer?: string; buying_asset_type: AssetType; created_at: string; id: string; offer_id: string | number; paging_token: string; price: string; price_r: PriceR; selling_asset_code?: string; selling_asset_issuer?: string; selling_asset_type: AssetType; source_account: string; transaction_hash: string; transaction_successful: boolean; type: manageOffer; type_i: manageOffer; } ``` **Source:** [src/horizon/horizon_api.ts:335](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L335) #### `manageOfferOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `manageOfferOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:340](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L340) #### `manageOfferOperationResponse.buying_asset_code` ```ts buying_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:342](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L342) #### `manageOfferOperationResponse.buying_asset_issuer` ```ts buying_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:343](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L343) #### `manageOfferOperationResponse.buying_asset_type` ```ts buying_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:341](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L341) #### `manageOfferOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `manageOfferOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `manageOfferOperationResponse.offer_id` ```ts offer_id: string | number; ``` **Source:** [src/horizon/horizon_api.ts:339](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L339) #### `manageOfferOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `manageOfferOperationResponse.price` ```ts price: string; ``` **Source:** [src/horizon/horizon_api.ts:344](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L344) #### `manageOfferOperationResponse.price_r` ```ts price_r: PriceR; ``` **Source:** [src/horizon/horizon_api.ts:345](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L345) #### `manageOfferOperationResponse.selling_asset_code` ```ts selling_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:347](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L347) #### `manageOfferOperationResponse.selling_asset_issuer` ```ts selling_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:348](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L348) #### `manageOfferOperationResponse.selling_asset_type` ```ts selling_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:346](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L346) #### `manageOfferOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `manageOfferOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `manageOfferOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `manageOfferOperationResponse.type` ```ts type: manageOffer; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `manageOfferOperationResponse.type_i` ```ts type_i: manageOffer; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.OperationResponseType ```ts enum OperationResponseType ``` **Source:** [src/horizon/horizon_api.ts:201](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L201) ### Horizon.HorizonApi.OperationResponseTypeI ```ts enum OperationResponseTypeI ``` **Source:** [src/horizon/horizon_api.ts:230](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L230) ### Horizon.HorizonApi.PassiveOfferOperationResponse ```ts interface PassiveOfferOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; buying_asset_code?: string; buying_asset_issuer?: string; buying_asset_type: AssetType; created_at: string; id: string; offer_id: string | number; paging_token: string; price: string; price_r: PriceR; selling_asset_code?: string; selling_asset_issuer?: string; selling_asset_type: AssetType; source_account: string; transaction_hash: string; transaction_successful: boolean; type: createPassiveOffer; type_i: createPassiveOffer; } ``` **Source:** [src/horizon/horizon_api.ts:350](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L350) #### `passiveOfferOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `passiveOfferOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:355](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L355) #### `passiveOfferOperationResponse.buying_asset_code` ```ts buying_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:357](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L357) #### `passiveOfferOperationResponse.buying_asset_issuer` ```ts buying_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:358](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L358) #### `passiveOfferOperationResponse.buying_asset_type` ```ts buying_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:356](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L356) #### `passiveOfferOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `passiveOfferOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `passiveOfferOperationResponse.offer_id` ```ts offer_id: string | number; ``` **Source:** [src/horizon/horizon_api.ts:354](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L354) #### `passiveOfferOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `passiveOfferOperationResponse.price` ```ts price: string; ``` **Source:** [src/horizon/horizon_api.ts:359](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L359) #### `passiveOfferOperationResponse.price_r` ```ts price_r: PriceR; ``` **Source:** [src/horizon/horizon_api.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L360) #### `passiveOfferOperationResponse.selling_asset_code` ```ts selling_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:362](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L362) #### `passiveOfferOperationResponse.selling_asset_issuer` ```ts selling_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:363](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L363) #### `passiveOfferOperationResponse.selling_asset_type` ```ts selling_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:361](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L361) #### `passiveOfferOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `passiveOfferOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `passiveOfferOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `passiveOfferOperationResponse.type` ```ts type: createPassiveOffer; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `passiveOfferOperationResponse.type_i` ```ts type_i: createPassiveOffer; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.PathPaymentOperationResponse ```ts interface PathPaymentOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; from: string; id: string; paging_token: string; path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; source_account: string; source_amount: string; source_asset_code?: string; source_asset_issuer?: string; source_asset_type: AssetType; source_max: string; to: string; transaction_hash: string; transaction_successful: boolean; type: pathPayment; type_i: pathPayment; } ``` **Source:** [src/horizon/horizon_api.ts:293](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L293) #### `pathPaymentOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `pathPaymentOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:297](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L297) #### `pathPaymentOperationResponse.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L298) #### `pathPaymentOperationResponse.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:299](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L299) #### `pathPaymentOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:300](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L300) #### `pathPaymentOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `pathPaymentOperationResponse.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:301](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L301) #### `pathPaymentOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `pathPaymentOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `pathPaymentOperationResponse.path` ```ts path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; ``` **Source:** [src/horizon/horizon_api.ts:302](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L302) #### `pathPaymentOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `pathPaymentOperationResponse.source_amount` ```ts source_amount: string; ``` **Source:** [src/horizon/horizon_api.ts:307](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L307) #### `pathPaymentOperationResponse.source_asset_code` ```ts source_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:308](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L308) #### `pathPaymentOperationResponse.source_asset_issuer` ```ts source_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:309](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L309) #### `pathPaymentOperationResponse.source_asset_type` ```ts source_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:310](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L310) #### `pathPaymentOperationResponse.source_max` ```ts source_max: string; ``` **Source:** [src/horizon/horizon_api.ts:311](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L311) #### `pathPaymentOperationResponse.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:312](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L312) #### `pathPaymentOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `pathPaymentOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `pathPaymentOperationResponse.type` ```ts type: pathPayment; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `pathPaymentOperationResponse.type_i` ```ts type_i: pathPayment; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.PathPaymentStrictSendOperationResponse ```ts interface PathPaymentStrictSendOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; destination_min: string; from: string; id: string; paging_token: string; path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; source_account: string; source_amount: string; source_asset_code?: string; source_asset_issuer?: string; source_asset_type: AssetType; to: string; transaction_hash: string; transaction_successful: boolean; type: pathPaymentStrictSend; type_i: pathPaymentStrictSend; } ``` **Source:** [src/horizon/horizon_api.ts:314](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L314) #### `pathPaymentStrictSendOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `pathPaymentStrictSendOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:318](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L318) #### `pathPaymentStrictSendOperationResponse.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:319](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L319) #### `pathPaymentStrictSendOperationResponse.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:320](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L320) #### `pathPaymentStrictSendOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:321](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L321) #### `pathPaymentStrictSendOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `pathPaymentStrictSendOperationResponse.destination_min` ```ts destination_min: string; ``` **Source:** [src/horizon/horizon_api.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L322) #### `pathPaymentStrictSendOperationResponse.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:323](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L323) #### `pathPaymentStrictSendOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `pathPaymentStrictSendOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `pathPaymentStrictSendOperationResponse.path` ```ts path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; ``` **Source:** [src/horizon/horizon_api.ts:324](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L324) #### `pathPaymentStrictSendOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `pathPaymentStrictSendOperationResponse.source_amount` ```ts source_amount: string; ``` **Source:** [src/horizon/horizon_api.ts:329](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L329) #### `pathPaymentStrictSendOperationResponse.source_asset_code` ```ts source_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:330](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L330) #### `pathPaymentStrictSendOperationResponse.source_asset_issuer` ```ts source_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:331](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L331) #### `pathPaymentStrictSendOperationResponse.source_asset_type` ```ts source_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:332](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L332) #### `pathPaymentStrictSendOperationResponse.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:333](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L333) #### `pathPaymentStrictSendOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `pathPaymentStrictSendOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `pathPaymentStrictSendOperationResponse.type` ```ts type: pathPaymentStrictSend; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `pathPaymentStrictSendOperationResponse.type_i` ```ts type_i: pathPaymentStrictSend; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.PaymentOperationResponse ```ts interface PaymentOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; from: string; id: string; paging_token: string; source_account: string; to: string; to_muxed?: string; to_muxed_id?: string; transaction_hash: string; transaction_successful: boolean; type: payment; type_i: payment; } ``` **Source:** [src/horizon/horizon_api.ts:280](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L280) #### `paymentOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `paymentOperationResponse.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:289](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L289) #### `paymentOperationResponse.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:287](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L287) #### `paymentOperationResponse.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:288](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L288) #### `paymentOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:286](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L286) #### `paymentOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `paymentOperationResponse.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:284](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L284) #### `paymentOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `paymentOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `paymentOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `paymentOperationResponse.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:285](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L285) #### `paymentOperationResponse.to_muxed` ```ts to_muxed?: string; ``` **Source:** [src/horizon/horizon_api.ts:290](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L290) #### `paymentOperationResponse.to_muxed_id` ```ts to_muxed_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:291](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L291) #### `paymentOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `paymentOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `paymentOperationResponse.type` ```ts type: payment; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `paymentOperationResponse.type_i` ```ts type_i: payment; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.Predicate ```ts interface Predicate { abs_before?: string; and?: Predicate[]; not?: Predicate; or?: Predicate[]; rel_before?: string; } ``` **Source:** [src/horizon/horizon_api.ts:439](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L439) #### `predicate.abs_before` ```ts abs_before?: string; ``` **Source:** [src/horizon/horizon_api.ts:443](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L443) #### `predicate.and` ```ts and?: Predicate[]; ``` **Source:** [src/horizon/horizon_api.ts:440](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L440) #### `predicate.not` ```ts not?: Predicate; ``` **Source:** [src/horizon/horizon_api.ts:442](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L442) #### `predicate.or` ```ts or?: Predicate[]; ``` **Source:** [src/horizon/horizon_api.ts:441](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L441) #### `predicate.rel_before` ```ts rel_before?: string; ``` **Source:** [src/horizon/horizon_api.ts:444](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L444) ### Horizon.HorizonApi.PriceR ```ts interface PriceR { denominator: number; numerator: number; } ``` **Source:** [src/horizon/horizon_api.ts:140](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L140) #### `priceR.denominator` ```ts denominator: number; ``` **Source:** [src/horizon/horizon_api.ts:142](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L142) #### `priceR.numerator` ```ts numerator: number; ``` **Source:** [src/horizon/horizon_api.ts:141](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L141) ### Horizon.HorizonApi.PriceRShorthand ```ts interface PriceRShorthand { d: number; n: number; } ``` **Source:** [src/horizon/horizon_api.ts:145](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L145) #### `priceRShorthand.d` ```ts d: number; ``` **Source:** [src/horizon/horizon_api.ts:147](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L147) #### `priceRShorthand.n` ```ts n: number; ``` **Source:** [src/horizon/horizon_api.ts:146](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L146) ### Horizon.HorizonApi.Reserve ```ts interface Reserve { amount: string; asset: string; } ``` **Source:** [src/horizon/horizon_api.ts:529](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L529) #### `reserve.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:531](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L531) #### `reserve.asset` ```ts asset: string; ``` **Source:** [src/horizon/horizon_api.ts:530](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L530) ### Horizon.HorizonApi.ResponseCollection ```ts interface ResponseCollection { _embedded: { records: T[] }; _links: { next: ResponseLink; prev: ResponseLink; self: ResponseLink }; } ``` **Source:** [src/horizon/horizon_api.ts:594](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L594) #### `responseCollection._embedded` ```ts _embedded: { records: T[] }; ``` **Source:** [src/horizon/horizon_api.ts:600](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L600) #### `responseCollection._links` ```ts _links: { next: ResponseLink; prev: ResponseLink; self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:595](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L595) ### Horizon.HorizonApi.ResponseLink ```ts interface ResponseLink { href: string; templated?: boolean; } ``` **Source:** [src/horizon/horizon_api.ts:5](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L5) #### `responseLink.href` ```ts href: string; ``` **Source:** [src/horizon/horizon_api.ts:6](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L6) #### `responseLink.templated` ```ts templated?: boolean; ``` **Source:** [src/horizon/horizon_api.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L7) ### Horizon.HorizonApi.RestoreFootprintOperationResponse ```ts interface RestoreFootprintOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; paging_token: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: restoreFootprint; type_i: restoreFootprint; } ``` **Source:** [src/horizon/horizon_api.ts:589](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L589) #### `restoreFootprintOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `restoreFootprintOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `restoreFootprintOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `restoreFootprintOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `restoreFootprintOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `restoreFootprintOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `restoreFootprintOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `restoreFootprintOperationResponse.type` ```ts type: restoreFootprint; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `restoreFootprintOperationResponse.type_i` ```ts type_i: restoreFootprint; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.RevokeSponsorshipOperationResponse ```ts interface RevokeSponsorshipOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; account_id?: string; claimable_balance_id?: string; created_at: string; data_account_id?: string; data_name?: string; id: string; offer_id?: string; paging_token: string; signer_account_id?: string; signer_key?: string; source_account: string; transaction_hash: string; transaction_successful: boolean; trustline_account_id?: string; trustline_asset?: string; trustline_liquidity_pool_id?: string; type: revokeSponsorship; type_i: revokeSponsorship; } ``` **Source:** [src/horizon/horizon_api.ts:484](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L484) #### `revokeSponsorshipOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `revokeSponsorshipOperationResponse.account_id` ```ts account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:488](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L488) #### `revokeSponsorshipOperationResponse.claimable_balance_id` ```ts claimable_balance_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:489](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L489) #### `revokeSponsorshipOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `revokeSponsorshipOperationResponse.data_account_id` ```ts data_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:490](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L490) #### `revokeSponsorshipOperationResponse.data_name` ```ts data_name?: string; ``` **Source:** [src/horizon/horizon_api.ts:491](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L491) #### `revokeSponsorshipOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `revokeSponsorshipOperationResponse.offer_id` ```ts offer_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:492](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L492) #### `revokeSponsorshipOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `revokeSponsorshipOperationResponse.signer_account_id` ```ts signer_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:496](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L496) #### `revokeSponsorshipOperationResponse.signer_key` ```ts signer_key?: string; ``` **Source:** [src/horizon/horizon_api.ts:497](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L497) #### `revokeSponsorshipOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `revokeSponsorshipOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `revokeSponsorshipOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `revokeSponsorshipOperationResponse.trustline_account_id` ```ts trustline_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:493](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L493) #### `revokeSponsorshipOperationResponse.trustline_asset` ```ts trustline_asset?: string; ``` **Source:** [src/horizon/horizon_api.ts:494](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L494) #### `revokeSponsorshipOperationResponse.trustline_liquidity_pool_id` ```ts trustline_liquidity_pool_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:495](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L495) #### `revokeSponsorshipOperationResponse.type` ```ts type: revokeSponsorship; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `revokeSponsorshipOperationResponse.type_i` ```ts type_i: revokeSponsorship; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.RootResponse ```ts interface RootResponse { core_latest_ledger: number; core_supported_protocol_version: number; core_version: string; current_protocol_version: number; history_elder_ledger: number; history_latest_ledger: number; history_latest_ledger_closed_at: string; horizon_version: string; ingest_latest_ledger: number; network_passphrase: string; supported_protocol_version: number; } ``` **Source:** [src/horizon/horizon_api.ts:686](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L686) #### `rootResponse.core_latest_ledger` ```ts core_latest_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:693](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L693) #### `rootResponse.core_supported_protocol_version` ```ts core_supported_protocol_version: number; ``` **Source:** [src/horizon/horizon_api.ts:697](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L697) #### `rootResponse.core_version` ```ts core_version: string; ``` **Source:** [src/horizon/horizon_api.ts:688](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L688) #### `rootResponse.current_protocol_version` ```ts current_protocol_version: number; ``` **Source:** [src/horizon/horizon_api.ts:695](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L695) #### `rootResponse.history_elder_ledger` ```ts history_elder_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:692](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L692) #### `rootResponse.history_latest_ledger` ```ts history_latest_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:690](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L690) #### `rootResponse.history_latest_ledger_closed_at` ```ts history_latest_ledger_closed_at: string; ``` **Source:** [src/horizon/horizon_api.ts:691](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L691) #### `rootResponse.horizon_version` ```ts horizon_version: string; ``` **Source:** [src/horizon/horizon_api.ts:687](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L687) #### `rootResponse.ingest_latest_ledger` ```ts ingest_latest_ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:689](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L689) #### `rootResponse.network_passphrase` ```ts network_passphrase: string; ``` **Source:** [src/horizon/horizon_api.ts:694](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L694) #### `rootResponse.supported_protocol_version` ```ts supported_protocol_version: number; ``` **Source:** [src/horizon/horizon_api.ts:696](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L696) ### Horizon.HorizonApi.SetOptionsOperationResponse ```ts interface SetOptionsOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; clear_flags: (1 | 2 | 4)[]; clear_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; created_at: string; high_threshold?: number; home_domain?: string; id: string; low_threshold?: number; master_key_weight?: number; med_threshold?: number; paging_token: string; set_flags: (1 | 2 | 4)[]; set_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; signer_key?: string; signer_weight?: number; source_account: string; transaction_hash: string; transaction_successful: boolean; type: setOptions; type_i: setOptions; } ``` **Source:** [src/horizon/horizon_api.ts:365](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L365) #### `setOptionsOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `setOptionsOperationResponse.clear_flags` ```ts clear_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:382](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L382) #### `setOptionsOperationResponse.clear_flags_s` ```ts clear_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; ``` **Source:** [src/horizon/horizon_api.ts:383](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L383) #### `setOptionsOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `setOptionsOperationResponse.high_threshold` ```ts high_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:374](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L374) #### `setOptionsOperationResponse.home_domain` ```ts home_domain?: string; ``` **Source:** [src/horizon/horizon_api.ts:375](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L375) #### `setOptionsOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `setOptionsOperationResponse.low_threshold` ```ts low_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:372](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L372) #### `setOptionsOperationResponse.master_key_weight` ```ts master_key_weight?: number; ``` **Source:** [src/horizon/horizon_api.ts:371](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L371) #### `setOptionsOperationResponse.med_threshold` ```ts med_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:373](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L373) #### `setOptionsOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `setOptionsOperationResponse.set_flags` ```ts set_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:376](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L376) #### `setOptionsOperationResponse.set_flags_s` ```ts set_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; ``` **Source:** [src/horizon/horizon_api.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L377) #### `setOptionsOperationResponse.signer_key` ```ts signer_key?: string; ``` **Source:** [src/horizon/horizon_api.ts:369](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L369) #### `setOptionsOperationResponse.signer_weight` ```ts signer_weight?: number; ``` **Source:** [src/horizon/horizon_api.ts:370](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L370) #### `setOptionsOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `setOptionsOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `setOptionsOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `setOptionsOperationResponse.type` ```ts type: setOptions; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `setOptionsOperationResponse.type_i` ```ts type_i: setOptions; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.SetTrustLineFlagsOperationResponse ```ts interface SetTrustLineFlagsOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code: string; asset_issuer: string; asset_type: AssetType; clear_flags: (1 | 2 | 4)[]; created_at: string; id: string; paging_token: string; set_flags: (1 | 2 | 4)[]; source_account: string; transaction_hash: string; transaction_successful: boolean; trustor: string; type: setTrustLineFlags; type_i: setTrustLineFlags; } ``` **Source:** [src/horizon/horizon_api.ts:518](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L518) #### `setTrustLineFlagsOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `setTrustLineFlagsOperationResponse.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:523](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L523) #### `setTrustLineFlagsOperationResponse.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:524](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L524) #### `setTrustLineFlagsOperationResponse.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:522](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L522) #### `setTrustLineFlagsOperationResponse.clear_flags` ```ts clear_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:527](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L527) #### `setTrustLineFlagsOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `setTrustLineFlagsOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `setTrustLineFlagsOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `setTrustLineFlagsOperationResponse.set_flags` ```ts set_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:526](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L526) #### `setTrustLineFlagsOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `setTrustLineFlagsOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `setTrustLineFlagsOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `setTrustLineFlagsOperationResponse.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:525](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L525) #### `setTrustLineFlagsOperationResponse.type` ```ts type: setTrustLineFlags; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `setTrustLineFlagsOperationResponse.type_i` ```ts type_i: setTrustLineFlags; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.HorizonApi.SubmitAsyncTransactionResponse ```ts interface SubmitAsyncTransactionResponse { error_result_xdr: string; hash: string; tx_status: string; } ``` **Source:** [src/horizon/horizon_api.ts:23](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L23) #### `submitAsyncTransactionResponse.error_result_xdr` ```ts error_result_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L26) #### `submitAsyncTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L24) #### `submitAsyncTransactionResponse.tx_status` ```ts tx_status: string; ``` **Source:** [src/horizon/horizon_api.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L25) ### Horizon.HorizonApi.SubmitTransactionResponse ```ts interface SubmitTransactionResponse { envelope_xdr: string; hash: string; ledger: number; paging_token: string; result_meta_xdr: string; result_xdr: string; successful: boolean; } ``` **Source:** [src/horizon/horizon_api.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L13) #### `submitTransactionResponse.envelope_xdr` ```ts envelope_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L17) #### `submitTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L14) #### `submitTransactionResponse.ledger` ```ts ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L15) #### `submitTransactionResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L20) #### `submitTransactionResponse.result_meta_xdr` ```ts result_meta_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L19) #### `submitTransactionResponse.result_xdr` ```ts result_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L18) #### `submitTransactionResponse.successful` ```ts successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L16) ### Horizon.HorizonApi.TransactionFailedExtras ```ts interface TransactionFailedExtras { envelope_xdr: string; result_codes: { operations: string[]; transaction: TransactionFailedResultCodes }; result_xdr: string; } ``` **Source:** [src/horizon/horizon_api.ts:677](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L677) #### `transactionFailedExtras.envelope_xdr` ```ts envelope_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:678](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L678) #### `transactionFailedExtras.result_codes` ```ts result_codes: { operations: string[]; transaction: TransactionFailedResultCodes }; ``` **Source:** [src/horizon/horizon_api.ts:679](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L679) #### `transactionFailedExtras.result_xdr` ```ts result_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:683](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L683) ### Horizon.HorizonApi.TransactionFailedResultCodes ```ts enum TransactionFailedResultCodes ``` **Source:** [src/horizon/horizon_api.ts:659](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L659) ### Horizon.HorizonApi.TransactionPreconditions ```ts interface TransactionPreconditions { extra_signers?: string[]; ledgerbounds?: { max_ledger: number; min_ledger: number }; min_account_sequence?: string; min_account_sequence_age?: string; min_account_sequence_ledger_gap?: number; timebounds?: { max_time: string; min_time: string }; } ``` **Source:** [src/horizon/horizon_api.ts:40](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L40) #### `transactionPreconditions.extra_signers` ```ts extra_signers?: string[]; ``` **Source:** [src/horizon/horizon_api.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L52) #### `transactionPreconditions.ledgerbounds` ```ts ledgerbounds?: { max_ledger: number; min_ledger: number }; ``` **Source:** [src/horizon/horizon_api.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L45) #### `transactionPreconditions.min_account_sequence` ```ts min_account_sequence?: string; ``` **Source:** [src/horizon/horizon_api.ts:49](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L49) #### `transactionPreconditions.min_account_sequence_age` ```ts min_account_sequence_age?: string; ``` **Source:** [src/horizon/horizon_api.ts:50](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L50) #### `transactionPreconditions.min_account_sequence_ledger_gap` ```ts min_account_sequence_ledger_gap?: number; ``` **Source:** [src/horizon/horizon_api.ts:51](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L51) #### `transactionPreconditions.timebounds` ```ts timebounds?: { max_time: string; min_time: string }; ``` **Source:** [src/horizon/horizon_api.ts:41](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L41) ### Horizon.HorizonApi.TransactionResponse ```ts interface TransactionResponse extends SubmitTransactionResponse, BaseResponse<"account" | "ledger" | "operations" | "effects" | "succeeds" | "precedes"> { _links: { account: ResponseLink; effects: ResponseLink; ledger: ResponseLink; operations: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink }; created_at: string; envelope_xdr: string; fee_account: string; fee_bump_transaction?: FeeBumpTransactionResponse; fee_charged: string | number; fee_meta_xdr: string; hash: string; id: string; inner_transaction?: InnerTransactionResponse; ledger: number; max_fee: string | number; memo?: string; memo_bytes?: string; memo_type: MemoType; operation_count: number; paging_token: string; preconditions?: TransactionPreconditions; result_meta_xdr: string; result_xdr: string; signatures: string[]; source_account: string; source_account_sequence: string; successful: boolean; } ``` **Source:** [src/horizon/horizon_api.ts:55](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L55) #### `transactionResponse._links` ```ts _links: { account: ResponseLink; effects: ResponseLink; ledger: ResponseLink; operations: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `transactionResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:66](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L66) #### `transactionResponse.envelope_xdr` ```ts envelope_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L17) #### `transactionResponse.fee_account` ```ts fee_account: string; ``` **Source:** [src/horizon/horizon_api.ts:79](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L79) #### `transactionResponse.fee_bump_transaction` ```ts fee_bump_transaction?: FeeBumpTransactionResponse; ``` **Source:** [src/horizon/horizon_api.ts:81](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L81) #### `transactionResponse.fee_charged` ```ts fee_charged: string | number; ``` **Source:** [src/horizon/horizon_api.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L68) #### `transactionResponse.fee_meta_xdr` ```ts fee_meta_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L67) #### `transactionResponse.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L14) #### `transactionResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:70](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L70) #### `transactionResponse.inner_transaction` ```ts inner_transaction?: InnerTransactionResponse; ``` **Source:** [src/horizon/horizon_api.ts:80](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L80) #### `transactionResponse.ledger` ```ts ledger: number; ``` **Source:** [src/horizon/horizon_api.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L15) #### `transactionResponse.max_fee` ```ts max_fee: string | number; ``` **Source:** [src/horizon/horizon_api.ts:69](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L69) #### `transactionResponse.memo` ```ts memo?: string; ``` **Source:** [src/horizon/horizon_api.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L72) #### `transactionResponse.memo_bytes` ```ts memo_bytes?: string; ``` **Source:** [src/horizon/horizon_api.ts:73](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L73) #### `transactionResponse.memo_type` ```ts memo_type: MemoType; ``` **Source:** [src/horizon/horizon_api.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L71) #### `transactionResponse.operation_count` ```ts operation_count: number; ``` **Source:** [src/horizon/horizon_api.ts:74](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L74) #### `transactionResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:75](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L75) #### `transactionResponse.preconditions` ```ts preconditions?: TransactionPreconditions; ``` **Source:** [src/horizon/horizon_api.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L82) #### `transactionResponse.result_meta_xdr` ```ts result_meta_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L19) #### `transactionResponse.result_xdr` ```ts result_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L18) #### `transactionResponse.signatures` ```ts signatures: string[]; ``` **Source:** [src/horizon/horizon_api.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L76) #### `transactionResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:77](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L77) #### `transactionResponse.source_account_sequence` ```ts source_account_sequence: string; ``` **Source:** [src/horizon/horizon_api.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L78) #### `transactionResponse.successful` ```ts successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L16) ### Horizon.HorizonApi.TransactionResponseCollection ```ts interface TransactionResponseCollection extends ResponseCollection { _embedded: { records: TransactionResponse[] }; _links: { next: ResponseLink; prev: ResponseLink; self: ResponseLink }; } ``` **Source:** [src/horizon/horizon_api.ts:604](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L604) #### `transactionResponseCollection._embedded` ```ts _embedded: { records: TransactionResponse[] }; ``` **Source:** [src/horizon/horizon_api.ts:600](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L600) #### `transactionResponseCollection._links` ```ts _links: { next: ResponseLink; prev: ResponseLink; self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:595](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L595) ### Horizon.HorizonApi.WithdrawLiquidityOperationResponse ```ts interface WithdrawLiquidityOperationResponse extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; id: string; liquidity_pool_id: string; paging_token: string; reserves_min: Reserve[]; reserves_received: Reserve[]; shares: string; source_account: string; transaction_hash: string; transaction_successful: boolean; type: liquidityPoolWithdraw; type_i: liquidityPoolWithdraw; } ``` **Source:** [src/horizon/horizon_api.ts:546](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L546) #### `withdrawLiquidityOperationResponse._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `withdrawLiquidityOperationResponse.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `withdrawLiquidityOperationResponse.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `withdrawLiquidityOperationResponse.liquidity_pool_id` ```ts liquidity_pool_id: string; ``` **Source:** [src/horizon/horizon_api.ts:550](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L550) #### `withdrawLiquidityOperationResponse.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `withdrawLiquidityOperationResponse.reserves_min` ```ts reserves_min: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:551](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L551) #### `withdrawLiquidityOperationResponse.reserves_received` ```ts reserves_received: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:553](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L553) #### `withdrawLiquidityOperationResponse.shares` ```ts shares: string; ``` **Source:** [src/horizon/horizon_api.ts:552](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L552) #### `withdrawLiquidityOperationResponse.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `withdrawLiquidityOperationResponse.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `withdrawLiquidityOperationResponse.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `withdrawLiquidityOperationResponse.type` ```ts type: liquidityPoolWithdraw; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `withdrawLiquidityOperationResponse.type_i` ```ts type_i: liquidityPoolWithdraw; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.Server.Options Options for configuring connections to Horizon servers. ```ts interface Options { allowHttp?: boolean; appName?: string; appVersion?: string; authToken?: string; headers?: Record; } ``` **Source:** [src/horizon/server.ts:916](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L916) #### `options.allowHttp` Allow connecting to http servers, default: `false`. This must be set to false in production deployments! You can also use `Config` class to set this globally. ```ts allowHttp?: boolean; ``` **Source:** [src/horizon/server.ts:918](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L918) #### `options.appName` Allow set custom header `X-App-Name`, default: `undefined`. ```ts appName?: string; ``` **Source:** [src/horizon/server.ts:920](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L920) #### `options.appVersion` Allow set custom header `X-App-Version`, default: `undefined`. ```ts appVersion?: string; ``` **Source:** [src/horizon/server.ts:922](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L922) #### `options.authToken` Allow set custom header `X-Auth-Token`, default: `undefined`. ```ts authToken?: string; ``` **Source:** [src/horizon/server.ts:924](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L924) #### `options.headers` ```ts headers?: Record; ``` **Source:** [src/horizon/server.ts:925](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L925) ### Horizon.Server.SubmitTransactionOptions ```ts interface SubmitTransactionOptions { skipMemoRequiredCheck?: boolean; } ``` **Source:** [src/horizon/server.ts:933](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L933) #### `submitTransactionOptions.skipMemoRequiredCheck` ```ts skipMemoRequiredCheck?: boolean; ``` **Source:** [src/horizon/server.ts:934](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L934) ### Horizon.Server.Timebounds ```ts interface Timebounds { maxTime: number; minTime: number; } ``` **Source:** [src/horizon/server.ts:928](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L928) #### `timebounds.maxTime` ```ts maxTime: number; ``` **Source:** [src/horizon/server.ts:930](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L930) #### `timebounds.minTime` ```ts minTime: number; ``` **Source:** [src/horizon/server.ts:929](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server.ts#L929) ### Horizon.ServerApi.AccountMergeOperationRecord ```ts interface AccountMergeOperationRecord extends BaseOperationRecord, AccountMergeOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; into: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: accountMerge; type_i: accountMerge; } ``` **Source:** [src/horizon/server_api.ts:249](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L249) #### `accountMergeOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `accountMergeOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `accountMergeOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `accountMergeOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `accountMergeOperationRecord.into` ```ts into: string; ``` **Source:** [src/horizon/horizon_api.ts:420](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L420) #### `accountMergeOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `accountMergeOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `accountMergeOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `accountMergeOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `accountMergeOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `accountMergeOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `accountMergeOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `accountMergeOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `accountMergeOperationRecord.type` ```ts type: accountMerge; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `accountMergeOperationRecord.type_i` ```ts type_i: accountMerge; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.AccountRecord ```ts interface AccountRecord extends BaseResponse { _links: { self: ResponseLink }; account_id: string; balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; data: (options: { value: string }) => Promise<{ value: string }>; data_attr: { [key: string]: string }; effects: CallCollectionFunction; flags: Flags; home_domain?: string; id: string; inflation_destination?: string; last_modified_ledger: number; last_modified_time: string; num_sponsored: number; num_sponsoring: number; offers: CallCollectionFunction; operations: CallCollectionFunction; paging_token: string; payments: CallCollectionFunction; sequence: string; sequence_ledger?: number; sequence_time?: string; signers: AccountRecordSigners[]; sponsor?: string; subentry_count: number; thresholds: AccountThresholds; trades: CallCollectionFunction; transactions: CallCollectionFunction; } ``` **Source:** [src/horizon/server_api.ts:96](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L96) #### `accountRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `accountRecord.account_id` ```ts account_id: string; ``` **Source:** [src/horizon/server_api.ts:99](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L99) #### `accountRecord.balances` ```ts balances: (BalanceLineNative | BalanceLineLiquidityPool | BalanceLineAsset<"credit_alphanum4"> | BalanceLineAsset<"credit_alphanum12">)[]; ``` **Source:** [src/horizon/server_api.ts:110](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L110) #### `accountRecord.data` ```ts data: (options: { value: string }) => Promise<{ value: string }>; ``` **Parameters** - **`options`** — `{ value: string }` (required) **Source:** [src/horizon/server_api.ts:112](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L112) #### `accountRecord.data_attr` ```ts data_attr: { [key: string]: string }; ``` **Source:** [src/horizon/server_api.ts:113](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L113) #### `accountRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:120](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L120) #### `accountRecord.flags` ```ts flags: Flags; ``` **Source:** [src/horizon/server_api.ts:109](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L109) #### `accountRecord.home_domain` ```ts home_domain?: string; ``` **Source:** [src/horizon/server_api.ts:104](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L104) #### `accountRecord.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L97) #### `accountRecord.inflation_destination` ```ts inflation_destination?: string; ``` **Source:** [src/horizon/server_api.ts:105](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L105) #### `accountRecord.last_modified_ledger` ```ts last_modified_ledger: number; ``` **Source:** [src/horizon/server_api.ts:106](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L106) #### `accountRecord.last_modified_time` ```ts last_modified_time: string; ``` **Source:** [src/horizon/server_api.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L107) #### `accountRecord.num_sponsored` ```ts num_sponsored: number; ``` **Source:** [src/horizon/server_api.ts:118](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L118) #### `accountRecord.num_sponsoring` ```ts num_sponsoring: number; ``` **Source:** [src/horizon/server_api.ts:117](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L117) #### `accountRecord.offers` ```ts offers: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:121](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L121) #### `accountRecord.operations` ```ts operations: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:122](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L122) #### `accountRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:98](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L98) #### `accountRecord.payments` ```ts payments: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:123](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L123) #### `accountRecord.sequence` ```ts sequence: string; ``` **Source:** [src/horizon/server_api.ts:100](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L100) #### `accountRecord.sequence_ledger` ```ts sequence_ledger?: number; ``` **Source:** [src/horizon/server_api.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L101) #### `accountRecord.sequence_time` ```ts sequence_time?: string; ``` **Source:** [src/horizon/server_api.ts:102](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L102) #### `accountRecord.signers` ```ts signers: AccountRecordSigners[]; ``` **Source:** [src/horizon/server_api.ts:111](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L111) #### `accountRecord.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/server_api.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L116) #### `accountRecord.subentry_count` ```ts subentry_count: number; ``` **Source:** [src/horizon/server_api.ts:103](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L103) #### `accountRecord.thresholds` ```ts thresholds: AccountThresholds; ``` **Source:** [src/horizon/server_api.ts:108](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L108) #### `accountRecord.trades` ```ts trades: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:124](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L124) #### `accountRecord.transactions` ```ts transactions: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:119](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L119) ### Horizon.ServerApi.AccountRecordSigners ```ts type AccountRecordSigners = AccountRecordSignersType ``` **Source:** [src/horizon/server_api.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L14) ### Horizon.ServerApi.AllowTrustOperationRecord ```ts interface AllowTrustOperationRecord extends BaseOperationRecord, AllowTrustOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code: string; asset_issuer: string; asset_type: AssetType; authorize: boolean; authorize_to_maintain_liabilities: boolean; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; trustee: string; trustor: string; type: allowTrust; type_i: allowTrust; } ``` **Source:** [src/horizon/server_api.ts:242](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L242) #### `allowTrustOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `allowTrustOperationRecord.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:409](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L409) #### `allowTrustOperationRecord.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:410](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L410) #### `allowTrustOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:408](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L408) #### `allowTrustOperationRecord.authorize` ```ts authorize: boolean; ``` **Source:** [src/horizon/horizon_api.ts:411](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L411) #### `allowTrustOperationRecord.authorize_to_maintain_liabilities` ```ts authorize_to_maintain_liabilities: boolean; ``` **Source:** [src/horizon/horizon_api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L412) #### `allowTrustOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `allowTrustOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `allowTrustOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `allowTrustOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `allowTrustOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `allowTrustOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `allowTrustOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `allowTrustOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `allowTrustOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `allowTrustOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `allowTrustOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `allowTrustOperationRecord.trustee` ```ts trustee: string; ``` **Source:** [src/horizon/horizon_api.ts:413](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L413) #### `allowTrustOperationRecord.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:414](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L414) #### `allowTrustOperationRecord.type` ```ts type: allowTrust; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `allowTrustOperationRecord.type_i` ```ts type_i: allowTrust; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.AssetRecord ```ts type AssetRecord = AssetRecordType ``` **Source:** [src/horizon/server_api.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L15) ### Horizon.ServerApi.BaseOperationRecord ```ts interface BaseOperationRecord extends BaseOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: T; type_i: TI; } ``` **Source:** [src/horizon/server_api.ts:173](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L173) #### `baseOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `baseOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `baseOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `baseOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `baseOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `baseOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `baseOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `baseOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `baseOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `baseOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `baseOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `baseOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `baseOperationRecord.type` ```ts type: T; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `baseOperationRecord.type_i` ```ts type_i: TI; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.BeginSponsoringFutureReservesOperationRecord ```ts interface BeginSponsoringFutureReservesOperationRecord extends BaseOperationRecord, BeginSponsoringFutureReservesOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; sponsored_id: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: beginSponsoringFutureReserves; type_i: beginSponsoringFutureReserves; } ``` **Source:** [src/horizon/server_api.ts:291](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L291) #### `beginSponsoringFutureReservesOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `beginSponsoringFutureReservesOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `beginSponsoringFutureReservesOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `beginSponsoringFutureReservesOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `beginSponsoringFutureReservesOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `beginSponsoringFutureReservesOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `beginSponsoringFutureReservesOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `beginSponsoringFutureReservesOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `beginSponsoringFutureReservesOperationRecord.sponsored_id` ```ts sponsored_id: string; ``` **Source:** [src/horizon/horizon_api.ts:474](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L474) #### `beginSponsoringFutureReservesOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `beginSponsoringFutureReservesOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `beginSponsoringFutureReservesOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `beginSponsoringFutureReservesOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `beginSponsoringFutureReservesOperationRecord.type` ```ts type: beginSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `beginSponsoringFutureReservesOperationRecord.type_i` ```ts type_i: beginSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.BumpFootprintExpirationOperationRecord ```ts interface BumpFootprintExpirationOperationRecord extends BaseOperationRecord, BumpFootprintExpirationOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; ledgers_to_expire: number; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: bumpFootprintExpiration; type_i: bumpFootprintExpiration; } ``` **Source:** [src/horizon/server_api.ts:354](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L354) #### `bumpFootprintExpirationOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `bumpFootprintExpirationOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `bumpFootprintExpirationOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `bumpFootprintExpirationOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `bumpFootprintExpirationOperationRecord.ledgers_to_expire` ```ts ledgers_to_expire: number; ``` **Source:** [src/horizon/horizon_api.ts:586](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L586) #### `bumpFootprintExpirationOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `bumpFootprintExpirationOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `bumpFootprintExpirationOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `bumpFootprintExpirationOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `bumpFootprintExpirationOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `bumpFootprintExpirationOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `bumpFootprintExpirationOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `bumpFootprintExpirationOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `bumpFootprintExpirationOperationRecord.type` ```ts type: bumpFootprintExpiration; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `bumpFootprintExpirationOperationRecord.type_i` ```ts type_i: bumpFootprintExpiration; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.BumpSequenceOperationRecord ```ts interface BumpSequenceOperationRecord extends BaseOperationRecord, BumpSequenceOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; bump_to: string; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: bumpSequence; type_i: bumpSequence; } ``` **Source:** [src/horizon/server_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L270) #### `bumpSequenceOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `bumpSequenceOperationRecord.bump_to` ```ts bump_to: string; ``` **Source:** [src/horizon/horizon_api.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L437) #### `bumpSequenceOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `bumpSequenceOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `bumpSequenceOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `bumpSequenceOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `bumpSequenceOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `bumpSequenceOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `bumpSequenceOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `bumpSequenceOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `bumpSequenceOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `bumpSequenceOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `bumpSequenceOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `bumpSequenceOperationRecord.type` ```ts type: bumpSequence; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `bumpSequenceOperationRecord.type_i` ```ts type_i: bumpSequence; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.CallCollectionFunction ```ts type CallCollectionFunction = (options?: CallFunctionTemplateOptions) => Promise> ``` **Source:** [src/horizon/server_api.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L33) ### Horizon.ServerApi.CallFunction ```ts type CallFunction = () => Promise ``` **Source:** [src/horizon/server_api.ts:30](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L30) ### Horizon.ServerApi.CallFunctionTemplateOptions ```ts interface CallFunctionTemplateOptions { cursor?: string | number; limit?: number; order?: "desc" | "asc"; } ``` **Source:** [src/horizon/server_api.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L24) #### `callFunctionTemplateOptions.cursor` ```ts cursor?: string | number; ``` **Source:** [src/horizon/server_api.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L25) #### `callFunctionTemplateOptions.limit` ```ts limit?: number; ``` **Source:** [src/horizon/server_api.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L26) #### `callFunctionTemplateOptions.order` ```ts order?: "desc" | "asc"; ``` **Source:** [src/horizon/server_api.ts:27](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L27) ### Horizon.ServerApi.ChangeTrustOperationRecord ```ts interface ChangeTrustOperationRecord extends BaseOperationRecord, ChangeTrustOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code?: string; asset_issuer?: string; asset_type: "credit_alphanum4" | "credit_alphanum12" | "liquidity_pool_shares"; created_at: string; effects: CallCollectionFunction; id: string; limit: string; liquidity_pool_id?: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; trustee?: string; trustor: string; type: changeTrust; type_i: changeTrust; } ``` **Source:** [src/horizon/server_api.ts:235](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L235) #### `changeTrustOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `changeTrustOperationRecord.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:397](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L397) #### `changeTrustOperationRecord.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:398](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L398) #### `changeTrustOperationRecord.asset_type` ```ts asset_type: "credit_alphanum4" | "credit_alphanum12" | "liquidity_pool_shares"; ``` **Source:** [src/horizon/horizon_api.ts:393](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L393) #### `changeTrustOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `changeTrustOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `changeTrustOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `changeTrustOperationRecord.limit` ```ts limit: string; ``` **Source:** [src/horizon/horizon_api.ts:402](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L402) #### `changeTrustOperationRecord.liquidity_pool_id` ```ts liquidity_pool_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:399](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L399) #### `changeTrustOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `changeTrustOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `changeTrustOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `changeTrustOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `changeTrustOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `changeTrustOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `changeTrustOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `changeTrustOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `changeTrustOperationRecord.trustee` ```ts trustee?: string; ``` **Source:** [src/horizon/horizon_api.ts:400](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L400) #### `changeTrustOperationRecord.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:401](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L401) #### `changeTrustOperationRecord.type` ```ts type: changeTrust; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `changeTrustOperationRecord.type_i` ```ts type_i: changeTrust; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.ClaimClaimableBalanceOperationRecord ```ts interface ClaimClaimableBalanceOperationRecord extends BaseOperationRecord, ClaimClaimableBalanceOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; balance_id: string; claimant: string; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: claimClaimableBalance; type_i: claimClaimableBalance; } ``` **Source:** [src/horizon/server_api.ts:284](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L284) #### `claimClaimableBalanceOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `claimClaimableBalanceOperationRecord.balance_id` ```ts balance_id: string; ``` **Source:** [src/horizon/horizon_api.ts:466](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L466) #### `claimClaimableBalanceOperationRecord.claimant` ```ts claimant: string; ``` **Source:** [src/horizon/horizon_api.ts:467](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L467) #### `claimClaimableBalanceOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `claimClaimableBalanceOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `claimClaimableBalanceOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `claimClaimableBalanceOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `claimClaimableBalanceOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `claimClaimableBalanceOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `claimClaimableBalanceOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `claimClaimableBalanceOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `claimClaimableBalanceOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `claimClaimableBalanceOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `claimClaimableBalanceOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `claimClaimableBalanceOperationRecord.type` ```ts type: claimClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `claimClaimableBalanceOperationRecord.type_i` ```ts type_i: claimClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.ClaimableBalanceRecord ```ts interface ClaimableBalanceRecord extends BaseResponse { _links: { self: ResponseLink }; amount: string; asset: string; claimants: Claimant[]; id: string; last_modified_ledger: number; paging_token: string; sponsor?: string; } ``` **Source:** [src/horizon/server_api.ts:87](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L87) #### `claimableBalanceRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `claimableBalanceRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/server_api.ts:91](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L91) #### `claimableBalanceRecord.asset` ```ts asset: string; ``` **Source:** [src/horizon/server_api.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L90) #### `claimableBalanceRecord.claimants` ```ts claimants: Claimant[]; ``` **Source:** [src/horizon/server_api.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L94) #### `claimableBalanceRecord.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:88](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L88) #### `claimableBalanceRecord.last_modified_ledger` ```ts last_modified_ledger: number; ``` **Source:** [src/horizon/server_api.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L93) #### `claimableBalanceRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L89) #### `claimableBalanceRecord.sponsor` ```ts sponsor?: string; ``` **Source:** [src/horizon/server_api.ts:92](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L92) ### Horizon.ServerApi.ClawbackClaimableBalanceOperationRecord ```ts interface ClawbackClaimableBalanceOperationRecord extends BaseOperationRecord, ClawbackClaimableBalanceOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; balance_id: string; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: clawbackClaimableBalance; type_i: clawbackClaimableBalance; } ``` **Source:** [src/horizon/server_api.ts:319](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L319) #### `clawbackClaimableBalanceOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `clawbackClaimableBalanceOperationRecord.balance_id` ```ts balance_id: string; ``` **Source:** [src/horizon/horizon_api.ts:515](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L515) #### `clawbackClaimableBalanceOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `clawbackClaimableBalanceOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `clawbackClaimableBalanceOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `clawbackClaimableBalanceOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `clawbackClaimableBalanceOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `clawbackClaimableBalanceOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `clawbackClaimableBalanceOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `clawbackClaimableBalanceOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `clawbackClaimableBalanceOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `clawbackClaimableBalanceOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `clawbackClaimableBalanceOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `clawbackClaimableBalanceOperationRecord.type` ```ts type: clawbackClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `clawbackClaimableBalanceOperationRecord.type_i` ```ts type_i: clawbackClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.ClawbackOperationRecord ```ts interface ClawbackOperationRecord extends BaseOperationRecord, ClawbackOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code: string; asset_issuer: string; asset_type: AssetType; created_at: string; effects: CallCollectionFunction; from: string; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: clawback; type_i: clawback; } ``` **Source:** [src/horizon/server_api.ts:312](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L312) #### `clawbackOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `clawbackOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:508](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L508) #### `clawbackOperationRecord.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:505](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L505) #### `clawbackOperationRecord.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:506](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L506) #### `clawbackOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:504](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L504) #### `clawbackOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `clawbackOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `clawbackOperationRecord.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:507](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L507) #### `clawbackOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `clawbackOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `clawbackOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `clawbackOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `clawbackOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `clawbackOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `clawbackOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `clawbackOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `clawbackOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `clawbackOperationRecord.type` ```ts type: clawback; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `clawbackOperationRecord.type_i` ```ts type_i: clawback; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.CollectionPage ```ts interface CollectionPage { next: () => Promise>; prev: () => Promise>; records: T[]; } ``` **Source:** [src/horizon/server_api.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L16) #### `collectionPage.next` ```ts next: () => Promise>; ``` **Source:** [src/horizon/server_api.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L20) #### `collectionPage.prev` ```ts prev: () => Promise>; ``` **Source:** [src/horizon/server_api.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L21) #### `collectionPage.records` ```ts records: T[]; ``` **Source:** [src/horizon/server_api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L19) ### Horizon.ServerApi.CreateAccountOperationRecord ```ts interface CreateAccountOperationRecord extends BaseOperationRecord, CreateAccountOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; account: string; created_at: string; effects: CallCollectionFunction; funder: string; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; starting_balance: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: createAccount; type_i: createAccount; } ``` **Source:** [src/horizon/server_api.ts:183](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L183) #### `createAccountOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `createAccountOperationRecord.account` ```ts account: string; ``` **Source:** [src/horizon/horizon_api.ts:276](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L276) #### `createAccountOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `createAccountOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `createAccountOperationRecord.funder` ```ts funder: string; ``` **Source:** [src/horizon/horizon_api.ts:277](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L277) #### `createAccountOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `createAccountOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `createAccountOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `createAccountOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `createAccountOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `createAccountOperationRecord.starting_balance` ```ts starting_balance: string; ``` **Source:** [src/horizon/horizon_api.ts:278](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L278) #### `createAccountOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `createAccountOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `createAccountOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `createAccountOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `createAccountOperationRecord.type` ```ts type: createAccount; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `createAccountOperationRecord.type_i` ```ts type_i: createAccount; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.CreateClaimableBalanceOperationRecord ```ts interface CreateClaimableBalanceOperationRecord extends BaseOperationRecord, CreateClaimableBalanceOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset: string; claimants: Claimant[]; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; sponsor: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: createClaimableBalance; type_i: createClaimableBalance; } ``` **Source:** [src/horizon/server_api.ts:277](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L277) #### `createClaimableBalanceOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `createClaimableBalanceOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:457](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L457) #### `createClaimableBalanceOperationRecord.asset` ```ts asset: string; ``` **Source:** [src/horizon/horizon_api.ts:456](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L456) #### `createClaimableBalanceOperationRecord.claimants` ```ts claimants: Claimant[]; ``` **Source:** [src/horizon/horizon_api.ts:459](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L459) #### `createClaimableBalanceOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `createClaimableBalanceOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `createClaimableBalanceOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `createClaimableBalanceOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `createClaimableBalanceOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `createClaimableBalanceOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `createClaimableBalanceOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `createClaimableBalanceOperationRecord.sponsor` ```ts sponsor: string; ``` **Source:** [src/horizon/horizon_api.ts:458](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L458) #### `createClaimableBalanceOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `createClaimableBalanceOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `createClaimableBalanceOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `createClaimableBalanceOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `createClaimableBalanceOperationRecord.type` ```ts type: createClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `createClaimableBalanceOperationRecord.type_i` ```ts type_i: createClaimableBalance; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.DepositLiquidityOperationRecord ```ts interface DepositLiquidityOperationRecord extends BaseOperationRecord, DepositLiquidityOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; liquidity_pool_id: string; max_price: string; max_price_r: PriceRShorthand; min_price: string; min_price_r: PriceRShorthand; paging_token: string; precedes: CallFunction; reserves_deposited: Reserve[]; reserves_max: Reserve[]; self: CallFunction; shares_received: string; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: liquidityPoolDeposit; type_i: liquidityPoolDeposit; } ``` **Source:** [src/horizon/server_api.ts:333](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L333) #### `depositLiquidityOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `depositLiquidityOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `depositLiquidityOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `depositLiquidityOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `depositLiquidityOperationRecord.liquidity_pool_id` ```ts liquidity_pool_id: string; ``` **Source:** [src/horizon/horizon_api.ts:537](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L537) #### `depositLiquidityOperationRecord.max_price` ```ts max_price: string; ``` **Source:** [src/horizon/horizon_api.ts:541](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L541) #### `depositLiquidityOperationRecord.max_price_r` ```ts max_price_r: PriceRShorthand; ``` **Source:** [src/horizon/horizon_api.ts:542](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L542) #### `depositLiquidityOperationRecord.min_price` ```ts min_price: string; ``` **Source:** [src/horizon/horizon_api.ts:539](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L539) #### `depositLiquidityOperationRecord.min_price_r` ```ts min_price_r: PriceRShorthand; ``` **Source:** [src/horizon/horizon_api.ts:540](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L540) #### `depositLiquidityOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `depositLiquidityOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `depositLiquidityOperationRecord.reserves_deposited` ```ts reserves_deposited: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:543](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L543) #### `depositLiquidityOperationRecord.reserves_max` ```ts reserves_max: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:538](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L538) #### `depositLiquidityOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `depositLiquidityOperationRecord.shares_received` ```ts shares_received: string; ``` **Source:** [src/horizon/horizon_api.ts:544](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L544) #### `depositLiquidityOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `depositLiquidityOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `depositLiquidityOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `depositLiquidityOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `depositLiquidityOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `depositLiquidityOperationRecord.type` ```ts type: liquidityPoolDeposit; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `depositLiquidityOperationRecord.type_i` ```ts type_i: liquidityPoolDeposit; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.EffectRecord ```ts type EffectRecord = BaseEffectRecordFromTypes & EffectRecordMethods ``` **Source:** [src/horizon/server_api.ts:85](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L85) ### Horizon.ServerApi.EndSponsoringFutureReservesOperationRecord ```ts interface EndSponsoringFutureReservesOperationRecord extends BaseOperationRecord, EndSponsoringFutureReservesOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; begin_sponsor: string; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: endSponsoringFutureReserves; type_i: endSponsoringFutureReserves; } ``` **Source:** [src/horizon/server_api.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L298) #### `endSponsoringFutureReservesOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `endSponsoringFutureReservesOperationRecord.begin_sponsor` ```ts begin_sponsor: string; ``` **Source:** [src/horizon/horizon_api.ts:481](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L481) #### `endSponsoringFutureReservesOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `endSponsoringFutureReservesOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `endSponsoringFutureReservesOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `endSponsoringFutureReservesOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `endSponsoringFutureReservesOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `endSponsoringFutureReservesOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `endSponsoringFutureReservesOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `endSponsoringFutureReservesOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `endSponsoringFutureReservesOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `endSponsoringFutureReservesOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `endSponsoringFutureReservesOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `endSponsoringFutureReservesOperationRecord.type` ```ts type: endSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `endSponsoringFutureReservesOperationRecord.type_i` ```ts type_i: endSponsoringFutureReserves; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.InflationOperationRecord ```ts interface InflationOperationRecord extends BaseOperationRecord, InflationOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: inflation; type_i: inflation; } ``` **Source:** [src/horizon/server_api.ts:256](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L256) #### `inflationOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `inflationOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `inflationOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `inflationOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `inflationOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `inflationOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `inflationOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `inflationOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `inflationOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `inflationOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `inflationOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `inflationOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `inflationOperationRecord.type` ```ts type: inflation; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `inflationOperationRecord.type_i` ```ts type_i: inflation; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.InvokeHostFunctionOperationRecord ```ts interface InvokeHostFunctionOperationRecord extends BaseOperationRecord, InvokeHostFunctionOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; address: string; asset_balance_changes: BalanceChange[]; created_at: string; effects: CallCollectionFunction; function: string; id: string; paging_token: string; parameters: { type: string; value: string }[]; precedes: CallFunction; salt: string; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: invokeHostFunction; type_i: invokeHostFunction; } ``` **Source:** [src/horizon/server_api.ts:347](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L347) #### `invokeHostFunctionOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `invokeHostFunctionOperationRecord.address` ```ts address: string; ``` **Source:** [src/horizon/horizon_api.ts:577](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L577) #### `invokeHostFunctionOperationRecord.asset_balance_changes` ```ts asset_balance_changes: BalanceChange[]; ``` **Source:** [src/horizon/horizon_api.ts:579](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L579) #### `invokeHostFunctionOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `invokeHostFunctionOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `invokeHostFunctionOperationRecord.function` ```ts function: string; ``` **Source:** [src/horizon/horizon_api.ts:572](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L572) #### `invokeHostFunctionOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `invokeHostFunctionOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `invokeHostFunctionOperationRecord.parameters` ```ts parameters: { type: string; value: string }[]; ``` **Source:** [src/horizon/horizon_api.ts:573](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L573) #### `invokeHostFunctionOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `invokeHostFunctionOperationRecord.salt` ```ts salt: string; ``` **Source:** [src/horizon/horizon_api.ts:578](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L578) #### `invokeHostFunctionOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `invokeHostFunctionOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `invokeHostFunctionOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `invokeHostFunctionOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `invokeHostFunctionOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `invokeHostFunctionOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `invokeHostFunctionOperationRecord.type` ```ts type: invokeHostFunction; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `invokeHostFunctionOperationRecord.type_i` ```ts type_i: invokeHostFunction; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.LedgerRecord ```ts interface LedgerRecord extends BaseResponse { _links: { self: ResponseLink }; base_fee_in_stroops: number; base_reserve_in_stroops: number; closed_at: string; effects: CallCollectionFunction; failed_transaction_count: number; fee_pool: string; hash: string; header_xdr: string; id: string; max_tx_set_size: number; operation_count: number; operations: CallCollectionFunction; paging_token: string; prev_hash: string; protocol_version: number; self: CallFunction; sequence: number; successful_transaction_count: number; total_coins: string; transactions: CallCollectionFunction; tx_set_operation_count: number | null; } ``` **Source:** [src/horizon/server_api.ts:145](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L145) #### `ledgerRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `ledgerRecord.base_fee_in_stroops` ```ts base_fee_in_stroops: number; ``` **Source:** [src/horizon/server_api.ts:161](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L161) #### `ledgerRecord.base_reserve_in_stroops` ```ts base_reserve_in_stroops: number; ``` **Source:** [src/horizon/server_api.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L162) #### `ledgerRecord.closed_at` ```ts closed_at: string; ``` **Source:** [src/horizon/server_api.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L155) #### `ledgerRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L164) #### `ledgerRecord.failed_transaction_count` ```ts failed_transaction_count: number; ``` **Source:** [src/horizon/server_api.ts:152](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L152) #### `ledgerRecord.fee_pool` ```ts fee_pool: string; ``` **Source:** [src/horizon/server_api.ts:157](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L157) #### `ledgerRecord.hash` ```ts hash: string; ``` **Source:** [src/horizon/server_api.ts:148](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L148) #### `ledgerRecord.header_xdr` ```ts header_xdr: string; ``` **Source:** [src/horizon/server_api.ts:160](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L160) #### `ledgerRecord.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:146](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L146) #### `ledgerRecord.max_tx_set_size` ```ts max_tx_set_size: number; ``` **Source:** [src/horizon/server_api.ts:158](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L158) #### `ledgerRecord.operation_count` ```ts operation_count: number; ``` **Source:** [src/horizon/server_api.ts:153](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L153) #### `ledgerRecord.operations` ```ts operations: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:165](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L165) #### `ledgerRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:147](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L147) #### `ledgerRecord.prev_hash` ```ts prev_hash: string; ``` **Source:** [src/horizon/server_api.ts:149](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L149) #### `ledgerRecord.protocol_version` ```ts protocol_version: number; ``` **Source:** [src/horizon/server_api.ts:159](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L159) #### `ledgerRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:166](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L166) #### `ledgerRecord.sequence` ```ts sequence: number; ``` **Source:** [src/horizon/server_api.ts:150](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L150) #### `ledgerRecord.successful_transaction_count` ```ts successful_transaction_count: number; ``` **Source:** [src/horizon/server_api.ts:151](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L151) #### `ledgerRecord.total_coins` ```ts total_coins: string; ``` **Source:** [src/horizon/server_api.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L156) #### `ledgerRecord.transactions` ```ts transactions: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L167) #### `ledgerRecord.tx_set_operation_count` ```ts tx_set_operation_count: number | null; ``` **Source:** [src/horizon/server_api.ts:154](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L154) ### Horizon.ServerApi.LiquidityPoolRecord ```ts interface LiquidityPoolRecord extends BaseResponse { _links: { self: ResponseLink }; fee_bp: number; id: string; paging_token: string; reserves: Reserve[]; total_shares: string; total_trustlines: string; type: LiquidityPoolType; } ``` **Source:** [src/horizon/server_api.ts:126](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L126) #### `liquidityPoolRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `liquidityPoolRecord.fee_bp` ```ts fee_bp: number; ``` **Source:** [src/horizon/server_api.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L129) #### `liquidityPoolRecord.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:127](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L127) #### `liquidityPoolRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:128](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L128) #### `liquidityPoolRecord.reserves` ```ts reserves: Reserve[]; ``` **Source:** [src/horizon/server_api.ts:133](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L133) #### `liquidityPoolRecord.total_shares` ```ts total_shares: string; ``` **Source:** [src/horizon/server_api.ts:132](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L132) #### `liquidityPoolRecord.total_trustlines` ```ts total_trustlines: string; ``` **Source:** [src/horizon/server_api.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L131) #### `liquidityPoolRecord.type` ```ts type: LiquidityPoolType; ``` **Source:** [src/horizon/server_api.ts:130](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L130) ### Horizon.ServerApi.ManageDataOperationRecord ```ts interface ManageDataOperationRecord extends BaseOperationRecord, ManageDataOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; name: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: manageData; type_i: manageData; value: Buffer; } ``` **Source:** [src/horizon/server_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L263) #### `manageDataOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `manageDataOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `manageDataOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `manageDataOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `manageDataOperationRecord.name` ```ts name: string; ``` **Source:** [src/horizon/horizon_api.ts:430](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L430) #### `manageDataOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `manageDataOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `manageDataOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `manageDataOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `manageDataOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `manageDataOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `manageDataOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `manageDataOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `manageDataOperationRecord.type` ```ts type: manageData; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `manageDataOperationRecord.type_i` ```ts type_i: manageData; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) #### `manageDataOperationRecord.value` ```ts value: Buffer; ``` **Source:** [src/horizon/horizon_api.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L431) ### Horizon.ServerApi.ManageOfferOperationRecord ```ts interface ManageOfferOperationRecord extends BaseOperationRecord, ManageOfferOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; buying_asset_code?: string; buying_asset_issuer?: string; buying_asset_type: AssetType; created_at: string; effects: CallCollectionFunction; id: string; offer_id: string | number; paging_token: string; precedes: CallFunction; price: string; price_r: PriceR; self: CallFunction; selling_asset_code?: string; selling_asset_issuer?: string; selling_asset_type: AssetType; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: manageOffer; type_i: manageOffer; } ``` **Source:** [src/horizon/server_api.ts:214](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L214) #### `manageOfferOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `manageOfferOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:340](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L340) #### `manageOfferOperationRecord.buying_asset_code` ```ts buying_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:342](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L342) #### `manageOfferOperationRecord.buying_asset_issuer` ```ts buying_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:343](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L343) #### `manageOfferOperationRecord.buying_asset_type` ```ts buying_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:341](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L341) #### `manageOfferOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `manageOfferOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `manageOfferOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `manageOfferOperationRecord.offer_id` ```ts offer_id: string | number; ``` **Source:** [src/horizon/horizon_api.ts:339](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L339) #### `manageOfferOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `manageOfferOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `manageOfferOperationRecord.price` ```ts price: string; ``` **Source:** [src/horizon/horizon_api.ts:344](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L344) #### `manageOfferOperationRecord.price_r` ```ts price_r: PriceR; ``` **Source:** [src/horizon/horizon_api.ts:345](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L345) #### `manageOfferOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `manageOfferOperationRecord.selling_asset_code` ```ts selling_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:347](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L347) #### `manageOfferOperationRecord.selling_asset_issuer` ```ts selling_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:348](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L348) #### `manageOfferOperationRecord.selling_asset_type` ```ts selling_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:346](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L346) #### `manageOfferOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `manageOfferOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `manageOfferOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `manageOfferOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `manageOfferOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `manageOfferOperationRecord.type` ```ts type: manageOffer; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `manageOfferOperationRecord.type_i` ```ts type_i: manageOffer; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.OfferRecord ```ts type OfferRecord = OfferRecordType ``` **Source:** [src/horizon/server_api.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L13) ### Horizon.ServerApi.OperationRecord ```ts type OperationRecord = CreateAccountOperationRecord | PaymentOperationRecord | PathPaymentOperationRecord | ManageOfferOperationRecord | PassiveOfferOperationRecord | SetOptionsOperationRecord | ChangeTrustOperationRecord | AllowTrustOperationRecord | AccountMergeOperationRecord | InflationOperationRecord | ManageDataOperationRecord | BumpSequenceOperationRecord | PathPaymentStrictSendOperationRecord | CreateClaimableBalanceOperationRecord | ClaimClaimableBalanceOperationRecord | BeginSponsoringFutureReservesOperationRecord | EndSponsoringFutureReservesOperationRecord | RevokeSponsorshipOperationRecord | ClawbackClaimableBalanceOperationRecord | ClawbackOperationRecord | SetTrustLineFlagsOperationRecord | DepositLiquidityOperationRecord | WithdrawLiquidityOperationRecord | InvokeHostFunctionOperationRecord | BumpFootprintExpirationOperationRecord | RestoreFootprintOperationRecord ``` **Source:** [src/horizon/server_api.ts:369](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L369) ### Horizon.ServerApi.OrderbookRecord ```ts interface OrderbookRecord extends BaseResponse { _links: { self: ResponseLink }; asks: { amount: string; price: string; price_r: { d: number; n: number } }[]; base: Asset; bids: { amount: string; price: string; price_r: { d: number; n: number } }[]; counter: Asset; } ``` **Source:** [src/horizon/server_api.ts:456](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L456) #### `orderbookRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `orderbookRecord.asks` ```ts asks: { amount: string; price: string; price_r: { d: number; n: number } }[]; ``` **Source:** [src/horizon/server_api.ts:465](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L465) #### `orderbookRecord.base` ```ts base: Asset; ``` **Source:** [src/horizon/server_api.ts:473](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L473) #### `orderbookRecord.bids` ```ts bids: { amount: string; price: string; price_r: { d: number; n: number } }[]; ``` **Source:** [src/horizon/server_api.ts:457](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L457) #### `orderbookRecord.counter` ```ts counter: Asset; ``` **Source:** [src/horizon/server_api.ts:474](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L474) ### Horizon.ServerApi.PassiveOfferOperationRecord ```ts interface PassiveOfferOperationRecord extends BaseOperationRecord, PassiveOfferOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; buying_asset_code?: string; buying_asset_issuer?: string; buying_asset_type: AssetType; created_at: string; effects: CallCollectionFunction; id: string; offer_id: string | number; paging_token: string; precedes: CallFunction; price: string; price_r: PriceR; self: CallFunction; selling_asset_code?: string; selling_asset_issuer?: string; selling_asset_type: AssetType; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: createPassiveOffer; type_i: createPassiveOffer; } ``` **Source:** [src/horizon/server_api.ts:221](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L221) #### `passiveOfferOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `passiveOfferOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:355](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L355) #### `passiveOfferOperationRecord.buying_asset_code` ```ts buying_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:357](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L357) #### `passiveOfferOperationRecord.buying_asset_issuer` ```ts buying_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:358](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L358) #### `passiveOfferOperationRecord.buying_asset_type` ```ts buying_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:356](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L356) #### `passiveOfferOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `passiveOfferOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `passiveOfferOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `passiveOfferOperationRecord.offer_id` ```ts offer_id: string | number; ``` **Source:** [src/horizon/horizon_api.ts:354](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L354) #### `passiveOfferOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `passiveOfferOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `passiveOfferOperationRecord.price` ```ts price: string; ``` **Source:** [src/horizon/horizon_api.ts:359](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L359) #### `passiveOfferOperationRecord.price_r` ```ts price_r: PriceR; ``` **Source:** [src/horizon/horizon_api.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L360) #### `passiveOfferOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `passiveOfferOperationRecord.selling_asset_code` ```ts selling_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:362](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L362) #### `passiveOfferOperationRecord.selling_asset_issuer` ```ts selling_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:363](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L363) #### `passiveOfferOperationRecord.selling_asset_type` ```ts selling_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:361](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L361) #### `passiveOfferOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `passiveOfferOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `passiveOfferOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `passiveOfferOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `passiveOfferOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `passiveOfferOperationRecord.type` ```ts type: createPassiveOffer; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `passiveOfferOperationRecord.type_i` ```ts type_i: createPassiveOffer; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.PathPaymentOperationRecord ```ts interface PathPaymentOperationRecord extends BaseOperationRecord, PathPaymentOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; effects: CallCollectionFunction; from: string; id: string; paging_token: string; path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; precedes: CallFunction; self: CallFunction; source_account: string; source_amount: string; source_asset_code?: string; source_asset_issuer?: string; source_asset_type: AssetType; source_max: string; succeeds: CallFunction; to: string; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: pathPayment; type_i: pathPayment; } ``` **Source:** [src/horizon/server_api.ts:200](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L200) #### `pathPaymentOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `pathPaymentOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:297](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L297) #### `pathPaymentOperationRecord.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L298) #### `pathPaymentOperationRecord.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:299](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L299) #### `pathPaymentOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:300](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L300) #### `pathPaymentOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `pathPaymentOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `pathPaymentOperationRecord.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:301](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L301) #### `pathPaymentOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `pathPaymentOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `pathPaymentOperationRecord.path` ```ts path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; ``` **Source:** [src/horizon/horizon_api.ts:302](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L302) #### `pathPaymentOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `pathPaymentOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `pathPaymentOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `pathPaymentOperationRecord.source_amount` ```ts source_amount: string; ``` **Source:** [src/horizon/horizon_api.ts:307](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L307) #### `pathPaymentOperationRecord.source_asset_code` ```ts source_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:308](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L308) #### `pathPaymentOperationRecord.source_asset_issuer` ```ts source_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:309](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L309) #### `pathPaymentOperationRecord.source_asset_type` ```ts source_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:310](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L310) #### `pathPaymentOperationRecord.source_max` ```ts source_max: string; ``` **Source:** [src/horizon/horizon_api.ts:311](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L311) #### `pathPaymentOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `pathPaymentOperationRecord.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:312](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L312) #### `pathPaymentOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `pathPaymentOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `pathPaymentOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `pathPaymentOperationRecord.type` ```ts type: pathPayment; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `pathPaymentOperationRecord.type_i` ```ts type_i: pathPayment; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.PathPaymentStrictSendOperationRecord ```ts interface PathPaymentStrictSendOperationRecord extends BaseOperationRecord, PathPaymentStrictSendOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; destination_min: string; effects: CallCollectionFunction; from: string; id: string; paging_token: string; path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; precedes: CallFunction; self: CallFunction; source_account: string; source_amount: string; source_asset_code?: string; source_asset_issuer?: string; source_asset_type: AssetType; succeeds: CallFunction; to: string; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: pathPaymentStrictSend; type_i: pathPaymentStrictSend; } ``` **Source:** [src/horizon/server_api.ts:207](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L207) #### `pathPaymentStrictSendOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `pathPaymentStrictSendOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:318](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L318) #### `pathPaymentStrictSendOperationRecord.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:319](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L319) #### `pathPaymentStrictSendOperationRecord.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:320](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L320) #### `pathPaymentStrictSendOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:321](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L321) #### `pathPaymentStrictSendOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `pathPaymentStrictSendOperationRecord.destination_min` ```ts destination_min: string; ``` **Source:** [src/horizon/horizon_api.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L322) #### `pathPaymentStrictSendOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `pathPaymentStrictSendOperationRecord.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:323](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L323) #### `pathPaymentStrictSendOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `pathPaymentStrictSendOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `pathPaymentStrictSendOperationRecord.path` ```ts path: { asset_code: string; asset_issuer: string; asset_type: AssetType }[]; ``` **Source:** [src/horizon/horizon_api.ts:324](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L324) #### `pathPaymentStrictSendOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `pathPaymentStrictSendOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `pathPaymentStrictSendOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `pathPaymentStrictSendOperationRecord.source_amount` ```ts source_amount: string; ``` **Source:** [src/horizon/horizon_api.ts:329](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L329) #### `pathPaymentStrictSendOperationRecord.source_asset_code` ```ts source_asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:330](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L330) #### `pathPaymentStrictSendOperationRecord.source_asset_issuer` ```ts source_asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:331](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L331) #### `pathPaymentStrictSendOperationRecord.source_asset_type` ```ts source_asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:332](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L332) #### `pathPaymentStrictSendOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `pathPaymentStrictSendOperationRecord.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:333](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L333) #### `pathPaymentStrictSendOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `pathPaymentStrictSendOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `pathPaymentStrictSendOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `pathPaymentStrictSendOperationRecord.type` ```ts type: pathPaymentStrictSend; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `pathPaymentStrictSendOperationRecord.type_i` ```ts type_i: pathPaymentStrictSend; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.PaymentOperationRecord ```ts interface PaymentOperationRecord extends BaseOperationRecord, PaymentOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; amount: string; asset_code?: string; asset_issuer?: string; asset_type: AssetType; created_at: string; effects: CallCollectionFunction; from: string; id: string; paging_token: string; precedes: CallFunction; receiver: CallFunction; self: CallFunction; sender: CallFunction; source_account: string; succeeds: CallFunction; to: string; to_muxed?: string; to_muxed_id?: string; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: payment; type_i: payment; } ``` **Source:** [src/horizon/server_api.ts:190](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L190) #### `paymentOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `paymentOperationRecord.amount` ```ts amount: string; ``` **Source:** [src/horizon/horizon_api.ts:289](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L289) #### `paymentOperationRecord.asset_code` ```ts asset_code?: string; ``` **Source:** [src/horizon/horizon_api.ts:287](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L287) #### `paymentOperationRecord.asset_issuer` ```ts asset_issuer?: string; ``` **Source:** [src/horizon/horizon_api.ts:288](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L288) #### `paymentOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:286](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L286) #### `paymentOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `paymentOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `paymentOperationRecord.from` ```ts from: string; ``` **Source:** [src/horizon/horizon_api.ts:284](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L284) #### `paymentOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `paymentOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `paymentOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `paymentOperationRecord.receiver` ```ts receiver: CallFunction; ``` **Source:** [src/horizon/server_api.ts:198](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L198) #### `paymentOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `paymentOperationRecord.sender` ```ts sender: CallFunction; ``` **Source:** [src/horizon/server_api.ts:197](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L197) #### `paymentOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `paymentOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `paymentOperationRecord.to` ```ts to: string; ``` **Source:** [src/horizon/horizon_api.ts:285](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L285) #### `paymentOperationRecord.to_muxed` ```ts to_muxed?: string; ``` **Source:** [src/horizon/horizon_api.ts:290](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L290) #### `paymentOperationRecord.to_muxed_id` ```ts to_muxed_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:291](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L291) #### `paymentOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `paymentOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `paymentOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `paymentOperationRecord.type` ```ts type: payment; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `paymentOperationRecord.type_i` ```ts type_i: payment; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.PaymentPathRecord ```ts interface PaymentPathRecord extends BaseResponse { _links: { self: ResponseLink }; destination_amount: string; destination_asset_code: string; destination_asset_issuer: string; destination_asset_type: string; path: { asset_code: string; asset_issuer: string; asset_type: string }[]; source_amount: string; source_asset_code: string; source_asset_issuer: string; source_asset_type: string; } ``` **Source:** [src/horizon/server_api.ts:476](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L476) #### `paymentPathRecord._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `paymentPathRecord.destination_amount` ```ts destination_amount: string; ``` **Source:** [src/horizon/server_api.ts:486](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L486) #### `paymentPathRecord.destination_asset_code` ```ts destination_asset_code: string; ``` **Source:** [src/horizon/server_api.ts:488](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L488) #### `paymentPathRecord.destination_asset_issuer` ```ts destination_asset_issuer: string; ``` **Source:** [src/horizon/server_api.ts:489](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L489) #### `paymentPathRecord.destination_asset_type` ```ts destination_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:487](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L487) #### `paymentPathRecord.path` ```ts path: { asset_code: string; asset_issuer: string; asset_type: string }[]; ``` **Source:** [src/horizon/server_api.ts:477](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L477) #### `paymentPathRecord.source_amount` ```ts source_amount: string; ``` **Source:** [src/horizon/server_api.ts:482](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L482) #### `paymentPathRecord.source_asset_code` ```ts source_asset_code: string; ``` **Source:** [src/horizon/server_api.ts:484](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L484) #### `paymentPathRecord.source_asset_issuer` ```ts source_asset_issuer: string; ``` **Source:** [src/horizon/server_api.ts:485](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L485) #### `paymentPathRecord.source_asset_type` ```ts source_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:483](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L483) ### Horizon.ServerApi.RestoreFootprintOperationRecord ```ts interface RestoreFootprintOperationRecord extends BaseOperationRecord, RestoreFootprintOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: restoreFootprint; type_i: restoreFootprint; } ``` **Source:** [src/horizon/server_api.ts:361](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L361) #### `restoreFootprintOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `restoreFootprintOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `restoreFootprintOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `restoreFootprintOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `restoreFootprintOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `restoreFootprintOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `restoreFootprintOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `restoreFootprintOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `restoreFootprintOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `restoreFootprintOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `restoreFootprintOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `restoreFootprintOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `restoreFootprintOperationRecord.type` ```ts type: restoreFootprint; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `restoreFootprintOperationRecord.type_i` ```ts type_i: restoreFootprint; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.RevokeSponsorshipOperationRecord ```ts interface RevokeSponsorshipOperationRecord extends BaseOperationRecord, RevokeSponsorshipOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; account_id?: string; claimable_balance_id?: string; created_at: string; data_account_id?: string; data_name?: string; effects: CallCollectionFunction; id: string; offer_id?: string; paging_token: string; precedes: CallFunction; self: CallFunction; signer_account_id?: string; signer_key?: string; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; trustline_account_id?: string; trustline_asset?: string; trustline_liquidity_pool_id?: string; type: revokeSponsorship; type_i: revokeSponsorship; } ``` **Source:** [src/horizon/server_api.ts:305](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L305) #### `revokeSponsorshipOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `revokeSponsorshipOperationRecord.account_id` ```ts account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:488](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L488) #### `revokeSponsorshipOperationRecord.claimable_balance_id` ```ts claimable_balance_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:489](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L489) #### `revokeSponsorshipOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `revokeSponsorshipOperationRecord.data_account_id` ```ts data_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:490](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L490) #### `revokeSponsorshipOperationRecord.data_name` ```ts data_name?: string; ``` **Source:** [src/horizon/horizon_api.ts:491](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L491) #### `revokeSponsorshipOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `revokeSponsorshipOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `revokeSponsorshipOperationRecord.offer_id` ```ts offer_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:492](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L492) #### `revokeSponsorshipOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `revokeSponsorshipOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `revokeSponsorshipOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `revokeSponsorshipOperationRecord.signer_account_id` ```ts signer_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:496](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L496) #### `revokeSponsorshipOperationRecord.signer_key` ```ts signer_key?: string; ``` **Source:** [src/horizon/horizon_api.ts:497](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L497) #### `revokeSponsorshipOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `revokeSponsorshipOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `revokeSponsorshipOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `revokeSponsorshipOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `revokeSponsorshipOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `revokeSponsorshipOperationRecord.trustline_account_id` ```ts trustline_account_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:493](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L493) #### `revokeSponsorshipOperationRecord.trustline_asset` ```ts trustline_asset?: string; ``` **Source:** [src/horizon/horizon_api.ts:494](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L494) #### `revokeSponsorshipOperationRecord.trustline_liquidity_pool_id` ```ts trustline_liquidity_pool_id?: string; ``` **Source:** [src/horizon/horizon_api.ts:495](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L495) #### `revokeSponsorshipOperationRecord.type` ```ts type: revokeSponsorship; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `revokeSponsorshipOperationRecord.type_i` ```ts type_i: revokeSponsorship; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.SetOptionsOperationRecord ```ts interface SetOptionsOperationRecord extends BaseOperationRecord, SetOptionsOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; clear_flags: (1 | 2 | 4)[]; clear_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; created_at: string; effects: CallCollectionFunction; high_threshold?: number; home_domain?: string; id: string; low_threshold?: number; master_key_weight?: number; med_threshold?: number; paging_token: string; precedes: CallFunction; self: CallFunction; set_flags: (1 | 2 | 4)[]; set_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; signer_key?: string; signer_weight?: number; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: setOptions; type_i: setOptions; } ``` **Source:** [src/horizon/server_api.ts:228](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L228) #### `setOptionsOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `setOptionsOperationRecord.clear_flags` ```ts clear_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:382](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L382) #### `setOptionsOperationRecord.clear_flags_s` ```ts clear_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; ``` **Source:** [src/horizon/horizon_api.ts:383](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L383) #### `setOptionsOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `setOptionsOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `setOptionsOperationRecord.high_threshold` ```ts high_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:374](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L374) #### `setOptionsOperationRecord.home_domain` ```ts home_domain?: string; ``` **Source:** [src/horizon/horizon_api.ts:375](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L375) #### `setOptionsOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `setOptionsOperationRecord.low_threshold` ```ts low_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:372](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L372) #### `setOptionsOperationRecord.master_key_weight` ```ts master_key_weight?: number; ``` **Source:** [src/horizon/horizon_api.ts:371](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L371) #### `setOptionsOperationRecord.med_threshold` ```ts med_threshold?: number; ``` **Source:** [src/horizon/horizon_api.ts:373](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L373) #### `setOptionsOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `setOptionsOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `setOptionsOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `setOptionsOperationRecord.set_flags` ```ts set_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:376](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L376) #### `setOptionsOperationRecord.set_flags_s` ```ts set_flags_s: ("auth_required_flag" | "auth_revocable_flag" | "auth_clawback_enabled_flag")[]; ``` **Source:** [src/horizon/horizon_api.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L377) #### `setOptionsOperationRecord.signer_key` ```ts signer_key?: string; ``` **Source:** [src/horizon/horizon_api.ts:369](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L369) #### `setOptionsOperationRecord.signer_weight` ```ts signer_weight?: number; ``` **Source:** [src/horizon/horizon_api.ts:370](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L370) #### `setOptionsOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `setOptionsOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `setOptionsOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `setOptionsOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `setOptionsOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `setOptionsOperationRecord.type` ```ts type: setOptions; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `setOptionsOperationRecord.type_i` ```ts type_i: setOptions; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.SetTrustLineFlagsOperationRecord ```ts interface SetTrustLineFlagsOperationRecord extends BaseOperationRecord, SetTrustLineFlagsOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; asset_code: string; asset_issuer: string; asset_type: AssetType; clear_flags: (1 | 2 | 4)[]; created_at: string; effects: CallCollectionFunction; id: string; paging_token: string; precedes: CallFunction; self: CallFunction; set_flags: (1 | 2 | 4)[]; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; trustor: string; type: setTrustLineFlags; type_i: setTrustLineFlags; } ``` **Source:** [src/horizon/server_api.ts:326](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L326) #### `setTrustLineFlagsOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `setTrustLineFlagsOperationRecord.asset_code` ```ts asset_code: string; ``` **Source:** [src/horizon/horizon_api.ts:523](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L523) #### `setTrustLineFlagsOperationRecord.asset_issuer` ```ts asset_issuer: string; ``` **Source:** [src/horizon/horizon_api.ts:524](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L524) #### `setTrustLineFlagsOperationRecord.asset_type` ```ts asset_type: AssetType; ``` **Source:** [src/horizon/horizon_api.ts:522](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L522) #### `setTrustLineFlagsOperationRecord.clear_flags` ```ts clear_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:527](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L527) #### `setTrustLineFlagsOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `setTrustLineFlagsOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `setTrustLineFlagsOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `setTrustLineFlagsOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `setTrustLineFlagsOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `setTrustLineFlagsOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `setTrustLineFlagsOperationRecord.set_flags` ```ts set_flags: (1 | 2 | 4)[]; ``` **Source:** [src/horizon/horizon_api.ts:526](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L526) #### `setTrustLineFlagsOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `setTrustLineFlagsOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `setTrustLineFlagsOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `setTrustLineFlagsOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `setTrustLineFlagsOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `setTrustLineFlagsOperationRecord.trustor` ```ts trustor: string; ``` **Source:** [src/horizon/horizon_api.ts:525](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L525) #### `setTrustLineFlagsOperationRecord.type` ```ts type: setTrustLineFlags; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `setTrustLineFlagsOperationRecord.type_i` ```ts type_i: setTrustLineFlags; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) ### Horizon.ServerApi.TradeRecord ```ts type TradeRecord = TradeRecord.Orderbook | TradeRecord.LiquidityPool ``` **Source:** [src/horizon/server_api.ts:397](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L397) ### Horizon.ServerApi.TradeRecord.LiquidityPool ```ts interface LiquidityPool extends Base { _links: { self: ResponseLink }; base: CallFunction; base_account?: string; base_amount: string; base_asset_code?: string; base_asset_issuer?: string; base_asset_type: string; base_is_seller: boolean; base_liquidity_pool_id?: string; counter: CallFunction; counter_account?: string; counter_amount: string; counter_asset_code?: string; counter_asset_issuer?: string; counter_asset_type: string; counter_liquidity_pool_id?: string; id: string; ledger_close_time: string; liquidity_pool_fee_bp: number; operation: CallFunction; paging_token: string; price?: { d: string; n: string }; trade_type: liquidityPools; } ``` **Source:** [src/horizon/server_api.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L431) #### `liquidityPool._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `liquidityPool.base` ```ts base: CallFunction; ``` **Source:** [src/horizon/server_api.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L437) #### `liquidityPool.base_account` ```ts base_account?: string; ``` **Source:** [src/horizon/server_api.ts:403](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L403) #### `liquidityPool.base_amount` ```ts base_amount: string; ``` **Source:** [src/horizon/server_api.ts:404](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L404) #### `liquidityPool.base_asset_code` ```ts base_asset_code?: string; ``` **Source:** [src/horizon/server_api.ts:406](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L406) #### `liquidityPool.base_asset_issuer` ```ts base_asset_issuer?: string; ``` **Source:** [src/horizon/server_api.ts:407](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L407) #### `liquidityPool.base_asset_type` ```ts base_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:405](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L405) #### `liquidityPool.base_is_seller` ```ts base_is_seller: boolean; ``` **Source:** [src/horizon/server_api.ts:413](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L413) #### `liquidityPool.base_liquidity_pool_id` ```ts base_liquidity_pool_id?: string; ``` **Source:** [src/horizon/server_api.ts:433](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L433) #### `liquidityPool.counter` ```ts counter: CallFunction; ``` **Source:** [src/horizon/server_api.ts:438](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L438) #### `liquidityPool.counter_account` ```ts counter_account?: string; ``` **Source:** [src/horizon/server_api.ts:408](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L408) #### `liquidityPool.counter_amount` ```ts counter_amount: string; ``` **Source:** [src/horizon/server_api.ts:409](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L409) #### `liquidityPool.counter_asset_code` ```ts counter_asset_code?: string; ``` **Source:** [src/horizon/server_api.ts:411](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L411) #### `liquidityPool.counter_asset_issuer` ```ts counter_asset_issuer?: string; ``` **Source:** [src/horizon/server_api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L412) #### `liquidityPool.counter_asset_type` ```ts counter_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:410](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L410) #### `liquidityPool.counter_liquidity_pool_id` ```ts counter_liquidity_pool_id?: string; ``` **Source:** [src/horizon/server_api.ts:434](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L434) #### `liquidityPool.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:399](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L399) #### `liquidityPool.ledger_close_time` ```ts ledger_close_time: string; ``` **Source:** [src/horizon/server_api.ts:401](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L401) #### `liquidityPool.liquidity_pool_fee_bp` ```ts liquidity_pool_fee_bp: number; ``` **Source:** [src/horizon/server_api.ts:435](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L435) #### `liquidityPool.operation` ```ts operation: CallFunction; ``` **Source:** [src/horizon/server_api.ts:419](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L419) #### `liquidityPool.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:400](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L400) #### `liquidityPool.price` ```ts price?: { d: string; n: string }; ``` **Source:** [src/horizon/server_api.ts:414](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L414) #### `liquidityPool.trade_type` ```ts trade_type: liquidityPools; ``` **Source:** [src/horizon/server_api.ts:432](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L432) ### Horizon.ServerApi.TradeRecord.Orderbook ```ts interface Orderbook extends Base { _links: { self: ResponseLink }; base: CallFunction; base_account: string; base_amount: string; base_asset_code?: string; base_asset_issuer?: string; base_asset_type: string; base_is_seller: boolean; base_offer_id: string; counter: CallFunction; counter_account: string; counter_amount: string; counter_asset_code?: string; counter_asset_issuer?: string; counter_asset_type: string; counter_offer_id: string; id: string; ledger_close_time: string; operation: CallFunction; paging_token: string; price?: { d: string; n: string }; trade_type: orderbook; } ``` **Source:** [src/horizon/server_api.ts:421](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L421) #### `orderbook._links` ```ts _links: { self: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `orderbook.base` ```ts base: CallFunction; ``` **Source:** [src/horizon/server_api.ts:428](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L428) #### `orderbook.base_account` ```ts base_account: string; ``` **Source:** [src/horizon/server_api.ts:424](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L424) #### `orderbook.base_amount` ```ts base_amount: string; ``` **Source:** [src/horizon/server_api.ts:404](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L404) #### `orderbook.base_asset_code` ```ts base_asset_code?: string; ``` **Source:** [src/horizon/server_api.ts:406](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L406) #### `orderbook.base_asset_issuer` ```ts base_asset_issuer?: string; ``` **Source:** [src/horizon/server_api.ts:407](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L407) #### `orderbook.base_asset_type` ```ts base_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:405](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L405) #### `orderbook.base_is_seller` ```ts base_is_seller: boolean; ``` **Source:** [src/horizon/server_api.ts:413](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L413) #### `orderbook.base_offer_id` ```ts base_offer_id: string; ``` **Source:** [src/horizon/server_api.ts:423](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L423) #### `orderbook.counter` ```ts counter: CallFunction; ``` **Source:** [src/horizon/server_api.ts:429](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L429) #### `orderbook.counter_account` ```ts counter_account: string; ``` **Source:** [src/horizon/server_api.ts:426](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L426) #### `orderbook.counter_amount` ```ts counter_amount: string; ``` **Source:** [src/horizon/server_api.ts:409](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L409) #### `orderbook.counter_asset_code` ```ts counter_asset_code?: string; ``` **Source:** [src/horizon/server_api.ts:411](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L411) #### `orderbook.counter_asset_issuer` ```ts counter_asset_issuer?: string; ``` **Source:** [src/horizon/server_api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L412) #### `orderbook.counter_asset_type` ```ts counter_asset_type: string; ``` **Source:** [src/horizon/server_api.ts:410](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L410) #### `orderbook.counter_offer_id` ```ts counter_offer_id: string; ``` **Source:** [src/horizon/server_api.ts:425](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L425) #### `orderbook.id` ```ts id: string; ``` **Source:** [src/horizon/server_api.ts:399](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L399) #### `orderbook.ledger_close_time` ```ts ledger_close_time: string; ``` **Source:** [src/horizon/server_api.ts:401](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L401) #### `orderbook.operation` ```ts operation: CallFunction; ``` **Source:** [src/horizon/server_api.ts:419](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L419) #### `orderbook.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/server_api.ts:400](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L400) #### `orderbook.price` ```ts price?: { d: string; n: string }; ``` **Source:** [src/horizon/server_api.ts:414](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L414) #### `orderbook.trade_type` ```ts trade_type: orderbook; ``` **Source:** [src/horizon/server_api.ts:422](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L422) ### Horizon.ServerApi.TradeType ```ts enum TradeType ``` **Source:** [src/horizon/server_api.ts:135](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L135) ### Horizon.ServerApi.TransactionRecord ```ts interface TransactionRecord extends Omit { _links: { account: ResponseLink; effects: ResponseLink; ledger: ResponseLink; operations: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink }; account: CallFunction; created_at: string; effects: CallCollectionFunction; envelope_xdr: string; fee_account: string; fee_bump_transaction?: FeeBumpTransactionResponse; fee_charged: string | number; fee_meta_xdr: string; hash: string; id: string; inner_transaction?: InnerTransactionResponse; ledger: CallFunction; ledger_attr: number; max_fee: string | number; memo?: string; memo_bytes?: string; memo_type: MemoType; operation_count: number; operations: CallCollectionFunction; paging_token: string; precedes: CallFunction; preconditions?: TransactionPreconditions; result_meta_xdr: string; result_xdr: string; self: CallFunction; signatures: string[]; source_account: string; source_account_sequence: string; succeeds: CallFunction; successful: boolean; } ``` **Source:** [src/horizon/server_api.ts:442](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L442) #### `transactionRecord._links` ```ts _links: { account: ResponseLink; effects: ResponseLink; ledger: ResponseLink; operations: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `transactionRecord.account` ```ts account: CallFunction; ``` **Source:** [src/horizon/server_api.ts:448](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L448) #### `transactionRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:66](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L66) #### `transactionRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:449](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L449) #### `transactionRecord.envelope_xdr` ```ts envelope_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L17) #### `transactionRecord.fee_account` ```ts fee_account: string; ``` **Source:** [src/horizon/horizon_api.ts:79](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L79) #### `transactionRecord.fee_bump_transaction` ```ts fee_bump_transaction?: FeeBumpTransactionResponse; ``` **Source:** [src/horizon/horizon_api.ts:81](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L81) #### `transactionRecord.fee_charged` ```ts fee_charged: string | number; ``` **Source:** [src/horizon/horizon_api.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L68) #### `transactionRecord.fee_meta_xdr` ```ts fee_meta_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L67) #### `transactionRecord.hash` ```ts hash: string; ``` **Source:** [src/horizon/horizon_api.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L14) #### `transactionRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:70](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L70) #### `transactionRecord.inner_transaction` ```ts inner_transaction?: InnerTransactionResponse; ``` **Source:** [src/horizon/horizon_api.ts:80](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L80) #### `transactionRecord.ledger` ```ts ledger: CallFunction; ``` **Source:** [src/horizon/server_api.ts:450](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L450) #### `transactionRecord.ledger_attr` ```ts ledger_attr: number; ``` **Source:** [src/horizon/server_api.ts:446](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L446) #### `transactionRecord.max_fee` ```ts max_fee: string | number; ``` **Source:** [src/horizon/horizon_api.ts:69](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L69) #### `transactionRecord.memo` ```ts memo?: string; ``` **Source:** [src/horizon/horizon_api.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L72) #### `transactionRecord.memo_bytes` ```ts memo_bytes?: string; ``` **Source:** [src/horizon/horizon_api.ts:73](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L73) #### `transactionRecord.memo_type` ```ts memo_type: MemoType; ``` **Source:** [src/horizon/horizon_api.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L71) #### `transactionRecord.operation_count` ```ts operation_count: number; ``` **Source:** [src/horizon/horizon_api.ts:74](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L74) #### `transactionRecord.operations` ```ts operations: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:451](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L451) #### `transactionRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:75](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L75) #### `transactionRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:452](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L452) #### `transactionRecord.preconditions` ```ts preconditions?: TransactionPreconditions; ``` **Source:** [src/horizon/horizon_api.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L82) #### `transactionRecord.result_meta_xdr` ```ts result_meta_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L19) #### `transactionRecord.result_xdr` ```ts result_xdr: string; ``` **Source:** [src/horizon/horizon_api.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L18) #### `transactionRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:453](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L453) #### `transactionRecord.signatures` ```ts signatures: string[]; ``` **Source:** [src/horizon/horizon_api.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L76) #### `transactionRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:77](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L77) #### `transactionRecord.source_account_sequence` ```ts source_account_sequence: string; ``` **Source:** [src/horizon/horizon_api.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L78) #### `transactionRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:454](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L454) #### `transactionRecord.successful` ```ts successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L16) ### Horizon.ServerApi.WithdrawLiquidityOperationRecord ```ts interface WithdrawLiquidityOperationRecord extends BaseOperationRecord, WithdrawLiquidityOperationResponse { _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; created_at: string; effects: CallCollectionFunction; id: string; liquidity_pool_id: string; paging_token: string; precedes: CallFunction; reserves_min: Reserve[]; reserves_received: Reserve[]; self: CallFunction; shares: string; source_account: string; succeeds: CallFunction; transaction: CallFunction; transaction_hash: string; transaction_successful: boolean; type: liquidityPoolWithdraw; type_i: liquidityPoolWithdraw; } ``` **Source:** [src/horizon/server_api.ts:340](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L340) #### `withdrawLiquidityOperationRecord._links` ```ts _links: { effects: ResponseLink; precedes: ResponseLink; self: ResponseLink; succeeds: ResponseLink; transaction: ResponseLink }; ``` **Source:** [src/horizon/horizon_api.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L10) #### `withdrawLiquidityOperationRecord.created_at` ```ts created_at: string; ``` **Source:** [src/horizon/horizon_api.ts:268](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L268) #### `withdrawLiquidityOperationRecord.effects` ```ts effects: CallCollectionFunction; ``` **Source:** [src/horizon/server_api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L180) #### `withdrawLiquidityOperationRecord.id` ```ts id: string; ``` **Source:** [src/horizon/horizon_api.ts:263](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L263) #### `withdrawLiquidityOperationRecord.liquidity_pool_id` ```ts liquidity_pool_id: string; ``` **Source:** [src/horizon/horizon_api.ts:550](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L550) #### `withdrawLiquidityOperationRecord.paging_token` ```ts paging_token: string; ``` **Source:** [src/horizon/horizon_api.ts:264](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L264) #### `withdrawLiquidityOperationRecord.precedes` ```ts precedes: CallFunction; ``` **Source:** [src/horizon/server_api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L179) #### `withdrawLiquidityOperationRecord.reserves_min` ```ts reserves_min: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:551](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L551) #### `withdrawLiquidityOperationRecord.reserves_received` ```ts reserves_received: Reserve[]; ``` **Source:** [src/horizon/horizon_api.ts:553](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L553) #### `withdrawLiquidityOperationRecord.self` ```ts self: CallFunction; ``` **Source:** [src/horizon/server_api.ts:177](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L177) #### `withdrawLiquidityOperationRecord.shares` ```ts shares: string; ``` **Source:** [src/horizon/horizon_api.ts:552](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L552) #### `withdrawLiquidityOperationRecord.source_account` ```ts source_account: string; ``` **Source:** [src/horizon/horizon_api.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L265) #### `withdrawLiquidityOperationRecord.succeeds` ```ts succeeds: CallFunction; ``` **Source:** [src/horizon/server_api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L178) #### `withdrawLiquidityOperationRecord.transaction` ```ts transaction: CallFunction; ``` **Source:** [src/horizon/server_api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/server_api.ts#L181) #### `withdrawLiquidityOperationRecord.transaction_hash` ```ts transaction_hash: string; ``` **Source:** [src/horizon/horizon_api.ts:269](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L269) #### `withdrawLiquidityOperationRecord.transaction_successful` ```ts transaction_successful: boolean; ``` **Source:** [src/horizon/horizon_api.ts:270](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L270) #### `withdrawLiquidityOperationRecord.type` ```ts type: liquidityPoolWithdraw; ``` **Source:** [src/horizon/horizon_api.ts:266](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L266) #### `withdrawLiquidityOperationRecord.type_i` ```ts type_i: liquidityPoolWithdraw; ``` **Source:** [src/horizon/horizon_api.ts:267](https://github.com/stellar/js-stellar-sdk/blob/main/src/horizon/horizon_api.ts#L267) # Source: docs/reference/network-rpc.md # Network / RPC ## rpc.Api.isSimulationError Checks if a simulation response indicates an error. ```ts isSimulationError(sim: SimulateTransactionResponse): sim is SimulateTransactionErrorResponse ``` **Parameters** - **`sim`** — `SimulateTransactionResponse` (required) — The simulation response to check. **Returns** True if the response indicates an error, false otherwise. **Source:** [src/rpc/api.ts:468](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L468) ## rpc.Api.isSimulationRaw Checks if a simulation response is in raw (unparsed) form. ```ts isSimulationRaw(sim: SimulateTransactionResponse | RawSimulateTransactionResponse): sim is RawSimulateTransactionResponse ``` **Parameters** - **`sim`** — `SimulateTransactionResponse | RawSimulateTransactionResponse` (required) — The simulation response to check. **Returns** True if the response is raw, false otherwise. **Source:** [src/rpc/api.ts:505](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L505) ## rpc.Api.isSimulationRestore Checks if a simulation response indicates that a restoration is needed. ```ts isSimulationRestore(sim: SimulateTransactionResponse): sim is SimulateTransactionRestoreResponse ``` **Parameters** - **`sim`** — `SimulateTransactionResponse` (required) — The simulation response to check. **Returns** True if the response indicates a restoration is needed, false otherwise. **Source:** [src/rpc/api.ts:490](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L490) ## rpc.Api.isSimulationSuccess Checks if a simulation response indicates success. ```ts isSimulationSuccess(sim: SimulateTransactionResponse): sim is SimulateTransactionSuccessResponse ``` **Parameters** - **`sim`** — `SimulateTransactionResponse` (required) — The simulation response to check. **Returns** True if the response indicates success, false otherwise. **Source:** [src/rpc/api.ts:479](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L479) ## rpc.BasicSleepStrategy ```ts const BasicSleepStrategy: SleepStrategy ``` **Source:** [src/rpc/server.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L90) ## rpc.LinearSleepStrategy ```ts const LinearSleepStrategy: SleepStrategy ``` **Source:** [src/rpc/server.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L93) ## rpc.Server Handles the network connection to a Soroban RPC instance, exposing an interface for requests to that instance. ```ts class Server { constructor(serverURL: string, opts: Options = {}); readonly httpClient: HttpClient; readonly serverURL: URL; _getEvents(request: GetEventsRequest): Promise; _getLatestLedger(): Promise; _getLedgerEntries(...keys: LedgerKey[]): Promise; _getLedgers(request: GetLedgersRequest): Promise; _getTransaction(hash: string): Promise; _getTransactions(request: GetTransactionsRequest): Promise; _sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise; _simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise; fundAddress(address: string, friendbotUrl?: string): Promise; getAccount(address: string): Promise; getAccountEntry(address: string): Promise; getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise; getClaimableBalance(id: string): Promise; getContractData(contract: string | Address | Contract, key: ScVal, durability: Durability = Durability.Persistent): Promise; getContractWasmByContractId(contractId: string): Promise>; getContractWasmByHash(wasmHash: string | Buffer, format: "base64" | "hex" | undefined = undefined): Promise>; getEvents(request: GetEventsRequest): Promise; getFeeStats(): Promise; getHealth(): Promise; getLatestLedger(): Promise; getLedgerEntries(...keys: LedgerKey[]): Promise; getLedgerEntry(key: LedgerKey): Promise; getLedgers(request: GetLedgersRequest): Promise; getNetwork(): Promise; getSACBalance(address: string | Address, sac: Asset, networkPassphrase?: string): Promise; getTransaction(hash: string): Promise; getTransactions(request: GetTransactionsRequest): Promise; getTrustline(account: string, asset: Asset): Promise; getVersionInfo(): Promise; pollTransaction(hash: string, opts?: PollingOptions): Promise; prepareTransaction(tx: Transaction | FeeBumpTransaction): Promise; requestAirdrop(address: string | Pick, friendbotUrl?: string): Promise; sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise; simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise; } ``` **See also** - `API reference docs` **Source:** [src/rpc/server.ts:53](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L53) ### `new Server(serverURL, opts)` ```ts constructor(serverURL: string, opts: Options = {}); ``` **Parameters** - **`serverURL`** — `string` (required) - **`opts`** — `Options` (optional) (default: `{}`) **Source:** [src/rpc/server.ts:170](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L170) ### `server.httpClient` HTTP client instance for making requests to Horizon. Exposes interceptors, defaults, and other configuration options. ```ts readonly httpClient: HttpClient; ``` **Example** ```ts // Add authentication header server.httpClient.defaults.headers['Authorization'] = 'Bearer token'; // Add request interceptor server.httpClient.interceptors.request.use((config) => { console.log('Request:', config.url); return config; }); ``` **Source:** [src/rpc/server.ts:169](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L169) ### `server.serverURL` ```ts readonly serverURL: URL; ``` **Source:** [src/rpc/server.ts:152](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L152) ### `server._getEvents(request)` ```ts _getEvents(request: GetEventsRequest): Promise; ``` **Parameters** - **`request`** — `GetEventsRequest` (required) **Source:** [src/rpc/server.ts:896](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L896) ### `server._getLatestLedger()` ```ts _getLatestLedger(): Promise; ``` **Source:** [src/rpc/server.ts:967](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L967) ### `server._getLedgerEntries(keys)` ```ts _getLedgerEntries(...keys: LedgerKey[]): Promise; ``` **Parameters** - **`...keys`** — `LedgerKey[]` (required) **Source:** [src/rpc/server.ts:661](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L661) ### `server._getLedgers(request)` ```ts _getLedgers(request: GetLedgersRequest): Promise; ``` **Parameters** - **`request`** — `GetLedgersRequest` (required) **Source:** [src/rpc/server.ts:1558](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1558) ### `server._getTransaction(hash)` ```ts _getTransaction(hash: string): Promise; ``` **Parameters** - **`hash`** — `string` (required) **Source:** [src/rpc/server.ts:784](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L784) ### `server._getTransactions(request)` ```ts _getTransactions(request: GetTransactionsRequest): Promise; ``` **Parameters** - **`request`** — `GetTransactionsRequest` (required) **Source:** [src/rpc/server.ts:835](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L835) ### `server._sendTransaction(transaction)` ```ts _sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) **Source:** [src/rpc/server.ts:1194](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1194) ### `server._simulateTransaction(transaction, addlResources, authMode)` ```ts _simulateTransaction(transaction: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) - **`addlResources`** — `ResourceLeeway` (optional) - **`authMode`** — `SimulationAuthMode` (optional) **Source:** [src/rpc/server.ts:1041](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1041) ### `server.fundAddress(address, friendbotUrl)` Fund an address using the network's Friendbot faucet, if any. This method supports both account (G...) and contract (C...) addresses. ```ts fundAddress(address: string, friendbotUrl?: string): Promise; ``` **Parameters** - **`address`** — `string` (required) — The address to fund. Can be either a Stellar account (G...) or contract (C...) address. - **`friendbotUrl`** — `string` (optional) — (optional) Optionally, an explicit Friendbot URL (by default: this calls the Stellar RPC `getNetwork` method to try to discover this network's Friendbot url). **Returns** The transaction response from the Friendbot funding transaction. **Throws** - If Friendbot is not configured on this network or the funding transaction fails. **Example** ```ts // Funding an account (G... address) const tx = await server.fundAddress("GBZC6Y2Y7..."); console.log("Funded! Hash:", tx.txHash); // If you need the Account object: const account = await server.getAccount("GBZC6Y2Y7..."); ``` **Example** ```ts // Funding a contract (C... address) const tx = await server.fundAddress("CBZC6Y2Y7..."); console.log("Contract funded! Hash:", tx.txHash); ``` **See also** - `Friendbot docs` **Source:** [src/rpc/server.ts:1317](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1317) ### `server.getAccount(address)` Fetch a minimal set of current info about a Stellar account. Needed to get the current sequence number for the account so you can build a successful transaction with `TransactionBuilder`. ```ts getAccount(address: string): Promise; ``` **Parameters** - **`address`** — `string` (required) — The public address of the account to load. **Returns** A promise which resolves to the `Account` object with a populated sequence number **Example** ```ts const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4"; server.getAccount(accountId).then((account) => { console.log("sequence:", account.sequence); }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:203](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L203) ### `server.getAccountEntry(address)` Fetch the full account entry for a Stellar account. ```ts getAccountEntry(address: string): Promise; ``` **Parameters** - **`address`** — `string` (required) — The public address of the account to load. **Returns** Resolves to the full on-chain account entry **Example** ```ts const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4"; server.getAccountEntry(accountId).then((account) => { console.log("sequence:", account.balance().toString()); }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:226](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L226) ### `server.getAssetBalance(address, asset, networkPassphrase)` Fetch the balance of an asset held by an account or contract. The `address` argument may be provided as a string (as a `StrKey`), `Address`, or `Contract`. ```ts getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise; ``` **Parameters** - **`address`** — `string | Address | Contract` (required) — The account or contract whose balance should be fetched. - **`asset`** — `Asset` (required) — The asset whose balance you want to inspect. - **`networkPassphrase`** — `string` (optional) — (optional) optionally, when requesting the balance of a contract, the network passphrase to which this token applies. If omitted and necessary, a request about network information will be made (see `getNetwork`), since contract IDs for assets are specific to a network. You can refer to `Networks` for a list of built-in passphrases, e.g., `Networks.TESTNET`. **Returns** Resolves with balance entry details when available. **Throws** - If the supplied `address` is not a valid account or contract strkey. **Example** ```ts const usdc = new Asset( "USDC", "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" ); const balance = await server.getAssetBalance("GD...", usdc); console.log(balance.balanceEntry?.amount); ``` **Source:** [src/rpc/server.ts:376](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L376) ### `server.getClaimableBalance(id)` Fetch the full claimable balance entry for a Stellar account. ```ts getClaimableBalance(id: string): Promise; ``` **Parameters** - **`id`** — `string` (required) — The strkey (`B...`) or hex (`00000000abcde...`) (both IDs with and without the 000... version prefix are accepted) of the claimable balance to load **Returns** Resolves to the full on-chain claimable balance entry **Example** ```ts const id = "00000000178826fbfe339e1f5c53417c6fedfe2c05e8bec14303143ec46b38981b09c3f9"; server.getClaimableBalance(id).then((entry) => { console.log(`Claimable balance {id.substr(0, 12)} has:`); console.log(` asset: ${Asset.fromXDRObject(entry.asset()).toString()}`; console.log(` amount: ${entry.amount().toString()}`; }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:308](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L308) ### `server.getContractData(contract, key, durability)` Reads the current value of contract data ledger entries directly. Allows you to directly inspect the current state of a contract. This is a backup way to access your contract data which may not be available via events or `rpc.Server.simulateTransaction`. ```ts getContractData(contract: string | Address | Contract, key: ScVal, durability: Durability = Durability.Persistent): Promise; ``` **Parameters** - **`contract`** — `string | Address | Contract` (required) — The contract ID containing the data to load as a strkey (`C...` form), a `Contract`, or an `Address` instance - **`key`** — `ScVal` (required) — The key of the contract data to load - **`durability`** — `Durability` (optional) (default: `Durability.Persistent`) — (optional) The "durability keyspace" that this ledger key belongs to, which is either 'temporary' or 'persistent' (the default), see `rpc.Durability`. **Returns** The current data value **Warning:** If the data entry in question is a 'temporary' entry, it's entirely possible that it has expired out of existence. **Example** ```ts const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"; const key = xdr.ScVal.scvSymbol("counter"); server.getContractData(contractId, key, Durability.Temporary).then(data => { console.log("value:", data.val); console.log("liveUntilLedgerSeq:", data.liveUntilLedgerSeq); console.log("lastModified:", data.lastModifiedLedgerSeq); console.log("latestLedger:", data.latestLedger); }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:477](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L477) ### `server.getContractWasmByContractId(contractId)` Retrieves the WASM bytecode for a given contract. This method allows you to fetch the WASM bytecode associated with a contract deployed on the Soroban network. The WASM bytecode represents the executable code of the contract. ```ts getContractWasmByContractId(contractId: string): Promise>; ``` **Parameters** - **`contractId`** — `string` (required) — The contract ID containing the WASM bytecode to retrieve **Returns** A Buffer containing the WASM bytecode **Throws** - If the contract or its associated WASM bytecode cannot be found on the network. **Example** ```ts const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"; server.getContractWasmByContractId(contractId).then(wasmBuffer => { console.log("WASM bytecode length:", wasmBuffer.length); // ... do something with the WASM bytecode ... }).catch(err => { console.error("Error fetching WASM bytecode:", err); }); ``` **Source:** [src/rpc/server.ts:551](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L551) ### `server.getContractWasmByHash(wasmHash, format)` Retrieves the WASM bytecode for a given contract hash. This method allows you to fetch the WASM bytecode associated with a contract deployed on the Soroban network using the contract's WASM hash. The WASM bytecode represents the executable code of the contract. ```ts getContractWasmByHash(wasmHash: string | Buffer, format: "base64" | "hex" | undefined = undefined): Promise>; ``` **Parameters** - **`wasmHash`** — `string | Buffer` (required) — The WASM hash of the contract - **`format`** — `"base64" | "hex" | undefined` (optional) (default: `undefined`) **Returns** A Buffer containing the WASM bytecode **Throws** - If the contract or its associated WASM bytecode cannot be found on the network. **Example** ```ts const wasmHash = Buffer.from("..."); server.getContractWasmByHash(wasmHash).then(wasmBuffer => { console.log("WASM bytecode length:", wasmBuffer.length); // ... do something with the WASM bytecode ... }).catch(err => { console.error("Error fetching WASM bytecode:", err); }); ``` **Source:** [src/rpc/server.ts:596](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L596) ### `server.getEvents(request)` Fetch all events that match a given set of filters. The given filters (see `Api.EventFilter` for detailed fields) are combined only in a logical OR fashion, and all of the fields in each filter are optional. To page through events, use the `pagingToken` field on the relevant `Api.EventResponse` object to set the `cursor` parameter. ```ts getEvents(request: GetEventsRequest): Promise; ``` **Parameters** - **`request`** — `GetEventsRequest` (required) — Event filters `Api.GetEventsRequest`, **Returns** A paginatable set of the events matching the given event filters **Example** ```ts server.getEvents({ startLedger: 1000, endLedger: 2000, filters: [ { type: "contract", contractIds: [ "deadb33f..." ], topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc=", "*" ]] }, { type: "system", contractIds: [ "...c4f3b4b3..." ], topics: [[ "*" ], [ "*", "AAAAAQB6Mcc=" ]] }, { contractIds: [ "...c4f3b4b3..." ], topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==" ]] }, { type: "diagnostic", topics: [[ "AAAAAQB6Mcc=" ]] } ], limit: 10, }); ``` **See also** - `getEvents docs` **Source:** [src/rpc/server.ts:890](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L890) ### `server.getFeeStats()` Provides an analysis of the recent fee stats for regular and smart contract operations. ```ts getFeeStats(): Promise; ``` **Returns** the fee stats **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getFeeStats **Source:** [src/rpc/server.ts:1363](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1363) ### `server.getHealth()` General node health check. ```ts getHealth(): Promise; ``` **Returns** A promise which resolves to the `Api.GetHealthResponse` object with the status of the server (e.g. "healthy"). **Example** ```ts server.getHealth().then((health) => { console.log("status:", health.status); }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:435](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L435) ### `server.getLatestLedger()` Fetch the latest ledger meta info from network which this Soroban RPC server is connected to. ```ts getLatestLedger(): Promise; ``` **Returns** metadata about the latest ledger on the network that this RPC server is connected to **Example** ```ts server.getLatestLedger().then((response) => { console.log("hash:", response.id); console.log("sequence:", response.sequence); console.log("protocolVersion:", response.protocolVersion); }); ``` **See also** - `getLatestLedger docs` **Source:** [src/rpc/server.ts:963](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L963) ### `server.getLedgerEntries(keys)` Reads the current value of arbitrary ledger entries directly. Allows you to directly inspect the current state of contracts, contract's code, accounts, or any other ledger entries. To fetch a contract's WASM byte-code, built the appropriate `xdr.LedgerKeyContractCode` ledger entry key (or see `Contract.getFootprint`). ```ts getLedgerEntries(...keys: LedgerKey[]): Promise; ``` **Parameters** - **`...keys`** — `LedgerKey[]` (required) — One or more ledger entry keys to load **Returns** The current on-chain values for the given ledger keys **Example** ```ts const contractId = "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM"; const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({ contractId: StrKey.decodeContract(contractId), key: xdr.ScVal.scvSymbol("counter"), })); server.getLedgerEntries([key]).then(response => { const ledgerData = response.entries[0]; console.log("key:", ledgerData.key); console.log("value:", ledgerData.val); console.log("liveUntilLedgerSeq:", ledgerData.liveUntilLedgerSeq); console.log("lastModified:", ledgerData.lastModifiedLedgerSeq); console.log("latestLedger:", response.latestLedger); }); ``` **See also** - - `getLedgerEntries docs` - RpcServer._getLedgerEntries **Source:** [src/rpc/server.ts:657](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L657) ### `server.getLedgerEntry(key)` ```ts getLedgerEntry(key: LedgerKey): Promise; ``` **Parameters** - **`key`** — `LedgerKey` (required) **Source:** [src/rpc/server.ts:672](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L672) ### `server.getLedgers(request)` Fetch a detailed list of ledgers starting from a specified point. Returns ledger data with support for pagination as long as the requested pages fall within the history retention of the RPC provider. ```ts getLedgers(request: GetLedgersRequest): Promise; ``` **Parameters** - **`request`** — `GetLedgersRequest` (required) — The request parameters for fetching ledgers. `Api.GetLedgersRequest` **Returns** A promise that resolves to the ledgers response containing an array of ledger data and pagination info. `Api.GetLedgersResponse` **Throws** - If startLedger is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. **Example** ```ts // Fetch ledgers starting from a specific sequence number server.getLedgers({ startLedger: 36233, pagination: { limit: 10 } }).then((response) => { console.log("Ledgers:", response.ledgers); console.log("Latest Ledger:", response.latestLedger); console.log("Cursor:", response.cursor); }); ``` **Example** ```ts // Paginate through ledgers using cursor const firstPage = await server.getLedgers({ startLedger: 36233, pagination: { limit: 5 } }); const nextPage = await server.getLedgers({ pagination: { cursor: firstPage.cursor, limit: 5 } }); ``` **See also** - `getLedgers docs` **Source:** [src/rpc/server.ts:1542](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1542) ### `server.getNetwork()` Fetch metadata about the network this Soroban RPC server is connected to. ```ts getNetwork(): Promise; ``` **Returns** Metadata about the current network this RPC server is connected to **Example** ```ts server.getNetwork().then((network) => { console.log("friendbotUrl:", network.friendbotUrl); console.log("passphrase:", network.passphrase); console.log("protocolVersion:", network.protocolVersion); }); ``` **See also** - `getNetwork docs` **Source:** [src/rpc/server.ts:937](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L937) ### `server.getSACBalance(address, sac, networkPassphrase)` **Deprecated.** Use `getAssetBalance`, instead Returns a contract's balance of a particular SAC asset, if any. This is a convenience wrapper around `Server.getLedgerEntries`. ```ts getSACBalance(address: string | Address, sac: Asset, networkPassphrase?: string): Promise; ``` **Parameters** - **`address`** — `string | Address` (required) — the contract (string `C...`) whose balance of `sac` you want to know - **`sac`** — `Asset` (required) — the built-in SAC token (e.g. `USDC:GABC...`) that you are querying from the given `contract`. - **`networkPassphrase`** — `string` (optional) — (optional) optionally, the network passphrase to which this token applies. If omitted, a request about network information will be made (see `getNetwork`), since contract IDs for assets are specific to a network. You can refer to `Networks` for a list of built-in passphrases, e.g., `Networks.TESTNET`. **Returns** , which will contain the balance entry details if and only if the request returned a valid balance ledger entry. If it doesn't, the `balanceEntry` field will not exist. **Throws** - If `address` is not a valid contract ID (C...). **Example** ```ts // assume `address` is some contract or account with an XLM balance // assume server is an instantiated `Server` instance. const entry = (await server.getSACBalance( new Address(address), Asset.native(), Networks.PUBLIC )); // assumes BigInt support: console.log( entry.balanceEntry ? BigInt(entry.balanceEntry.amount) : "Address has no XLM"); ``` **See also** - - getLedgerEntries - https://developers.stellar.org/docs/tokens/stellar-asset-contract **Source:** [src/rpc/server.ts:1427](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1427) ### `server.getTransaction(hash)` Fetch the details of a submitted transaction. After submitting a transaction, clients should poll this to tell when the transaction has completed. ```ts getTransaction(hash: string): Promise; ``` **Parameters** - **`hash`** — `string` (required) — Hex-encoded hash of the transaction to check **Returns** The status, result, and other details about the transaction **Example** ```ts const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a"; server.getTransaction(transactionHash).then((tx) => { console.log("status:", tx.status); console.log("envelopeXdr:", tx.envelopeXdr); console.log("resultMetaXdr:", tx.resultMetaXdr); console.log("resultXdr:", tx.resultXdr); }); ``` **See also** - `getTransaction docs` **Source:** [src/rpc/server.ts:757](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L757) ### `server.getTransactions(request)` Fetch transactions starting from a given start ledger or a cursor. The end ledger is the latest ledger in that RPC instance. ```ts getTransactions(request: GetTransactionsRequest): Promise; ``` **Parameters** - **`request`** — `GetTransactionsRequest` (required) — The request parameters. **Returns** - A promise that resolves to the transactions response. **Example** ```ts server.getTransactions({ startLedger: 10000, limit: 10, }).then((response) => { console.log("Transactions:", response.transactions); console.log("Latest Ledger:", response.latestLedger); console.log("Cursor:", response.cursor); }); ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransactions **Source:** [src/rpc/server.ts:817](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L817) ### `server.getTrustline(account, asset)` **Deprecated.** Use `getAssetBalance`, instead Fetch the full trustline entry for a Stellar account. ```ts getTrustline(account: string, asset: Asset): Promise; ``` **Parameters** - **`account`** — `string` (required) — The public address of the account whose trustline it is - **`asset`** — `Asset` (required) — The trustline's asset **Returns** Resolves to the full on-chain trustline entry **Example** ```ts const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4"; const asset = new Asset( "USDC", "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" ); server.getTrustline(accountId, asset).then((entry) => { console.log(`{asset.toString()} balance for ${accountId}:", entry.balance().toString()); }); ``` **See also** - `getLedgerEntries docs` **Source:** [src/rpc/server.ts:265](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L265) ### `server.getVersionInfo()` Provides information about the current version details of the Soroban RPC and captive-core ```ts getVersionInfo(): Promise; ``` **Returns** the version info **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getVersionInfo **Source:** [src/rpc/server.ts:1377](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1377) ### `server.pollTransaction(hash, opts)` Poll for a particular transaction with certain parameters. After submitting a transaction, clients can use this to poll for transaction completion and return a definitive state of success or failure. ```ts pollTransaction(hash: string, opts?: PollingOptions): Promise; ``` **Parameters** - **`hash`** — `string` (required) — the transaction you're polling for - **`opts`** — `PollingOptions` (optional) — (optional) polling options - `attempts` (optional): (optional) the number of attempts to make before returning the last-seen status. By default or on invalid inputs, try 5 times. - `sleepStrategy` (optional): (optional) the amount of time to wait for between each attempt. By default, sleep for 1 second between each attempt. **Returns** the response after a "found" response (which may be success or failure) or the last response obtained after polling the maximum number of specified attempts. **Example** ```ts const h = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a"; const txStatus = await server.pollTransaction(h, { attempts: 100, // I'm a maniac sleepStrategy: rpc.LinearSleepStrategy }); // this will take 5,050 seconds to complete ``` **Source:** [src/rpc/server.ts:710](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L710) ### `server.prepareTransaction(tx)` Submit a trial contract invocation, first run a simulation of the contract invocation as defined on the incoming transaction, and apply the results to a new copy of the transaction which is then returned. Setting the ledger footprint and authorization, so the resulting transaction is ready for signing & sending. The returned transaction will also have an updated fee that is the sum of fee set on incoming transaction with the contract resource fees estimated from simulation. It is advisable to check the fee on returned transaction and validate or take appropriate measures for interaction with user to confirm it is acceptable. You can call the `rpc.Server.simulateTransaction` method directly first if you want to inspect estimated fees for a given transaction in detail first, then re-assemble it manually or via `rpc.assembleTransaction`. ```ts prepareTransaction(tx: Transaction | FeeBumpTransaction): Promise; ``` **Parameters** - **`tx`** — `Transaction | FeeBumpTransaction` (required) — the transaction to prepare. It should include exactly one operation, which must be one of `xdr.InvokeHostFunctionOp`, `xdr.ExtendFootprintTtlOp`, or `xdr.RestoreFootprintOp`. Any provided footprint will be overwritten. However, if your operation has existing auth entries, they will be preferred over ALL auth entries from the simulation. In other words, if you include auth entries, you don't care about the auth returned from the simulation. Other fields (footprint, etc.) will be filled as normal. **Returns** A copy of the transaction with the expected authorizations (in the case of invocation), resources, and ledger footprints added. The transaction fee will also automatically be padded with the contract's minimum resource fees discovered from the simulation. **Throws** - * If simulation fails **Example** ```ts const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; const contract = new StellarSdk.Contract(contractId); // Right now, this is just the default fee for this example. const fee = StellarSdk.BASE_FEE; const transaction = new StellarSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the horizon hostname. //.setNetworkPassphrase(StellarSdk.Networks.PUBLIC) .setNetworkPassphrase(StellarSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build(); const preparedTransaction = await server.prepareTransaction(transaction); // Sign this transaction with the secret key // NOTE: signing is transaction is network specific. Test network transactions // won't work in the public network. To switch networks, use the Network object // as explained above (look for StellarSdk.Network). const sourceKeypair = StellarSdk.Keypair.fromSecret(sourceSecretKey); preparedTransaction.sign(sourceKeypair); server.sendTransaction(transaction).then(result => { console.log("hash:", result.hash); console.log("status:", result.status); console.log("errorResultXdr:", result.errorResultXdr); }); ``` **See also** - - module:rpc.assembleTransaction - `simulateTransaction docs` **Source:** [src/rpc/server.ts:1133](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1133) ### `server.requestAirdrop(address, friendbotUrl)` **Deprecated.** Use `Server.fundAddress` instead, which supports both account (G...) and contract (C...) addresses. Fund a new account using the network's Friendbot faucet, if any. ```ts requestAirdrop(address: string | Pick, friendbotUrl?: string): Promise; ``` **Parameters** - **`address`** — `string | Pick` (required) — The address or account instance that we want to create and fund with Friendbot - **`friendbotUrl`** — `string` (optional) — (optional) Optionally, an explicit address for friendbot (by default: this calls the Soroban RPC `getNetwork` method to try to discover this network's Friendbot url). **Returns** An `Account` object for the created account, or the existing account if it's already funded with the populated sequence number (note that the account will not be "topped off" if it already exists) **Throws** - If Friendbot is not configured on this network or request failure **Example** ```ts server .requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4") .then((accountCreated) => { console.log("accountCreated:", accountCreated); }).catch((error) => { console.error("error:", error); }); ``` **See also** - - `Friendbot docs` - `Friendbot.Api.Response` **Source:** [src/rpc/server.ts:1239](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1239) ### `server.sendTransaction(transaction)` Submit a real transaction to the Stellar network. Unlike Horizon, RPC does not wait for transaction completion. It simply validates the transaction and enqueues it. Clients should call `rpc.Server.getTransaction` to learn about transaction success/failure. ```ts sendTransaction(transaction: Transaction | FeeBumpTransaction): Promise; ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — to submit **Returns** the transaction id, status, and any error if available **Example** ```ts const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; const contract = new StellarSdk.Contract(contractId); // Right now, this is just the default fee for this example. const fee = StellarSdk.BASE_FEE; const transaction = new StellarSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the horizon hostname. //.setNetworkPassphrase(StellarSdk.Networks.PUBLIC) .setNetworkPassphrase(StellarSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build(); // Sign this transaction with the secret key // NOTE: signing is transaction is network specific. Test network transactions // won't work in the public network. To switch networks, use the Network object // as explained above (look for StellarSdk.Network). const sourceKeypair = StellarSdk.Keypair.fromSecret(sourceSecretKey); transaction.sign(sourceKeypair); server.sendTransaction(transaction).then((result) => { console.log("hash:", result.hash); console.log("status:", result.status); console.log("errorResultXdr:", result.errorResultXdr); }); ``` **See also** - - `transaction docs` - `sendTransaction docs` **Source:** [src/rpc/server.ts:1188](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1188) ### `server.simulateTransaction(tx, addlResources, authMode)` Submit a trial contract invocation to get back return values, expected ledger footprint, expected authorizations, and expected costs. ```ts simulateTransaction(tx: Transaction | FeeBumpTransaction, addlResources?: ResourceLeeway, authMode?: SimulationAuthMode): Promise; ``` **Parameters** - **`tx`** — `Transaction | FeeBumpTransaction` (required) — the transaction to simulate, which should include exactly one operation (one of `xdr.InvokeHostFunctionOp`, `xdr.ExtendFootprintTtlOp`, or `xdr.RestoreFootprintOp`). Any provided footprint or auth information will be ignored. - **`addlResources`** — `ResourceLeeway` (optional) — (optional) any additional resources to add to the simulation-provided ones, for example if you know you will need extra CPU instructions - **`authMode`** — `SimulationAuthMode` (optional) — (optional) optionally, specify the type of auth mode to use for simulation: `enforce` for enforcement mode, `record` for recording mode, or `record_allow_nonroot` for recording mode that allows non-root authorization **Returns** An object with the cost, footprint, result/auth requirements (if applicable), and error of the transaction **Example** ```ts const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; const contract = new StellarSdk.Contract(contractId); // Right now, this is just the default fee for this example. const fee = StellarSdk.BASE_FEE; const transaction = new StellarSdk.TransactionBuilder(account, { fee }) // Uncomment the following line to build transactions for the live network. Be // sure to also change the horizon hostname. //.setNetworkPassphrase(StellarSdk.Networks.PUBLIC) .setNetworkPassphrase(StellarSdk.Networks.FUTURENET) .setTimeout(30) // valid for the next 30s // Add an operation to call increment() on the contract .addOperation(contract.call("increment")) .build(); server.simulateTransaction(transaction).then((sim) => { console.log("cost:", sim.cost); console.log("result:", sim.result); console.log("error:", sim.error); console.log("latestLedger:", sim.latestLedger); }); ``` **See also** - - `transaction docs` - `simulateTransaction docs` - `authorization modes` - module:rpc.Server#prepareTransaction - module:rpc.assembleTransaction **Source:** [src/rpc/server.ts:1031](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L1031) ## rpc.assembleTransaction Combines the given raw transaction alongside the simulation results. If the given transaction already has authorization entries in a host function invocation (see `Operation.invokeHostFunction`), **the simulation entries are ignored**. If the given transaction already has authorization entries in a host function invocation (see `Operation.invokeHostFunction`), **the simulation entries are ignored**. ```ts assembleTransaction(raw: Transaction | FeeBumpTransaction, simulation: SimulateTransactionResponse | RawSimulateTransactionResponse): TransactionBuilder ``` **Parameters** - **`raw`** — `Transaction | FeeBumpTransaction` (required) — the initial transaction, w/o simulation applied - **`simulation`** — `SimulateTransactionResponse | RawSimulateTransactionResponse` (required) — the Soroban RPC simulation result (see `rpc.Server.simulateTransaction`) **Returns** a new, cloned transaction with the proper auth and resource (fee, footprint) simulation data applied **See also** - - `rpc.Server.simulateTransaction` - `rpc.Server.prepareTransaction` **Source:** [src/rpc/transaction.ts:44](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/transaction.ts#L44) ## rpc.parseRawEvents Parse and return the retrieved events, if any, from a raw response from a RPC server. ```ts parseRawEvents(raw: RawGetEventsResponse): GetEventsResponse ``` **Parameters** - **`raw`** — `RawGetEventsResponse` (required) — the raw `getEvents` response from the RPC server to parse **Returns** events parsed from the RPC server's response **Source:** [src/rpc/parsers.ts:96](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/parsers.ts#L96) ## rpc.parseRawSimulation Converts a raw response schema into one with parsed XDR fields and a simplified interface. **Warning:** This API is only exported for testing purposes and should not be relied on or considered "stable". ```ts parseRawSimulation(sim: SimulateTransactionResponse | RawSimulateTransactionResponse): SimulateTransactionResponse ``` **Parameters** - **`sim`** — `SimulateTransactionResponse | RawSimulateTransactionResponse` (required) — the raw response schema (parsed ones are allowed, best-effort detected, and returned untouched) **Returns** the original parameter (if already parsed), parsed otherwise **Source:** [src/rpc/parsers.ts:236](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/parsers.ts#L236) ## Types ### rpc.Api.BalanceResponse ```ts interface BalanceResponse { balanceEntry?: { amount: string; authorized: boolean; authorizedToMaintainLiabilities?: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; revocable?: boolean }; latestLedger: number; } ``` **Source:** [src/rpc/api.ts:586](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L586) #### `balanceResponse.balanceEntry` present only on success, otherwise request malformed or no balance ```ts balanceEntry?: { amount: string; authorized: boolean; authorizedToMaintainLiabilities?: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; revocable?: boolean }; ``` **Source:** [src/rpc/api.ts:589](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L589) #### `balanceResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:587](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L587) ### rpc.Api.BaseSendTransactionResponse ```ts interface BaseSendTransactionResponse { hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus; } ``` **Source:** [src/rpc/api.ts:376](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L376) #### `baseSendTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/rpc/api.ts:378](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L378) #### `baseSendTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:379](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L379) #### `baseSendTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:380](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L380) #### `baseSendTransactionResponse.status` ```ts status: SendTransactionStatus; ``` **Source:** [src/rpc/api.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L377) ### rpc.Api.BaseSimulateTransactionResponse ```ts interface BaseSimulateTransactionResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number; } ``` **Source:** [src/rpc/api.ts:410](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L410) #### `baseSimulateTransactionResponse._parsed` a private field to mark the schema as parsed ```ts _parsed: boolean; ``` **Source:** [src/rpc/api.ts:425](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L425) #### `baseSimulateTransactionResponse.events` The field is always present, but may be empty in cases where: - you didn't simulate an invocation or - there were no events ```ts events: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:422](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L422) #### `baseSimulateTransactionResponse.id` always present: the JSON-RPC request ID ```ts id: string; ``` **Source:** [src/rpc/api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L412) #### `baseSimulateTransactionResponse.latestLedger` always present: the LCL known to the server when responding ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:415](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L415) ### rpc.Api.EventFilter ```ts interface EventFilter { contractIds?: string[]; topics?: string[][]; type?: EventType; } ``` **Source:** [src/rpc/api.ts:228](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L228) #### `eventFilter.contractIds` ```ts contractIds?: string[]; ``` **Source:** [src/rpc/api.ts:230](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L230) #### `eventFilter.topics` ```ts topics?: string[][]; ``` **Source:** [src/rpc/api.ts:231](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L231) #### `eventFilter.type` ```ts type?: EventType; ``` **Source:** [src/rpc/api.ts:229](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L229) ### rpc.Api.EventResponse ```ts interface EventResponse extends BaseEventResponse { contractId?: Contract; id: string; inSuccessfulContractCall: boolean; ledger: number; ledgerClosedAt: string; operationIndex: number; topic: ScVal[]; transactionIndex: number; txHash: string; type: EventType; value: ScVal; } ``` **Source:** [src/rpc/api.ts:304](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L304) #### `eventResponse.contractId` ```ts contractId?: Contract; ``` **Source:** [src/rpc/api.ts:305](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L305) #### `eventResponse.id` ```ts id: string; ``` **Source:** [src/rpc/api.ts:316](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L316) #### `eventResponse.inSuccessfulContractCall` ```ts inSuccessfulContractCall: boolean; ``` **Source:** [src/rpc/api.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L322) #### `eventResponse.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:318](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L318) #### `eventResponse.ledgerClosedAt` ```ts ledgerClosedAt: string; ``` **Source:** [src/rpc/api.ts:319](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L319) #### `eventResponse.operationIndex` ```ts operationIndex: number; ``` **Source:** [src/rpc/api.ts:321](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L321) #### `eventResponse.topic` ```ts topic: ScVal[]; ``` **Source:** [src/rpc/api.ts:306](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L306) #### `eventResponse.transactionIndex` ```ts transactionIndex: number; ``` **Source:** [src/rpc/api.ts:320](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L320) #### `eventResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:323](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L323) #### `eventResponse.type` ```ts type: EventType; ``` **Source:** [src/rpc/api.ts:317](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L317) #### `eventResponse.value` ```ts value: ScVal; ``` **Source:** [src/rpc/api.ts:307](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L307) ### rpc.Api.EventType ```ts type EventType = "contract" | "system" ``` **Source:** [src/rpc/api.ts:226](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L226) ### rpc.Api.GetEventsRequest Request parameters for fetching events from the Stellar network. **Important**: This type enforces mutually exclusive pagination modes: - **Ledger range mode**: Use `startLedger` and `endLedger` (cursor must be omitted) - **Cursor pagination mode**: Use `cursor` (startLedger and endLedger must be omitted) ```ts type GetEventsRequest = { cursor?: never; endLedger?: number; filters: Api.EventFilter[]; limit?: number; startLedger: number } | { cursor: string; endLedger?: never; filters: Api.EventFilter[]; limit?: number; startLedger?: never } ``` **Example** ```ts // ✅ Correct: Ledger range mode const rangeRequest: GetEventsRequest = { filters: [], startLedger: 1000, endLedger: 2000, limit: 100 }; ``` **Example** ```ts // ✅ Correct: Cursor pagination mode const cursorRequest: GetEventsRequest = { filters: [], cursor: "some-cursor-value", limit: 100 }; ``` **Example** ```ts // ❌ Invalid: Cannot mix cursor with ledger range const invalidRequest = { filters: [], startLedger: 1000, // ❌ Cannot use with cursor endLedger: 2000, // ❌ Cannot use with cursor cursor: "cursor", // ❌ Cannot use with ledger range limit: 100 }; ``` **See also** - `getEvents API reference` **Source:** [src/rpc/api.ts:283](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L283) ### rpc.Api.GetEventsResponse ```ts interface GetEventsResponse extends RetentionState { cursor: string; events: EventResponse[]; latestLedger: number; latestLedgerCloseTime: string; oldestLedger: number; oldestLedgerCloseTime: string; } ``` **Source:** [src/rpc/api.ts:299](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L299) #### `getEventsResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:301](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L301) #### `getEventsResponse.events` ```ts events: EventResponse[]; ``` **Source:** [src/rpc/api.ts:300](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L300) #### `getEventsResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:235](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L235) #### `getEventsResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:237](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L237) #### `getEventsResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:236](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L236) #### `getEventsResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:238](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L238) ### rpc.Api.GetFailedTransactionResponse ```ts interface GetFailedTransactionResponse extends GetAnyTransactionResponse { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; status: FAILED; txHash: string; } ``` **Source:** [src/rpc/api.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L97) #### `getFailedTransactionResponse.applicationOrder` ```ts applicationOrder: number; ``` **Source:** [src/rpc/api.ts:102](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L102) #### `getFailedTransactionResponse.createdAt` ```ts createdAt: number; ``` **Source:** [src/rpc/api.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L101) #### `getFailedTransactionResponse.diagnosticEventsXdr` ```ts diagnosticEventsXdr?: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L107) #### `getFailedTransactionResponse.envelopeXdr` ```ts envelopeXdr: TransactionEnvelope; ``` **Source:** [src/rpc/api.ts:104](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L104) #### `getFailedTransactionResponse.events` ```ts events: TransactionEvents; ``` **Source:** [src/rpc/api.ts:108](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L108) #### `getFailedTransactionResponse.feeBump` ```ts feeBump: boolean; ``` **Source:** [src/rpc/api.ts:103](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L103) #### `getFailedTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:87](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L87) #### `getFailedTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:88](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L88) #### `getFailedTransactionResponse.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:100](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L100) #### `getFailedTransactionResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L89) #### `getFailedTransactionResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L90) #### `getFailedTransactionResponse.resultMetaXdr` ```ts resultMetaXdr: TransactionMeta; ``` **Source:** [src/rpc/api.ts:106](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L106) #### `getFailedTransactionResponse.resultXdr` ```ts resultXdr: TransactionResult; ``` **Source:** [src/rpc/api.ts:105](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L105) #### `getFailedTransactionResponse.status` ```ts status: FAILED; ``` **Source:** [src/rpc/api.ts:98](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L98) #### `getFailedTransactionResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L86) ### rpc.Api.GetFeeStatsResponse ```ts interface GetFeeStatsResponse { inclusionFee: FeeDistribution; latestLedger: number; sorobanInclusionFee: FeeDistribution; } ``` **Source:** [src/rpc/api.ts:560](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L560) #### `getFeeStatsResponse.inclusionFee` ```ts inclusionFee: FeeDistribution; ``` **Source:** [src/rpc/api.ts:562](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L562) #### `getFeeStatsResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:563](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L563) #### `getFeeStatsResponse.sorobanInclusionFee` ```ts sorobanInclusionFee: FeeDistribution; ``` **Source:** [src/rpc/api.ts:561](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L561) ### rpc.Api.GetHealthResponse ```ts interface GetHealthResponse { latestLedger: number; ledgerRetentionWindow: number; oldestLedger: number; status: "healthy"; } ``` **Source:** [src/rpc/api.ts:5](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L5) #### `getHealthResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:6](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L6) #### `getHealthResponse.ledgerRetentionWindow` ```ts ledgerRetentionWindow: number; ``` **Source:** [src/rpc/api.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L7) #### `getHealthResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L8) #### `getHealthResponse.status` ```ts status: "healthy"; ``` **Source:** [src/rpc/api.ts:9](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L9) ### rpc.Api.GetLatestLedgerResponse ```ts interface GetLatestLedgerResponse { closeTime: string; headerXdr: LedgerHeader; id: string; metadataXdr: LedgerCloseMeta; protocolVersion: string; sequence: number; } ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLatestLedger **Source:** [src/rpc/api.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L52) #### `getLatestLedgerResponse.closeTime` ```ts closeTime: string; ``` **Source:** [src/rpc/api.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L56) #### `getLatestLedgerResponse.headerXdr` ```ts headerXdr: LedgerHeader; ``` **Source:** [src/rpc/api.ts:57](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L57) #### `getLatestLedgerResponse.id` ```ts id: string; ``` **Source:** [src/rpc/api.ts:53](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L53) #### `getLatestLedgerResponse.metadataXdr` ```ts metadataXdr: LedgerCloseMeta; ``` **Source:** [src/rpc/api.ts:58](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L58) #### `getLatestLedgerResponse.protocolVersion` ```ts protocolVersion: string; ``` **Source:** [src/rpc/api.ts:55](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L55) #### `getLatestLedgerResponse.sequence` ```ts sequence: number; ``` **Source:** [src/rpc/api.ts:54](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L54) ### rpc.Api.GetLedgerEntriesResponse An XDR-parsed version of `RawLedgerEntryResult` ```ts interface GetLedgerEntriesResponse { entries: LedgerEntryResult[]; latestLedger: number; } ``` **Source:** [src/rpc/api.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L33) #### `getLedgerEntriesResponse.entries` ```ts entries: LedgerEntryResult[]; ``` **Source:** [src/rpc/api.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L34) #### `getLedgerEntriesResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L35) ### rpc.Api.GetLedgersRequest Request parameters for fetching a sequential list of ledgers. This type supports two distinct pagination modes that are mutually exclusive: - **Ledger-based pagination**: Use `startLedger` to begin fetching from a specific ledger sequence - **Cursor-based pagination**: Use `cursor` to continue from a previous response's pagination token ```ts type GetLedgersRequest = { pagination?: { cursor?: never; limit?: number }; startLedger: number } | { pagination: { cursor: string; limit?: number }; startLedger?: never } ``` **Example** ```ts // Ledger-based pagination - start from specific ledger const ledgerRequest: GetLedgersRequest = { startLedger: 36233, pagination: { limit: 10 } }; ``` **Example** ```ts // Cursor-based pagination - continue from previous response const cursorRequest: GetLedgersRequest = { pagination: { cursor: "36234", limit: 5 } }; ``` **See also** - `getLedgers API reference` **Source:** [src/rpc/api.ts:633](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L633) ### rpc.Api.GetLedgersResponse ```ts interface GetLedgersResponse { cursor: string; latestLedger: number; latestLedgerCloseTime: number; ledgers: LedgerResponse[]; oldestLedger: number; oldestLedgerCloseTime: number; } ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgers **Source:** [src/rpc/api.ts:669](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L669) #### `getLedgersResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:675](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L675) #### `getLedgersResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:671](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L671) #### `getLedgersResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:672](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L672) #### `getLedgersResponse.ledgers` ```ts ledgers: LedgerResponse[]; ``` **Source:** [src/rpc/api.ts:670](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L670) #### `getLedgersResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:673](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L673) #### `getLedgersResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:674](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L674) ### rpc.Api.GetMissingTransactionResponse ```ts interface GetMissingTransactionResponse extends GetAnyTransactionResponse { latestLedger: number; latestLedgerCloseTime: number; oldestLedger: number; oldestLedgerCloseTime: number; status: NOT_FOUND; txHash: string; } ``` **Source:** [src/rpc/api.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L93) #### `getMissingTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:87](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L87) #### `getMissingTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:88](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L88) #### `getMissingTransactionResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L89) #### `getMissingTransactionResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L90) #### `getMissingTransactionResponse.status` ```ts status: NOT_FOUND; ``` **Source:** [src/rpc/api.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L94) #### `getMissingTransactionResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L86) ### rpc.Api.GetNetworkResponse ```ts interface GetNetworkResponse { friendbotUrl?: string; passphrase: string; protocolVersion: string; } ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getNetwork **Source:** [src/rpc/api.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L45) #### `getNetworkResponse.friendbotUrl` ```ts friendbotUrl?: string; ``` **Source:** [src/rpc/api.ts:46](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L46) #### `getNetworkResponse.passphrase` ```ts passphrase: string; ``` **Source:** [src/rpc/api.ts:47](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L47) #### `getNetworkResponse.protocolVersion` ```ts protocolVersion: string; ``` **Source:** [src/rpc/api.ts:48](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L48) ### rpc.Api.GetSuccessfulTransactionResponse ```ts interface GetSuccessfulTransactionResponse extends GetAnyTransactionResponse { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; returnValue?: ScVal; status: SUCCESS; txHash: string; } ``` **Source:** [src/rpc/api.ts:111](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L111) #### `getSuccessfulTransactionResponse.applicationOrder` ```ts applicationOrder: number; ``` **Source:** [src/rpc/api.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L116) #### `getSuccessfulTransactionResponse.createdAt` ```ts createdAt: number; ``` **Source:** [src/rpc/api.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L115) #### `getSuccessfulTransactionResponse.diagnosticEventsXdr` ```ts diagnosticEventsXdr?: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:121](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L121) #### `getSuccessfulTransactionResponse.envelopeXdr` ```ts envelopeXdr: TransactionEnvelope; ``` **Source:** [src/rpc/api.ts:118](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L118) #### `getSuccessfulTransactionResponse.events` ```ts events: TransactionEvents; ``` **Source:** [src/rpc/api.ts:124](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L124) #### `getSuccessfulTransactionResponse.feeBump` ```ts feeBump: boolean; ``` **Source:** [src/rpc/api.ts:117](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L117) #### `getSuccessfulTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:87](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L87) #### `getSuccessfulTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:88](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L88) #### `getSuccessfulTransactionResponse.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:114](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L114) #### `getSuccessfulTransactionResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:89](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L89) #### `getSuccessfulTransactionResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:90](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L90) #### `getSuccessfulTransactionResponse.resultMetaXdr` ```ts resultMetaXdr: TransactionMeta; ``` **Source:** [src/rpc/api.ts:120](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L120) #### `getSuccessfulTransactionResponse.resultXdr` ```ts resultXdr: TransactionResult; ``` **Source:** [src/rpc/api.ts:119](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L119) #### `getSuccessfulTransactionResponse.returnValue` ```ts returnValue?: ScVal; ``` **Source:** [src/rpc/api.ts:123](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L123) #### `getSuccessfulTransactionResponse.status` ```ts status: SUCCESS; ``` **Source:** [src/rpc/api.ts:112](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L112) #### `getSuccessfulTransactionResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:86](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L86) ### rpc.Api.GetTransactionResponse ```ts type GetTransactionResponse = GetSuccessfulTransactionResponse | GetFailedTransactionResponse | GetMissingTransactionResponse ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getTransaction **Source:** [src/rpc/api.ts:79](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L79) ### rpc.Api.GetTransactionStatus ```ts enum GetTransactionStatus ``` **Source:** [src/rpc/api.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L72) ### rpc.Api.GetTransactionsRequest ```ts type GetTransactionsRequest = { pagination?: { cursor?: never; limit?: number }; startLedger: number } | { pagination: { cursor: string; limit?: number }; startLedger?: never } ``` **Source:** [src/rpc/api.ts:149](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L149) ### rpc.Api.GetTransactionsResponse ```ts interface GetTransactionsResponse { cursor: string; latestLedger: number; latestLedgerCloseTimestamp: number; oldestLedger: number; oldestLedgerCloseTimestamp: number; transactions: TransactionInfo[]; } ``` **Source:** [src/rpc/api.ts:208](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L208) #### `getTransactionsResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:214](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L214) #### `getTransactionsResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:210](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L210) #### `getTransactionsResponse.latestLedgerCloseTimestamp` ```ts latestLedgerCloseTimestamp: number; ``` **Source:** [src/rpc/api.ts:211](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L211) #### `getTransactionsResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:212](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L212) #### `getTransactionsResponse.oldestLedgerCloseTimestamp` ```ts oldestLedgerCloseTimestamp: number; ``` **Source:** [src/rpc/api.ts:213](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L213) #### `getTransactionsResponse.transactions` ```ts transactions: TransactionInfo[]; ``` **Source:** [src/rpc/api.ts:209](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L209) ### rpc.Api.GetVersionInfoResponse ```ts interface GetVersionInfoResponse { build_timestamp: string; buildTimestamp: string; captive_core_version: string; captiveCoreVersion: string; commit_hash: string; commitHash: string; protocol_version: number; protocolVersion: number; version: string; } ``` **Source:** [src/rpc/api.ts:543](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L543) #### `getVersionInfoResponse.build_timestamp` ```ts build_timestamp: string; ``` **Source:** [src/rpc/api.ts:553](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L553) #### `getVersionInfoResponse.buildTimestamp` ```ts buildTimestamp: string; ``` **Source:** [src/rpc/api.ts:546](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L546) #### `getVersionInfoResponse.captive_core_version` ```ts captive_core_version: string; ``` **Source:** [src/rpc/api.ts:555](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L555) #### `getVersionInfoResponse.captiveCoreVersion` ```ts captiveCoreVersion: string; ``` **Source:** [src/rpc/api.ts:547](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L547) #### `getVersionInfoResponse.commit_hash` ```ts commit_hash: string; ``` **Source:** [src/rpc/api.ts:551](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L551) #### `getVersionInfoResponse.commitHash` ```ts commitHash: string; ``` **Source:** [src/rpc/api.ts:545](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L545) #### `getVersionInfoResponse.protocol_version` ```ts protocol_version: number; ``` **Source:** [src/rpc/api.ts:557](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L557) #### `getVersionInfoResponse.protocolVersion` ```ts protocolVersion: number; ``` **Source:** [src/rpc/api.ts:548](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L548) #### `getVersionInfoResponse.version` ```ts version: string; ``` **Source:** [src/rpc/api.ts:544](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L544) ### rpc.Api.LedgerEntryChange ```ts interface LedgerEntryChange { after: LedgerEntry | null; before: LedgerEntry | null; key: LedgerKey; type: number; } ``` **Source:** [src/rpc/api.ts:342](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L342) #### `ledgerEntryChange.after` ```ts after: LedgerEntry | null; ``` **Source:** [src/rpc/api.ts:346](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L346) #### `ledgerEntryChange.before` ```ts before: LedgerEntry | null; ``` **Source:** [src/rpc/api.ts:345](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L345) #### `ledgerEntryChange.key` ```ts key: LedgerKey; ``` **Source:** [src/rpc/api.ts:344](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L344) #### `ledgerEntryChange.type` ```ts type: number; ``` **Source:** [src/rpc/api.ts:343](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L343) ### rpc.Api.LedgerEntryResult ```ts interface LedgerEntryResult { key: LedgerKey; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; val: LedgerEntryData; } ``` **Source:** [src/rpc/api.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L12) #### `ledgerEntryResult.key` ```ts key: LedgerKey; ``` **Source:** [src/rpc/api.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L14) #### `ledgerEntryResult.lastModifiedLedgerSeq` ```ts lastModifiedLedgerSeq?: number; ``` **Source:** [src/rpc/api.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L13) #### `ledgerEntryResult.liveUntilLedgerSeq` ```ts liveUntilLedgerSeq?: number; ``` **Source:** [src/rpc/api.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L16) #### `ledgerEntryResult.val` ```ts val: LedgerEntryData; ``` **Source:** [src/rpc/api.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L15) ### rpc.Api.LedgerResponse ```ts interface LedgerResponse { hash: string; headerXdr: LedgerHeaderHistoryEntry; ledgerCloseTime: string; metadataXdr: LedgerCloseMeta; sequence: number; } ``` **Source:** [src/rpc/api.ts:687](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L687) #### `ledgerResponse.hash` ```ts hash: string; ``` **Source:** [src/rpc/api.ts:688](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L688) #### `ledgerResponse.headerXdr` ```ts headerXdr: LedgerHeaderHistoryEntry; ``` **Source:** [src/rpc/api.ts:691](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L691) #### `ledgerResponse.ledgerCloseTime` ```ts ledgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:690](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L690) #### `ledgerResponse.metadataXdr` ```ts metadataXdr: LedgerCloseMeta; ``` **Source:** [src/rpc/api.ts:692](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L692) #### `ledgerResponse.sequence` ```ts sequence: number; ``` **Source:** [src/rpc/api.ts:689](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L689) ### rpc.Api.RawEventResponse ```ts interface RawEventResponse extends BaseEventResponse { contractId: string; id: string; inSuccessfulContractCall: boolean; ledger: number; ledgerClosedAt: string; operationIndex: number; topic?: string[]; transactionIndex: number; txHash: string; type: EventType; value: string; } ``` **Source:** [src/rpc/api.ts:326](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L326) #### `rawEventResponse.contractId` ```ts contractId: string; ``` **Source:** [src/rpc/api.ts:327](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L327) #### `rawEventResponse.id` ```ts id: string; ``` **Source:** [src/rpc/api.ts:316](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L316) #### `rawEventResponse.inSuccessfulContractCall` ```ts inSuccessfulContractCall: boolean; ``` **Source:** [src/rpc/api.ts:322](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L322) #### `rawEventResponse.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:318](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L318) #### `rawEventResponse.ledgerClosedAt` ```ts ledgerClosedAt: string; ``` **Source:** [src/rpc/api.ts:319](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L319) #### `rawEventResponse.operationIndex` ```ts operationIndex: number; ``` **Source:** [src/rpc/api.ts:321](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L321) #### `rawEventResponse.topic` ```ts topic?: string[]; ``` **Source:** [src/rpc/api.ts:328](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L328) #### `rawEventResponse.transactionIndex` ```ts transactionIndex: number; ``` **Source:** [src/rpc/api.ts:320](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L320) #### `rawEventResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:323](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L323) #### `rawEventResponse.type` ```ts type: EventType; ``` **Source:** [src/rpc/api.ts:317](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L317) #### `rawEventResponse.value` ```ts value: string; ``` **Source:** [src/rpc/api.ts:329](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L329) ### rpc.Api.RawGetEventsResponse ```ts interface RawGetEventsResponse extends RetentionState { cursor: string; events: RawEventResponse[]; latestLedger: number; latestLedgerCloseTime: string; oldestLedger: number; oldestLedgerCloseTime: string; } ``` **Source:** [src/rpc/api.ts:310](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L310) #### `rawGetEventsResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:312](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L312) #### `rawGetEventsResponse.events` ```ts events: RawEventResponse[]; ``` **Source:** [src/rpc/api.ts:311](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L311) #### `rawGetEventsResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:235](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L235) #### `rawGetEventsResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:237](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L237) #### `rawGetEventsResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:236](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L236) #### `rawGetEventsResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:238](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L238) ### rpc.Api.RawGetLatestLedgerResponse ```ts interface RawGetLatestLedgerResponse { closeTime: string; headerXdr: string; id: string; metadataXdr: string; protocolVersion: string; sequence: number; } ``` **Source:** [src/rpc/api.ts:61](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L61) #### `rawGetLatestLedgerResponse.closeTime` ```ts closeTime: string; ``` **Source:** [src/rpc/api.ts:65](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L65) #### `rawGetLatestLedgerResponse.headerXdr` a base-64 encoded `xdr.LedgerHeader` instance ```ts headerXdr: string; ``` **Source:** [src/rpc/api.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L67) #### `rawGetLatestLedgerResponse.id` ```ts id: string; ``` **Source:** [src/rpc/api.ts:62](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L62) #### `rawGetLatestLedgerResponse.metadataXdr` a base-64 encoded `xdr.LedgerCloseMeta` instance ```ts metadataXdr: string; ``` **Source:** [src/rpc/api.ts:69](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L69) #### `rawGetLatestLedgerResponse.protocolVersion` ```ts protocolVersion: string; ``` **Source:** [src/rpc/api.ts:64](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L64) #### `rawGetLatestLedgerResponse.sequence` ```ts sequence: number; ``` **Source:** [src/rpc/api.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L63) ### rpc.Api.RawGetLedgerEntriesResponse ```ts interface RawGetLedgerEntriesResponse { entries?: RawLedgerEntryResult[]; latestLedger: number; } ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries **Source:** [src/rpc/api.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L39) #### `rawGetLedgerEntriesResponse.entries` ```ts entries?: RawLedgerEntryResult[]; ``` **Source:** [src/rpc/api.ts:40](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L40) #### `rawGetLedgerEntriesResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:41](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L41) ### rpc.Api.RawGetLedgersResponse ```ts interface RawGetLedgersResponse { cursor: string; latestLedger: number; latestLedgerCloseTime: number; ledgers: RawLedgerResponse[]; oldestLedger: number; oldestLedgerCloseTime: number; } ``` **Source:** [src/rpc/api.ts:678](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L678) #### `rawGetLedgersResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:684](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L684) #### `rawGetLedgersResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:680](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L680) #### `rawGetLedgersResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:681](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L681) #### `rawGetLedgersResponse.ledgers` ```ts ledgers: RawLedgerResponse[]; ``` **Source:** [src/rpc/api.ts:679](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L679) #### `rawGetLedgersResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:682](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L682) #### `rawGetLedgersResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:683](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L683) ### rpc.Api.RawGetTransactionResponse ```ts interface RawGetTransactionResponse { applicationOrder?: number; createdAt?: number; diagnosticEventsXdr?: string[]; envelopeXdr?: string; events?: RawTransactionEvents; feeBump?: boolean; latestLedger: number; latestLedgerCloseTime: number; ledger?: number; oldestLedger: number; oldestLedgerCloseTime: number; resultMetaXdr?: string; resultXdr?: string; status: GetTransactionStatus; txHash: string; } ``` **Source:** [src/rpc/api.ts:127](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L127) #### `rawGetTransactionResponse.applicationOrder` ```ts applicationOrder?: number; ``` **Source:** [src/rpc/api.ts:136](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L136) #### `rawGetTransactionResponse.createdAt` ```ts createdAt?: number; ``` **Source:** [src/rpc/api.ts:139](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L139) #### `rawGetTransactionResponse.diagnosticEventsXdr` ```ts diagnosticEventsXdr?: string[]; ``` **Source:** [src/rpc/api.ts:144](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L144) #### `rawGetTransactionResponse.envelopeXdr` ```ts envelopeXdr?: string; ``` **Source:** [src/rpc/api.ts:141](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L141) #### `rawGetTransactionResponse.events` ```ts events?: RawTransactionEvents; ``` **Source:** [src/rpc/api.ts:146](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L146) #### `rawGetTransactionResponse.feeBump` ```ts feeBump?: boolean; ``` **Source:** [src/rpc/api.ts:137](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L137) #### `rawGetTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L129) #### `rawGetTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:130](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L130) #### `rawGetTransactionResponse.ledger` ```ts ledger?: number; ``` **Source:** [src/rpc/api.ts:138](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L138) #### `rawGetTransactionResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L131) #### `rawGetTransactionResponse.oldestLedgerCloseTime` ```ts oldestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:132](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L132) #### `rawGetTransactionResponse.resultMetaXdr` ```ts resultMetaXdr?: string; ``` **Source:** [src/rpc/api.ts:143](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L143) #### `rawGetTransactionResponse.resultXdr` ```ts resultXdr?: string; ``` **Source:** [src/rpc/api.ts:142](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L142) #### `rawGetTransactionResponse.status` ```ts status: GetTransactionStatus; ``` **Source:** [src/rpc/api.ts:128](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L128) #### `rawGetTransactionResponse.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:133](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L133) ### rpc.Api.RawGetTransactionsResponse ```ts interface RawGetTransactionsResponse { cursor: string; latestLedger: number; latestLedgerCloseTimestamp: number; oldestLedger: number; oldestLedgerCloseTimestamp: number; transactions: RawTransactionInfo[] | null; } ``` **Source:** [src/rpc/api.ts:217](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L217) #### `rawGetTransactionsResponse.cursor` ```ts cursor: string; ``` **Source:** [src/rpc/api.ts:223](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L223) #### `rawGetTransactionsResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:219](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L219) #### `rawGetTransactionsResponse.latestLedgerCloseTimestamp` ```ts latestLedgerCloseTimestamp: number; ``` **Source:** [src/rpc/api.ts:220](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L220) #### `rawGetTransactionsResponse.oldestLedger` ```ts oldestLedger: number; ``` **Source:** [src/rpc/api.ts:221](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L221) #### `rawGetTransactionsResponse.oldestLedgerCloseTimestamp` ```ts oldestLedgerCloseTimestamp: number; ``` **Source:** [src/rpc/api.ts:222](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L222) #### `rawGetTransactionsResponse.transactions` ```ts transactions: RawTransactionInfo[] | null; ``` **Source:** [src/rpc/api.ts:218](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L218) ### rpc.Api.RawLedgerEntryResult ```ts interface RawLedgerEntryResult { key: string; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; xdr: string; } ``` **Source:** [src/rpc/api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L19) #### `rawLedgerEntryResult.key` a base-64 encoded `xdr.LedgerKey` instance ```ts key: string; ``` **Source:** [src/rpc/api.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L22) #### `rawLedgerEntryResult.lastModifiedLedgerSeq` ```ts lastModifiedLedgerSeq?: number; ``` **Source:** [src/rpc/api.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L20) #### `rawLedgerEntryResult.liveUntilLedgerSeq` optional, a future ledger number upon which this entry will expire based on https://github.com/stellar/soroban-tools/issues/1010 ```ts liveUntilLedgerSeq?: number; ``` **Source:** [src/rpc/api.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L29) #### `rawLedgerEntryResult.xdr` a base-64 encoded `xdr.LedgerEntryData` instance ```ts xdr: string; ``` **Source:** [src/rpc/api.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L24) ### rpc.Api.RawLedgerResponse ```ts interface RawLedgerResponse { hash: string; headerXdr: string; ledgerCloseTime: string; metadataXdr: string; sequence: number; } ``` **Source:** [src/rpc/api.ts:695](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L695) #### `rawLedgerResponse.hash` ```ts hash: string; ``` **Source:** [src/rpc/api.ts:696](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L696) #### `rawLedgerResponse.headerXdr` a base-64 encoded `xdr.LedgerHeaderHistoryEntry` instance ```ts headerXdr: string; ``` **Source:** [src/rpc/api.ts:700](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L700) #### `rawLedgerResponse.ledgerCloseTime` ```ts ledgerCloseTime: string; ``` **Source:** [src/rpc/api.ts:698](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L698) #### `rawLedgerResponse.metadataXdr` a base-64 encoded `xdr.LedgerCloseMeta` instance ```ts metadataXdr: string; ``` **Source:** [src/rpc/api.ts:702](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L702) #### `rawLedgerResponse.sequence` ```ts sequence: number; ``` **Source:** [src/rpc/api.ts:697](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L697) ### rpc.Api.RawSendTransactionResponse ```ts interface RawSendTransactionResponse extends BaseSendTransactionResponse { diagnosticEventsXdr?: string[]; errorResultXdr?: string; hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus; } ``` **Source:** [src/rpc/api.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L360) #### `rawSendTransactionResponse.diagnosticEventsXdr` This is a base64-encoded instance of an array of `xdr.DiagnosticEvent`s, set only when `status` is `"ERROR"` and diagnostic events are enabled on the server. ```ts diagnosticEventsXdr?: string[]; ``` **Source:** [src/rpc/api.ts:373](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L373) #### `rawSendTransactionResponse.errorResultXdr` This is a base64-encoded instance of `xdr.TransactionResult`, set only when `status` is `"ERROR"`. It contains details on why the network rejected the transaction. ```ts errorResultXdr?: string; ``` **Source:** [src/rpc/api.ts:367](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L367) #### `rawSendTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/rpc/api.ts:378](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L378) #### `rawSendTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:379](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L379) #### `rawSendTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:380](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L380) #### `rawSendTransactionResponse.status` ```ts status: SendTransactionStatus; ``` **Source:** [src/rpc/api.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L377) ### rpc.Api.RawSimulateTransactionResponse ```ts interface RawSimulateTransactionResponse { error?: string; events?: string[]; id: string; latestLedger: number; minResourceFee?: string; restorePreamble?: { minResourceFee: string; transactionData: string }; results?: RawSimulateHostFunctionResult[]; stateChanges?: RawLedgerEntryChange[]; transactionData?: string; } ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction **Source:** [src/rpc/api.ts:519](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L519) #### `rawSimulateTransactionResponse.error` ```ts error?: string; ``` **Source:** [src/rpc/api.ts:522](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L522) #### `rawSimulateTransactionResponse.events` These are xdr.DiagnosticEvents in base64 ```ts events?: string[]; ``` **Source:** [src/rpc/api.ts:526](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L526) #### `rawSimulateTransactionResponse.id` ```ts id: string; ``` **Source:** [src/rpc/api.ts:520](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L520) #### `rawSimulateTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:521](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L521) #### `rawSimulateTransactionResponse.minResourceFee` ```ts minResourceFee?: string; ``` **Source:** [src/rpc/api.ts:527](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L527) #### `rawSimulateTransactionResponse.restorePreamble` Present if succeeded but has expired ledger entries ```ts restorePreamble?: { minResourceFee: string; transactionData: string }; ``` **Source:** [src/rpc/api.ts:534](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L534) #### `rawSimulateTransactionResponse.results` This will only contain a single element if present, because only a single invokeHostFunctionOperation is supported per transaction. ```ts results?: RawSimulateHostFunctionResult[]; ``` **Source:** [src/rpc/api.ts:532](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L532) #### `rawSimulateTransactionResponse.stateChanges` State difference information ```ts stateChanges?: RawLedgerEntryChange[]; ``` **Source:** [src/rpc/api.ts:540](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L540) #### `rawSimulateTransactionResponse.transactionData` This is an xdr.SorobanTransactionData in base64 ```ts transactionData?: string; ``` **Source:** [src/rpc/api.ts:524](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L524) ### rpc.Api.RawTransactionEvents ```ts interface RawTransactionEvents { contractEventsXdr?: string[][]; transactionEventsXdr?: string[]; } ``` **Source:** [src/rpc/api.ts:165](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L165) #### `rawTransactionEvents.contractEventsXdr` ```ts contractEventsXdr?: string[][]; ``` **Source:** [src/rpc/api.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L167) #### `rawTransactionEvents.transactionEventsXdr` ```ts transactionEventsXdr?: string[]; ``` **Source:** [src/rpc/api.ts:166](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L166) ### rpc.Api.RawTransactionInfo ```ts interface RawTransactionInfo { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: string[]; envelopeXdr?: string; events?: RawTransactionEvents; feeBump: boolean; ledger: number; resultMetaXdr?: string; resultXdr?: string; status: GetTransactionStatus; txHash: string; } ``` **Source:** [src/rpc/api.ts:170](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L170) #### `rawTransactionInfo.applicationOrder` ```ts applicationOrder: number; ``` **Source:** [src/rpc/api.ts:174](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L174) #### `rawTransactionInfo.createdAt` ```ts createdAt: number; ``` **Source:** [src/rpc/api.ts:173](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L173) #### `rawTransactionInfo.diagnosticEventsXdr` ```ts diagnosticEventsXdr?: string[]; ``` **Source:** [src/rpc/api.ts:181](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L181) #### `rawTransactionInfo.envelopeXdr` ```ts envelopeXdr?: string; ``` **Source:** [src/rpc/api.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L178) #### `rawTransactionInfo.events` ```ts events?: RawTransactionEvents; ``` **Source:** [src/rpc/api.ts:183](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L183) #### `rawTransactionInfo.feeBump` ```ts feeBump: boolean; ``` **Source:** [src/rpc/api.ts:175](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L175) #### `rawTransactionInfo.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:172](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L172) #### `rawTransactionInfo.resultMetaXdr` ```ts resultMetaXdr?: string; ``` **Source:** [src/rpc/api.ts:180](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L180) #### `rawTransactionInfo.resultXdr` ```ts resultXdr?: string; ``` **Source:** [src/rpc/api.ts:179](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L179) #### `rawTransactionInfo.status` ```ts status: GetTransactionStatus; ``` **Source:** [src/rpc/api.ts:171](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L171) #### `rawTransactionInfo.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:176](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L176) ### rpc.Api.SendTransactionResponse ```ts interface SendTransactionResponse extends BaseSendTransactionResponse { diagnosticEvents?: DiagnosticEvent[]; errorResult?: TransactionResult; hash: string; latestLedger: number; latestLedgerCloseTime: number; status: SendTransactionStatus; } ``` **Source:** [src/rpc/api.ts:355](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L355) #### `sendTransactionResponse.diagnosticEvents` ```ts diagnosticEvents?: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:357](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L357) #### `sendTransactionResponse.errorResult` ```ts errorResult?: TransactionResult; ``` **Source:** [src/rpc/api.ts:356](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L356) #### `sendTransactionResponse.hash` ```ts hash: string; ``` **Source:** [src/rpc/api.ts:378](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L378) #### `sendTransactionResponse.latestLedger` ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:379](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L379) #### `sendTransactionResponse.latestLedgerCloseTime` ```ts latestLedgerCloseTime: number; ``` **Source:** [src/rpc/api.ts:380](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L380) #### `sendTransactionResponse.status` ```ts status: SendTransactionStatus; ``` **Source:** [src/rpc/api.ts:377](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L377) ### rpc.Api.SendTransactionStatus ```ts type SendTransactionStatus = "PENDING" | "DUPLICATE" | "TRY_AGAIN_LATER" | "ERROR" ``` **Source:** [src/rpc/api.ts:349](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L349) ### rpc.Api.SimulateHostFunctionResult ```ts interface SimulateHostFunctionResult { auth: SorobanAuthorizationEntry[]; retval: ScVal; } ``` **Source:** [src/rpc/api.ts:383](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L383) #### `simulateHostFunctionResult.auth` ```ts auth: SorobanAuthorizationEntry[]; ``` **Source:** [src/rpc/api.ts:384](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L384) #### `simulateHostFunctionResult.retval` ```ts retval: ScVal; ``` **Source:** [src/rpc/api.ts:385](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L385) ### rpc.Api.SimulateTransactionErrorResponse Includes details about why the simulation failed ```ts interface SimulateTransactionErrorResponse extends BaseSimulateTransactionResponse { _parsed: boolean; error: string; events: DiagnosticEvent[]; id: string; latestLedger: number; } ``` **Source:** [src/rpc/api.ts:441](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L441) #### `simulateTransactionErrorResponse._parsed` a private field to mark the schema as parsed ```ts _parsed: boolean; ``` **Source:** [src/rpc/api.ts:425](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L425) #### `simulateTransactionErrorResponse.error` ```ts error: string; ``` **Source:** [src/rpc/api.ts:442](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L442) #### `simulateTransactionErrorResponse.events` The field is always present, but may be empty in cases where: - you didn't simulate an invocation or - there were no events ```ts events: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:443](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L443) #### `simulateTransactionErrorResponse.id` always present: the JSON-RPC request ID ```ts id: string; ``` **Source:** [src/rpc/api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L412) #### `simulateTransactionErrorResponse.latestLedger` always present: the LCL known to the server when responding ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:415](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L415) ### rpc.Api.SimulateTransactionResponse Simplifies `RawSimulateTransactionResponse` into separate interfaces based on status: - on success, this includes all fields, though `result` is only present if an invocation was simulated (since otherwise there's nothing to "resultify") - if there was an expiration error, this includes error and restoration fields - for all other errors, this only includes error fields ```ts type SimulateTransactionResponse = SimulateTransactionSuccessResponse | SimulateTransactionRestoreResponse | SimulateTransactionErrorResponse ``` **See also** - https://developers.stellar.org/docs/data/rpc/api-reference/methods/simulateTransaction **Source:** [src/rpc/api.ts:405](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L405) ### rpc.Api.SimulateTransactionRestoreResponse Includes simplified fields only present on success. ```ts interface SimulateTransactionRestoreResponse extends SimulateTransactionSuccessResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number; minResourceFee: string; restorePreamble: { minResourceFee: string; transactionData: SorobanDataBuilder }; result: SimulateHostFunctionResult; stateChanges?: LedgerEntryChange[]; transactionData: SorobanDataBuilder; } ``` **Source:** [src/rpc/api.ts:446](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L446) #### `simulateTransactionRestoreResponse._parsed` a private field to mark the schema as parsed ```ts _parsed: boolean; ``` **Source:** [src/rpc/api.ts:425](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L425) #### `simulateTransactionRestoreResponse.events` The field is always present, but may be empty in cases where: - you didn't simulate an invocation or - there were no events ```ts events: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:422](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L422) #### `simulateTransactionRestoreResponse.id` always present: the JSON-RPC request ID ```ts id: string; ``` **Source:** [src/rpc/api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L412) #### `simulateTransactionRestoreResponse.latestLedger` always present: the LCL known to the server when responding ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:415](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L415) #### `simulateTransactionRestoreResponse.minResourceFee` ```ts minResourceFee: string; ``` **Source:** [src/rpc/api.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L431) #### `simulateTransactionRestoreResponse.restorePreamble` Indicates that a restoration is necessary prior to submission. In other words, seeing a restoration preamble means that your invocation was executed AS IF the required ledger entries were present, and this field includes information about what you need to restore for the simulation to succeed. ```ts restorePreamble: { minResourceFee: string; transactionData: SorobanDataBuilder }; ``` **Source:** [src/rpc/api.ts:457](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L457) #### `simulateTransactionRestoreResponse.result` present only for invocation simulation ```ts result: SimulateHostFunctionResult; ``` **Source:** [src/rpc/api.ts:447](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L447) #### `simulateTransactionRestoreResponse.stateChanges` State Difference information ```ts stateChanges?: LedgerEntryChange[]; ``` **Source:** [src/rpc/api.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L437) #### `simulateTransactionRestoreResponse.transactionData` ```ts transactionData: SorobanDataBuilder; ``` **Source:** [src/rpc/api.ts:430](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L430) ### rpc.Api.SimulateTransactionSuccessResponse Includes simplified fields only present on success. ```ts interface SimulateTransactionSuccessResponse extends BaseSimulateTransactionResponse { _parsed: boolean; events: DiagnosticEvent[]; id: string; latestLedger: number; minResourceFee: string; result?: SimulateHostFunctionResult; stateChanges?: LedgerEntryChange[]; transactionData: SorobanDataBuilder; } ``` **Source:** [src/rpc/api.ts:429](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L429) #### `simulateTransactionSuccessResponse._parsed` a private field to mark the schema as parsed ```ts _parsed: boolean; ``` **Source:** [src/rpc/api.ts:425](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L425) #### `simulateTransactionSuccessResponse.events` The field is always present, but may be empty in cases where: - you didn't simulate an invocation or - there were no events ```ts events: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:422](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L422) #### `simulateTransactionSuccessResponse.id` always present: the JSON-RPC request ID ```ts id: string; ``` **Source:** [src/rpc/api.ts:412](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L412) #### `simulateTransactionSuccessResponse.latestLedger` always present: the LCL known to the server when responding ```ts latestLedger: number; ``` **Source:** [src/rpc/api.ts:415](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L415) #### `simulateTransactionSuccessResponse.minResourceFee` ```ts minResourceFee: string; ``` **Source:** [src/rpc/api.ts:431](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L431) #### `simulateTransactionSuccessResponse.result` present only for invocation simulation ```ts result?: SimulateHostFunctionResult; ``` **Source:** [src/rpc/api.ts:434](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L434) #### `simulateTransactionSuccessResponse.stateChanges` State Difference information ```ts stateChanges?: LedgerEntryChange[]; ``` **Source:** [src/rpc/api.ts:437](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L437) #### `simulateTransactionSuccessResponse.transactionData` ```ts transactionData: SorobanDataBuilder; ``` **Source:** [src/rpc/api.ts:430](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L430) ### rpc.Api.SimulationAuthMode ```ts type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot" ``` **Source:** [src/rpc/api.ts:388](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L388) ### rpc.Api.TransactionEvents ```ts interface TransactionEvents { contractEventsXdr: ContractEvent[][]; transactionEventsXdr: TransactionEvent[]; } ``` **Source:** [src/rpc/api.ts:186](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L186) #### `transactionEvents.contractEventsXdr` ```ts contractEventsXdr: ContractEvent[][]; ``` **Source:** [src/rpc/api.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L188) #### `transactionEvents.transactionEventsXdr` ```ts transactionEventsXdr: TransactionEvent[]; ``` **Source:** [src/rpc/api.ts:187](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L187) ### rpc.Api.TransactionInfo ```ts interface TransactionInfo { applicationOrder: number; createdAt: number; diagnosticEventsXdr?: DiagnosticEvent[]; envelopeXdr: TransactionEnvelope; events: TransactionEvents; feeBump: boolean; ledger: number; resultMetaXdr: TransactionMeta; resultXdr: TransactionResult; returnValue?: ScVal; status: GetTransactionStatus; txHash: string; } ``` **Source:** [src/rpc/api.ts:191](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L191) #### `transactionInfo.applicationOrder` ```ts applicationOrder: number; ``` **Source:** [src/rpc/api.ts:195](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L195) #### `transactionInfo.createdAt` ```ts createdAt: number; ``` **Source:** [src/rpc/api.ts:194](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L194) #### `transactionInfo.diagnosticEventsXdr` ```ts diagnosticEventsXdr?: DiagnosticEvent[]; ``` **Source:** [src/rpc/api.ts:203](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L203) #### `transactionInfo.envelopeXdr` ```ts envelopeXdr: TransactionEnvelope; ``` **Source:** [src/rpc/api.ts:199](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L199) #### `transactionInfo.events` ```ts events: TransactionEvents; ``` **Source:** [src/rpc/api.ts:205](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L205) #### `transactionInfo.feeBump` ```ts feeBump: boolean; ``` **Source:** [src/rpc/api.ts:196](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L196) #### `transactionInfo.ledger` ```ts ledger: number; ``` **Source:** [src/rpc/api.ts:193](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L193) #### `transactionInfo.resultMetaXdr` ```ts resultMetaXdr: TransactionMeta; ``` **Source:** [src/rpc/api.ts:201](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L201) #### `transactionInfo.resultXdr` ```ts resultXdr: TransactionResult; ``` **Source:** [src/rpc/api.ts:200](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L200) #### `transactionInfo.returnValue` ```ts returnValue?: ScVal; ``` **Source:** [src/rpc/api.ts:202](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L202) #### `transactionInfo.status` ```ts status: GetTransactionStatus; ``` **Source:** [src/rpc/api.ts:192](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L192) #### `transactionInfo.txHash` ```ts txHash: string; ``` **Source:** [src/rpc/api.ts:197](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/api.ts#L197) ### rpc.Durability Specifies the durability namespace of contract-related ledger entries. ```ts enum Durability ``` **See also** - - `State Archival docs` - `Rust SDK Storage docs` **Source:** [src/rpc/server.ts:48](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L48) ### rpc.Server.GetEventsRequest **Deprecated.** Use `Api.GetEventsRequest` instead. ```ts type GetEventsRequest = Api.GetEventsRequest ``` **See also** - `Api.GetEventsRequest` **Source:** [src/rpc/server.ts:58](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L58) ### rpc.Server.Options Options for configuring connections to RPC servers. ```ts interface Options { allowHttp?: boolean; headers?: Record; timeout?: number; } ``` **Source:** [src/rpc/server.ts:76](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L76) #### `options.allowHttp` Allow connecting to http servers, default: `false`. This must be set to false in production deployments! ```ts allowHttp?: boolean; ``` **Source:** [src/rpc/server.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L78) #### `options.headers` Additional headers that should be added to any requests to the RPC server. ```ts headers?: Record; ``` **Source:** [src/rpc/server.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L82) #### `options.timeout` Allow a timeout, default: 0. Allows user to avoid nasty lag. ```ts timeout?: number; ``` **Source:** [src/rpc/server.ts:80](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L80) ### rpc.Server.PollingOptions ```ts interface PollingOptions { attempts?: number; sleepStrategy?: SleepStrategy; } ``` **Source:** [src/rpc/server.ts:60](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L60) #### `pollingOptions.attempts` ```ts attempts?: number; ``` **Source:** [src/rpc/server.ts:61](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L61) #### `pollingOptions.sleepStrategy` ```ts sleepStrategy?: SleepStrategy; ``` **Source:** [src/rpc/server.ts:62](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L62) ### rpc.Server.ResourceLeeway Describes additional resource leeways for transaction simulation. ```ts interface ResourceLeeway { cpuInstructions: number; } ``` **Source:** [src/rpc/server.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L68) #### `resourceLeeway.cpuInstructions` Simulate the transaction with more CPU instructions available. ```ts cpuInstructions: number; ``` **Source:** [src/rpc/server.ts:70](https://github.com/stellar/js-stellar-sdk/blob/main/src/rpc/server.ts#L70) # Source: docs/reference/network-friendbot.md # Network / Friendbot ## Types ### Friendbot.Api.Response ```ts interface Response { hash: string; result_meta_xdr: string; } ``` **Source:** [src/friendbot/index.ts:3](https://github.com/stellar/js-stellar-sdk/blob/main/src/friendbot/index.ts#L3) #### `response.hash` ```ts hash: string; ``` **Source:** [src/friendbot/index.ts:4](https://github.com/stellar/js-stellar-sdk/blob/main/src/friendbot/index.ts#L4) #### `response.result_meta_xdr` ```ts result_meta_xdr: string; ``` **Source:** [src/friendbot/index.ts:5](https://github.com/stellar/js-stellar-sdk/blob/main/src/friendbot/index.ts#L5) # Source: docs/reference/contracts-client.md # Contracts / Client ## contract.AssembledTransaction The main workhorse of `Client`. This class is used to wrap a transaction-under-construction and provide high-level interfaces to the most common workflows, while still providing access to low-level stellar-sdk transaction manipulation. Most of the time, you will not construct an `AssembledTransaction` directly, but instead receive one as the return value of a `Client` method. If you're familiar with the libraries generated by soroban-cli's `contract bindings typescript` command, these also wraps `Client` and return `AssembledTransaction` instances. Let's look at examples of how to use `AssembledTransaction` for a variety of use-cases: #### 1. Simple read call Since these only require simulation, you can get the `result` of the call right after constructing your `AssembledTransaction`: ```ts const { result } = await AssembledTransaction.build({ method: 'myReadMethod', args: spec.funcArgsToScVals('myReadMethod', { args: 'for', my: 'method', ... }), contractId: 'C123…', networkPassphrase: '…', rpcUrl: 'https://…', publicKey: undefined, // irrelevant, for simulation-only read calls parseResultXdr: (result: xdr.ScVal) => spec.funcResToNative('myReadMethod', result), }) ``` While that looks pretty complicated, most of the time you will use this in conjunction with `Client`, which simplifies it to: ```ts const { result } = await client.myReadMethod({ args: 'for', my: 'method', ... }) ``` #### 2. Simple write call For write calls that will be simulated and then sent to the network without further manipulation, only one more step is needed: ```ts const assembledTx = await client.myWriteMethod({ args: 'for', my: 'method', ... }) const sentTx = await assembledTx.signAndSend() ``` Here we're assuming that you're using a `Client`, rather than constructing `AssembledTransaction`'s directly. Note that `sentTx`, the return value of `signAndSend`, is a `SentTransaction`. `SentTransaction` is similar to `AssembledTransaction`, but is missing many of the methods and fields that are only relevant while assembling a transaction. It also has a few extra methods and fields that are only relevant after the transaction has been sent to the network. Like `AssembledTransaction`, `SentTransaction` also has a `result` getter, which contains the parsed final return value of the contract call. Most of the time, you may only be interested in this, so rather than getting the whole `sentTx` you may just want to: ```ts const tx = await client.myWriteMethod({ args: 'for', my: 'method', ... }) const { result } = await tx.signAndSend() ``` #### 3. More fine-grained control over transaction construction If you need more control over the transaction before simulating it, you can set various `MethodOptions` when constructing your `AssembledTransaction`. With a `Client`, this is passed as a second object after the arguments (or the only object, if the method takes no arguments): ```ts const tx = await client.myWriteMethod( { args: 'for', my: 'method', ... }, { fee: '10000', // default: {@link BASE_FEE} simulate: false, timeoutInSeconds: 20, // default: {@link DEFAULT_TIMEOUT} } ) ``` Since we've skipped simulation, we can now edit the `raw` transaction and then manually call `simulate`: ```ts tx.raw.addMemo(Memo.text('Nice memo, friend!')) await tx.simulate() ``` If you need to inspect the simulation later, you can access it with `tx.simulation`. #### 4. Multi-auth workflows Soroban, and Stellar in general, allows multiple parties to sign a transaction. Let's consider an Atomic Swap contract. Alice wants to give 10 of her Token A tokens to Bob for 5 of his Token B tokens. ```ts const ALICE = 'G123...' const BOB = 'G456...' const TOKEN_A = 'C123…' const TOKEN_B = 'C456…' const AMOUNT_A = 10n const AMOUNT_B = 5n ``` Let's say Alice is also going to be the one signing the final transaction envelope, meaning she is the invoker. So your app, from Alice's browser, simulates the `swap` call: ```ts const tx = await swapClient.swap({ a: ALICE, b: BOB, token_a: TOKEN_A, token_b: TOKEN_B, amount_a: AMOUNT_A, amount_b: AMOUNT_B, }) ``` But your app can't `signAndSend` this right away, because Bob needs to sign it first. You can check this: ```ts const whoElseNeedsToSign = tx.needsNonInvokerSigningBy() ``` You can verify that `whoElseNeedsToSign` is an array of length `1`, containing only Bob's public key. Then, still on Alice's machine, you can serialize the transaction-under-assembly: ```ts const json = tx.toJSON() ``` And now you need to send it to Bob's browser. How you do this depends on your app. Maybe you send it to a server first, maybe you use WebSockets, or maybe you have Alice text the JSON blob to Bob and have him paste it into your app in his browser (note: this option might be error-prone 😄). Once you get the JSON blob into your app on Bob's machine, you can deserialize it: ```ts const tx = swapClient.txFromJSON(json) ``` Or, if you're using a client generated with `soroban contract bindings typescript`, this deserialization will look like: ```ts const tx = swapClient.fromJSON.swap(json) ``` Then you can have Bob sign it. What Bob will actually need to sign is some _auth entries_ within the transaction, not the transaction itself or the transaction envelope. Your app can verify that Bob has the correct wallet selected, then: ```ts await tx.signAuthEntries() ``` Under the hood, this uses `signAuthEntry`, which you either need to inject during initial construction of the `Client`/`AssembledTransaction`, or which you can pass directly to `signAuthEntries`. Now Bob can again serialize the transaction and send back to Alice, where she can finally call `signAndSend()`. To see an even more complicated example, where Alice swaps with Bob but the transaction is invoked by yet another party, check out [test-swap.js](https://github.com/stellar/js-stellar-sdk/blob/master/test/e2e/src/test-swap.js). ```ts class AssembledTransaction { static Errors: { ExpiredState: typeof ExpiredStateError; ExternalServiceError: typeof ExternalServiceError; FakeAccount: typeof FakeAccountError; InternalWalletError: typeof InternalWalletError; InvalidClientRequest: typeof InvalidClientRequestError; NeedsMoreSignatures: typeof NeedsMoreSignaturesError; NoSignatureNeeded: typeof NoSignatureNeededError; NoSigner: typeof NoSignerError; NotYetSimulated: typeof NotYetSimulatedError; NoUnsignedNonInvokerAuthEntries: typeof NoUnsignedNonInvokerAuthEntriesError; RestorationFailure: typeof RestoreFailureError; SimulationFailed: typeof SimulationFailedError; UserRejected: typeof UserRejectedError }; static build(options: AssembledTransactionOptions): Promise>; static buildWithOp(operation: Operation2, options: AssembledTransactionOptions): Promise>; static fromJSON(options: Omit, "args">, __namedParameters: { simulationResult: { auth: string[]; retval: string }; simulationTransactionData: string; tx: string }): AssembledTransaction; static fromXDR(options: Omit, "args" | "method" | "parseResultXdr">, encodedXDR: string, spec: Spec): AssembledTransaction; built?: Transaction; options: AssembledTransactionOptions; raw?: TransactionBuilder; signed?: Transaction; simulation?: SimulateTransactionResponse; readonly isReadCall: boolean; readonly result: T; readonly simulationData: { result: SimulateHostFunctionResult; transactionData: SorobanTransactionData }; needsNonInvokerSigningBy(__namedParameters: { includeAlreadySigned?: boolean } = {}): string[]; restoreFootprint(restorePreamble: { minResourceFee: string; transactionData: SorobanDataBuilder }, account?: Account): Promise; send(watcher?: Watcher): Promise>; sign(__namedParameters: { force?: boolean; signTransaction?: SignTransaction } = {}): Promise; signAndSend(__namedParameters: { force?: boolean; signTransaction?: SignTransaction; watcher?: Watcher } = {}): Promise>; signAuthEntries(__namedParameters: { address?: string; authorizeEntry?: (entry: SorobanAuthorizationEntry, signer: Keypair | SigningCallback, validUntilLedgerSeq: number, networkPassphrase: string, forAddress?: string) => Promise; expiration?: number | Promise; signAuthEntry?: SignAuthEntry } = {}): Promise; simulate(__namedParameters: { restore?: boolean } = {}): Promise>; toJSON(): string; toXDR(): string; } ``` **Source:** [src/contract/assembled_transaction.ts:257](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L257) ### `AssembledTransaction.Errors` A list of the most important errors that various AssembledTransaction methods can throw. Feel free to catch specific errors in your application logic. ```ts static Errors: { ExpiredState: typeof ExpiredStateError; ExternalServiceError: typeof ExternalServiceError; FakeAccount: typeof FakeAccountError; InternalWalletError: typeof InternalWalletError; InvalidClientRequest: typeof InvalidClientRequestError; NeedsMoreSignatures: typeof NeedsMoreSignaturesError; NoSignatureNeeded: typeof NoSignatureNeededError; NoSigner: typeof NoSignerError; NotYetSimulated: typeof NotYetSimulatedError; NoUnsignedNonInvokerAuthEntries: typeof NoUnsignedNonInvokerAuthEntriesError; RestorationFailure: typeof RestoreFailureError; SimulationFailed: typeof SimulationFailedError; UserRejected: typeof UserRejectedError }; ``` **Source:** [src/contract/assembled_transaction.ts:338](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L338) ### `AssembledTransaction.build(options)` Construct a new AssembledTransaction. This is the main way to create a new AssembledTransaction; the constructor is private. This is an asynchronous constructor for two reasons: 1. It needs to fetch the account from the network to get the current sequence number. 2. It needs to simulate the transaction to get the expected fee. If you don't want to simulate the transaction, you can set `simulate` to `false` in the options. If you need to create an operation other than `invokeHostFunction`, you can use `AssembledTransaction.buildWithOp` instead. ```ts static build(options: AssembledTransactionOptions): Promise>; ``` **Parameters** - **`options`** — `AssembledTransactionOptions` (required) **Example** ```ts const tx = await AssembledTransaction.build({ ..., simulate: false, }) ``` **Source:** [src/contract/assembled_transaction.ts:572](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L572) ### `AssembledTransaction.buildWithOp(operation, options)` Construct a new AssembledTransaction, specifying an Operation other than `invokeHostFunction` (the default used by `AssembledTransaction.build`). Note: `AssembledTransaction` currently assumes these operations can be simulated. This is not true for classic operations; only for those used by Soroban Smart Contracts like `invokeHostFunction` and `createCustomContract`. ```ts static buildWithOp(operation: Operation2, options: AssembledTransactionOptions): Promise>; ``` **Parameters** - **`operation`** — `Operation2` (required) - **`options`** — `AssembledTransactionOptions` (required) **Example** ```ts const tx = await AssembledTransaction.buildWithOp( Operation.createCustomContract({ ... }); { ..., simulate: false, } ) ``` **Source:** [src/contract/assembled_transaction.ts:601](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L601) ### `AssembledTransaction.fromJSON(options, __namedParameters)` ```ts static fromJSON(options: Omit, "args">, __namedParameters: { simulationResult: { auth: string[]; retval: string }; simulationTransactionData: string; tx: string }): AssembledTransaction; ``` **Parameters** - **`options`** — `Omit, "args">` (required) - **`__namedParameters`** — `{ simulationResult: { auth: string[]; retval: string }; simulationTransactionData: string; tx: string }` (required) **Source:** [src/contract/assembled_transaction.ts:433](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L433) ### `AssembledTransaction.fromXDR(options, encodedXDR, spec)` Deserialize the AssembledTransaction from a base64-encoded XDR string. ```ts static fromXDR(options: Omit, "args" | "method" | "parseResultXdr">, encodedXDR: string, spec: Spec): AssembledTransaction; ``` **Parameters** - **`options`** — `Omit, "args" | "method" | "parseResultXdr">` (required) - **`encodedXDR`** — `string` (required) - **`spec`** — `Spec` (required) **Source:** [src/contract/assembled_transaction.ts:492](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L492) ### `assembledTransaction.built` The Transaction as it was built with `raw.build()` right before simulation. Once this is set, modifying `raw` will have no effect unless you call `tx.simulate()` again. ```ts built?: Transaction; ``` **Source:** [src/contract/assembled_transaction.ts:285](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L285) ### `assembledTransaction.options` ```ts options: AssembledTransactionOptions; ``` **Source:** [src/contract/assembled_transaction.ts:542](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L542) ### `assembledTransaction.raw` The TransactionBuilder as constructed in `AssembledTransaction`.build. Feel free set `simulate: false` to modify this object before calling `tx.simulate()` manually. Example: ```ts const tx = await myContract.myMethod( { args: 'for', my: 'method', ... }, { simulate: false } ); tx.raw.addMemo(Memo.text('Nice memo, friend!')) await tx.simulate(); ``` ```ts raw?: TransactionBuilder; ``` **Source:** [src/contract/assembled_transaction.ts:272](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L272) ### `assembledTransaction.signed` The signed transaction. ```ts signed?: Transaction; ``` **Source:** [src/contract/assembled_transaction.ts:331](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L331) ### `assembledTransaction.simulation` The result of the transaction simulation. This is set after the first call to `simulate`. It is difficult to serialize and deserialize, so it is not included in the `toJSON` and `fromJSON` methods. See `simulationData` cached, serializable access to the data needed by AssembledTransaction logic. ```ts simulation?: SimulateTransactionResponse; ``` **Source:** [src/contract/assembled_transaction.ts:294](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L294) ### `assembledTransaction.isReadCall` Whether this transaction is a read call. This is determined by the simulation result and the transaction data. If the transaction is a read call, it will not need to be signed and sent to the network. If this returns `false`, then you need to call `signAndSend` on this transaction. ```ts readonly isReadCall: boolean; ``` **Source:** [src/contract/assembled_transaction.ts:1089](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1089) ### `assembledTransaction.result` ```ts readonly result: T; ``` **Source:** [src/contract/assembled_transaction.ts:738](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L738) ### `assembledTransaction.simulationData` ```ts readonly simulationData: { result: SimulateHostFunctionResult; transactionData: SorobanTransactionData }; ``` **Source:** [src/contract/assembled_transaction.ts:695](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L695) ### `assembledTransaction.needsNonInvokerSigningBy(__namedParameters)` Get a list of accounts, other than the invoker of the simulation, that need to sign auth entries in this transaction. Soroban allows multiple people to sign a transaction. Someone needs to sign the final transaction envelope; this person/account is called the _invoker_, or _source_. Other accounts might need to sign individual auth entries in the transaction, if they're not also the invoker. This function returns a list of accounts that need to sign auth entries, assuming that the same invoker/source account will sign the final transaction envelope as signed the initial simulation. One at a time, for each public key in this array, you will need to serialize this transaction with `toJSON`, send to the owner of that key, deserialize the transaction with `txFromJson`, and call `AssembledTransaction.signAuthEntries`. Then re-serialize and send to the next account in this list. ```ts needsNonInvokerSigningBy(__namedParameters: { includeAlreadySigned?: boolean } = {}): string[]; ``` **Parameters** - **`__namedParameters`** — `{ includeAlreadySigned?: boolean }` (optional) (default: `{}`) **Source:** [src/contract/assembled_transaction.ts:924](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L924) ### `assembledTransaction.restoreFootprint(restorePreamble, account)` Restores the footprint (resource ledger entries that can be read or written) of an expired transaction. The method will: 1. Build a new transaction aimed at restoring the necessary resources. 2. Sign this new transaction if a `signTransaction` handler is provided. 3. Send the signed transaction to the network. 4. Await and return the response from the network. Preconditions: - A `signTransaction` function must be provided during the Client initialization. - The provided `restorePreamble` should include a minimum resource fee and valid transaction data. ```ts restoreFootprint(restorePreamble: { minResourceFee: string; transactionData: SorobanDataBuilder }, account?: Account): Promise; ``` **Parameters** - **`restorePreamble`** — `{ minResourceFee: string; transactionData: SorobanDataBuilder }` (required) — The preamble object containing data required to build the restore transaction. - **`account`** — `Account` (optional) — The account that is executing the footprint restore operation. If omitted, will use the account from the AssembledTransaction. **Throws** - - Throws an error if no `signTransaction` function is provided during Client initialization. - - Throws a custom error if the restore transaction fails, providing the details of the failure. **Source:** [src/contract/assembled_transaction.ts:1118](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1118) ### `assembledTransaction.send(watcher)` Sends the transaction to the network to return a `SentTransaction` that keeps track of all the attempts to fetch the transaction. Optionally pass a `Watcher` that allows you to keep track of the progress as the transaction is sent and processed. ```ts send(watcher?: Watcher): Promise>; ``` **Parameters** - **`watcher`** — `Watcher` (optional) **Source:** [src/contract/assembled_transaction.ts:853](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L853) ### `assembledTransaction.sign(__namedParameters)` Sign the transaction with the signTransaction function included previously. If you did not previously include one, you need to include one now. ```ts sign(__namedParameters: { force?: boolean; signTransaction?: SignTransaction } = {}): Promise; ``` **Parameters** - **`__namedParameters`** — `{ force?: boolean; signTransaction?: SignTransaction }` (optional) (default: `{}`) **Source:** [src/contract/assembled_transaction.ts:766](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L766) ### `assembledTransaction.signAndSend(__namedParameters)` Sign the transaction with the `signTransaction` function included previously. If you did not previously include one, you need to include one now. After signing, this method will send the transaction to the network and return a `SentTransaction` that keeps track of all the attempts to fetch the transaction. You may pass a `Watcher` to keep track of this progress. ```ts signAndSend(__namedParameters: { force?: boolean; signTransaction?: SignTransaction; watcher?: Watcher } = {}): Promise>; ``` **Parameters** - **`__namedParameters`** — `{ force?: boolean; signTransaction?: SignTransaction; watcher?: Watcher }` (optional) (default: `{}`) **Source:** [src/contract/assembled_transaction.ts:871](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L871) ### `assembledTransaction.signAuthEntries(__namedParameters)` If `AssembledTransaction.needsNonInvokerSigningBy` returns a non-empty list, you can serialize the transaction with `toJSON`, send it to the owner of one of the public keys in the map, deserialize with `txFromJSON`, and call this method on their machine. Internally, this will use `signAuthEntry` function from connected `wallet` for each. Then, re-serialize the transaction and either send to the next `needsNonInvokerSigningBy` owner, or send it back to the original account who simulated the transaction so they can `AssembledTransaction.sign` the transaction envelope and `AssembledTransaction.send` it to the network. Sending to all `needsNonInvokerSigningBy` owners in parallel is not currently supported! ```ts signAuthEntries(__namedParameters: { address?: string; authorizeEntry?: (entry: SorobanAuthorizationEntry, signer: Keypair | SigningCallback, validUntilLedgerSeq: number, networkPassphrase: string, forAddress?: string) => Promise; expiration?: number | Promise; signAuthEntry?: SignAuthEntry } = {}): Promise; ``` **Parameters** - **`__namedParameters`** — `{ address?: string; authorizeEntry?: (entry: SorobanAuthorizationEntry, signer: Keypair | SigningCallback, validUntilLedgerSeq: number, networkPassphrase: string, forAddress?: string) => Promise; expiration?: number | Promise; signAuthEntry?: SignAuthEntry }` (optional) (default: `{}`) **Source:** [src/contract/assembled_transaction.ts:985](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L985) ### `assembledTransaction.simulate(__namedParameters)` ```ts simulate(__namedParameters: { restore?: boolean } = {}): Promise>; ``` **Parameters** - **`__namedParameters`** — `{ restore?: boolean }` (optional) (default: `{}`) **Source:** [src/contract/assembled_transaction.ts:642](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L642) ### `assembledTransaction.toJSON()` Serialize the AssembledTransaction to a JSON string. This is useful for saving the transaction to a database or sending it over the wire for multi-auth workflows. `fromJSON` can be used to deserialize the transaction. This only works with transactions that have been simulated. ```ts toJSON(): string; ``` **Source:** [src/contract/assembled_transaction.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L360) ### `assembledTransaction.toXDR()` Serialize the AssembledTransaction to a base64-encoded XDR string. ```ts toXDR(): string; ``` **Source:** [src/contract/assembled_transaction.ts:480](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L480) ## contract.Client Generate a class from the contract spec that where each contract method gets included with an identical name. Each method returns an `AssembledTransaction` that can be used to modify, simulate, decode results, and possibly sign, & submit the transaction. ```ts class Client { constructor(spec: Spec, options: ClientOptions); static deploy(args: Record | null, options: MethodOptions & Omit & { address?: string; format?: "base64" | "hex"; salt?: Uint8Array | Buffer; wasmHash: string | Buffer }): Promise>; static from(options: ClientOptions): Promise; static fromWasm(wasm: Buffer, options: ClientOptions): Promise; static fromWasmHash(wasmHash: string | Buffer, options: ClientOptions, format: "base64" | "hex" = "hex"): Promise; readonly options: ClientOptions; readonly spec: Spec; txFromJSON(json: string): AssembledTransaction; txFromXDR(xdrBase64: string): AssembledTransaction; } ``` **Source:** [src/contract/client.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L37) ### `new Client(spec, options)` ```ts constructor(spec: Spec, options: ClientOptions); ``` **Parameters** - **`spec`** — `Spec` (required) - **`options`** — `ClientOptions` (required) **Source:** [src/contract/client.ts:92](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L92) ### `Client.deploy(args, options)` ```ts static deploy(args: Record | null, options: MethodOptions & Omit & { address?: string; format?: "base64" | "hex"; salt?: Uint8Array | Buffer; wasmHash: string | Buffer }): Promise>; ``` **Parameters** - **`args`** — `Record | null` (required) — Constructor/Initialization Args for the contract's `__constructor` method - **`options`** — `MethodOptions & Omit & { address?: string; format?: "base64" | "hex"; salt?: Uint8Array | Buffer; wasmHash: string | Buffer }` (required) — Options for initializing a Client as well as for calling a method, with extras specific to deploying. **Source:** [src/contract/client.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L38) ### `Client.from(options)` Generates a Client instance from the provided ClientOptions, which must include the contractId and rpcUrl. ```ts static from(options: ClientOptions): Promise; ``` **Parameters** - **`options`** — `ClientOptions` (required) — The ClientOptions object containing the necessary configuration, including the contractId and rpcUrl. **Returns** A Promise that resolves to a Client instance. **Throws** - If the provided options object does not contain both rpcUrl and contractId. **Source:** [src/contract/client.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L188) ### `Client.fromWasm(wasm, options)` Generates a Client instance from the provided ClientOptions and the contract's wasm binary. ```ts static fromWasm(wasm: Buffer, options: ClientOptions): Promise; ``` **Parameters** - **`wasm`** — `Buffer` (required) — The contract's wasm binary as a Buffer. - **`options`** — `ClientOptions` (required) — The ClientOptions object containing the necessary configuration. **Returns** A Promise that resolves to a Client instance. **Throws** - If the contract spec cannot be obtained from the provided wasm binary. **Source:** [src/contract/client.ts:176](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L176) ### `Client.fromWasmHash(wasmHash, options, format)` Generates a Client instance from the provided ClientOptions and the contract's wasm hash. The wasmHash can be provided in either hex or base64 format. ```ts static fromWasmHash(wasmHash: string | Buffer, options: ClientOptions, format: "base64" | "hex" = "hex"): Promise; ``` **Parameters** - **`wasmHash`** — `string | Buffer` (required) — The hash of the contract's wasm binary, in either hex or base64 format. - **`options`** — `ClientOptions` (required) — The ClientOptions object containing the necessary configuration, including the rpcUrl. - **`format`** — `"base64" | "hex"` (optional) (default: `"hex"`) — (optional) The format of the provided wasmHash, either "hex" or "base64". Defaults to "hex". **Returns** A Promise that resolves to a Client instance. **Throws** - If the provided options object does not contain an rpcUrl. **Source:** [src/contract/client.ts:148](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L148) ### `client.options` ```ts readonly options: ClientOptions; ``` **Source:** [src/contract/client.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L94) ### `client.spec` ```ts readonly spec: Spec; ``` **Source:** [src/contract/client.ts:93](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L93) ### `client.txFromJSON(json)` ```ts txFromJSON(json: string): AssembledTransaction; ``` **Parameters** - **`json`** — `string` (required) **Source:** [src/contract/client.ts:201](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L201) ### `client.txFromXDR(xdrBase64)` ```ts txFromXDR(xdrBase64: string): AssembledTransaction; ``` **Parameters** - **`xdrBase64`** — `string` (required) **Source:** [src/contract/client.ts:214](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/client.ts#L214) ## contract.DEFAULT_TIMEOUT The default timebounds, in seconds, during which a transaction will be valid. This is attached to the transaction _before_ transaction simulation (it is needed for simulation to succeed). It is also re-calculated and re-added _before_ transaction signing. ```ts const DEFAULT_TIMEOUT: number ``` **Source:** [src/contract/types.ts:292](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L292) ## contract.NULL_ACCOUNT An impossible account on the Stellar network ```ts const NULL_ACCOUNT: "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF" ``` **Source:** [src/contract/types.ts:298](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L298) ## contract.SentTransaction A transaction that has been sent to the Soroban network. This happens in two steps: 1. `sendTransaction`: initial submission of the transaction to the network. If this step runs into problems, the attempt to sign and send will be aborted. You can see the result of this call in the `sendTransactionResponse` getter. 2. `getTransaction`: once the transaction has been submitted to the network successfully, you need to wait for it to finalize to get the result of the transaction. This will be retried with exponential backoff for `MethodOptions.timeoutInSeconds` seconds. See all attempts in `getTransactionResponseAll` and the most recent attempt in `getTransactionResponse`. ```ts class SentTransaction { constructor(assembled: AssembledTransaction); static Errors: { SendFailed: typeof SendFailedError; SendResultOnly: typeof SendResultOnlyError; TransactionStillPending: typeof TransactionStillPendingError }; static init(assembled: AssembledTransaction, watcher?: Watcher): Promise>; assembled: AssembledTransaction; getTransactionResponse?: GetTransactionResponse; getTransactionResponseAll?: GetTransactionResponse[]; sendTransactionResponse?: SendTransactionResponse; server: RpcServer; readonly result: T; } ``` **Source:** [src/contract/sent_transaction.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L28) ### `new SentTransaction(assembled)` ```ts constructor(assembled: AssembledTransaction); ``` **Parameters** - **`assembled`** — `AssembledTransaction` (required) **Source:** [src/contract/sent_transaction.ts:57](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L57) ### `SentTransaction.Errors` ```ts static Errors: { SendFailed: typeof SendFailedError; SendResultOnly: typeof SendResultOnlyError; TransactionStillPending: typeof TransactionStillPendingError }; ``` **Source:** [src/contract/sent_transaction.ts:51](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L51) ### `SentTransaction.init(assembled, watcher)` Initialize a `SentTransaction` from `AssembledTransaction` `assembled`, passing an optional `Watcher` `watcher`. This will also send the transaction to the network. ```ts static init(assembled: AssembledTransaction, watcher?: Watcher): Promise>; ``` **Parameters** - **`assembled`** — `AssembledTransaction` (required) — `AssembledTransaction` from which this SentTransaction was initialized - **`watcher`** — `Watcher` (optional) **Source:** [src/contract/sent_transaction.ts:67](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L67) ### `sentTransaction.assembled` ```ts assembled: AssembledTransaction; ``` **Source:** [src/contract/sent_transaction.ts:57](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L57) ### `sentTransaction.getTransactionResponse` The most recent result of calling `getTransaction`, from the `getTransactionResponseAll` array. ```ts getTransactionResponse?: GetTransactionResponse; ``` **Source:** [src/contract/sent_transaction.ts:49](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L49) ### `sentTransaction.getTransactionResponseAll` If `sendTransaction` completes successfully (which means it has `status: 'PENDING'`), then `getTransaction` will be called in a loop for `MethodOptions.timeoutInSeconds` seconds. This array contains all the results of those calls. ```ts getTransactionResponseAll?: GetTransactionResponse[]; ``` **Source:** [src/contract/sent_transaction.ts:43](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L43) ### `sentTransaction.sendTransactionResponse` The result of calling `sendTransaction` to broadcast the transaction to the network. ```ts sendTransactionResponse?: SendTransactionResponse; ``` **Source:** [src/contract/sent_transaction.ts:35](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L35) ### `sentTransaction.server` ```ts server: RpcServer; ``` **Source:** [src/contract/sent_transaction.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L29) ### `sentTransaction.result` ```ts readonly result: T; ``` **Source:** [src/contract/sent_transaction.ts:132](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L132) ## contract.Spec Provides a ContractSpec class which can contains the XDR types defined by the contract. This allows the class to be used to convert between native and raw `xdr.ScVal`s. Constructs a new ContractSpec from an array of XDR spec entries. ```ts class Spec { constructor(entries: string | string[] | Buffer | ScSpecEntry[]); static fromWasm(wasm: Buffer): Spec; entries: ScSpecEntry[]; errorCases(): ScSpecUdtErrorEnumCaseV0[]; findEntry(name: string): ScSpecEntry; funcArgsToScVals(name: string, args: object): ScVal[]; funcResToNative(name: string, val_or_base64: string | ScVal): any; funcs(): ScSpecFunctionV0[]; getFunc(name: string): ScSpecFunctionV0; jsonSchema(funcName?: string): JSONSchema7; nativeToScVal(val: any, ty: ScSpecTypeDef): ScVal; scValStrToNative(scv: string, typeDef: ScSpecTypeDef): T; scValToNative(scv: ScVal, typeDef: ScSpecTypeDef): T; } ``` **Example** ```ts const specEntries = [...]; // XDR spec entries of a smart contract const contractSpec = new ContractSpec(specEntries); // Convert native value to ScVal const args = { arg1: 'value1', arg2: 1234 }; const scArgs = contractSpec.funcArgsToScVals('funcName', args); // Call contract const resultScv = await callContract(contractId, 'funcName', scArgs); // Convert result ScVal back to native value const result = contractSpec.funcResToNative('funcName', resultScv); console.log(result); // {success: true} ``` **Source:** [src/contract/spec.ts:491](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L491) ### `new Spec(entries)` Generates a Spec instance from contract specs in any of the following forms: - An XDR encoded stream of xdr.ScSpecEntry entries, the format of the spec stored inside Wasm files. - A base64 XDR encoded stream of xdr.ScSpecEntry entries. - An array of xdr.ScSpecEntry. - An array of base64 XDR encoded xdr.ScSpecEntry. ```ts constructor(entries: string | string[] | Buffer | ScSpecEntry[]); ``` **Parameters** - **`entries`** — `string | string[] | Buffer | ScSpecEntry[]` (required) **Returns** A Promise that resolves to a Client instance. **Throws** - If the contract spec cannot be obtained from the provided wasm binary. **Source:** [src/contract/spec.ts:520](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L520) ### `Spec.fromWasm(wasm)` Generates a Spec instance from the contract's wasm binary. ```ts static fromWasm(wasm: Buffer): Spec; ``` **Parameters** - **`wasm`** — `Buffer` (required) — The contract's wasm binary as a Buffer. **Returns** A Promise that resolves to a Spec instance. **Throws** - If the contract spec cannot be obtained from the provided wasm binary. **Source:** [src/contract/spec.ts:504](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L504) ### `spec.entries` The XDR spec entries. ```ts entries: ScSpecEntry[]; ``` **Source:** [src/contract/spec.ts:495](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L495) ### `spec.errorCases()` Gets the XDR error cases from the spec. ```ts errorCases(): ScSpecUdtErrorEnumCaseV0[]; ``` **Returns** all contract functions **Source:** [src/contract/spec.ts:1180](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L1180) ### `spec.findEntry(name)` Finds the XDR spec entry for the given name. ```ts findEntry(name: string): ScSpecEntry; ``` **Parameters** - **`name`** — `string` (required) — the name to find **Returns** the entry **Throws** - if no entry with the given name exists **Source:** [src/contract/spec.ts:647](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L647) ### `spec.funcArgsToScVals(name, args)` Converts native JS arguments to ScVals for calling a contract function. ```ts funcArgsToScVals(name: string, args: object): ScVal[]; ``` **Parameters** - **`name`** — `string` (required) — the name of the function - **`args`** — `object` (required) — the arguments object **Returns** the converted arguments **Throws** - if argument is missing or incorrect type **Example** ```ts const args = { arg1: 'value1', arg2: 1234 }; const scArgs = contractSpec.funcArgsToScVals('funcName', args); ``` **Source:** [src/contract/spec.ts:590](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L590) ### `spec.funcResToNative(name, val_or_base64)` Converts the result ScVal of a function call to a native JS value. ```ts funcResToNative(name: string, val_or_base64: string | ScVal): any; ``` **Parameters** - **`name`** — `string` (required) — the name of the function - **`val_or_base64`** — `string | ScVal` (required) — the result ScVal or base64 encoded string **Returns** the converted native value **Throws** - if return type mismatch or invalid input **Example** ```ts const resultScv = 'AAA=='; // Base64 encoded ScVal const result = contractSpec.funcResToNative('funcName', resultScv); ``` **Source:** [src/contract/spec.ts:612](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L612) ### `spec.funcs()` Gets the XDR functions from the spec. ```ts funcs(): ScSpecFunctionV0[]; ``` **Returns** all contract functions **Source:** [src/contract/spec.ts:544](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L544) ### `spec.getFunc(name)` Gets the XDR function spec for the given function name. ```ts getFunc(name: string): ScSpecFunctionV0; ``` **Parameters** - **`name`** — `string` (required) — the name of the function **Returns** the function spec **Throws** - if no function with the given name exists **Source:** [src/contract/spec.ts:562](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L562) ### `spec.jsonSchema(funcName)` Converts the contract spec to a JSON schema. If `funcName` is provided, the schema will be a reference to the function schema. ```ts jsonSchema(funcName?: string): JSONSchema7; ``` **Parameters** - **`funcName`** — `string` (optional) — (optional) the name of the function to convert **Returns** the converted JSON schema **Throws** - if the contract spec is invalid **Source:** [src/contract/spec.ts:1200](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L1200) ### `spec.nativeToScVal(val, ty)` Converts a native JS value to an ScVal based on the given type. ```ts nativeToScVal(val: any, ty: ScSpecTypeDef): ScVal; ``` **Parameters** - **`val`** — `any` (required) — the native JS value - **`ty`** — `ScSpecTypeDef` (required) — (optional) the expected type **Returns** the converted ScVal **Throws** - if value cannot be converted to the given type **Source:** [src/contract/spec.ts:666](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L666) ### `spec.scValStrToNative(scv, typeDef)` Converts an base64 encoded ScVal back to a native JS value based on the given type. ```ts scValStrToNative(scv: string, typeDef: ScSpecTypeDef): T; ``` **Parameters** - **`scv`** — `string` (required) — the base64 encoded ScVal - **`typeDef`** — `ScSpecTypeDef` (required) — the expected type **Returns** the converted native JS value **Throws** - if ScVal cannot be converted to the given type **Source:** [src/contract/spec.ts:972](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L972) ### `spec.scValToNative(scv, typeDef)` Converts an ScVal back to a native JS value based on the given type. ```ts scValToNative(scv: ScVal, typeDef: ScSpecTypeDef): T; ``` **Parameters** - **`scv`** — `ScVal` (required) — the ScVal - **`typeDef`** — `ScSpecTypeDef` (required) — the expected type **Returns** the converted native JS value **Throws** - if ScVal cannot be converted to the given type **Source:** [src/contract/spec.ts:985](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L985) ## contract.Watcher ```ts class Watcher { constructor(); onProgress(response?: GetTransactionResponse): void; onSubmitted(response?: SendTransactionResponse): void; } ``` **Source:** [src/contract/sent_transaction.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L167) ### `new Watcher()` ```ts constructor(); ``` ### `watcher.onProgress(response)` Function to call every time the submitted transaction's status is checked while awaiting its full inclusion in the ledger ```ts onProgress(response?: GetTransactionResponse): void; ``` **Parameters** - **`response`** — `GetTransactionResponse` (optional) **Source:** [src/contract/sent_transaction.ts:178](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L178) ### `watcher.onSubmitted(response)` Function to call after transaction has been submitted successfully to the network for processing ```ts onSubmitted(response?: SendTransactionResponse): void; ``` **Parameters** - **`response`** — `SendTransactionResponse` (optional) **Source:** [src/contract/sent_transaction.ts:172](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/sent_transaction.ts#L172) ## contract.basicNodeSigner For use with `Client` and `contract.AssembledTransaction`. Implements `signTransaction` and `signAuthEntry` with signatures expected by those classes. This is useful for testing and maybe some simple Node applications. Feel free to use this as a starting point for your own Wallet/TransactionSigner implementation. ```ts basicNodeSigner(keypair: Keypair, networkPassphrase: string): { signAuthEntry: SignAuthEntry; signTransaction: SignTransaction } ``` **Parameters** - **`keypair`** — `Keypair` (required) — `Keypair` to use to sign the transaction or auth entry - **`networkPassphrase`** — `string` (required) — passphrase of network to sign for **Source:** [src/contract/basic_node_signer.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/basic_node_signer.ts#L16) ## Types ### contract.AssembledTransactionOptions ```ts type AssembledTransactionOptions = MethodOptions & ClientOptions & { address?: string; args?: any[]; method: string; parseResultXdr: (xdr: xdr.ScVal) => T; submit?: boolean; submitUrl?: string } ``` **Source:** [src/contract/types.ts:260](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L260) ### contract.ClientOptions Options for a smart contract client. ```ts type ClientOptions = { allowHttp?: boolean; contractId: string; errorTypes?: Record; headers?: Record; networkPassphrase: string; publicKey?: string; rpcUrl: string; server?: Server; signAuthEntry?: SignAuthEntry; signTransaction?: SignTransaction } ``` **Source:** [src/contract/types.ts:127](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L127) ### contract.Duration An unsigned 64-bit integer. ```ts type Duration = bigint ``` **Source:** [src/contract/types.ts:53](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L53) ### contract.ErrorMessage Error interface containing the error message. Matches Rust's implementation. Part of implementing `Result`, a minimal implementation of Rust's `Result` type. Used for contract methods that return Results, to maintain their distinction from methods that simply either return a value or throw. ```ts interface ErrorMessage { message: string; } ``` **Source:** [src/contract/rust_result.ts:51](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L51) #### `errorMessage.message` ```ts message: string; ``` **Source:** [src/contract/rust_result.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L52) ### contract.MethodOptions Options for a smart contract method invocation. ```ts type MethodOptions = { fee?: string; publicKey?: string; restore?: boolean; signAuthEntry?: SignAuthEntry; signTransaction?: SignTransaction; simulate?: boolean; timeoutInSeconds?: number } ``` **Source:** [src/contract/types.ts:203](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L203) ### contract.Option ```ts type Option = T | undefined ``` **Source:** [src/contract/types.ts:41](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L41) ### contract.Result A minimal implementation of Rust's `Result` type. Used for contract methods that return Results, to maintain their distinction from methods that simply either return a value or throw. #### Why is this needed? This is used by ``ContractSpec`` and ``AssembledTransaction`` when parsing values return by contracts. Contract methods can be implemented to return simple values, in which case they can also throw errors. This matches JavaScript's most idiomatic workflow, using `try...catch` blocks. But Rust also gives the flexibility of returning `Result` types. And Soroban contracts further support this with the `#[contracterror]` macro. Should JavaScript calls to such methods ignore all of that, and just flatten this extra info down to the same `try...catch` flow as other methods? We're not sure. For now, we've added this minimal implementation of Rust's `Result` logic, which exports the `Result` interface and its associated implementations, `Ok` and `Err`. This allows `ContractSpec` and `AssembledTransaction` to work together to duplicate the contract's Rust logic, always returning `Result` types for contract methods that are implemented to do so. In the future, if this feels too un-idiomatic for JavaScript, we can always remove this and flatten all JS calls to `try...catch`. Easier to remove this logic later than it would be to add it. ```ts interface Result { isErr(): boolean; isOk(): boolean; unwrap(): T; unwrapErr(): E; } ``` **Source:** [src/contract/rust_result.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L36) #### `result.isErr()` ```ts isErr(): boolean; ``` **Source:** [src/contract/rust_result.ts:40](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L40) #### `result.isOk()` ```ts isOk(): boolean; ``` **Source:** [src/contract/rust_result.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L39) #### `result.unwrap()` ```ts unwrap(): T; ``` **Source:** [src/contract/rust_result.ts:37](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L37) #### `result.unwrapErr()` ```ts unwrapErr(): E; ``` **Source:** [src/contract/rust_result.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/rust_result.ts#L38) ### contract.SignAuthEntry A function to request a wallet to sign an authorization entry preimage. Similar to signing a transaction, this function takes an authorization entry preimage provided by the requester and applies a signature to it. It returns a signed hash of the same authorization entry and the signer address back to the requester. ```ts type SignAuthEntry = (authEntry: string, opts?: { address?: string; networkPassphrase?: string }) => Promise<{ signedAuthEntry: string; signerAddress?: string } & { error?: WalletError }> ``` **Source:** [src/contract/types.ts:111](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L111) ### contract.SignTransaction A function to request a wallet to sign a built transaction This function takes an XDR provided by the requester and applies a signature to it. It returns a base64-encoded string XDR-encoded Transaction Envelope with Decorated Signatures and the signer address back to the requester. ```ts type SignTransaction = (xdr: string, opts?: { address?: string; networkPassphrase?: string; submit?: boolean; submitUrl?: string }) => Promise<{ signedTxXdr: string; signerAddress?: string } & { error?: WalletError }> ``` **Source:** [src/contract/types.ts:82](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L82) ### contract.Timepoint An unsigned 64-bit integer. ```ts type Timepoint = bigint ``` **Source:** [src/contract/types.ts:49](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L49) ### contract.Tx A "regular" transaction, as opposed to a FeeBumpTransaction. ```ts type Tx = Transaction ``` **Source:** [src/contract/types.ts:58](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L58) ### contract.Typepoint **Deprecated.** Use `Timepoint` instead. ```ts type Typepoint = bigint ``` **Source:** [src/contract/types.ts:45](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L45) ### contract.Union ```ts interface Union { tag: string; values?: T; } ``` **Source:** [src/contract/spec.ts:14](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L14) #### `union.tag` ```ts tag: string; ``` **Source:** [src/contract/spec.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L15) #### `union.values` ```ts values?: T; ``` **Source:** [src/contract/spec.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/spec.ts#L16) ### contract.WalletError ```ts interface WalletError { code: number; ext?: string[]; message: string; } ``` **Source:** [src/contract/types.ts:60](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L60) #### `walletError.code` ```ts code: number; ``` **Source:** [src/contract/types.ts:62](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L62) #### `walletError.ext` ```ts ext?: string[]; ``` **Source:** [src/contract/types.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L63) #### `walletError.message` ```ts message: string; ``` **Source:** [src/contract/types.ts:61](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L61) ### contract.XDR_BASE64 ```ts type XDR_BASE64 = string ``` **Source:** [src/contract/types.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L8) ### contract.i128 A signed 128-bit integer. ```ts type i128 = bigint ``` **Source:** [src/contract/types.ts:32](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L32) ### contract.i256 A signed 256-bit integer. ```ts type i256 = bigint ``` **Source:** [src/contract/types.ts:40](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L40) ### contract.i32 A signed 32-bit integer. ```ts type i32 = number ``` **Source:** [src/contract/types.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L16) ### contract.i64 A signed 64-bit integer. ```ts type i64 = bigint ``` **Source:** [src/contract/types.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L24) ### contract.u128 An unsigned 128-bit integer. ```ts type u128 = bigint ``` **Source:** [src/contract/types.ts:28](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L28) ### contract.u256 An unsigned 256-bit integer. ```ts type u256 = bigint ``` **Source:** [src/contract/types.ts:36](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L36) ### contract.u32 An unsigned 32-bit integer. ```ts type u32 = number ``` **Source:** [src/contract/types.ts:12](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L12) ### contract.u64 An unsigned 64-bit integer. ```ts type u64 = bigint ``` **Source:** [src/contract/types.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/types.ts#L20) # Source: docs/reference/contracts-bindings.md # Contracts / Bindings ## BindingGenerator Generates TypeScript bindings for Stellar smart contracts. This class creates fully-typed TypeScript client code from a contract's specification, allowing developers to interact with Stellar smart contracts with full IDE support and compile-time type checking. ```ts class BindingGenerator { static fromContractId(contractId: string, rpcServer: RpcServer): Promise; static fromSpec(spec: Spec): BindingGenerator; static fromWasm(wasmBuffer: Buffer): BindingGenerator; static fromWasmHash(wasmHash: string, rpcServer: RpcServer): Promise; generate(options: GenerateOptions): GeneratedBindings; } ``` **Example** ```ts // Create from a local WASM file const wasmBuffer = fs.readFileSync("./my_contract.wasm"); const generator = await BindingGenerator.fromWasm(wasmBuffer); const bindings = generator.generate({ contractName: "my-contract" }); ``` **Example** ```ts // Create from a contract deployed on the network const generator = await BindingGenerator.fromContractId( "CABC...XYZ", "https://soroban-testnet.stellar.org", Networks.TESTNET ); const bindings = generator.generate({ contractName: "my-contract" }); ``` **Example** ```ts // Create from a Spec object directly const spec = new Spec(specEntries); const generator = BindingGenerator.fromSpec(spec); const bindings = generator.generate({ contractName: "my-contract" }); ``` **Source:** [src/bindings/generator.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L78) ### `BindingGenerator.fromContractId(contractId, rpcServer)` Creates a BindingGenerator by fetching contract info from a deployed contract ID. Retrieves the contract's WASM from the network using the contract ID, then parses the specification. If the contract is a Stellar Asset Contract (SAC), returns a generator with the standard SAC specification. ```ts static fromContractId(contractId: string, rpcServer: RpcServer): Promise; ``` **Parameters** - **`contractId`** — `string` (required) — The contract ID (C... address) of the deployed contract - **`rpcServer`** — `RpcServer` (required) — The Stellar RPC server instance **Returns** A Promise resolving to a new BindingGenerator instance **Throws** - If the contract cannot be found or fetched **Example** ```ts const generator = await BindingGenerator.fromContractId( "CABC123...XYZ", rpcServer ); ``` **Source:** [src/bindings/generator.ts:182](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L182) ### `BindingGenerator.fromSpec(spec)` Creates a BindingGenerator from an existing Spec object. Use this when you already have a parsed contract specification, such as from manually constructed spec entries or from another source. ```ts static fromSpec(spec: Spec): BindingGenerator; ``` **Parameters** - **`spec`** — `Spec` (required) — The contract specification containing function and type definitions **Returns** A new BindingGenerator instance **Example** ```ts const spec = new Spec(specEntries); const generator = BindingGenerator.fromSpec(spec); ``` **Source:** [src/bindings/generator.ts:105](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L105) ### `BindingGenerator.fromWasm(wasmBuffer)` Creates a BindingGenerator from a WASM binary buffer. Parses the contract specification directly from the WASM file's custom section. This is the most common method when working with locally compiled contracts. ```ts static fromWasm(wasmBuffer: Buffer): BindingGenerator; ``` **Parameters** - **`wasmBuffer`** — `Buffer` (required) — The raw WASM binary as a Buffer **Returns** A Promise resolving to a new BindingGenerator instance **Throws** - If the WASM file doesn't contain a valid contract spec **Example** ```ts const wasmBuffer = fs.readFileSync("./target/wasm32-unknown-unknown/release/my_contract.wasm"); const generator = await BindingGenerator.fromWasm(wasmBuffer); ``` **Source:** [src/bindings/generator.ts:125](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L125) ### `BindingGenerator.fromWasmHash(wasmHash, rpcServer)` Creates a BindingGenerator by fetching WASM from the network using its hash. Retrieves the WASM bytecode from Stellar RPC using the WASM hash, then parses the contract specification from it. Useful when you know the hash of an installed WASM but don't have the binary locally. ```ts static fromWasmHash(wasmHash: string, rpcServer: RpcServer): Promise; ``` **Parameters** - **`wasmHash`** — `string` (required) — The hex-encoded hash of the installed WASM blob - **`rpcServer`** — `RpcServer` (required) — The Stellar RPC server instance **Returns** A Promise resolving to a new BindingGenerator instance **Throws** - If the WASM cannot be fetched or doesn't contain a valid spec **Example** ```ts const generator = await BindingGenerator.fromWasmHash( "a1b2c3...xyz", "https://soroban-testnet.stellar.org", Networks.TESTNET ); ``` **Source:** [src/bindings/generator.ts:151](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L151) ### `bindingGenerator.generate(options)` Generates TypeScript bindings for the contract. Produces all the files needed for a standalone npm package: - `client.ts`: A typed Client class with methods for each contract function - `types.ts`: TypeScript interfaces for all contract types (structs, enums, unions) - `index.ts`: Barrel export file - `package.json`, `tsconfig.json`, `README.md`, `.gitignore`: Package configuration The generated code does not write to disk - use the returned strings to write files as needed. ```ts generate(options: GenerateOptions): GeneratedBindings; ``` **Parameters** - **`options`** — `GenerateOptions` (required) — Configuration options for generation - `contractName`: Required. The name for the generated package (kebab-case recommended) **Returns** An object containing all generated file contents as strings **Throws** - If contractName is missing or empty **Example** ```ts const bindings = generator.generate({ contractName: "my-token", contractAddress: "CABC...XYZ", rpcUrl: "https://soroban-testnet.stellar.org", networkPassphrase: Networks.TESTNET }); // Write files to disk fs.writeFileSync("./src/client.ts", bindings.client); fs.writeFileSync("./src/types.ts", bindings.types); ``` **Source:** [src/bindings/generator.ts:226](https://github.com/stellar/js-stellar-sdk/blob/main/src/bindings/generator.ts#L226) # Source: docs/reference/seps-toml.md # SEPs / Toml ## StellarToml.Resolver Resolver allows resolving `stellar.toml` files. ```ts class Resolver { constructor(); static resolve(domain: string, opts: StellarTomlResolveOptions = {}): Promise; } ``` **Source:** [src/stellartoml/index.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L16) ### `new Resolver()` ```ts constructor(); ``` ### `Resolver.resolve(domain, opts)` Returns a parsed `stellar.toml` file for a given domain. ```ts static resolve(domain: string, opts: StellarTomlResolveOptions = {}): Promise; ``` **Parameters** - **`domain`** — `string` (required) — Domain to get stellar.toml file for - **`opts`** — `StellarTomlResolveOptions` (optional) (default: `{}`) — (optional) Options object - `allowHttp` (optional): Allow connecting to http servers. This must be set to false in production deployments! - `timeout` (optional): Allow a timeout. Allows user to avoid nasty lag due to TOML resolve issue. **Returns** A `Promise` that resolves to the parsed stellar.toml object **Example** ```ts StellarSdk.StellarToml.Resolver.resolve('acme.com') .then(stellarToml => { // stellarToml in an object representing domain stellar.toml file. }) .catch(error => { // stellar.toml does not exist or is invalid }); ``` **See also** - `Stellar.toml doc` **Source:** [src/stellartoml/index.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L38) ## StellarToml.STELLAR_TOML_MAX_SIZE The maximum size of stellar.toml file, in bytes ```ts const STELLAR_TOML_MAX_SIZE: number ``` **Source:** [src/stellartoml/index.ts:11](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L11) ## Types ### StellarToml.Api.ContractId ```ts type ContractId = string ``` **Source:** [src/stellartoml/index.ts:101](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L101) ### StellarToml.Api.Currency ```ts interface Currency { anchor_asset?: string; anchor_asset_type?: "fiat" | "crypto" | "nft" | "stock" | "bond" | "commodity" | "realestate" | "other"; approval_criteria?: string; approval_server?: string; attestation_of_reserve?: string; attestation_of_reserve_amount?: string; attestation_of_reserve_last_audit?: string; code?: string; code_template?: string; collateral_address_messages?: string[]; collateral_address_signatures?: string[]; collateral_addresses?: string[]; conditions?: string; desc?: string; display_decimals?: number; fixed_number?: number; image?: string; is_asset_anchored?: boolean; is_unlimited?: boolean; issuer?: string; max_number?: number; name?: string; redemption_instructions?: string; regulated?: boolean; status?: "live" | "dead" | "test" | "private"; } ``` **Source:** [src/stellartoml/index.ts:134](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L134) #### `currency.anchor_asset` ```ts anchor_asset?: string; ``` **Source:** [src/stellartoml/index.ts:155](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L155) #### `currency.anchor_asset_type` ```ts anchor_asset_type?: "fiat" | "crypto" | "nft" | "stock" | "bond" | "commodity" | "realestate" | "other"; ``` **Source:** [src/stellartoml/index.ts:146](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L146) #### `currency.approval_criteria` ```ts approval_criteria?: string; ``` **Source:** [src/stellartoml/index.ts:167](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L167) #### `currency.approval_server` ```ts approval_server?: string; ``` **Source:** [src/stellartoml/index.ts:166](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L166) #### `currency.attestation_of_reserve` ```ts attestation_of_reserve?: string; ``` **Source:** [src/stellartoml/index.ts:156](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L156) #### `currency.attestation_of_reserve_amount` ```ts attestation_of_reserve_amount?: string; ``` **Source:** [src/stellartoml/index.ts:157](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L157) #### `currency.attestation_of_reserve_last_audit` ```ts attestation_of_reserve_last_audit?: string; ``` **Source:** [src/stellartoml/index.ts:158](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L158) #### `currency.code` ```ts code?: string; ``` **Source:** [src/stellartoml/index.ts:135](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L135) #### `currency.code_template` ```ts code_template?: string; ``` **Source:** [src/stellartoml/index.ts:136](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L136) #### `currency.collateral_address_messages` ```ts collateral_address_messages?: string[]; ``` **Source:** [src/stellartoml/index.ts:164](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L164) #### `currency.collateral_address_signatures` ```ts collateral_address_signatures?: string[]; ``` **Source:** [src/stellartoml/index.ts:165](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L165) #### `currency.collateral_addresses` ```ts collateral_addresses?: string[]; ``` **Source:** [src/stellartoml/index.ts:163](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L163) #### `currency.conditions` ```ts conditions?: string; ``` **Source:** [src/stellartoml/index.ts:142](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L142) #### `currency.desc` ```ts desc?: string; ``` **Source:** [src/stellartoml/index.ts:141](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L141) #### `currency.display_decimals` ```ts display_decimals?: number; ``` **Source:** [src/stellartoml/index.ts:138](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L138) #### `currency.fixed_number` ```ts fixed_number?: number; ``` **Source:** [src/stellartoml/index.ts:143](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L143) #### `currency.image` ```ts image?: string; ``` **Source:** [src/stellartoml/index.ts:161](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L161) #### `currency.is_asset_anchored` ```ts is_asset_anchored?: boolean; ``` **Source:** [src/stellartoml/index.ts:145](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L145) #### `currency.is_unlimited` ```ts is_unlimited?: boolean; ``` **Source:** [src/stellartoml/index.ts:159](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L159) #### `currency.issuer` ```ts issuer?: string; ``` **Source:** [src/stellartoml/index.ts:137](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L137) #### `currency.max_number` ```ts max_number?: number; ``` **Source:** [src/stellartoml/index.ts:144](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L144) #### `currency.name` ```ts name?: string; ``` **Source:** [src/stellartoml/index.ts:140](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L140) #### `currency.redemption_instructions` ```ts redemption_instructions?: string; ``` **Source:** [src/stellartoml/index.ts:160](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L160) #### `currency.regulated` ```ts regulated?: boolean; ``` **Source:** [src/stellartoml/index.ts:162](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L162) #### `currency.status` ```ts status?: "live" | "dead" | "test" | "private"; ``` **Source:** [src/stellartoml/index.ts:139](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L139) ### StellarToml.Api.Documentation ```ts interface Documentation { ORG_DBA?: string; ORG_DESCRIPTION?: string; ORG_GITHUB?: string; ORG_KEYBASE?: string; ORG_LICENSE_NUMBER?: string; ORG_LICENSE_TYPE?: string; ORG_LICENSING_AUTHORITY?: string; ORG_LOGO?: string; ORG_NAME?: string; ORG_OFFICIAL_EMAIL?: string; ORG_PHONE_NUMBER?: string; ORG_PHONE_NUMBER_ATTESTATION?: string; ORG_PHYSICAL_ADDRESS?: string; ORG_PHYSICAL_ADDRESS_ATTESTATION?: string; ORG_SUPPORT_EMAIL?: string; ORG_TWITTER?: string; ORG_URL?: string; } ``` **Source:** [src/stellartoml/index.ts:103](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L103) #### `documentation.ORG_DBA` ```ts ORG_DBA?: string; ``` **Source:** [src/stellartoml/index.ts:105](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L105) #### `documentation.ORG_DESCRIPTION` ```ts ORG_DESCRIPTION?: string; ``` **Source:** [src/stellartoml/index.ts:112](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L112) #### `documentation.ORG_GITHUB` ```ts ORG_GITHUB?: string; ``` **Source:** [src/stellartoml/index.ts:120](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L120) #### `documentation.ORG_KEYBASE` ```ts ORG_KEYBASE?: string; ``` **Source:** [src/stellartoml/index.ts:118](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L118) #### `documentation.ORG_LICENSE_NUMBER` ```ts ORG_LICENSE_NUMBER?: string; ``` **Source:** [src/stellartoml/index.ts:109](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L109) #### `documentation.ORG_LICENSE_TYPE` ```ts ORG_LICENSE_TYPE?: string; ``` **Source:** [src/stellartoml/index.ts:111](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L111) #### `documentation.ORG_LICENSING_AUTHORITY` ```ts ORG_LICENSING_AUTHORITY?: string; ``` **Source:** [src/stellartoml/index.ts:110](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L110) #### `documentation.ORG_LOGO` ```ts ORG_LOGO?: string; ``` **Source:** [src/stellartoml/index.ts:108](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L108) #### `documentation.ORG_NAME` ```ts ORG_NAME?: string; ``` **Source:** [src/stellartoml/index.ts:104](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L104) #### `documentation.ORG_OFFICIAL_EMAIL` ```ts ORG_OFFICIAL_EMAIL?: string; ``` **Source:** [src/stellartoml/index.ts:116](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L116) #### `documentation.ORG_PHONE_NUMBER` ```ts ORG_PHONE_NUMBER?: string; ``` **Source:** [src/stellartoml/index.ts:107](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L107) #### `documentation.ORG_PHONE_NUMBER_ATTESTATION` ```ts ORG_PHONE_NUMBER_ATTESTATION?: string; ``` **Source:** [src/stellartoml/index.ts:115](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L115) #### `documentation.ORG_PHYSICAL_ADDRESS` ```ts ORG_PHYSICAL_ADDRESS?: string; ``` **Source:** [src/stellartoml/index.ts:113](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L113) #### `documentation.ORG_PHYSICAL_ADDRESS_ATTESTATION` ```ts ORG_PHYSICAL_ADDRESS_ATTESTATION?: string; ``` **Source:** [src/stellartoml/index.ts:114](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L114) #### `documentation.ORG_SUPPORT_EMAIL` ```ts ORG_SUPPORT_EMAIL?: string; ``` **Source:** [src/stellartoml/index.ts:117](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L117) #### `documentation.ORG_TWITTER` ```ts ORG_TWITTER?: string; ``` **Source:** [src/stellartoml/index.ts:119](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L119) #### `documentation.ORG_URL` ```ts ORG_URL?: string; ``` **Source:** [src/stellartoml/index.ts:106](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L106) ### StellarToml.Api.ISODateTime ```ts type ISODateTime = string ``` **Source:** [src/stellartoml/index.ts:102](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L102) ### StellarToml.Api.Principal ```ts interface Principal { email: string; github?: string; id_photo_hash?: string; keybase?: string; name: string; telegram?: string; twitter?: string; verification_photo_hash?: string; } ``` **Source:** [src/stellartoml/index.ts:123](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L123) #### `principal.email` ```ts email: string; ``` **Source:** [src/stellartoml/index.ts:125](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L125) #### `principal.github` ```ts github?: string; ``` **Source:** [src/stellartoml/index.ts:126](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L126) #### `principal.id_photo_hash` ```ts id_photo_hash?: string; ``` **Source:** [src/stellartoml/index.ts:130](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L130) #### `principal.keybase` ```ts keybase?: string; ``` **Source:** [src/stellartoml/index.ts:127](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L127) #### `principal.name` ```ts name: string; ``` **Source:** [src/stellartoml/index.ts:124](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L124) #### `principal.telegram` ```ts telegram?: string; ``` **Source:** [src/stellartoml/index.ts:128](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L128) #### `principal.twitter` ```ts twitter?: string; ``` **Source:** [src/stellartoml/index.ts:129](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L129) #### `principal.verification_photo_hash` ```ts verification_photo_hash?: string; ``` **Source:** [src/stellartoml/index.ts:131](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L131) ### StellarToml.Api.PublicKey ```ts type PublicKey = string ``` **Source:** [src/stellartoml/index.ts:100](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L100) ### StellarToml.Api.StellarToml ```ts interface StellarToml { ACCOUNTS?: string[]; ANCHOR_QUOTE_SERVER?: string; CURRENCIES?: Currency[]; DIRECT_PAYMENT_SERVER?: string; DOCUMENTATION?: Documentation; FEDERATION_SERVER?: string; HORIZON_URL?: string; KYC_SERVER?: string; NETWORK_PASSPHRASE?: Networks; PRINCIPALS?: Principal[]; SIGNING_KEY?: string; TRANSFER_SERVER?: string; TRANSFER_SERVER_SEP0024?: string; URI_REQUEST_SIGNING_KEY?: string; VALIDATORS?: Validator[]; VERSION?: string; WEB_AUTH_CONTRACT_ID?: string; WEB_AUTH_ENDPOINT?: string; WEB_AUTH_FOR_CONTRACTS_ENDPOINT?: string; } ``` **Source:** [src/stellartoml/index.ts:182](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L182) #### `stellarToml.ACCOUNTS` ```ts ACCOUNTS?: string[]; ``` **Source:** [src/stellartoml/index.ts:184](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L184) #### `stellarToml.ANCHOR_QUOTE_SERVER` ```ts ANCHOR_QUOTE_SERVER?: string; ``` **Source:** [src/stellartoml/index.ts:197](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L197) #### `stellarToml.CURRENCIES` ```ts CURRENCIES?: Currency[]; ``` **Source:** [src/stellartoml/index.ts:200](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L200) #### `stellarToml.DIRECT_PAYMENT_SERVER` ```ts DIRECT_PAYMENT_SERVER?: string; ``` **Source:** [src/stellartoml/index.ts:196](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L196) #### `stellarToml.DOCUMENTATION` ```ts DOCUMENTATION?: Documentation; ``` **Source:** [src/stellartoml/index.ts:198](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L198) #### `stellarToml.FEDERATION_SERVER` ```ts FEDERATION_SERVER?: string; ``` **Source:** [src/stellartoml/index.ts:192](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L192) #### `stellarToml.HORIZON_URL` ```ts HORIZON_URL?: string; ``` **Source:** [src/stellartoml/index.ts:194](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L194) #### `stellarToml.KYC_SERVER` ```ts KYC_SERVER?: string; ``` **Source:** [src/stellartoml/index.ts:188](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L188) #### `stellarToml.NETWORK_PASSPHRASE` ```ts NETWORK_PASSPHRASE?: Networks; ``` **Source:** [src/stellartoml/index.ts:185](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L185) #### `stellarToml.PRINCIPALS` ```ts PRINCIPALS?: Principal[]; ``` **Source:** [src/stellartoml/index.ts:199](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L199) #### `stellarToml.SIGNING_KEY` ```ts SIGNING_KEY?: string; ``` **Source:** [src/stellartoml/index.ts:193](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L193) #### `stellarToml.TRANSFER_SERVER` ```ts TRANSFER_SERVER?: string; ``` **Source:** [src/stellartoml/index.ts:187](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L187) #### `stellarToml.TRANSFER_SERVER_SEP0024` ```ts TRANSFER_SERVER_SEP0024?: string; ``` **Source:** [src/stellartoml/index.ts:186](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L186) #### `stellarToml.URI_REQUEST_SIGNING_KEY` ```ts URI_REQUEST_SIGNING_KEY?: string; ``` **Source:** [src/stellartoml/index.ts:195](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L195) #### `stellarToml.VALIDATORS` ```ts VALIDATORS?: Validator[]; ``` **Source:** [src/stellartoml/index.ts:201](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L201) #### `stellarToml.VERSION` ```ts VERSION?: string; ``` **Source:** [src/stellartoml/index.ts:183](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L183) #### `stellarToml.WEB_AUTH_CONTRACT_ID` ```ts WEB_AUTH_CONTRACT_ID?: string; ``` **Source:** [src/stellartoml/index.ts:191](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L191) #### `stellarToml.WEB_AUTH_ENDPOINT` ```ts WEB_AUTH_ENDPOINT?: string; ``` **Source:** [src/stellartoml/index.ts:189](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L189) #### `stellarToml.WEB_AUTH_FOR_CONTRACTS_ENDPOINT` ```ts WEB_AUTH_FOR_CONTRACTS_ENDPOINT?: string; ``` **Source:** [src/stellartoml/index.ts:190](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L190) ### StellarToml.Api.StellarTomlResolveOptions ```ts interface StellarTomlResolveOptions { allowedRedirects?: number; allowHttp?: boolean; timeout?: number; } ``` **Source:** [src/stellartoml/index.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L94) #### `stellarTomlResolveOptions.allowedRedirects` ```ts allowedRedirects?: number; ``` **Source:** [src/stellartoml/index.ts:97](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L97) #### `stellarTomlResolveOptions.allowHttp` ```ts allowHttp?: boolean; ``` **Source:** [src/stellartoml/index.ts:95](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L95) #### `stellarTomlResolveOptions.timeout` ```ts timeout?: number; ``` **Source:** [src/stellartoml/index.ts:96](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L96) ### StellarToml.Api.Url ```ts type Url = string ``` **Source:** [src/stellartoml/index.ts:99](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L99) ### StellarToml.Api.Validator ```ts interface Validator { ALIAS?: string; DISPLAY_NAME?: string; HISTORY?: string; HOST?: string; PUBLIC_KEY?: string; } ``` **Source:** [src/stellartoml/index.ts:171](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L171) #### `validator.ALIAS` ```ts ALIAS?: string; ``` **Source:** [src/stellartoml/index.ts:172](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L172) #### `validator.DISPLAY_NAME` ```ts DISPLAY_NAME?: string; ``` **Source:** [src/stellartoml/index.ts:173](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L173) #### `validator.HISTORY` ```ts HISTORY?: string; ``` **Source:** [src/stellartoml/index.ts:176](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L176) #### `validator.HOST` ```ts HOST?: string; ``` **Source:** [src/stellartoml/index.ts:175](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L175) #### `validator.PUBLIC_KEY` ```ts PUBLIC_KEY?: string; ``` **Source:** [src/stellartoml/index.ts:174](https://github.com/stellar/js-stellar-sdk/blob/main/src/stellartoml/index.ts#L174) # Source: docs/reference/seps-federation.md # SEPs / Federation ## Federation.FEDERATION_RESPONSE_MAX_SIZE The maximum size of response from a federation server ```ts const FEDERATION_RESPONSE_MAX_SIZE: number ``` **Source:** [src/federation/server.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L15) ## Federation.Server Federation.Server handles a network connection to a [federation server](https://developers.stellar.org/docs/learn/encyclopedia/federation) instance and exposes an interface for requests to that instance. ```ts class Server { constructor(serverURL: string, domain: string, opts: Options = {}); static createForDomain(domain: string, opts: Options = {}): Promise; static resolve(value: string, opts: Options = {}): Promise; resolveAccountId(accountId: string): Promise; resolveAddress(address: string): Promise; resolveTransactionId(transactionId: string): Promise; } ``` **Source:** [src/federation/server.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L26) ### `new Server(serverURL, domain, opts)` ```ts constructor(serverURL: string, domain: string, opts: Options = {}); ``` **Parameters** - **`serverURL`** — `string` (required) - **`domain`** — `string` (required) - **`opts`** — `Options` (optional) (default: `{}`) **Source:** [src/federation/server.ts:137](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L137) ### `Server.createForDomain(domain, opts)` Creates a `FederationServer` instance based on information from [stellar.toml](https://developers.stellar.org/docs/issuing-assets/publishing-asset-info) file for a given domain. If `stellar.toml` file does not exist for a given domain or it does not contain information about a federation server Promise will reject. ```ts static createForDomain(domain: string, opts: Options = {}): Promise; ``` **Parameters** - **`domain`** — `string` (required) — Domain to get federation server for - **`opts`** — `Options` (optional) (default: `{}`) — (optional) Options object **Returns** A promise that resolves to the federation record **Throws** - Will throw an error if the domain's stellar.toml file does not contain a federation server field. **Example** ```ts StellarSdk.FederationServer.createForDomain('acme.com') .then(federationServer => { // federationServer.resolveAddress('bob').then(...) }) .catch(error => { // stellar.toml does not exist or it does not contain information about federation server. }); ``` **See also** - Stellar.toml doc **Source:** [src/federation/server.ts:123](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L123) ### `Server.resolve(value, opts)` A helper method for handling user inputs that contain `destination` value. It accepts two types of values: * For Stellar address (ex. `bob*stellar.org`) it splits Stellar address and then tries to find information about federation server in `stellar.toml` file for a given domain. It returns a `Promise` which resolves if federation server exists and user has been found and rejects in all other cases. * For Account ID (ex. `GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS`) it returns a `Promise` which resolves if Account ID is valid and rejects in all other cases. Please note that this method does not check if the account actually exists in a ledger. ```ts static resolve(value: string, opts: Options = {}): Promise; ``` **Parameters** - **`value`** — `string` (required) — Stellar Address (ex. `bob*stellar.org`) - **`opts`** — `Options` (optional) (default: `{}`) — (optional) Options object **Returns** A promise that resolves to the federation record **Throws** - Will throw an error if the provided account ID is not a valid Ed25519 public key. **Example** ```ts StellarSdk.FederationServer.resolve('bob*stellar.org') .then(federationRecord => { // { // account_id: 'GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS', // memo_type: 'id', // memo: 100 // } }); ``` **See also** - - Federation doc - Stellar.toml doc **Source:** [src/federation/server.ts:72](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L72) ### `server.resolveAccountId(accountId)` Given an account ID, get their federation record if the user was found ```ts resolveAccountId(accountId: string): Promise; ``` **Parameters** - **`accountId`** — `string` (required) — Account ID (ex. `GBYNR2QJXLBCBTRN44MRORCMI4YO7FZPFBCNOKTOBCAAFC7KC3LNPRYS`) **Returns** A promise that resolves to the federation record **Throws** - Will throw an error if the federation server returns an invalid memo value. - Will throw an error if the federation server's response exceeds the allowed maximum size. - Will throw an error if the server query fails with an improper response. **See also** - Federation doc **Source:** [src/federation/server.ts:194](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L194) ### `server.resolveAddress(address)` Get the federation record if the user was found for a given Stellar address ```ts resolveAddress(address: string): Promise; ``` **Parameters** - **`address`** — `string` (required) — Stellar address (ex. `bob*stellar.org`). If `FederationServer` was instantiated with `domain` param only username (ex. `bob`) can be passed. **Returns** A promise that resolves to the federation record **Throws** - Will throw an error if the federated address does not contain a domain, or if the server object was not instantiated with a `domain` parameter **See also** - Federation doc **Source:** [src/federation/server.ts:166](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L166) ### `server.resolveTransactionId(transactionId)` Given a transactionId, get the federation record if the sender of the transaction was found ```ts resolveTransactionId(transactionId: string): Promise; ``` **Parameters** - **`transactionId`** — `string` (required) — Transaction ID (ex. `3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889`) **Returns** A promise that resolves to the federation record **Throws** - Will throw an error if the federation server returns an invalid memo value. - Will throw an error if the federation server's response exceeds the allowed maximum size. - Will throw an error if the server query fails with an improper response. **See also** - Federation doc **Source:** [src/federation/server.ts:211](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/server.ts#L211) ## Types ### Federation.Api.Options Options for configuring connections to federation servers. You can also use `Config` class to set this globally. ```ts interface Options { allowHttp?: boolean; timeout?: number; } ``` **Source:** [src/federation/api.ts:25](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L25) #### `options.allowHttp` Allow connecting to http servers, default: `false`. This must be set to false in production deployments! ```ts allowHttp?: boolean; ``` **Source:** [src/federation/api.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L29) #### `options.timeout` Allow a timeout, default: 0. Allows user to avoid nasty lag due to TOML resolve issue. ```ts timeout?: number; ``` **Source:** [src/federation/api.ts:33](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L33) ### Federation.Api.Record Record returned from a federation server. ```ts interface Record { account_id: string; memo?: string; memo_type?: string; } ``` **Source:** [src/federation/api.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L7) #### `record.account_id` The Stellar public key resolved from the federation lookup ```ts account_id: string; ``` **Source:** [src/federation/api.ts:11](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L11) #### `record.memo` The memo value, if any, required to send payments to this user ```ts memo?: string; ``` **Source:** [src/federation/api.ts:19](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L19) #### `record.memo_type` The type of memo, if any, required to send payments to this user ```ts memo_type?: string; ``` **Source:** [src/federation/api.ts:15](https://github.com/stellar/js-stellar-sdk/blob/main/src/federation/api.ts#L15) # Source: docs/reference/seps-webauth.md # SEPs / WebAuth ## WebAuth.buildChallengeTx Returns a valid `SEP-10` challenge transaction which you can use for Stellar Web Authentication. ```ts buildChallengeTx(serverKeypair: Keypair, clientAccountID: string, homeDomain: string, timeout: number = 300, networkPassphrase: string, webAuthDomain: string, memo: string | null = null, clientDomain: string | null = null, clientSigningKey: string | null = null): string ``` **Parameters** - **`serverKeypair`** — `Keypair` (required) — Keypair for server's signing account. - **`clientAccountID`** — `string` (required) — The stellar account (G...) or muxed account (M...) that the wallet wishes to authenticate with the server. - **`homeDomain`** — `string` (required) — The fully qualified domain name of the service requiring authentication - **`timeout`** — `number` (optional) (default: `300`) — Challenge duration (default to 5 minutes). - **`networkPassphrase`** — `string` (required) — The network passphrase. If you pass this argument then timeout is required. - **`webAuthDomain`** — `string` (required) — The fully qualified domain name of the service issuing the challenge. - **`memo`** — `string | null` (optional) (default: `null`) — The memo to attach to the challenge transaction. The memo must be of type `id`. If the `clientaccountID` is a muxed account, memos cannot be used. - **`clientDomain`** — `string | null` (optional) (default: `null`) — The fully qualified domain of the client requesting the challenge. Only necessary when the 'client_domain' parameter is passed. - **`clientSigningKey`** — `string | null` (optional) (default: `null`) — The public key assigned to the SIGNING_KEY attribute specified on the stellar.toml hosted on the client domain. Only necessary when the 'client_domain' parameter is passed. **Returns** A base64 encoded string of the raw TransactionEnvelope xdr struct for the transaction. **Throws** - Will throw if `clientAccountID` is a muxed account, and `memo` is present. - Will throw if `clientDomain` is provided, but `clientSigningKey` is missing **Example** ```ts import { Keypair, Networks, WebAuth } from 'stellar-sdk' let serverKeyPair = Keypair.fromSecret("server-secret") let challenge = WebAuth.buildChallengeTx( serverKeyPair, "client-stellar-account-id", "stellar.org", 300, Networks.TESTNET); ``` **See also** - `SEP-10: Stellar Web Auth` **Source:** [src/webauth/challenge_transaction.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/challenge_transaction.ts#L63) ## WebAuth.gatherTxSigners Checks if a transaction has been signed by one or more of the given signers, returning a list of non-repeated signers that were found to have signed the given transaction. ```ts gatherTxSigners(transaction: Transaction | FeeBumpTransaction, signers: string[]): string[] ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — The signed transaction. - **`signers`** — `string[]` (required) — The signer's public keys. **Returns** A list of signers that were found to have signed the transaction. **Example** ```ts let keypair1 = Keypair.random(); let keypair2 = Keypair.random(); const account = new StellarSdk.Account(keypair1.publicKey(), "-1"); const transaction = new TransactionBuilder(account, { fee: 100 }) .setTimeout(30) .build(); transaction.sign(keypair1, keypair2) WebAuth.gatherTxSigners(transaction, [keypair1.publicKey(), keypair2.publicKey()]) ``` **Source:** [src/webauth/utils.ts:32](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/utils.ts#L32) ## WebAuth.readChallengeTx Reads a SEP-10 challenge transaction and returns the decoded transaction and client account ID contained within. It also verifies that the transaction has been signed by the server. It does not verify that the transaction has been signed by the client or that any signatures other than the server's on the transaction are valid. Use one of the following functions to completely verify the transaction: - `WebAuth.verifyChallengeTxThreshold` - `WebAuth.verifyChallengeTxSigners` ```ts readChallengeTx(challengeTx: string, serverAccountID: string, networkPassphrase: string, homeDomains: string | string[], webAuthDomain: string): { clientAccountID: string; matchedHomeDomain: string; memo: string | null; tx: Transaction } ``` **Parameters** - **`challengeTx`** — `string` (required) — SEP0010 challenge transaction in base64. - **`serverAccountID`** — `string` (required) — The server's stellar account (public key). - **`networkPassphrase`** — `string` (required) — The network passphrase, e.g.: 'Test SDF Network ; September 2015' (see `Networks`) - **`homeDomains`** — `string | string[]` (required) — The home domain that is expected to be included in the first Manage Data operation's string key. If an array is provided, one of the domain names in the array must match. - **`webAuthDomain`** — `string` (required) — The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key. If no such operation is included, this parameter is not used. **Returns** The actual transaction and the Stellar public key (master key) used to sign the Manage Data operation, the matched home domain, and the memo attached to the transaction, which will be null if not present. **See also** - `SEP-10: Stellar Web Auth` **Source:** [src/webauth/challenge_transaction.ts:163](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/challenge_transaction.ts#L163) ## WebAuth.verifyChallengeTxSigners Verifies that for a SEP 10 challenge transaction all signatures on the transaction are accounted for. A transaction is verified if it is signed by the server account, and all other signatures match a signer that has been provided as an argument (as the accountIDs list). Additional signers can be provided that do not have a signature, but all signatures must be matched to a signer (accountIDs) for verification to succeed. If verification succeeds, a list of signers that were found is returned, not including the server account ID. Signers that are not prefixed as an address/account ID strkey (G...) will be ignored. Errors will be raised if: - The transaction is invalid according to `WebAuth.readChallengeTx`. - No client signatures are found on the transaction. - One or more signatures in the transaction are not identifiable as the server account or one of the signers provided in the arguments. ```ts verifyChallengeTxSigners(challengeTx: string, serverAccountID: string, networkPassphrase: string, signers: string[], homeDomains: string | string[], webAuthDomain: string): string[] ``` **Parameters** - **`challengeTx`** — `string` (required) — SEP0010 challenge transaction in base64. - **`serverAccountID`** — `string` (required) — The server's stellar account (public key). - **`networkPassphrase`** — `string` (required) — The network passphrase, e.g.: 'Test SDF Network ; September 2015' (see `Networks`). - **`signers`** — `string[]` (required) — The signers public keys. This list should contain the public keys for all signers that have signed the transaction. - **`homeDomains`** — `string | string[]` (required) — The home domain(s) that should be included in the first Manage Data operation's string key. Required in readChallengeTx(). - **`webAuthDomain`** — `string` (required) — The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key, if present. Used in readChallengeTx(). **Returns** The list of signers public keys that have signed the transaction, excluding the server account ID. **Example** ```ts import { Networks, TransactionBuilder, WebAuth } from 'stellar-sdk'; const serverKP = Keypair.random(); const clientKP1 = Keypair.random(); const clientKP2 = Keypair.random(); // Challenge, possibly built in the server side const challenge = WebAuth.buildChallengeTx( serverKP, clientKP1.publicKey(), "SDF", 300, Networks.TESTNET ); // clock.tick(200); // Simulates a 200 ms delay when communicating from server to client // Transaction gathered from a challenge, possibly from the client side const transaction = TransactionBuilder.fromXDR(challenge, Networks.TESTNET); transaction.sign(clientKP1, clientKP2); const signedChallenge = transaction .toEnvelope() .toXDR("base64") .toString(); // The result below should be equal to [clientKP1.publicKey(), clientKP2.publicKey()] WebAuth.verifyChallengeTxSigners( signedChallenge, serverKP.publicKey(), Networks.TESTNET, threshold, [clientKP1.publicKey(), clientKP2.publicKey()] ); ``` **See also** - `SEP-10: Stellar Web Auth` **Source:** [src/webauth/challenge_transaction.ts:419](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/challenge_transaction.ts#L419) ## WebAuth.verifyChallengeTxThreshold Verifies that for a SEP-10 challenge transaction all signatures on the transaction are accounted for and that the signatures meet a threshold on an account. A transaction is verified if it is signed by the server account, and all other signatures match a signer that has been provided as an argument, and those signatures meet a threshold on the account. Signers that are not prefixed as an address/account ID strkey (G...) will be ignored. Errors will be raised if: - The transaction is invalid according to `WebAuth.readChallengeTx`. - No client signatures are found on the transaction. - One or more signatures in the transaction are not identifiable as the server account or one of the signers provided in the arguments. - The signatures are all valid but do not meet the threshold. ```ts verifyChallengeTxThreshold(challengeTx: string, serverAccountID: string, networkPassphrase: string, threshold: number, signerSummary: AccountRecordSigners[], homeDomains: string | string[], webAuthDomain: string): string[] ``` **Parameters** - **`challengeTx`** — `string` (required) — SEP0010 challenge transaction in base64. - **`serverAccountID`** — `string` (required) — The server's stellar account (public key). - **`networkPassphrase`** — `string` (required) — The network passphrase, e.g.: 'Test SDF Network ; September 2015' (see `Networks`). - **`threshold`** — `number` (required) — The required signatures threshold for verifying this transaction. - **`signerSummary`** — `AccountRecordSigners[]` (required) — a map of all authorized signers to their weights. It's used to validate if the transaction signatures have met the given threshold. - **`homeDomains`** — `string | string[]` (required) — The home domain(s) that should be included in the first Manage Data operation's string key. Required in `verifyChallengeTxSigners() => readChallengeTx()`. - **`webAuthDomain`** — `string` (required) — The home domain that is expected to be included as the value of the Manage Data operation with the 'web_auth_domain' key, if present. Used in `verifyChallengeTxSigners() => readChallengeTx()`. **Returns** The list of signers public keys that have signed the transaction, excluding the server account ID, given that the threshold was met. **Throws** - Will throw if the collective weight of the transaction's signers does not meet the necessary threshold to verify this transaction. **Example** ```ts import { Networks, TransactionBuilder, WebAuth } from 'stellar-sdk'; const serverKP = Keypair.random(); const clientKP1 = Keypair.random(); const clientKP2 = Keypair.random(); // Challenge, possibly built in the server side const challenge = WebAuth.buildChallengeTx( serverKP, clientKP1.publicKey(), "SDF", 300, Networks.TESTNET ); // clock.tick(200); // Simulates a 200 ms delay when communicating from server to client // Transaction gathered from a challenge, possibly from the client side const transaction = TransactionBuilder.fromXDR(challenge, Networks.TESTNET); transaction.sign(clientKP1, clientKP2); const signedChallenge = transaction .toEnvelope() .toXDR("base64") .toString(); // Defining the threshold and signerSummary const threshold = 3; const signerSummary = [ { key: this.clientKP1.publicKey(), weight: 1, }, { key: this.clientKP2.publicKey(), weight: 2, }, ]; // The result below should be equal to [clientKP1.publicKey(), clientKP2.publicKey()] WebAuth.verifyChallengeTxThreshold( signedChallenge, serverKP.publicKey(), Networks.TESTNET, threshold, signerSummary ); ``` **See also** - `SEP-10: Stellar Web Auth` **Source:** [src/webauth/challenge_transaction.ts:645](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/challenge_transaction.ts#L645) ## WebAuth.verifyTxSignedBy Verifies if a transaction was signed by the given account id. ```ts verifyTxSignedBy(transaction: Transaction | FeeBumpTransaction, accountID: string): boolean ``` **Parameters** - **`transaction`** — `Transaction | FeeBumpTransaction` (required) — The signed transaction. - **`accountID`** — `string` (required) — The signer's public key. **Returns** Whether or not `accountID` was found to have signed the transaction. **Example** ```ts let keypair = Keypair.random(); const account = new StellarSdk.Account(keypair.publicKey(), "-1"); const transaction = new TransactionBuilder(account, { fee: 100 }) .setTimeout(30) .build(); transaction.sign(keypair) WebAuth.verifyTxSignedBy(transaction, keypair.publicKey()) ``` **Source:** [src/webauth/utils.ts:94](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/utils.ts#L94) ## Types ### WebAuth.ChallengeTxDetails A parsed and validated challenge transaction, and some of its constituent details. ```ts type ChallengeTxDetails = { clientAccountId: string; matchedHomeDomain: string; memo?: string; tx: Transaction } ``` **Source:** [src/webauth/utils.ts:104](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/utils.ts#L104) # Source: docs/reference/errors.md # Errors ## AccountRequiresMemoError AccountRequiresMemoError is raised when a transaction is trying to submit an operation to an account which requires a memo. See [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md) for more information. This error contains two attributes to help you identify the account requiring the memo and the operation where the account is the destination ```ts class AccountRequiresMemoError extends Error { constructor(message: string, accountId: string, operationIndex: number); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; accountId: string; cause?: unknown; message: string; name: string; operationIndex: number; stack?: string; } ``` **Example** ```ts console.log('The following account requires a memo ', err.accountId) console.log('The account is used in operation: ', err.operationIndex) ``` **Source:** [src/errors/account_requires_memo.ts:20](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/account_requires_memo.ts#L20) ### `new AccountRequiresMemoError(message, accountId, operationIndex)` ```ts constructor(message: string, accountId: string, operationIndex: number); ``` **Parameters** - **`message`** — `string` (required) - **`accountId`** — `string` (required) - **`operationIndex`** — `number` (required) **Source:** [src/errors/account_requires_memo.ts:24](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/account_requires_memo.ts#L24) ### `AccountRequiresMemoError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `AccountRequiresMemoError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `AccountRequiresMemoError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `accountRequiresMemoError.accountId` ```ts accountId: string; ``` **Source:** [src/errors/account_requires_memo.ts:21](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/account_requires_memo.ts#L21) ### `accountRequiresMemoError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `accountRequiresMemoError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `accountRequiresMemoError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `accountRequiresMemoError.operationIndex` ```ts operationIndex: number; ``` **Source:** [src/errors/account_requires_memo.ts:22](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/account_requires_memo.ts#L22) ### `accountRequiresMemoError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) ## BadRequestError BadRequestError is raised when a request made to Horizon is invalid in some way (incorrect timebounds for trade call builders, for example.) ```ts class BadRequestError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; } ``` **Source:** [src/errors/bad_request.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/bad_request.ts#L10) ### `new BadRequestError(message, response)` ```ts constructor(message: string, response: any); ``` **Parameters** - **`message`** — `string` (required) - **`response`** — `any` (required) **Source:** [src/errors/network.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L29) ### `BadRequestError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `BadRequestError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `BadRequestError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `badRequestError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `badRequestError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `badRequestError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `badRequestError.response` Response details, received from the Horizon server. ```ts response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Source:** [src/errors/network.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L18) ### `badRequestError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) ### `badRequestError.getResponse()` Returns the error response sent by the Horizon server. ```ts getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Returns** Response details, received from the Horizon server. **Source:** [src/errors/network.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L38) ## BadResponseError BadResponseError is raised when a response from a `Horizon` or `Federation` server is invalid in some way. For example, a federation response may exceed the maximum allowed size, or a transaction submission may have failed with Horizon. ```ts class BadResponseError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; } ``` **Source:** [src/errors/bad_response.ts:13](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/bad_response.ts#L13) ### `new BadResponseError(message, response)` ```ts constructor(message: string, response: any); ``` **Parameters** - **`message`** — `string` (required) - **`response`** — `any` (required) **Source:** [src/errors/network.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L29) ### `BadResponseError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `BadResponseError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `BadResponseError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `badResponseError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `badResponseError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `badResponseError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `badResponseError.response` Response details, received from the Horizon server. ```ts response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Source:** [src/errors/network.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L18) ### `badResponseError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) ### `badResponseError.getResponse()` Returns the error response sent by the Horizon server. ```ts getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Returns** Response details, received from the Horizon server. **Source:** [src/errors/network.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L38) ## NetworkError NetworkError is raised when an interaction with a Horizon server has caused some kind of problem. ```ts class NetworkError extends Error { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; } ``` **Source:** [src/errors/network.ts:16](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L16) ### `new NetworkError(message, response)` ```ts constructor(message: string, response: any); ``` **Parameters** - **`message`** — `string` (required) - **`response`** — `any` (required) **Source:** [src/errors/network.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L29) ### `NetworkError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `NetworkError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `NetworkError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `networkError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `networkError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `networkError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `networkError.response` Response details, received from the Horizon server. ```ts response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Source:** [src/errors/network.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L18) ### `networkError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) ### `networkError.getResponse()` Returns the error response sent by the Horizon server. ```ts getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Returns** Response details, received from the Horizon server. **Source:** [src/errors/network.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L38) ## NotFoundError NotFoundError is raised when the resource requested from Horizon is unavailable. ```ts class NotFoundError extends NetworkError { constructor(message: string, response: any); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; stack?: string; getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; } ``` **Source:** [src/errors/not_found.ts:10](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/not_found.ts#L10) ### `new NotFoundError(message, response)` ```ts constructor(message: string, response: any); ``` **Parameters** - **`message`** — `string` (required) - **`response`** — `any` (required) **Source:** [src/errors/network.ts:29](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L29) ### `NotFoundError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `NotFoundError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `NotFoundError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `notFoundError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `notFoundError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `notFoundError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `notFoundError.response` Response details, received from the Horizon server. ```ts response: { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Source:** [src/errors/network.ts:18](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L18) ### `notFoundError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) ### `notFoundError.getResponse()` Returns the error response sent by the Horizon server. ```ts getResponse(): { data?: ErrorResponseData; status?: number; statusText?: string; url?: string }; ``` **Returns** Response details, received from the Horizon server. **Source:** [src/errors/network.ts:38](https://github.com/stellar/js-stellar-sdk/blob/main/src/errors/network.ts#L38) ## WebAuth.InvalidChallengeError InvalidChallengeError is raised when a challenge transaction does not meet the requirements for a SEP-10 challenge transaction (for example, a non-zero sequence number). ```ts class InvalidChallengeError extends Error { constructor(message?: string); static stackTraceLimit: number; static captureStackTrace(targetObject: object, constructorOpt?: Function): void; static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; cause?: unknown; message: string; name: string; stack?: string; } ``` **Source:** [src/webauth/errors.ts:8](https://github.com/stellar/js-stellar-sdk/blob/main/src/webauth/errors.ts#L8) ### `new InvalidChallengeError(message)` ```ts constructor(message?: string); ``` **Parameters** - **`message`** — `string` (optional) **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1082](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1082) ### `InvalidChallengeError.stackTraceLimit` The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. ```ts static stackTraceLimit: number; ``` **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:68](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L68) ### `InvalidChallengeError.captureStackTrace(targetObject, constructorOpt)` Creates a `.stack` property on `targetObject`, which when accessed returns a string representing the location in the code at which `Error.captureStackTrace()` was called. ```js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` ``` The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the generated stack trace. The `constructorOpt` argument is useful for hiding implementation details of error generation from the user. For instance: ```js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a(); ``` ```ts static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` **Parameters** - **`targetObject`** — `object` (required) - **`constructorOpt`** — `Function` (optional) **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:52](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L52) ### `InvalidChallengeError.prepareStackTrace(err, stackTraces)` ```ts static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` **Parameters** - **`err`** — `Error` (required) - **`stackTraces`** — `CallSite[]` (required) **See also** - https://v8.dev/docs/stack-trace-api#customizing-stack-traces **Source:** [node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts:56](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/@types+node@22.19.17/node_modules/@types/node/globals.d.ts#L56) ### `invalidChallengeError.cause` ```ts cause?: unknown; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts#L26) ### `invalidChallengeError.message` ```ts message: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1077) ### `invalidChallengeError.name` ```ts name: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1076) ### `invalidChallengeError.stack` ```ts stack?: string; ``` **Source:** [node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078](https://github.com/stellar/js-stellar-sdk/blob/main/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts#L1078) # Source: docs/reference/cross-cutting.md # Cross-cutting ## Config Global config class. ```ts class Config { constructor(); static getTimeout(): number; static isAllowHttp(): boolean; static setAllowHttp(value: boolean): void; static setDefault(): void; static setTimeout(value: number): void; } ``` **Example** ```ts import { Config } from '@stellar/stellar-sdk'; Config.setAllowHttp(true); Config.setTimeout(5000); ``` **Example** ```ts StellarSdk.Config.setAllowHttp(true); StellarSdk.Config.setTimeout(5000); ``` **Source:** [src/config.ts:39](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L39) ### `new Config()` ```ts constructor(); ``` ### `Config.getTimeout()` Returns the configured `timeout` flag. ```ts static getTimeout(): number; ``` **Returns** The timeout value. **Source:** [src/config.ts:71](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L71) ### `Config.isAllowHttp()` Returns the configured `allowHttp` flag. ```ts static isAllowHttp(): boolean; ``` **Returns** The allowHttp value. **Source:** [src/config.ts:63](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L63) ### `Config.setAllowHttp(value)` Sets `allowHttp` flag globally. When set to `true`, connections to insecure http protocol servers will be allowed. Must be set to `false` in production. ```ts static setAllowHttp(value: boolean): void; ``` **Parameters** - **`value`** — `boolean` (required) **Source:** [src/config.ts:46](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L46) ### `Config.setDefault()` Sets all global config flags to default values. ```ts static setDefault(): void; ``` **Source:** [src/config.ts:78](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L78) ### `Config.setTimeout(value)` Sets `timeout` flag globally. When set to anything besides 0, the request will timeout after specified time (ms). ```ts static setTimeout(value: number): void; ``` **Parameters** - **`value`** — `number` (required) **Source:** [src/config.ts:55](https://github.com/stellar/js-stellar-sdk/blob/main/src/config.ts#L55) ## Utils Miscellaneous utilities. ```ts class Utils { constructor(); static sleep(ms: number): Promise; static validateTimebounds(transaction: Transaction, gracePeriod: number = 0): boolean; } ``` **Source:** [src/utils.ts:7](https://github.com/stellar/js-stellar-sdk/blob/main/src/utils.ts#L7) ### `new Utils()` ```ts constructor(); ``` ### `Utils.sleep(ms)` ```ts static sleep(ms: number): Promise; ``` **Parameters** - **`ms`** — `number` (required) **Source:** [src/utils.ts:34](https://github.com/stellar/js-stellar-sdk/blob/main/src/utils.ts#L34) ### `Utils.validateTimebounds(transaction, gracePeriod)` Verifies if the current date is within the transaction's timebounds ```ts static validateTimebounds(transaction: Transaction, gracePeriod: number = 0): boolean; ``` **Parameters** - **`transaction`** — `Transaction` (required) — The transaction whose timebounds will be validated. - **`gracePeriod`** — `number` (optional) (default: `0`) — (optional) An additional window of time that should be considered valid on either end of the transaction's time range. **Returns** Returns true if the current time is within the transaction's [minTime, maxTime] range. **Source:** [src/utils.ts:17](https://github.com/stellar/js-stellar-sdk/blob/main/src/utils.ts#L17) # Source: docs/agents.md # AI Agents This SDK publishes its documentation in formats designed for AI agents. There are three independent surfaces; pick whichever matches your workflow. ## llms.txt bundles Structured bundles of the entire docs corpus, served at the site root: - [`llms.txt`](../llms.txt) — index of every guide and reference page, one entry per page, with each entry's `description` field sourced from the page's frontmatter. Use this as a routing map: pick the page most relevant to your task, then fetch it directly. - [`llms-full.txt`](../llms-full.txt) — the full corpus concatenated as one prose stream, with frontmatter blocks stripped and replaced by per-page `# Source: ` headings. Ingest as a single document when you want the whole API surface in one shot. Links inside `llms.txt` are bundle-relative, so they resolve correctly no matter what host or base path the bundle is served from. ## Raw markdown siblings Every rendered docs page has a `.md` sibling at the same URL with `.md` appended. For example: | HTML page | Raw markdown | | --- | --- | | `…/guides/01-getting-started/` | `…/guides/01-getting-started.md` | | `…/reference/core-keys/` | `…/reference/core-keys.md` | Agents that prefer parsing markdown directly (instead of stripping HTML or fetching the full bundle) can fetch any page's source by appending `.md` to its URL. Frontmatter is preserved. ## Crawler policy (robots.txt) The site's [`robots.txt`](../robots.txt) declares an open policy via [Cloudflare Content Signals](https://blog.cloudflare.com/content-signals-policy/): `search`, `ai-input`, and `ai-train` are all permitted. Per-bot `Allow` rules are emitted for every major AI crawler so the policy is auditable on inspection. The full bot list and the policy values are kept in [`config/site.ts`](https://github.com/stellar/js-stellar-sdk/blob/master/config/site.ts); edit that file and rebuild to change either. ## Refresh cadence All three surfaces (bundles, `.md` siblings, robots.txt) are regenerated on every release deploy. They reflect the **current SDK major** only — older majors are not bundled (see [Versioning and compatibility](/js-stellar-sdk/#versioning-and-compatibility) for the rationale). The current SDK version is **15.0.1**, sourced from `package.json#version` at build time. ## Intentionally not implemented A few emerging agent-readiness conventions don't apply to a JavaScript SDK documentation site and are deliberately not published here. This list is explicit so an agent (or an automated audit tool) can distinguish "deliberately absent" from "forgotten": - **API Catalog ([RFC 9727](https://www.rfc-editor.org/rfc/rfc9727))** is for domains that host HTTP APIs. This site documents a JS library; the underlying Stellar network APIs (Horizon, Soroban RPC) are owned by the Stellar Development Foundation and live at [developers.stellar.org](https://developers.stellar.org). - **MCP Server Card, WebMCP, and Agent Skills** are for sites that expose Model Context Protocol servers or agent-callable skills. We don't host either — the SDK is consumed via `npm install`. - **OAuth discovery endpoints** ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414), [RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)) — no auth surface to advertise. - **Agent Card / A2A** — no agent-to-agent protocol exposed. - **Commerce protocols (x402, MPP, UCP, ACP)** — not a commerce site. If the SDK ever ships an MCP server, agent skill bundle, or HTTP API of its own, the relevant entries here would change. # Source: CHANGELOG.md # Changelog A breaking change will get clearly marked in this log. ## Unreleased ## v16.0.0-rc.1 There are a few major updates in this release: - JS Stellar Base (`@stellar/stellar-base`) was rewritten in TypeScript, which provides proper type definitions and fixes inconsistencies caused by manual type declarations. ([#1399]) - JS Stellar Base is now merged into the JS Stellar SDK. Everything lives in one place now. ([#1399]) - The JS SDK now has better tree-shaking, which should result in a lighter bundle size. ([#1397]) - Protocol 27 support: the XDR was regenerated for CAP-71, and the Soroban authorization helpers now build and sign the new address-bound (`SOROBAN_CREDENTIALS_ADDRESS_V2`) and delegated (`SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES`) credential types. ([#1429]) ### 1. Breaking Changes These break code, builds, or installs until you change something. #### Install & runtime - **Drop `@stellar/stellar-base` from your dependencies** if you were importing it manually. It is now bundled into `@stellar/stellar-sdk`. Remove the package and switch all imports from `@stellar/stellar-base` to `@stellar/stellar-sdk`. ([#1399]) - **Upgrade to Node 22 or later.** `engines.node` is now `>=22.0.0`; CI tests against `[22, 24]`. ([#1408]) - **Stop using the default import.** `import StellarBase from '@stellar/stellar-sdk'` no longer works. Use `import * as StellarBase` or named imports. ([#1396]) - **Adjust deep `lib/` imports.** Library output paths moved: - ESM at `lib/esm/`, - CJS at `lib/cjs/`, - axios variants at `lib/axios/esm/` and `lib/axios/cjs/`, - type declarations alongside the ESM output at `lib/esm/` (e.g. `lib/esm/index.d.ts`). The `dist/` UMD bundle filenames are unchanged. ([#1397]) - **The package.json `browser` field and browser export conditions were removed.** Bundlers no longer auto-substitute the prebuilt UMD bundle for the package entry — they bundle the ESM/CJS source directly. Load the UMD build from its explicit `dist/` path if you need it. ([#1396], [#1397]) #### HTTP client - **Default HTTP client switched from axios to fetch.** If you rely on axios behavior (interceptors, adapters, regression fallback), import from the alternative entry point `@stellar/stellar-sdk/axios` instead. ([#1394]) - **The `no-eventsource` build variant is gone.** `eventsource` was upgraded to v4, which uses `fetch` internally and works in every supported runtime (Node 22+, browsers, Deno, Bun, `workerd`). Remove any `no-eventsource` build/import; the default build covers all environments. ([#1395]) - **The `/no-axios` and `/minimal` subpath exports are removed**, along with their `/contract` and `/rpc` variants. Axios is now opt-in through the `@stellar/stellar-sdk/axios` family (`/axios`, `/axios/contract`, `/axios/rpc`, and `@stellar/stellar-sdk/http-client/axios`); the minimal build no longer exists. ([#1394]) - **`Horizon.Server.serverURL` and `rpc.Server.serverURL` are now native `URL` objects** (and `readonly`) instead of `urijs` `URI` instances. Code that called urijs methods on them (`server.serverURL.protocol()`, `.clone()`, `.segment()`, `.query()`) must move to the WHATWG `URL` API (e.g. `serverURL.protocol === "https:"`, `serverURL.hostname`). ([#1402]) #### `Transaction` & `TransactionBuilder` - **`Transaction.minAccountSequenceAge` is now `bigint`.** The underlying XDR type is 64-bit; consuming code must switch from `number` to native `bigint` (the runtime value is no longer an `xdr.UnsignedHyper` object either). ([#1399]) - **`TransactionBuilder.setMinAccountSequenceAge` requires `bigint`.** Pass `60n` instead of `60`. `TransactionBuilderOptions.minAccountSequenceAge` is also `bigint`. ([#1399]) - **`Transaction.extraSigners` is now `xdr.SignerKey[]`.** It always was at runtime — only the type was wrong. Use `SignerKey.encodeSignerKey()` to get StrKey strings. ([#1399]) - **`Transaction` is no longer generic.** Remove `` parameters (e.g., `Transaction>` no longer compiles). ([#1399]) - **`Operation.isValidAmount()`, `Operation.constructAmountRequirementsError()`, and `Operation.setSourceAccount()` are no longer on the runtime `Operation` class.** JavaScript callers that reached for these need to drop them — they remain only as internal helpers in `src/base/util/operations.ts`. ([#1399]) - **Revoke-sponsorship operation `type` is split into seven strings.** `"revokeSponsorship"` is replaced by `"revokeAccountSponsorship"`, `"revokeTrustlineSponsorship"`, `"revokeOfferSponsorship"`, `"revokeDataSponsorship"`, `"revokeClaimableBalanceSponsorship"`, `"revokeLiquidityPoolSponsorship"`, `"revokeSignerSponsorship"`. The runtime always returned the specific strings; consumers that switched on `type` should update their cases. ([#1399]) #### `Asset`, `Keypair`, signing helpers - **`Asset.code` and `Asset.issuer` are now `readonly`.** Stop mutating them in place — construct a new `Asset` instead. ([#1399]) - **`Asset.issuer` is typed as `string | undefined`.** Native assets have no issuer; add nullish checks. ([#1399]) - **`FastSigning` constant removed.** Signing now goes through `@noble/ed25519` exclusively — drop the import. ([#1401]) - **`TransactionI` removed.** Use `TransactionBase` instead. ([#1399]) - **`authorizeInvocation()` takes a single object parameter.** Switch from `authorizeInvocation(signer, validUntilLedgerSeq, invocation, publicKey, networkPassphrase)` to `authorizeInvocation({ signer, validUntilLedgerSeq, invocation, networkPassphrase, publicKey })`. ([#1399]) - **`authorizeEntry()` no longer defaults `networkPassphrase` to `Networks.FUTURENET`.** Pass the network passphrase explicitly at every call site. ([#1399]) ### 2. Should know (type-only or behavior changes that may surface) Won't fail at install. May fail at compile time, or change behavior at runtime, depending on how you use the API. #### TypeScript-only - **`CreateInvocation.token` renamed to `CreateInvocation.asset`** in the type declarations — runtime was already `.asset`. ([#1399]) - **`ScIntType` adds `'timepoint'` and `'duration'`.** Exhaustive switches on `ScIntType` need new cases. ([#1399]) - **`XdrLargeInt.getType()` returns `ScIntType | undefined`** instead of a raw lowercased string; non-integer types yield `undefined`. ([#1399]) - **`SorobanDataBuilder.fromXDR` return type corrected** to `xdr.SorobanTransactionData`. Runtime always returned this — only the type was wrong. ([#1399]) - **`SetOptions.clearFlags` / `setFlags` accept arbitrary numeric bitmasks.** The type was widened from `AuthFlag` to `AuthFlags` (`AuthFlag | (number & {})`), so you can now pass combined flag values without a cast. This is a widening — existing code keeps compiling. ([#1399]) - **`supportMuxing` parameter removed** from `decodeAddressToMuxedAccount` / `encodeMuxedAccountToAddress` type declarations. It was silently ignored at runtime. ([#1399]) #### Runtime behavior - **`Keypair.rawSecretKey()` throws on public-key-only instances** with `Error("no secret seed available")` instead of returning `undefined`. ([#1399]) - **`TransactionBase.tx` returns a defensive copy.** External mutation no longer affects the transaction that will be signed or serialized. If you were intentionally mutating `tx`, you'll need a different approach. ([#1399]) - **`TransactionBuilder` constructor preserves `0n` for `minAccountSequenceAge`** instead of coercing falsy values to `null`. This may flip `hasV2Preconditions()` to `true` when the field is set to `0n`. ([#1399]) - **`toXDRPrice` rejects more bad input earlier.** Zero/negative/`NaN`/ `Infinity` numeric prices now throw `"price must be positive"` before reaching `best_r()`. Zero denominators also rejected (`d <= 0`). ([#1399]) - **Constructor and input validation now throw where the SDK was previously lenient.** `MuxedAccount` validates uint64 IDs; `Claimant` rejects falsy destinations; `Account` rejects `NaN` sequences; `Memo` is fully immutable and throws on invalid types instead of returning `null`; `Memo.id()` rejects non-plain-digit strings; `allow_trust` throws when `authorize` is missing; `setTrustLineFlags` rejects non-boolean flag values; `Asset.getAssetType()` throws for unknown types instead of returning `"unknown"`. (`set_options` also no longer mutates the caller's signer fields.) ([#1399]) - **`TransactionBuilder` now validates and throws.** `build()` throws on total-fee overflow past `uint32` max; `cloneFrom()` throws on zero-operation inputs; the constructor rejects negative or inverted `timebounds` / `ledgerbounds`. ([#1399]) - **`Operation.setOptions()` rejects malformed numeric strings.** Flag, weight, and threshold fields (`setFlags`, `clearFlags`, `masterWeight`, the signer weight, and the `*Threshold` options) now reject values like `"123abc"` that `parseFloat()` previously accepted by reading only the leading digits. ([#1399]) - **`XdrLargeInt` / `ScInt` built from an array of limbs now decode correctly.** Passing multiple big-endian integer parts (for `i128`/`u128`/`i256`/`u256`) previously wrapped them in a nested array and produced wrong values; the limbs are now passed through correctly. ([#1399]) - **Large-integer conversions reject out-of-range / malformed input.** `nativeToScVal` bounds-checks `u32`/`i32` values and rejects non-numeric strings like `"123abc"`; `XdrLargeInt.toI128()` / `toI256()` reject unsigned values exceeding the signed range instead of silently flipping the sign bit. ([#1399]) - **`bignumber.js` upgraded to v11; v9's `DEBUG` guard replaced by `STRICT` mode.** Invalid values (non-numeric strings, unsupported types) still throw, as before. The behavior that changed: v11 dropped v9's "more than 15 significant digits" check, so a high-precision JS `number` passed as an amount or price no longer throws — it is silently rounded to floating-point precision instead. Pass such values as strings or `bigint` to avoid quiet precision loss. ([#1401]) - **`eventsource` v4 no longer swallows exceptions thrown inside stream callbacks.** A throw inside a `CallBuilder.stream()` `onmessage`/`onerror` handler now surfaces as an uncaught exception (v4's spec-compliant `EventTarget` no longer discards it); make those callbacks handle their own errors. ([#1395]) - **`authorizeInvocation()` now builds `SOROBAN_CREDENTIALS_ADDRESS_V2` credentials** instead of legacy `SOROBAN_CREDENTIALS_ADDRESS` (CAP-71-02), so the signature payload is now address-bound (`ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS`). This is transparent if you sign and submit through the SDK, but the entries it produces are only valid on protocol 27+; code that asserts on the credential type, or targets a pre-protocol-27 network, must account for the new type. ([#1429]) #### Internal-detail shifts (low likelihood of impact) - `uri.js` replaced with native `URL` / `URLSearchParams` for internal request building (the consumer-visible part is the `serverURL` type change noted under Breaking Changes → HTTP client). ([#1402]) - Root `tsconfig.json` moved from `config/tsconfig.json` to project root — matters if your tooling references the old path. ([#1401]) ### 3. Quietly improved (no caller action needed) These are robustness and correctness gains rolled up by theme. - **`nativeToScVal` robustness.** Plain-object detection, per-key type lookups, prefixed numeric inputs, and map-key sorting are more predictable. (Caller-visible new throws are listed under Should know → Runtime behavior.) ([#1399]) - **`TransactionBuilder.addSacTransferOperation` accepts muxed addresses.** Both the destination and source may now be muxed (`M...`) addresses. ([#1399]) - **`ScInt` auto-type classification fixed for negative boundary values.** `-(2^63)` is now classified as `i64`, not `i128`. (The related `toI128()` / `toI256()` range rejections are listed under Should know → Runtime behavior.) ([#1399]) - **Round-trip fidelity with `Operation.fromXDRObject`.** `changeTrust` accepts `line` as a fallback for `asset`; `manageData` accepts `undefined` for `opts.value` as a delete; `ed25519SignedPayload` signer keys are now decoded instead of throwing in the default case. ([#1399]) - **Soroban-specific fixes.** Token amount formatting, custom-contract errors, claimable-balance addresses, sorted-map comparisons, and `best_r` edge cases are more reliable. ([#1399]) - **Horizon call builders.** Asset-filtered queries (offers, order book, paths, trade aggregations) no longer emit `*_asset_code`/`*_asset_issuer` parameters for issuerless assets, avoiding `undefined` values in the outgoing request. ([#1402]) - **Misc.** `Transaction` construction avoids unnecessary copy overhead, `authorizeInvocation` has a clearer missing-`publicKey` error, and a `signHashX` error-message typo was fixed. ([#1399]) #### Newly typed / newly available (the `Added` section, summarized) `Address`, `hash`, `sign`, `verify`, `Keypair.xdrMuxedAccount(id)`, `SorobanDataBuilder`, `Memo.return()`, `revokeSignerSponsorship`, and `Operation.fromXDRObject` have more complete types or signer support. `scvSortedMap` is now exported. New type exports: `NativeToScValOpts`, `WasmCreateDetails`, and `OperationRecord`. Contract-create/upload operations now accept an `auth` array. ([#1399]) For protocol 27 / CAP-71 Soroban authorization, `authorizeEntry()` now signs the new address-bound and delegated credential types, accepts `forAddress`, and exports `buildAuthorizationEntryPreimage()`, `buildWithDelegatesEntry()`, `DelegateSignature`, and `BuildWithDelegatesParams`. ([#1429]) ### 4. Internal / FYI (no consumer-visible effect) Toolchain modernization that consumers won't notice but is worth knowing if you build the SDK from source or maintain forks. - **Build switched from Webpack + Babel to Rollup.** One `rollup.config.mjs` now produces library + UMD output, with a single `tsc` types pass. ([#1397]) - **Dual ESM + CJS package layout.** `package.json` declares `"type": "module"`; CJS output lives under `lib/cjs/`, and internal relative imports now use explicit `.js` extensions. ([#1396]) - **Dependency swaps for smaller footprint.** `randombytes` removed (randomness now comes from `crypto.getRandomValues` / `@noble/ed25519`); `sha.js` → `@noble/hashes`; `@noble/curves` Ed25519 → `@noble/ed25519`; `toml` → `smol-toml`. ([#1401]) - **`eventsource` v2 → v4.** Native `fetch` transport under the hood; the dependency contributes well under 2 KB to bundles. ([#1395]) [#1394]: https://github.com/stellar/js-stellar-sdk/pull/1394 [#1395]: https://github.com/stellar/js-stellar-sdk/pull/1395 [#1396]: https://github.com/stellar/js-stellar-sdk/pull/1396 [#1397]: https://github.com/stellar/js-stellar-sdk/pull/1397 [#1399]: https://github.com/stellar/js-stellar-sdk/pull/1399 [#1401]: https://github.com/stellar/js-stellar-sdk/pull/1401 [#1402]: https://github.com/stellar/js-stellar-sdk/pull/1402 [#1408]: https://github.com/stellar/js-stellar-sdk/pull/1408 [#1429]: https://github.com/stellar/js-stellar-sdk/pull/1429 ## [v15.1.0](https://github.com/stellar/js-stellar-sdk/compare/v15.0.1...v15.1.0) ### Fixed * Security: `FederationServer.createForDomain` and the `FederationServer` constructor now validate domains per RFC 1035, rejecting malformed domains before issuing federation or `stellar.toml` requests. Port numbers are also accepted ([#1393](https://github.com/stellar/js-stellar-sdk/pull/1393)). * `RpcServer.pollTransaction` off-by-one: the polling loop used `<` instead of `<=`, causing one fewer attempt than configured([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `requestAirdrop` error path: fixed incorrect property access (`error.response.detail` instead of `error.response.data.detail`) when checking for `createAccountAlreadyExist` ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * Operator precedence bug in `parseSuccessful`: `sim.results?.length ?? 0 > 0` was parsed as `?? (0 > 0)`, causing simulation results and state changes to never be included in the parsed response ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `Spec.typeRef` now properly handles `scSpecTypeResult` by returning the JSON schema for the `okType`, instead of silently breaking out of the switch ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `structToJsonSchema` now places `additionalProperties: false` on the schema object itself rather than incorrectly nesting it inside `properties` ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * Fixed bigint-to-U32/I32 conversion in `Spec` using `Number(val)` instead of `val as number` (a no-op for bigints) ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * Fixed missing template literal `$` in two `Spec` error messages that were not interpolated ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * WASM custom section parser: when a section was skipped (invalid name length), the offset was not advanced, causing an infinite loop or incorrect parsing of subsequent sections ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `FederationServer` URL mutation: `resolveAddress`, `resolveAccountId`, and `resolveTransactionId` mutated the shared `serverURL` by appending query params on each call. Fixed by cloning the URL before modifying ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `CallBuilder.stream()` URL mutation: `stream()` mutated the shared `this.url` by adding query params, corrupting the builder for subsequent calls. Fixed by cloning the URL ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `AssembledTransaction` restore path: when `buildWithOp` was used and automatic state restoration was needed, the rebuild incorrectly reconstructed the operation via `contract.call()` instead of reusing the original operation ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `SERVER_TIME_MAP` port collision: the Horizon time-sync cache keyed entries by hostname only, so two servers on different ports of the same host shared a cache entry. Fixed by including the port in the key ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `Spec.funcResToNative` now correctly returns an `Err` instance when a contract function with a `Result` return type returns an error, instead of throwing while decoding it as the `Ok` type ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * SEP-10: `verifyChallengeTxSigners` now rejects challenges signed only by the server and `client_domain` key with no actual client signer, instead of returning an empty signers list ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). * `getAssetBalance` used incorrect flag bitmask constants (`AuthRequiredFlag`, `AuthRevocableFlag`, `AuthClawbackEnabledFlag`) which are account-level flags, not trustline-level flags. Replaced with the correct trustline flag bitmasks (`0x1`, `0x2`, `0x4`) ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). * `AssembledTransaction.simulate` did not clear `this.built` before re-simulating after a state restoration rebuild, causing it to assemble stale transaction data ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). * `AssembledTransaction.signAndSend` mutated the shared `this.options.submit` flag to prevent double submission. Replaced with a wrapper around `signTransaction` that injects `submit: false` without mutating shared state ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). * Fetch HTTP client: async request interceptors were not awaited — the synchronous `try/catch` loop passed unresolved promise objects as the config. Replaced with a proper `.then()` chain matching Axios interceptor semantics ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). * Fetch HTTP client: cancellation now preserves custom cancel reasons and `isCancel` no longer depends on exact error-message text ([#1390](https://github.com/stellar/js-stellar-sdk/pull/1390)). * Fetch HTTP client: instance default headers and params now merge correctly with per-request overrides on the no-axios / minimal builds, including requests that use bounded options ([#1390](https://github.com/stellar/js-stellar-sdk/pull/1390)). * Fetch HTTP client: `maxRedirects` and `maxContentLength` were silently ignored on the no-axios / minimal builds, turning SDK-set SSRF and DoS guards (`StellarToml.Resolver.resolve`, `FederationServer`) into no-ops. A new bounded adapter activates when either option is set, refusing redirects past `maxRedirects` and streaming the response body with a running-total check so oversized responses abort mid-stream ([#1390](https://github.com/stellar/js-stellar-sdk/pull/1390)). * Fetch HTTP client: the no-axios bounded path now more closely matches Axios behavior for object request bodies, `baseURL`, timeout errors, redirect method/body handling, and stripping credential-bearing headers on cross-origin redirects ([#1390](https://github.com/stellar/js-stellar-sdk/pull/1390)). * `src/bindings/config.ts` imported `../../package.json` with a relative path that resolved incorrectly for the `lib/no-axios/` and `lib/minimal/` build outputs, making those libs unloadable. Replaced with the `__PACKAGE_VERSION__` compile-time define ([#1390](https://github.com/stellar/js-stellar-sdk/pull/1390)). * Updated the production `axios` dependency from `1.14.0` to `1.15.0` ([#1381](https://github.com/stellar/js-stellar-sdk/pull/1381)). ### Added * `AccountResponse` constructor now uses explicit field-by-field assignment instead of `Object.entries` dynamic assignment for type safety ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * Added `transactions` collection to `Api.AccountRecord` and `AccountResponse` ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * Added range checks for U32/I32 values in `Spec`: bigint values are now validated against min/max bounds before conversion, throwing a `RangeError` instead of silently truncating ([#1373](https://github.com/stellar/js-stellar-sdk/pull/1373)). * `rpc.Server.getLatestLedger()` now includes `closeTime`, `headerXdr`, and `metadataXdr` in the typed response, with `headerXdr`/`metadataXdr` parsed into XDR objects instead of raw base64 strings ([#1389](https://github.com/stellar/js-stellar-sdk/pull/1389)). ### Deprecated * `BalanceResponse.revocable` is deprecated in favor of `authorizedToMaintainLiabilities`, which correctly reflects the trustline flag semantics ([#1372](https://github.com/stellar/js-stellar-sdk/pull/1372)). ## [v15.0.1](https://github.com/stellar/js-stellar-sdk/compare/v15.0.0...v15.0.1) ### Fixed * Pin axios to a specific version. ## [v15.0.0](https://github.com/stellar/js-stellar-sdk/compare/v14.6.1...v15.0.0) ### Breaking Changes * XDR has been upgraded to support **Protocol 26**, please refer to the [`@stellar/stellar-base`](https://github.com/stellar/js-stellar-base/releases/tag/v15.0.0) release notes for details and other breaking changes. ### Fixed * Sanitize identifiers and escape string literals in generated TypeScript bindings to prevent code injection via malicious contract spec names. `sanitizeIdentifier` now strips non-identifier characters, and a new `escapeStringLiteral` helper escapes quotes and newlines in string contexts ([#1345](https://github.com/stellar/js-stellar-sdk/pull/1345)). * `AssembledTransaction.fromXDR()` and `fromJSON()` now validate that the deserialized transaction targets the expected contract, rejecting mismatched contract IDs and non-invokeContract operations. ([#1349](https://github.com/stellar/js-stellar-sdk/pull/1349)). ## [v14.6.1](https://github.com/stellar/js-stellar-sdk/compare/v14.6.0...v14.6.1) ### Fixed * Fix `assembleTransaction` double-counting the resource fee when the input transaction already has Soroban data attached (e.g. when re-assembling a previously simulated transaction) ([#1343](https://github.com/stellar/js-stellar-sdk/pull/1343)). * Removed adding `resourceFee` in `assembleTransaction` as it's now handled by `TransactionBuilder.build()` ([#1343](https://github.com/stellar/js-stellar-sdk/pull/1343)). ## [v14.6.0](https://github.com/stellar/js-stellar-sdk/compare/v14.5.0...v14.6.0) ### Added * Upgraded underlying `@stellar/stellar-base` library to include its new features and fixes ([release notes](https://github.com/stellar/js-stellar-base/releases/tag/v14.1.0)). ## [v14.5.0](https://github.com/stellar/js-stellar-sdk/compare/v14.4.3...v14.5.0) ### Added * Introduced CLI functionality for generating smart contract bindings ([#1287](https://github.com/stellar/js-stellar-sdk/pull/1287)). * Added `BindingGeneration` class for parsing contract specs into fully typed TypeScript libraries for calling contract methods ([#1287](https://github.com/stellar/js-stellar-sdk/pull/1287)). * Introduced `rpc.Server.fundAddress` that supports funding contract and account addresses via Friendbot ([#1314](https://github.com/stellar/js-stellar-sdk/pull/1314)). * Updated the `StellarToml` interface with SEP 45 fields `WEB_AUTH_FOR_CONTRACTS_ENDPOINT` and `WEB_AUTH_CONTRACT_ID` ([#1326](https://github.com/stellar/js-stellar-sdk/pull/1326)). ### Fixed * X-App-Name and X-App-Version headers are now included when using `CallBuilder.stream()` ([#1317](https://github.com/stellar/js-stellar-sdk/pull/1317)). * `CallBuilder` now correctly uses the configured server URL for all requests, including pagination and linked resources. Previously, URLs returned by Horizon in `_links` would bypass reverse proxies ([#1318](https://github.com/stellar/js-stellar-sdk/pull/1318)). ### Deprecated * `rpc.Server.requestAirdrop` is deprecated in favor of `rpc.Server.fundAddress` ([#1314](https://github.com/stellar/js-stellar-sdk/pull/1314)). ## [v14.4.3](https://github.com/stellar/js-stellar-sdk/compare/v14.4.2...v14.4.3) ### Fixed * Upgraded underlying `@stellar/stellar-base` library to include its fixes ([release notes](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.4)). ## [v14.4.2](https://github.com/stellar/js-stellar-sdk/compare/v14.4.1...v14.4.2) ### Fixed * Fixed package installation for Windows environments ([#1306](https://github.com/stellar/js-stellar-sdk/pull/1306)) ## [v14.4.1](https://github.com/stellar/js-stellar-sdk/compare/v14.4.0...v14.4.1) ### Fixed * Set `Api.GetEventsRequest.endLedger` to be optional to align with RPC behavior ([#1304](https://github.com/stellar/js-stellar-sdk/pull/1304/)) * Added back `Typepoint` and marked it _deprecated_ in favor of `Timepoint` ([#1303](https://github.com/stellar/js-stellar-sdk/pull/1303)) ## [v14.4.0](https://github.com/stellar/js-stellar-sdk/compare/v14.3.3...v14.4.0) ### Added * Introduced an `rpc.Server.getAssetBalance()` helper to fetch asset balances both for contracts and accounts ([#1286](https://github.com/stellar/js-stellar-sdk/pull/1286/)). * `rpc.Api.BalanceResponse` now can include a `revocable` field in its `balanceEntry` for when trustlines are fetched ([#1286](https://github.com/stellar/js-stellar-sdk/pull/1286/)). * Added Timepoint and Duration support to `Spec` ([#1288](https://github.com/stellar/js-stellar-sdk/pull/1288)) * `Api.GetHealthResponse` interface now includes `latestLedger`, `ledgerRetentionWindow`, and `oldestLedger` fields ([#1297](https://github.com/stellar/js-stellar-sdk/pull/1297)). * Added `publicKey`, `signTransaction`, and `signAuthEntry` as optional fields to `contract.MethodOptions` ([#1293](https://github.com/stellar/js-stellar-sdk/pull/1293)). ### Fixed * `Api.RawEventResponse.topics` is now optional to reflect topicless events ([#1292](https://github.com/stellar/js-stellar-sdk/pull/1292)). * `parseRawEvents` correctly checks if `Api.RawEventResponse.topics` is undefined ([#1292](https://github.com/stellar/js-stellar-sdk/pull/1292)). * Remove `WebAssembly` usage in favor of manual wasm parsing ([#1300](https://github.com/stellar/js-stellar-sdk/pull/1300)). * Fixed URL contamination in `Horizon.Server` methods ([#1296](https://github.com/stellar/js-stellar-sdk/pull/1296)). ## [v14.3.3](https://github.com/stellar/js-stellar-sdk/compare/v14.3.2...v14.3.3) ### Added * `Spec.nativeToScVal` supports parsing Muxed Address([#1274](https://github.com/stellar/js-stellar-sdk/pull/1274)), ## [v14.3.2](https://github.com/stellar/js-stellar-sdk/compare/v14.3.1...v14.3.2) ### Added * `AssembledTransaction.sign()` throws an error if `publicKey` was not provided when instantiated ([#1269](https://github.com/stellar/js-stellar-sdk/pull/1269)). ## [v14.3.1](https://github.com/stellar/js-stellar-sdk/compare/v14.3.0...v14.3.1) ### Added * Added optional `server: rpc.Server` field to `ClientOption` for HttpClient reuse. ([#1234](https://github.com/stellar/js-stellar-sdk/pull/1234)). ### Fixed * Replaced global `HttpClient` with per-instance clients in `horizon.Server` and `rpc.Server` to prevent cross-instance header contamination ([#1234](https://github.com/stellar/js-stellar-sdk/pull/1234)). ## [v14.3.0](https://github.com/stellar/js-stellar-sdk/compare/v14.2.0...v14.3.0) ### Added * `Spec.scValToNative` now supports parsing `Option`s ([#1228](https://github.com/stellar/js-stellar-sdk/pull/1228)). * Added `getLedgers` method to `rpc.Server` for retreiving ledger data. ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)). ### Fixed * `Spec.scValToNative` returns `null` for `void`s or `Option`als instead of the ambiguous `undefined` ([#1228](https://github.com/stellar/js-stellar-sdk/pull/1228)). * The `getEvents` API now requires either a start and end ledger or a cursor to be provided ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)). ### Deprecated * `GetEventsRequest` interface moved from `server.ts` to `api.ts` ([#1231](https://github.com/stellar/js-stellar-sdk/pull/1231)). ## [v14.2.0](https://github.com/stellar/js-stellar-sdk/compare/v14.1.1...v14.2.0) ### Added * `rpc.Server` now includes `getAccountEntry`, `getTrustlineEntry`, and `getClaimableBalance` methods to facilitate retrieving those entries without manually constructing the ledger keys ([#1218](https://github.com/stellar/js-stellar-sdk/pull/1218), [#1221](https://github.com/stellar/js-stellar-sdk/pull/1221)). ### Fixed * The `getTransactions` API no longer requires `startLedger` when providing `cursor` because they are mutually exclusive ([#1192](https://github.com/stellar/js-stellar-sdk/pull/1192)). * Updated `@stellar/stellar-base` to latest patch (see its [release notes](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.1), [#1221](https://github.com/stellar/js-stellar-sdk/pull/1221)). ## [v14.1.1](https://github.com/stellar/js-stellar-sdk/compare/v14.1.0...v14.1.1) ### Fixed * Added missing `transactionIndex` and `operationIndex` to `getEvents` return schema ([#1206](https://github.com/stellar/js-stellar-sdk/pull/1206)). * Remove previously-deprecated and now-removed `pagingToken` from `getEvents` (use `id` instead or the top-level `cursor`, depending on pagination needs) ([#1207](https://github.com/stellar/js-stellar-sdk/pull/1207)). ## [v14.1.0](https://github.com/stellar/js-stellar-sdk/compare/v14.0.0...v14.1.0) ### Added * Add support to `new contract.Spec(...)` for constructing from a stream of `ScSpecEntry` XDR entries (base64, or binary) ([#1198](https://github.com/stellar/js-stellar-sdk/pull/1198)). * Add `contract.Spec.fromWasm(wasmFile)` for extracting contract spec from contract Wasm files. ([#1198](https://github.com/stellar/js-stellar-sdk/pull/1198)). ## [v14.0.0](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0) ### Breaking Changes * **This package requires Node 20.** * XDR has been upgraded to support **Protocol 23**, please refer to the [`@stellar/stellar-base`](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.0-rc.1) release notes for details and other breaking changes. * Removes the defunct `destination_muxed_id_type` field for Horizon balance changes ([#1187](https://github.com/stellar/js-stellar-sdk/pull/1187)). ### Added * The Horizon API's `BalanceChange` object for operations now optionally has details about muxed information if the invocation involved a muxed destination address: ```typescript export type MuxedIdType = "uint64" | "string" | "bytes"; export interface BalanceChange { // ... destination_muxed_id_type?: MuxedIdType; destination_muxed_id?: string; } ``` * The RPC server's `getTransaction` and `getTransactions` responses now include a top-level `events` object containing a disjoint breakdown of the events: ```typescript export interface TransactionEvents { transactionEventsXdr: xdr.TransactionEvent[]; contractEventsXdr: xdr.ContractEvent[][]; } ``` * The RPC server's `getEvents` now includes retention state information: ```typescript export interface GetEventsResponse { // ... oldestLedger: number; latestLedgerCloseTime: string; oldestLedgerCloseTime: string; } ``` * The RPC server's `simulateTransaction` method now includes an optional `authMode` parameter to specify the type of authorization to simulate: ```typescript export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot"; ``` * `AssembledTransaction#signAndSend` now takes a `watcher` argument ([#1174](https://github.com/stellar/js-stellar-sdk/pull/1174)). This `watcher` is an abstract class with two optional methods: - `onSubmitted`: called with the return value from the `sendTransaction` call that submits the transaction to the network for processing - `onProgress`: called with each return value of `getTransaction` that checks on the ongoing status of the transaction For example, a `watcher` like this: ```typescript await tx.signAndSend({ watcher: { onSubmitted: ({ status, hash, latestLedger }) => { console.log({ status, hash, latestLedger }); }, onProgress: ({ status, txHash, latestLedger }) => { console.log({ status, txHash, latestLedger }); } }}); ``` ...will result in output like: ``` { status: 'PENDING', hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'NOT_FOUND', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'SUCCESS', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25077 } ``` ### Fixed * Fixed type for Horizon streaming endpoints, namely `EventSourceOptions.onmessage` now extends `CollectionPage` ([#1100](https://github.com/stellar/js-stellar-sdk/pull/1100)). * Fix the issue of transaction submission failure in a no axios environment ([#1176](https://github.com/stellar/js-stellar-sdk/pull/1176)). ## [v14.0.0-rc.3](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0-rc.3) ### Fixed * Fixes a bug in `Rpc.Server.getTransaction` where either `transactionEventsXdr` and/or `contractEventsXdr` may not be present in the new `events` field. ## [v14.0.0-rc.2](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0-rc.2) ### Breaking Changes * The RPC server's `getTransaction` and `getTransactions` responses have dropped the `events.diagnosticEventsXdr` field ([#1183](https://github.com/stellar/js-stellar-sdk/pull/1183)): ```diff export interface TransactionEvents { - diagnosticEventsXdr: xdr.DiagnosticEvent[]; transactionEventsXdr: xdr.TransactionEvent[]; } ``` ### Fixed * Fixed type for Horizon streaming endpoints, namely `EventSourceOptions.onmessage` now extends `CollectionPage` ([#1100](https://github.com/stellar/js-stellar-sdk/pull/1100)). ## [v14.0.0-rc.1](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v14.0.0-rc.1) ### Breaking Changes * **This package requires Node 20.** * XDR has been upgraded to support **Protocol 23**, please refer to the [`@stellar/stellar-base`](https://github.com/stellar/js-stellar-base/releases/tag/v14.0.0-rc.1) release notes for details and other breaking changes. * **Deprecated**: `getTransaction` and `getTransactions` top-level `diagnosticEventsXdr` field. ### Added * The Horizon API's `BalanceChange` object for operations now optionally has details about muxed information if the invocation involved a muxed destination address: ```typescript export type MuxedIdType = "uint64" | "string" | "bytes"; export interface BalanceChange { // ... destination_muxed_id_type?: MuxedIdType; destination_muxed_id?: string; } ``` * The RPC server's `getTransaction` and `getTransactions` responses now include a top-level `events` object containing a disjoint breakdown of the events: ```typescript export interface TransactionEvents { diagnosticEventsXdr: xdr.DiagnosticEvent[]; transactionEventsXdr: xdr.TransactionEvent[]; contractEventsXdr: xdr.ContractEvent[][]; } ``` * The RPC server's `getEvents` now includes retention state information: ```typescript export interface GetEventsResponse { // ... oldestLedger: number; latestLedgerCloseTime: string; oldestLedgerCloseTime: string; } ``` * The RPC server's `simulateTransaction` method now includes an optional `authMode` parameter to specify the type of authorization to simulate: ```typescript export type SimulationAuthMode = "enforce" | "record" | "record_allow_nonroot"; ``` * `AssembledTransaction#signAndSend` now takes a `watcher` argument ([#1174](https://github.com/stellar/js-stellar-sdk/pull/1174)). This `watcher` is an abstract class with two optional methods: - `onSubmitted`: called with the return value from the `sendTransaction` call that submits the transaction to the network for processing - `onProgress`: called with each return value of `getTransaction` that checks on the ongoing status of the transaction For example, a `watcher` like this: ```ts await tx.signAndSend({ watcher: { onSubmitted: ({ status, hash, latestLedger }) => { console.log({ status, hash, latestLedger }); }, onProgress: ({ status, txHash, latestLedger }) => { console.log({ status, txHash, latestLedger }); } }}); ``` ...will result in output like: ``` { status: 'PENDING', hash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'NOT_FOUND', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25076 } { status: 'SUCCESS', txHash: '8239a5c6a3248966291a202bab2ba393dabc872947b5ee4224921b071850b021', latestLedger: 25077 } ``` ### Fixed * Fix the issue of transaction submission failure in a no axios environment ([#1176](https://github.com/stellar/js-stellar-sdk/pull/1176)). ## [v13.3.0](https://github.com/stellar/js-stellar-sdk/compare/v13.2.0...v13.3.0) ### Added * Add `includeFailed` to `PaymentCallBuilder` for including failed transactions in calls ([#1168](https://github.com/stellar/js-stellar-sdk/pull/1168)). ### Fixed * Ensure that `rpc.Api.GetTransactionsResponse.transactions` is always a valid array ([#1162](https://github.com/stellar/js-stellar-sdk/pull/1162)). ## [v13.2.0](https://github.com/stellar/js-stellar-sdk/compare/v13.1.0...v13.2.0) ### Added * Support passing in an optional `options.address` to the `contract.Client.deploy` method ([#1158](https://github.com/stellar/js-stellar-sdk/pull/1158)). ### Fixed * Extend support for parsing contract specifications in environments that don't have WebAssembly compilers ([#1157](https://github.com/stellar/js-stellar-sdk/pull/1157)). * Upgraded `@stellar/stellar-base` dependency to latest version ([#1159](https://github.com/stellar/js-stellar-sdk/pull/1159)). ## [v13.1.0](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0...v13.1.0) ### Added * Added `Horizon.Server.root` to obtain information from the Horizon root endpoint ([#1122](https://github.com/stellar/js-stellar-sdk/pull/1122/)). ### Fixed * When using a friendbot that points to a Horizon instance that has ledger metadata disabled, you can no longer extract the account sequence from the response. Instead, we hit RPC directly ([#1107](https://github.com/stellar/js-stellar-sdk/pull/1107/)). * `rpc.Server.getEvents()` now correctly returns the `cursor` field at the top-level response ([#1124](https://github.com/stellar/js-stellar-sdk/pull/1124)). ## [v13.0.0](https://github.com/stellar/js-stellar-sdk/compare/v12.3.0...v13.0.0) This is a direct re-tag of rc.2 with the only change being an upgrade to the `stellar-base` library to incorporate a patch release. Nonetheless, the entire changelog from the prior major version here is replicated for a comprehensive view on what's broken, added, and fixed. ### Breaking Changes - We stopped supporting Node 18 explicitly a while ago, but now the Babelification of the codebase will transform to Node 18 instead of 16. #### TypeScript Bindings: the `contract` module. - `contract.AssembledTransaction#signAuthEntries` now takes an `address` instead of a `publicKey`. This brings the API more inline with its actual functionality: It can be used to sign all the auth entries for a particular _address_, whether that is the address of an account (public key) or a contract. ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)). - The `ClientOptions.signTransaction` type has been updated to reflect the latest [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which matches the latest major version of Freighter and other wallets. It now accepts `address`, `submit`, and `submitUrl` options, and it returns a promise containing the `signedTxXdr` and the `signerAddress`. It now also returns an `Error` type if an error occurs during signing. * `basicNodeSigner` has been updated to reflect this new type. - `ClientOptions.signAuthEntry` type has been updated to reflect the [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which returns a promise containing the `signerAddress` in addition to the `signAuthEntry` that was returned previously. It also can return an `Error` type. - `SentTransaction.init` and `new SentTransaction` now take _one_ (1) argument instead of _two_ (2). The first argument had previously been deprecated and ignored. To update: ```diff -SentTransaction(nonsense, realStuff) +SentTransaction(realStuff) -new SentTransaction(nonsense, realStuff) +new SentTransaction(realStuff) ``` #### Server APIs: the `rpc` and `Horizon` modules. - Deprecated RPC APIs have been removed ([#1084](https://github.com/stellar/js-stellar-sdk/pull/1084)): * `simulateTransaction`'s `cost` field is removed * `rpc.Server.getEvents`'s `pagingToken` field is deprecated, use `cursor` instead - Deprecated Horizon APIs have been removed (deprecated since [v10.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v10.0.1), []()): * removed fields `transaction_count`, `base_fee`, and `base_reserve` * removed fields `num_accounts` and `amount` from assets - The `SorobanRpc` import, previously deprecated, has been removed. You can import `rpc` instead: ```diff -import { SorobanRpc } from '@stellar/stellar-sdk' +import { rpc } from '@stellar/stellar-sdk' // alternatively, you can also import from the `rpc` entrypoint: import { Server } from '@stellar/stellar-sdk/rpc' ``` ### Added #### TypeScript Bindings: the `contract` module. * `contract.Client` now has a static `deploy` method that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's `__constructor` method in accordance with [CAP-42](https://stellar.org/protocol/cap-42) ([#1086](https://github.com/stellar/js-stellar-sdk/pull/1086/)). For example, using the `increment` test contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45: ```typescript const tx = await contract.Client.deploy( { counter: 42 }, { networkPassphrase, rpcUrl, wasmHash: uploadedWasmHash, publicKey: someKeypair.publicKey(), ...basicNodeSigner(someKeypair, networkPassphrase), }, ); const { result: client } = await tx.signAndSend(); const t = await client.get(); expect(t.result, 42); ``` * `contract.AssembledTransaction#signAuthEntries` now allows you to override `authorizeEntry`. This can be used to streamline novel workflows using cross-contract auth. ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)). #### Server modules: the `rpc`, `Horizon`, and `stellartoml` modules. * `Horizon.ServerApi` now has an `EffectType` exported so that you can compare and infer effect types directly ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)). * `Horizon.ServerApi.Trade` type now has a `type_i` field for type inference ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)). * All effects now expose their type as an exact string ([#947](https://github.com/stellar/js-stellar-sdk/pull/947)). * `stellartoml.Resolver.resolve` now has a `allowedRedirects` option to configure the number of allowed redirects to follow when resolving a stellar toml file. * `rpc.Server.getEvents` now returns a `cursor` field that matches `pagingToken` and `id` * `rpc.Server.getTransactions` now returns a `txHash` field * `rpc.Server` has two new methods: - `pollTransaction` to retry transaction retrieval ([#1092]https://github.com/stellar/js-stellar-sdk/pull/1092), and - `getSACBalance` to fetch the balance of a built-in Stellar Asset Contract token held by a contract ([#1046](https://github.com/stellar/js-stellar-sdk/pull/1046)), returning this schema: ```typescript export interface BalanceResponse { latestLedger: number; /** present only on success, otherwise request malformed or no balance */ balanceEntry?: { /** a 64-bit integer */ amount: string; authorized: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; }; } ``` #### New bundles without dependencies - You can now build the browser bundle without various dependencies: * Set `USE_AXIOS=false` to build without the `axios` dependency: this will build `stellar-sdk-no-axios.js` and `stellar-sdk-no-axios.min.js` in the `dist/` directory, or just run `yarn build:browser:no-axios` to generate these files. * You can import Node packages without the `axios` dependency via `@stellar/stellar-sdk/no-axios`. For Node environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-axios/index`. * Set `USE_EVENTSOURCE=false` to build without the `eventsource` dependency: this will build `stellar-sdk-no-eventsource.js` and `stellar-sdk-no-eventsource.min.js` in the `dist/` directory, or just run `yarn build:browser:no-eventsource` to generate these files. * You can import Node packages without the `eventsource` dependency via `@stellar/stellar-sdk/no-eventsource`. For Node.js environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-eventsource/index`. * To use a minimal build without both Axios and EventSource, use `stellar-sdk-minimal.js` for the browser build and import from `@stellar/stellar-sdk/minimal` for the Node package. ### Fixed - `contract.AssembledTransaction#nonInvokerSigningBy` now correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error. `sign` will ignore these contract addresses, since auth happens via cross-contract call ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)). - `buildInvocationTree` now correctly handles V2 contract creation and displays constructor args ([js-stellar-base#785](https://github.com/stellar/js-stellar-base/pull/785)). ## [v13.0.0-rc.2](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0-rc.1...v13.0.0-rc.2) ### Breaking Changes - The `ClientOptions.signTransaction` type has been updated to reflect the latest [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which matches the latest major version of Freighter and other wallets. It now accepts `address`, `submit`, and `submitUrl` options, and it returns a promise containing the `signedTxXdr` and the `signerAddress`. It now also returns an `Error` type if an error occurs during signing. * `basicNodeSigner` has been updated to reflect the new type. - `ClientOptions.signAuthEntry` type has also been updated to reflect the [SEP-43](https://stellar.org/protocol/sep-43#wallet-interface-format) protocol, which also returns a promise containing the `signerAddress` in addition to the `signAuthEntry` that was returned previously. It also can return an `Error` type. ### Added * `contract.Client` now has a static `deploy` method that can be used to deploy a contract instance from an existing uploaded/"installed" Wasm hash. The first arguments to this method are the arguments for the contract's `__constructor` method in accordance with CAP-42 ([#1086](https://github.com/stellar/js-stellar-sdk/pull/1086/)). For example, using the `increment` test contract as modified in https://github.com/stellar/soroban-test-examples/pull/2/files#diff-8734809100be3803c3ce38064730b4578074d7c2dc5fb7c05ca802b2248b18afR10-R45: ```typescript const tx = await contract.Client.deploy( { counter: 42 }, { networkPassphrase, rpcUrl, wasmHash: uploadedWasmHash, publicKey: someKeypair.publicKey(), ...basicNodeSigner(someKeypair, networkPassphrase), }, ); const { result: client } = await tx.signAndSend(); const t = await client.get(); expect(t.result, 42); ``` * `Horizon.ServerApi` now has an `EffectType` exported so that you can compare and infer effect types directly ([#1099](https://github.com/stellar/js-stellar-sdk/pull/1099)). * `Horizon.ServerApi.Trade` type now has a `type_i` field for type inference. * All effects now expose their type as an exact string ([#947](https://github.com/stellar/js-stellar-sdk/pull/947)). * `stellartoml-Resolver.resolve` now has a `allowedRedirects` option to configure the number of allowed redirects to follow when resolving a stellar toml file. ## [v13.0.0-rc.1](https://github.com/stellar/js-stellar-sdk/compare/v13.0.0-beta.1...v13.0.0-rc.1) ### Breaking Changes - Deprecated RPC APIs have been removed ([#1084](https://github.com/stellar/js-stellar-sdk/pull/1084)): * `simulateTransaction`'s `cost` field is removed * `getEvents` returns a `cursor` field that matches `pagingToken` and `id` * `getTransactions` returns a `txHash` field - Horizon Server API types: removed fields `transaction_count`, `base_fee`, and `base_reserve` (deprecated since [v10.0.1](https://github.com/stellar/js-stellar-sdk/releases/tag/v10.0.1)) - `SentTransaction.init` and `new SentTransaction` now take _one_ (1) argument instead of _two_ (2). The first argument had previously been deprecated and ignored. To update: ```diff -SentTransaction(nonsense, realStuff) +SentTransaction(realStuff) -new SentTransaction(nonsense, realStuff) +new SentTransaction(realStuff) ``` - `SorobanRpc` import, previously deprecated, has been removed. You can import `rpc` instead: ```diff -import { SorobanRpc } from '@stellar/stellar-sdk' +import { rpc } from '@stellar/stellar-sdk' ``` As an alternative, you can also import from the `rpc` entrypoint: ```ts import { Server } from '@stellar/stellar-sdk/rpc' ``` ### Added - `rpc.Server` now has a `pollTransaction` method to retry transaction retrieval ([#1092]https://github.com/stellar/js-stellar-sdk/pull/1092). ## [v13.0.0-beta.1](https://github.com/stellar/js-stellar-sdk/compare/v12.3.0...v13.0.0-beta.1) ### Breaking Changes - `contract.AssembledTransaction#signAuthEntries` now takes an `address` instead of a `publicKey`. This brings the API more inline with its actual functionality: It can be used to sign all the auth entries for a particular _address_, whether that is the address of an account (public key) or a contract. ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)). - The Node.js code will now Babelify to Node 18 instead of Node 16, but we stopped supporting Node 16 long ago so this shouldn't be a breaking change. ### Added - You can now build the browser bundle without various dependencies: * Set `USE_AXIOS=false` to build without the `axios` dependency: this will build `stellar-sdk-no-axios.js` and `stellar-sdk-no-axios.min.js` in the `dist/` directory, or just run `yarn build:browser:no-axios` to generate these files. * You can import Node packages without the `axios` dependency via `@stellar/stellar-sdk/no-axios`. For Node environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-axios/index`. * Set `USE_EVENTSOURCE=false` to build without the `eventsource` dependency: this will build `stellar-sdk-no-eventsource.js` and `stellar-sdk-no-eventsource.min.js` in the `dist/` directory, or just run `yarn build:browser:no-eventsource` to generate these files. * You can import Node packages without the `eventsource` dependency via `@stellar/stellar-sdk/no-eventsource`. For Node.js environments that don't support modern imports, use `@stellar/stellar-sdk/lib/no-eventsource/index`. * To use a minimal build without both Axios and EventSource, use `stellar-sdk-minimal.js` for the browser build and import from `@stellar/stellar-sdk/minimal` for the Node package. - `contract.AssembledTransaction#signAuthEntries` now allows you to override `authorizeEntry`. This can be used to streamline novel workflows using cross-contract auth. (#1044) - `rpc.Server` now has a `getSACBalance` helper which lets you fetch the balance of a built-in Stellar Asset Contract token held by a contract ([#1046](https://github.com/stellar/js-stellar-sdk/pull/1046)): ```typescript export interface BalanceResponse { latestLedger: number; /** present only on success, otherwise request malformed or no balance */ balanceEntry?: { /** a 64-bit integer */ amount: string; authorized: boolean; clawback: boolean; lastModifiedLedgerSeq?: number; liveUntilLedgerSeq?: number; }; } ``` ### Fixed - `contract.AssembledTransaction#nonInvokerSigningBy` now correctly returns contract addresses, in instances of cross-contract auth, rather than throwing an error. `sign` will ignore these contract addresses, since auth happens via cross-contract call ([#1044](https://github.com/stellar/js-stellar-sdk/pull/1044)). ## [v12.3.0](https://github.com/stellar/js-stellar-sdk/compare/v12.2.0...v12.3.0) ### Added - `rpc.Server` now has a `getTransactions`, which has the same response schema as `getTransactions` except with bundles of transactions ([#1037](https://github.com/stellar/js-stellar-sdk/pull/1037)). - `rpc.Server` now has a `getVersionInfo` method which reports version information of the RPC instance it is connected to ([#1028](https://github.com/stellar/js-stellar-sdk/issues/1028)): ```typescript export interface GetVersionInfoResponse { version: string; commit_hash: string; build_time_stamp: string; captive_core_version: string; protocol_version: number; } ``` ### Fixed - Lower authorization entry's default signature expiration to ~8min for security reasons ([#1023](https://github.com/stellar/js-stellar-sdk/pull/1023)). - Remove `statusText` error check to broaden compatibility ([#1001](https://github.com/stellar/js-stellar-sdk/pull/1001)). - Upgraded `stellar-base` which includes various fixes ([release notes](https://github.com/stellar/js-stellar-base/releases/tag/v12.1.1), [#1045](https://github.com/stellar/js-stellar-sdk/pull/1045)). ## [v12.2.0](https://github.com/stellar/js-stellar-sdk/compare/v12.1.0...v12.2.0) ### Fixed - `@stellar/stellar-base` and its underlying dependency `@stellar/js-xdr` have been upgraded to their latest versions; reference their release notes ([v12.1.0](https://github.com/stellar/js-stellar-base/releases/tag/v12.1.0) and [v3.1.2](https://github.com/stellar/js-xdr/releases/tag/v3.1.2), respectively) for details ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)). ### Added - You can now pass custom headers to both `rpc.Server` and `Horizon.Server` ([#1013](https://github.com/stellar/js-stellar-sdk/pull/1013)): ```typescript import { Server } from "@stellar/stellar-sdk/rpc"; const s = new Server("", { headers: { "X-Custom-Header": "hello" }}) ``` - `Horizon.Server` now supports the new `POST /transactions_async` endpoint via the `submitAsyncTransaction` method ([#989](https://github.com/stellar/js-stellar-sdk/pull/989)). Its purpose is to provide an immediate response to the submission rather than waiting for Horizon to determine its status. The response schema is as follows: ```typescript interface SubmitAsyncTransactionResponse { // the submitted transaction hash hash: string; // one of "PENDING", "DUPLICATE", "TRY_AGAIN_LATER", or "ERROR" tx_status: string; // a base64-encoded xdr.TransactionResult iff `tx_status` is "ERROR" error_result_xdr: string; } ``` - `rpc.Server` now has a `getFeeStats` method which retrieves fee statistics for a previous chunk of ledgers to provide users with a way to provide informed decisions about getting their transactions included in the following ledgers ([#998](https://github.com/stellar/js-stellar-sdk/issues/998)): ```typescript export interface GetFeeStatsResponse { sorobanInclusionFee: FeeDistribution; inclusionFee: FeeDistribution; latestLedger: number; // uint32 } interface FeeDistribution { max: string; // uint64 min: string; // uint64 mode: string; // uint64 p10: string; // uint64 p20: string; // uint64 p30: string; // uint64 p40: string; // uint64 p50: string; // uint64 p60: string; // uint64 p70: string; // uint64 p80: string; // uint64 p90: string; // uint64 p95: string; // uint64 p99: string; // uint64 transactionCount: string; // uint32 ledgerCount: number; // uint32 } ``` ## [v12.1.0](https://github.com/stellar/js-stellar-sdk/compare/v12.0.1...v12.1.0) ### Added - `contract` now exports the `DEFAULT_TIMEOUT` ([#984](https://github.com/stellar/js-stellar-sdk/pull/984)). - `contract.AssembledTransaction` now has: - `toXDR` and `fromXDR` methods for serializing the transaction to and from XDR. These methods should be used in place of `AssembledTransaction.toJSON` and `AssembledTransaction.fromJSON`for multi-auth signing. The JSON methods are now deprecated. **Note:** you must now call `simulate` on the transaction before the final `signAndSend` call after all required signatures are gathered when using the XDR methods ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)). - a `restoreFootprint` method which accepts the `restorePreamble` returned when a simulation call fails due to some contract state that has expired. When invoking a contract function, one can now set `restore` to `true` in the `MethodOptions`. When enabled, a `restoreFootprint` transaction will be created and await signing when required ([#991](https://github.com/stellar/js-stellar-sdk/pull/991)). - separate `sign` and `send` methods so that you can sign a transaction without sending it (`signAndSend` still works as before; [#922](https://github.com/stellar/js-stellar-sdk/pull/992)). - `contract.Client` now has a `txFromXDR` method which should be used in place of `txFromJSON` for multi-auth signing ([#977](https://github.com/stellar/js-stellar-sdk/pull/977)). ### Deprecated - In `contract.AssembledTransaction`, `toJSON` and `fromJSON` should be replaced with `toXDR` and `fromXDR`. - In `contract.Client`, `txFromJSON` should be replaced with `txFromXDR`. ### Fixed - If you edit an `AssembledTransaction` with `tx.raw = cloneFrom(tx.build)`, the `tx.simulationData` will now be updated correctly ([#985](https://github.com/stellar/js-stellar-sdk/pull/985)). ## [v12.0.1](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.1) - This is a re-tag of `v12.0.0-rc.3` with dependency updates and a single new feature. ### Added - `rpc.server.simulateTransaction` now supports an optional `stateChanges?: LedgerEntryChange[]` field ([#963](https://github.com/stellar/js-stellar-sdk/pull/963)): * If `Before` is omitted, it constitutes a creation, if `After` is omitted, it constitutes a deletions, note that `Before` and `After` cannot be omitted at the same time. Each item follows this schema: ```typescript interface LedgerEntryChange { type: number; key: xdr.LedgerKey; before: xdr.LedgerEntry | null; after: xdr.LedgerEntry | null; } ``` ## [v12.0.0-rc.3](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.0-rc.3) ### Breaking Changes - `ContractClient` functionality previously added in [v11.3.0](https://github.com/stellar/js-stellar-sdk/releases/tag/v11.3.0) was exported in a non-standard way. You can now import it as any other `stellar-sdk` module ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)): ```diff -import { ContractClient } from '@stellar/stellar-sdk/lib/contract_client' +import { contract } from '@stellar/stellar-sdk' +const { Client } = contract ``` Note that this top-level `contract` export is a container for ContractClient and related functionality. The `ContractClient` class is now available at `contract.Client`, as shown. Further note that there is a capitalized `Contract` export as well, which comes [from stellar-base](https://github.com/stellar/js-stellar-base/blob/b96281b9b3f94af23a913f93bdb62477f5434ccc/src/contract.js#L6-L19). You can remember which is which because capital-C `Contract` is a class, whereas lowercase-c `contract` is a container/module with a bunch of classes, functions, and types. Additionally, this is available from the `/contract` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports). Finally, some of its exports have been renamed: ```diff import { - ContractClient, + Client, AssembledTransaction, - ContractClientOptions, + ClientOptions, SentTransaction, -} from '@stellar/stellar-sdk/lib/contract_client' +} from '@stellar/stellar-sdk/contract' ``` - The `ContractSpec` class is now nested under the `contract` module, and has been **renamed** to `Spec` ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)). Alternatively, you can import this from the `contract` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports): ```diff -import { ContractSpec } from '@stellar/stellar-sdk' +import { contract } from '@stellar/stellar-sdk' +const { Spec } = contract // OR +import { Spec } from '@stellar/stellar-sdk/contract' ``` - Previously, `AssembledTransaction.signAndSend()` would return a `SentTransaction` even if the transaction was never finalized. That is, if it successfully sent the transaction to the network, but the transaction was still `status: 'PENDING'`, then it would `console.error` an error message, but return the indeterminate transaction anyhow. **It now throws** a `SentTransaction.Errors.TransactionStillPending` error with that error message instead ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)). ### Deprecated - `SorobanRpc` module is now also exported as `rpc` ([#962](https://github.com/stellar/js-stellar-sdk/pull/962)). You can import it with either name for now, but `SorobanRpc` will be removed in a future release: ```diff -import { SorobanRpc } from '@stellar/stellar-sdk' +import { rpc } from '@stellar/stellar-sdk' ``` You can also now import it at the `/rpc` entrypoint, if your version of Node [and TypeScript](https://stackoverflow.com/a/70020984/249801) support [the `exports` declaration](https://nodejs.org/api/packages.html#exports). ```diff -import { SorobanRpc } from '@stellar/stellar-sdk' -const { Api } = SorobanRpc +import { Api } from '@stellar/stellar-sdk/rpc' ``` ### Added * New methods on `contract.Client` ([#960](https://github.com/stellar/js-stellar-sdk/pull/960)): - `from(opts: ContractClientOptions)` instantiates `contract.Client` by fetching the `contractId`'s WASM from the network to fill out the client's `ContractSpec`. - `fromWasm` and `fromWasmHash` methods to instantiate a `contract.Client` when you already have the WASM bytes or hash alongside the `contract.ClientOptions`. * New methods on `rpc.Server` ([#960](https://github.com/stellar/js-stellar-sdk/pull/960)): - `getContractWasmByContractId` and `getContractWasmByHash` to retrieve a contract's WASM bytecode via its `contractId` or `wasmHash`, respectively. ### Fixed * The breaking changes above (strictly speaking, they are not breaking changes because importing from the inner guts of the SDK is not supported) enable the `contract` module to be used in non-Node environments. ## [v12.0.0-rc.2](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.0-rc.2) **This update supports Protocol 21**. It is an additive change to the protocol so there are no true backwards incompatibilities, but your software may break if you encounter new unexpected fields from this Protocol ([#949](https://github.com/stellar/js-stellar-sdk/pull/949)). ### Breaking Changes * The **default timeout for transaction calls is now set to 300 seconds (5 minutes)** from the previous default of 10 seconds. 10 seconds is often not enough time to review transactions before signing, especially in Freighter or using a hardware wallet like a Ledger, which would cause a `txTooLate` error response from the server. Five minutes is also the value used by the CLI, so this brings the two into alignment ([#956](https://github.com/stellar/js-stellar-sdk/pull/956)). ### Fixed * Dependencies have been properly updated to pull in Protocol 21 XDR ([#959](https://github.com/stellar/js-stellar-sdk/pull/959)). ## [v12.0.0-rc.1](https://github.com/stellar/js-stellar-sdk/compare/v11.3.0...v12.0.0-rc.1) ### Breaking Changes * **This update supports Protocol 21**. It is an additive change to the protocol so there are no true backwards incompatibilities, but your software may break if you encounter new unexpected fields from this Protocol ([#949](https://github.com/stellar/js-stellar-sdk/pull/949)). ### Fixed * Each item in the `GetEventsResponse.events` list will now have a `txHash` item corresponding to the transaction hash that triggered a particular event ([#939](https://github.com/stellar/js-stellar-sdk/pull/939)). * `ContractClient` now properly handles methods that take no arguments by making `MethodOptions` the only parameter, bringing it inline with the types generated by Soroban CLI's `soroban contract bindings typescript` ([#940](https://github.com/stellar/js-stellar-sdk/pull/940)). * `ContractClient` now allows `publicKey` to be undefined ([#941](https://github.com/stellar/js-stellar-sdk/pull/941)). * `SentTransaction` will only pass `allowHttp` if (and only if) its corresponding `AssembledTransaction#options` config allowed it ([#952](https://github.com/stellar/js-stellar-sdk/pull/952)). * `SentTransaction` will now modify the time bounds of the transaction to be `timeoutInSeconds` seconds after the transaction has been simulated. Previously this was set when the transaction is built, before the simulation. This makes the time bounds line up with the timeout retry logic in `SentTransaction`. ## [v11.3.0](https://github.com/stellar/js-stellar-sdk/compare/v11.2.2...v11.3.0) ### Added * Introduces an entire suite of helpers to assist with interacting with smart contracts ([#929](https://github.com/stellar/js-stellar-sdk/pull/929)): - `ContractClient`: generate a class from the contract specification where each Rust contract method gets a matching method in this class. Each method returns an `AssembledTransaction` that can be used to modify, simulate, decode results, and possibly sign, & submit the transaction. - `AssembledTransaction`: used to wrap a transaction-under-construction and provide high-level interfaces to the most common workflows, while still providing access to low-level transaction manipulation. - `SentTransaction`: transaction sent to the Soroban network, in two steps - initial submission and waiting for it to finalize to get the result (retried with exponential backoff) ### Fixed * Upgrade underlying dependencies, including `@stellar/js-xdr` which should broaden compatibility to pre-ES2016 environments ([#932](https://github.com/stellar/js-stellar-sdk/pull/932), [#930](https://github.com/stellar/js-stellar-sdk/pull/930)). ### Fixed * `SorobanRpc`: remove all instances of array-based parsing to conform to future breaking changes in Soroban RPC ([#924](https://github.com/stellar/js-stellar-sdk/pull/924)). ## [v11.2.2](https://github.com/stellar/js-stellar-sdk/compare/v11.2.1...v11.2.2) ### Fixed * Event streaming tests now pass on Node 20, which seems to have tighter conformance to the spec ([#917](https://github.com/stellar/js-stellar-sdk/pull/917)). * `@stellar/stellar-base` has been upgraded to its latest major version ([#918](https://github.com/stellar/js-stellar-sdk/pull/918), see [v11.0.0](https://github.com/stellar/js-stellar-base/releases/tag/v11.0.0) for release notes). ## [v11.2.1](https://github.com/stellar/js-stellar-sdk/compare/v11.2.0...v11.2.1) ### Fixed * An unnecessary dependency has been removed which was causing a TypeScript error in certain environments ([#912](https://github.com/stellar/js-stellar-sdk/pull/912)). * Dependencies have been upgraded (see [`stellar-base@v10.0.2`](https://github.com/stellar/js-stellar-base/releases/tag/v10.0.2) for release notes, [#913](https://github.com/stellar/js-stellar-sdk/pull/913)). ## [v11.2.0](https://github.com/stellar/js-stellar-sdk/compare/v11.1.0...v11.2.0) ### Added * Support for the new, optional `diagnosticEventsXdr` field on the `SorobanRpc.Server.sendTransaction` method. The raw field will be present when using the `_sendTransaction` method, while the normal method will have an already-parsed `diagnosticEvents: xdr.DiagnosticEvent[]` field, instead ([#905](https://github.com/stellar/js-stellar-sdk/pull/905)). * A new exported interface `SorobanRpc.Api.EventResponse` so that developers can type-check individual events ([#904](https://github.com/stellar/js-stellar-sdk/pull/904)). ### Updated * Dependencies have been updated to their latest versions ([#906](https://github.com/stellar/js-stellar-sdk/pull/906), [#908](https://github.com/stellar/js-stellar-sdk/pull/908)). ## [v11.1.0](https://github.com/stellar/js-stellar-sdk/compare/v11.0.1...v11.1.0) ### Added * `SorobanRpc.Server.simulateTransaction` now supports an optional `addlResources` parameter to allow users to specify additional resources that they want to include in a simulation ([#896](https://github.com/stellar/js-stellar-sdk/pull/896)). * `ContractSpec` now has a `jsonSchema()` method to generate a [JSON Schema](https://json-schema.org/) for a particular contract specification ([#889](https://github.com/stellar/js-stellar-sdk/pull/889)). ### Fixed * All dependencies have been updated to their latest versions, including `stellar-base` to [v10.0.1](https://github.com/stellar/js-stellar-base/releases/tag/v10.0.1) which included a small patch ([#897](https://github.com/stellar/js-stellar-sdk/pull/897)). ## [v11.0.1](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0) ### Fixed * `SorobanRpc.Server.getEvents` uses the correct type for the start ledger. ## [v11.0.0](https://github.com/stellar/js-stellar-sdk/compare/v10.2.1...v11.0.0) ### Breaking Changes * The package has been renamed to `@stellar/stellar-sdk`. * The new minimum supported version is Node 18. * The `PaymentCallBuilder` was incorrectly indicating that it would return a collection of `Payment` records, while [in reality](https://developers.stellar.org/api/horizon/resources/list-all-payments) it can return a handful of "payment-like" records ([#885](https://github.com/stellar/js-stellar-sdk/pull/885)). ### Fixed * The `SorobanRpc.Server.getEvents` method now correctly parses responses without a `contractId` field set. The `events[i].contractId` field on an event is now optional, omitted if there was no ID for the event (e.g. system events; ([#883](https://github.com/stellar/js-stellar-sdk/pull/883))). ## [v11.0.0-beta.6](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.5...v11.0.0-beta.6) ### Fixed * The `stellar-base` library has been upgraded to `beta.4` which contains a bugfix for large sequence numbers ([#877](https://github.com/stellar/js-stellar-sdk/pull/877)). * The `SorobanRpc.Server.getTransaction()` method will now return the full response when encountering a `FAILED` transaction result ([#872](https://github.com/stellar/js-stellar-sdk/pull/872)). * The `SorobanRpc.Server.getEvents()` method will correctly parse the event value (which is an `xdr.ScVal` rather than an `xdr.DiagnosticEvent`, see the modified `SorobanRpc.Api.EventResponse.value`; [#876](https://github.com/stellar/js-stellar-sdk/pull/876)). ## [v11.0.0-beta.5](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.4...v11.0.0-beta.5) ### Breaking Changes * The `soroban-client` library ([stellar/js-soroban-client](https://github.com/stellar/js-soroban-client)) has been merged into this package, causing significant breaking changes in the module structure ([#860](https://github.com/stellar/js-stellar-sdk/pull/860)): - The namespaces have changed to move each server-dependent component into its own module. Shared components (e.g. `TransactionBuilder`) are still in the top level, Horizon-specific interactions are in the `Horizon` namespace (i.e. `Server` is now `Horizon.Server`), and new Soroban RPC interactions are in the `SorobanRpc` namespace. - There is a [detailed migration guide](https://gist.github.com/Shaptic/5ce4f16d9cce7118f391fbde398c2f30) available to outline both the literal (i.e. necessary code changes) and philosophical (i.e. how to find certain functionality) changes needed to adapt to this merge. * The `SorobanRpc.Server.prepareTransaction` and `SorobanRpc.assembleTransaction` methods no longer need an optional `networkPassphrase` parameter, because it is implicitly part of the transaction already ([#870](https://github.com/stellar/js-stellar-sdk/pull/870)). ## [v11.0.0-beta.4](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.3...v11.0.0-beta.4) ### Fixed - The `stellar-base` dependency has been pinned to a specific version to avoid incorrect semver resolution ([#867](https://github.com/stellar/js-stellar-sdk/pull/867)). ## [v11.0.0-beta.3](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.2...v11.0.0-beta.3) ### Fixed - Fix a webpack error preventing correct exports of the SDK for browsers ([#862](https://github.com/stellar/js-stellar-sdk/pull/862)). ## [v11.0.0-beta.2](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.1...v11.0.0-beta.2) ### Breaking Changes - Certain effects have been renamed to align better with the "tense" that other structures have ([#844](https://github.com/stellar/js-stellar-sdk/pull/844)): * `DepositLiquidityEffect` -> `LiquidityPoolDeposited` * `WithdrawLiquidityEffect` -> `LiquidityPoolWithdrew` * `LiquidityPoolTradeEffect` -> `LiquidityPoolTrade` * `LiquidityPoolCreatedEffect` -> `LiquidityPoolCreated` * `LiquidityPoolRevokedEffect` -> `LiquidityPoolRevoked` * `LiquidityPoolRemovedEffect` -> `LiquidityPoolRemoved` ### Add - New effects have been added to support Protocol 20 (Soroban) ([#842](https://github.com/stellar/js-stellar-sdk/pull/842)): * `ContractCredited` occurs when a Stellar asset moves **into** its corresponding Stellar Asset Contract instance * `ContractDebited` occurs when a Stellar asset moves **out of** its corresponding Stellar Asset Contract instance - Asset stat records (`ServerApi.AssetRecord`) contain two new fields to support the Protocol 20 (Soroban) release ([#841](https://github.com/stellar/js-stellar-sdk/pull/841)): * `num_contracts` - the integer quantity of contracts that hold this asset * `contracts_amount` - the total units of that asset held by contracts - New operation responses ([#845](https://github.com/stellar/js-stellar-sdk/pull/845)): * `invokeHostFunction`: see `Horizon.InvokeHostFunctionOperationResponse` * `bumpFootprintExpiration`: see `Horizon.BumpFootprintExpirationOperationResponse` * `restoreFootprint`: see `Horizon.RestoreFootprintOperationResponse` * You can refer to the actual definitions for details, but the gist of the schemas is below: ```ts interface InvokeHostFunctionOperationResponse { function: string; parameters: { value: string; type: string; }[]; address: string; salt: string; asset_balance_changes: { type: string; from: string; to: string; amount: string; }[]; } interface BumpFootprintExpirationOperationResponse { ledgersToExpire: string; } interface RestoreFootprintOperationResponse {}; ``` ### Fixed - Some effect definitions that were missing have been added ([#842](https://github.com/stellar/js-stellar-sdk/pull/842)): * `ClaimableBalanceClawedBack` is now defined * `type EffectRecord` now has all of the effect types - The `stellar-base` library has been upgraded to support the latest Protocol 20 XDR schema and all Soroban functionality ([]()). ## [v11.0.0-beta.1](https://github.com/stellar/js-stellar-sdk/compare/v11.0.0-beta.0...v11.0.0-beta.1) ### Update - Bundle size has decreased by dropping unnecessary dependencies (`lodash`: [#822](https://github.com/stellar/js-stellar-sdk/pull/822), `es6-promise`: [#823](https://github.com/stellar/js-stellar-sdk/pull/823), polyfills: [#825](https://github.com/stellar/js-stellar-sdk/pull/825), `detect-node`: [#831](https://github.com/stellar/js-stellar-sdk/issues/831)). - Dependencies (including `stellar-base`) have been updated to their latest versions ([#825](https://github.com/stellar/js-stellar-sdk/pull/825), [#827](https://github.com/stellar/js-stellar-sdk/pull/827)). ## [v11.0.0-beta.0](https://github.com/stellar/js-stellar-sdk/compare/v10.4.1...v11.0.0-beta.0) This version is marked by a major version bump because of the significant upgrades to underlying dependencies. While there should be no noticeable API changes from a downstream perspective, there may be breaking changes in the way that this library is bundled. ### Update - Build system has been overhauled to support Webpack 5 ([#814](https://github.com/stellar/js-stellar-sdk/pull/814)). - `stellar-base` has been updated to its corresponding overhaul ([#818](https://github.com/stellar/js-stellar-sdk/pull/818)). ### Fix - Missing fields have been added to certain API responses ([#801](https://github.com/stellar/js-stellar-sdk/pull/801) and [#797](https://github.com/stellar/js-stellar-sdk/pull/797)). ## [v10.4.1](https://github.com/stellar/js-stellar-sdk/compare/v10.4.0...v10.4.1) ### Update - Bumps `stellar-base` version to [v8.2.2](https://github.com/stellar/js-stellar-base/releases/tag/v8.2.2) to include latest fix: enabling fast signing in service workers ([#806](https://github.com/stellar/js-stellar-sdk/pull/806)). ## [v10.4.0](https://github.com/stellar/js-stellar-sdk/compare/v10.3.0...v10.4.0) ### Add - Add [SEP-1](https://stellar.org/protocol/sep-1) fields to `StellarTomlResolver` for type checks ([#794](https://github.com/stellar/js-stellar-sdk/pull/794)). - Add support for passing `X-Auth-Token` as a custom header ([#795](https://github.com/stellar/js-stellar-sdk/pull/795)). ### Update - Bumps `stellar-base` version to [v8.2.1](https://github.com/stellar/js-stellar-base/releases/tag/v8.2.1) to include latest fixes. ## [v10.3.0](https://github.com/stellar/js-stellar-sdk/compare/v10.2.0...v10.3.0) ### Fix - Adds `successful` field to transaction submission response ([#790](https://github.com/stellar/js-stellar-sdk/pull/790)). ### Update - Bumps `stellar-base` version to [v8.2.0](https://github.com/stellar/js-stellar-base/releases/tag/v8.2.0) to include CAP-40 support in `Operation.setOptions`. ## [v10.2.0](https://github.com/stellar/js-stellar-sdk/compare/v10.1.2...v10.2.0) ### Fix - Adds the missing `successful` field to transaction responses ([#790](https://github.com/stellar/js-stellar-sdk/pull/790)). ### Update - Bumps `stellar-base` version to [v8.1.0](https://github.com/stellar/js-stellar-base/releases/tag/v8.1.0) to include bug fixes and latest XDR changes. ## [v10.1.2](https://github.com/stellar/js-stellar-sdk/compare/v10.1.1...v10.1.2) ### Fix - Upgrades the `eventsource` dependency to fix a critical security vulnerability ([#783](https://github.com/stellar/js-stellar-sdk/pull/783)). ## [v10.1.1](https://github.com/stellar/js-stellar-sdk/compare/v10.1.0...v10.1.1) ### Fix - Reverts a change from [v10.1.0](#v10.1.0) which caused streams to die prematurely ([#780](https://github.com/stellar/js-stellar-sdk/pull/780)). - Bumps `stellar-base` version to [v8.0.1](https://github.com/stellar/js-stellar-base/releases/tag/v8.0.1) to include latest bugfixes. ## [v10.1.0](https://github.com/stellar/js-stellar-sdk/compare/v10.0.1...v10.1.0-beta.0) This is a promotion from the beta version without changes, besides upgrading the underlying [stellar-base@v8.0.0](https://github.com/stellar/js-stellar-base/releases/tag/v8.0.0) to its stable release. ## [v10.1.0-beta.0](https://github.com/stellar/js-stellar-sdk/compare/v10.0.1...v10.1.0-beta.0) ### Add - Add a way to filter offers by seller: `OfferCallBuilder.seller(string)`, corresponding to `GET /offers?seller=` ([#773](https://github.com/stellar/js-stellar-sdk/pull/773)). ### Add - Support for Protocol 19 ([#775](https://github.com/stellar/js-stellar-sdk/pull/775)): * new precondition fields on a `TransactionResponse` * new account fields on `AccountResponse` and `AccountRecord` * bumping `stellar-base` to the latest beta version ### Fix - Add missing field to account responses: `last_modified_time` which is the time equivalent of the existing `last_modified_ledger` ([#770](https://github.com/stellar/js-stellar-sdk/pull/770)). - Stop opening extra connections when SSE streams receive `event: close` events ([#772](https://github.com/stellar/js-stellar-sdk/pull/772)). - Fix SSE streams not loading under React Native (thank you, @hunterpetersen!) ([#761](https://github.com/stellar/js-stellar-sdk/pull/761)). ## [v10.0.1](https://github.com/stellar/js-stellar-sdk/compare/v10.0.0...v10.0.1) ### Fix - Add missing fields to the `LedgerRecord`: `successful_transaction_count` and `failed_transaction_count` ([#740](https://github.com/stellar/js-stellar-sdk/pull/740)). Note that this also marks several fields as _deprecated_ because they don't actually exist in the Horizon API response: * `transaction_count`: superceded by the sum of the aforementioned fields * `base_fee`: superceded by the `base_fee_in_stroops` field * `base_reserve`: superceded by the `base_reserve_in_stroops` field These deprecated fields will be removed in the next major version. It's unlikely that this breaking change should affect anyone, as these fields have likely been missing/invalid for some time. ### Update - Update a number of dependencies that needed various security updates: * several dependencies bumped their patch version ([#736](https://github.com/stellar/js-stellar-sdk/pull/736), [#684](https://github.com/stellar/js-stellar-sdk/pull/684), [#672](https://github.com/stellar/js-stellar-sdk/pull/672), [#666](https://github.com/stellar/js-stellar-sdk/pull/666), [#644](https://github.com/stellar/js-stellar-sdk/pull/644), [#622](https://github.com/stellar/js-stellar-sdk/pull/622)) * axios has been bumped to 0.25.0 without causing breaking changes ([#742](https://github.com/stellar/js-stellar-sdk/pull/742)) * the `karma` suite of packages has been updated to the latest major version ([#743](https://github.com/stellar/js-stellar-sdk/pull/743)) All of the dependencies in question besides `axios` were _developer_ dependencies, so there never was downstream security impact nor will there be downstream upgrade impact. ## [v10.0.0](https://github.com/stellar/js-stellar-sdk/compare/v9.1.0...v10.0.0) This release introduces breaking changes from `stellar-base`. It adds **unconditional support for muxed accounts**. Please refer to the corresponding [release notes](https://github.com/stellar/js-stellar-base/releases/tag/v7.0.0) for details on the breaking changes there. ### Breaking Updates - Upgrades the stellar-base library to v7.0.0 ([#735](https://github.com/stellar/js-stellar-sdk/pull/735)). - Removes the `AccountResponse.createSubaccount` method since this is also gone from the underlying `Account` interface. The `stellar-base` release notes describe alternative construction methods ([#735](https://github.com/stellar/js-stellar-sdk/pull/735)). ### Fix - Use the right string for liquidity pool trades ([#734](https://github.com/stellar/js-stellar-sdk/pull/734)). ## [v9.1.0](https://github.com/stellar/js-stellar-sdk/compare/v9.0.1...v9.1.0) ### Add - Adds a way to filter liquidity pools by participating account: `server.liquidityPools.forAccount(id)` ([#727](https://github.com/stellar/js-stellar-sdk/pull/727)). ### Updates - Updates the following SEP-10 utility functions to include [client domain verification](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md#verifying-the-client-domain) functionality ([#720](https://github.com/stellar/js-stellar-sdk/pull/720)): - `Utils.buildChallengeTx()` accepts the `clientDomain` and `clientSigningKey` optional parameters - `Utils.readChallengeTx()` parses challenge transactions containing a `client_domain` ManageData operation - `Utils.verifyChallengeTxSigners()` verifies an additional signature from the `clientSigningKey` keypair if a `client_domain` Manage Data operation is included in the challenge - Bumps `stellar-base` version to [v6.0.6](https://github.com/stellar/js-stellar-base/releases/tag/v6.0.6). ### Fix - Fixes the `type_i` enumeration field to accurately reflect liquidity pool effects ([#723](https://github.com/stellar/js-stellar-sdk/pull/723)). - Upgrades axios dependency to v0.21.4 to alleviate security concern ([GHSA-cph5-m8f7-6c5x](https://github.com/advisories/GHSA-cph5-m8f7-6c5x), [#724](https://github.com/stellar/js-stellar-sdk/pull/724)). - Publish Bower package to [stellar/bower-js-stellar-sdk](https://github.com/stellar/bower-js-stellar-sdk) ([#725](https://github.com/stellar/js-stellar-sdk/pull/725)). ## [v9.0.1](https://github.com/stellar/js-stellar-sdk/compare/v9.0.0-beta.1...v9.0.1) This stable release adds **support for Protocol 18**. For details, you can refer to [CAP-38](https://stellar.org/protocol/cap-38) for XDR changes and [this document](https://docs.google.com/document/d/1pXL8kr1a2vfYSap9T67R-g72B_WWbaE1YsLMa04OgoU/view) for changes to the Horizon API. Refer to the release notes for the betas (e.g. [v9.0.0-beta.0](https://github.com/stellar/js-stellar-sdk/releases/v9.0.0-beta.0)) for a comprehensive list of changes to this library. ### Fix - Corrects the `reserves` field on `LiquidityPoolRecord`s to be an array ([#715](https://github.com/stellar/js-stellar-sdk/pull/715)). - Bumps the `stellar-base` dependency to [v6.0.4](https://github.com/stellar/js-stellar-base/releases/tag/v6.0.4) ([#715](https://github.com/stellar/js-stellar-sdk/pull/715)). ## [v9.0.0-beta.1](https://github.com/stellar/js-stellar-sdk/compare/v9.0.0-beta.0...v9.0.0-beta.1) ### Add - Add `/liquidity_pools/:id/trades` endpoint ([#710](https://github.com/stellar/js-stellar-sdk/pull/710)) ### Updates - Updates the following SEP-10 utility functions to be compliant with the protocols ([#709](https://github.com/stellar/js-stellar-sdk/pull/709/), [stellar-protocol/#1036](https://github.com/stellar/stellar-protocol/pull/1036)) - Updated `utils.buildChallengeTx()` to accept muxed accounts (`M...`) for client account IDs - Updated `utils.buildChallengeTx()` to accept a `memo` parameter to attach to the challenge transaction - Updated `utils.readChallengeTx()` to provide a `memo` property in the returned object - Updated `utils.readChallengeTx()` to validate challenge transactions with muxed accounts (`M...`) as the client account ID ### Fix - Drops the `chai-http` dependency to be only for developers ([#707](https://github.com/stellar/js-stellar-sdk/pull/707)). ## [v9.0.0-beta.0](https://github.com/stellar/js-stellar-sdk/compare/v8.2.5...v9.0.0-beta.0) This beta release adds **support for Automated Market Makers**. For details, you can refer to [CAP-38](https://stellar.org/protocol/cap-38) for XDR changes and [this document](https://docs.google.com/document/d/1pXL8kr1a2vfYSap9T67R-g72B_WWbaE1YsLMa04OgoU/view) for detailed changes to the Horizon API. ### Add - Introduced a `LiquidityPoolCallBuilder` to make calls to a new endpoint: * `/liquidity_pools[?reserves=...]` - a collection of liquidity pools, optionally filtered by one or more assets ([#682](https://github.com/stellar/js-stellar-sdk/pull/682)) * `/liquidity_pools/:id` - a specific liquidity pool ([#687](https://github.com/stellar/js-stellar-sdk/pull/687)) - Expanded the `TransactionCallBuilder`, `OperationCallBuilder`, and `EffectsCallBuilder`s to apply to specific liquidity pools ([#689](https://github.com/stellar/js-stellar-sdk/pull/689)). This corresponds to the following new endpoints: * `/liquidity_pools/:id/transactions` * `/liquidity_pools/:id/operations` * `/liquidity_pools/:id/effects` - Expanded the `TradesCallBuilder` to support fetching liquidity pool trades and accepts a new `trade_type` filter ([#685](https://github.com/stellar/js-stellar-sdk/pull/685)): * `/trades?trade_type={orderbook,liquidity_pools,all}`. By default, the filter is `all`, including both liquidity pool and orderbook records. * A liquidity pool trade contains the following fields: - `liquidity_pool_fee_bp`: LP fee expressed in basis points, and *either* - `base_liquidity_pool_id` or `counter_liquidity_pool_id` - Added new effects related to liquidity pools ([#690](https://github.com/stellar/js-stellar-sdk/pull/690)): * `DepositLiquidityEffect` * `WithdrawLiquidityEffect` * `LiquidityPoolTradeEffect` * `LiquidityPoolCreatedEffect` * `LiquidityPoolRemovedEffect` * `LiquidityPoolRevokedEffect` - Added new responses related to liquidity pool operations ([#692](https://github.com/stellar/js-stellar-sdk/pull/692)): * `DepositLiquidityOperationResponse` * `WithdrawLiquidityOperationResponse` ### Updates - Updated the underlying `stellar-base` library to [v6.0.1](https://github.com/stellar/js-stellar-base/releases/tag/v6.0.1) to include CAP-38 changes ([#681](https://github.com/stellar/js-stellar-sdk/pull/681)). - Updated various developer dependencies to secure versions ([#671](https://github.com/stellar/js-stellar-sdk/pull/671)). - Updated `AccountResponse` to include liquidity pool shares in its `balances` field ([#688](https://github.com/stellar/js-stellar-sdk/pull/688)). - Updated `AccountCallBuilder` to allow filtering based on participation in a certain liquidity pool ([#688](https://github.com/stellar/js-stellar-sdk/pull/688)), corresponding to the following new filter: * `/accounts?reserves=[...list of assets...]` - Updated `RevokeSponsorshipOperationResponse` to contain an optional attribute `trustline_liquidity_pool_id`, for when a liquidity pool trustline is revoked ([#690](https://github.com/stellar/js-stellar-sdk/pull/690)). ### Breaking changes - A `TradeRecord` can now correspond to two different types of trades and has changed ([#685](https://github.com/stellar/js-stellar-sdk/pull/685)): * `Orderbook` (the existing structure) - `counter_offer_id` and `base_offer_id` only show up in these records - the redundant `offer_id` field was removed; it matches `base_offer_id` * `LiquidityPool` (new) - `base_account` xor `counter_account` will appear in these records * `price` fields changed from `number`s to `string`s * The links to `base` and `counter` can now point to *either* an account or a liquidity pool - An account's `balances` array can now include a new type ([#688](https://github.com/stellar/js-stellar-sdk/pull/688)): * `asset_type` can now be `liquidity_pool_shares` * The following fields are *not* included in pool share balances: - `buying_liabilities` - `selling_liabilities` - `asset_code` - `asset_issue` - The `ChangeTrustOperationResponse` has changed ([#688](https://github.com/stellar/js-stellar-sdk/pull/688), [#692](https://github.com/stellar/js-stellar-sdk/pull/692)): * `asset_type` can now be `liquidity_pool_shares` * `asset_code`, `asset_issuer`, and `trustee` are now optional * `liquidity_pool_id` is a new optional field - The trustline effects (`TrustlineCreated`, `TrustlineUpdated`, `TrustlineRevoked`) have changed ([#690](https://github.com/stellar/js-stellar-sdk/pull/690)): * the asset type can now be `liquidity_pool_shares` * they can optionally include a `liquidity_pool_id` - Trustline sponsorship effects (`TrustlineSponsorshipCreated`, `TrustlineSponsorshipUpdated`, `TrustlineSponsorshipRemoved`) have been updated ([#690](https://github.com/stellar/js-stellar-sdk/pull/690)): * the `asset` field is now optional, and is replaced by * the `liquidity_pool_id` field for liquidity pools ## [v8.2.5](https://github.com/stellar/js-stellar-sdk/compare/v8.2.4...v8.2.5) ### Update - The `js-stellar-base` library has been updated to [v5.3.2](https://github.com/stellar/js-stellar-base/releases/tag/v5.3.2), which fixes a muxed account bug and updates vulnerable dependencies ([#670](https://github.com/stellar/js-stellar-sdk/pull/670)). ## [v8.2.4](https://github.com/stellar/js-stellar-sdk/compare/v8.2.3...v8.2.4) ### Fix - Utils.readTransactionTx now checks timebounds with a 5-minute grace period to account for clock drift. ## [v8.2.3](https://github.com/stellar/js-stellar-sdk/compare/v8.2.2...v8.2.3) ### Fix - Fix server signature verification in `Utils.readChallengeTx`. The function was not verifying the server account had signed the challenge transaction. ## [v8.2.2](https://github.com/stellar/js-stellar-sdk/compare/v8.2.1...v8.2.2) ### Fix - Fixes a breaking bug introduced in v8.2.0 in which `AccountResponse` no longer conformed to the `StellarBase.Account` interface, which was updated in [stellar-base@v5.2.0](https://github.com/stellar/js-stellar-base/releases/tag/v5.2.0) [(#655)](https://github.com/stellar/js-stellar-sdk/pull/655). ## [v8.2.1](https://github.com/stellar/js-stellar-sdk/compare/v8.2.0...v8.2.1) ### Fix - A defunct query paramater (`?c=[...]`) has been removed now that Horizon properly sends Cache-Control headers [(#652)](https://github.com/stellar/js-stellar-sdk/pull/652). ## [v8.2.0](https://github.com/stellar/js-stellar-sdk/compare/v8.1.1...v8.2.0) ### Add - Added support for querying the relevant transactions and operations for a claimable balance [(#628)](https://github.com/stellar/js-stellar-sdk/pull/628): * `TransactionCallBuilder.forClaimableBalance()`: builds a query to `/claimable_balances/:id/transactions/` * `OperationCallBuilder.forClaimableBalance()`: builds a query to `/claimable_balances/:id/operations/` - Added support for new stat fields on the `/assets` endpoint [(#628)](https://github.com/stellar/js-stellar-sdk/pull/628): * `accounts` - a breakdown of accounts using this asset by authorization type * `balances` - a breakdown of balances by account authorization type * `num_claimable_balances` - the number of pending claimable balances * `claimable_balances_amount` - the total balance of pending claimable balances - Added types for all Effects supported as an enum, and moved `Trade`, `Asset`, `Offer`, and `Account` types to separate files [(#635)](https://github.com/stellar/js-stellar-sdk/pull/635). ### Update - Upgraded `js-stellar-base` package to version `^5.2.1` from `^5.1.0`, refer to its [release notes](https://github.com/stellar/js-stellar-base/releases/tag/v5.2.0) for more [(#639)](https://github.com/stellar/js-stellar-sdk/pull/639): * opt-in **support for muxed accounts** ([SEP-23](https://stellar.org/protocol/sep-23)) * exposing the `AuthClawbackEnabled` flag to Typescript to **complete Protocol 17 support** * fixing a public key parsing regression - Exposed more Protocol 17 (CAP-35) operations [(#633)](https://github.com/stellar/js-stellar-sdk/pull/633): * The `/accounts` endpoint now resolves the `flags.auth_clawback_enabled` field. * The operation responses for `clawback`, `clawbackClaimableBalance`, and `setTrustLineFlags` are now defined. * The operation response for `setOptions` has been updated to show `auth_clawback_enabled`. ## [v8.1.1](https://github.com/stellar/js-stellar-sdk/compare/v8.1.0...v8.1.1) ### Fix - Upgraded `js-stellar-base` package to version `^5.1.0` from `^5.0.0` to expose the Typescript hints for CAP-35 operations [(#629)](https://github.com/stellar/js-stellar-sdk/pull/629). ## [v8.1.0](https://github.com/stellar/js-stellar-sdk/compare/v8.0.0...v8.1.0) ### Update - Upgraded `js-stellar-base` package to version `^5.0.0` from `^4.0.3` to support new CAP-35 operations [(#624)](https://github.com/stellar/js-stellar-sdk/pull/624) ## [v8.0.0](https://github.com/stellar/js-stellar-sdk/compare/v7.0.0...v8.0.0) ### Breaking - Updates the SEP-10 utility function parameters to support [SEP-10 v3.1](https://github.com/stellar/stellar-protocol/commit/6c8c9cf6685c85509835188a136ffb8cd6b9c11c) [(#607)](https://github.com/stellar/js-stellar-sdk/pull/607) - A new required `webAuthDomain` parameter was added to the following functions - `utils.buildChallengeTx()` - `utils.readChallengeTx()` - `utils.verifyChallengeTxThreshold()` - `utils.verifyChallengeTxSigners()` - The `webAuthDomain` parameter is expected to match the value of the Manage Data operation with the 'web_auth_domain' key, if present ### Fix - Fixes bug where the first Manage Data operation in a challenge transaction could have a null value [(#591)](https://github.com/stellar/js-stellar-sdk/pull/591) ### Update - Upgraded `axios` package to version `^0.21.1` from `^0.19.0` to fix security vulnerabilities [(#608)](https://github.com/stellar/js-stellar-sdk/pull/608) - Upgraded `js-stellar-base` package to version `^4.0.3` from `^4.0.0` to allow accounts with a balance of zero [(#616)](https://github.com/stellar/js-stellar-sdk/pull/616) ## [v7.0.0](https://github.com/stellar/js-stellar-sdk/compare/v6.2.0...v7.0.0) This release includes a major-version increase due to breaking changes included. ### Breaking - Updates the SEP-10 utility function parameters and return values to support [SEP-10 v3.0](https://github.com/stellar/stellar-protocol/commit/9d121f98fd2201a5edfe0ed2befe92f4bf88bfe4) - The following functions replaced the `homeDomain` parameter with `homeDomains` (note: plural): - `utils.readChallengeTx()` - `utils.verifyChallengeTxThreshold()` - `utils.verifyChallengeTxSigners()` - `utils.readChallengeTx()` now returns an additional object attribute, `matchedHomeDomain` ### Update - Update challenge transaction helpers for SEP0010 v3.0.0. ([#596](https://github.com/stellar/js-stellar-sdk/pull/596)) * Restore `homeDomain` validation in `readChallengeTx()`. ## [v6.2.0](https://github.com/stellar/js-stellar-sdk/compare/v6.1.0...v6.2.0) ### Update - Update challenge transaction helpers for SEP0010 v2.1.0. ([#581](https://github.com/stellar/js-stellar-sdk/issues/581)) * Remove verification of home domain. * Allow additional manage data operations that have the source account set as the server key. ## [v6.1.0](https://github.com/stellar/js-stellar-sdk/compare/v6.0.0...v6.1.0) ### Update - Update claim predicate fields to match Horizon 1.9.1 ([#575](https://github.com/stellar/js-stellar-sdk/pull/575)). ## [v6.0.0](https://github.com/stellar/js-stellar-sdk/compare/v5.0.4...v6.0.0) ### Add - Add support for claimable balances ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)). Extend server class to allow loading claimable balances from Horizon. The following functions are available: ``` server.claimableBalances(); server.claimableBalances().claimant(claimant); server.claimableBalances().sponsor(sponsorID); server.claimableBalances().asset(asset); server.claimableBalances().claimableBalance(balanceID); ``` - Add the following attributes to `AccountResponse` ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)): * `sponsor?: string` * `num_sponsoring: number` * `num_sponsored: number` - Add the optional attribute `sponsor` to `AccountSigner`, `BalanceLineAsset`, `ClaimableBalanceRecord`, and `OfferRecord` ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)). - Add `sponsor` filtering support for `offers` and `accounts` ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)). * `server.offers().sponsor(accountID)` * `server.accounts().sponsor(accountID)` - Extend operation responses to support new operations ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)). * `create_claimable_balance` with the following fields: * `asset` - asset available to be claimed (in canonical form), * `amount` - amount available to be claimed, * `claimants` - list of claimants with predicates (see below): * `destination` - destination account ID, * `predicate` - predicate required to claim a balance (see below). * `claim_claimable_balance` with the following fields: * `balance_id` - unique ID of balance to be claimed, * `claimant` - account ID of a claimant. * `begin_sponsoring_future_reserves` with the following fields: * `sponsored_id` - account ID for which future reserves will be sponsored. * `end_sponsoring_future_reserves` with the following fields: * `begin_sponsor` - account sponsoring reserves. * `revoke_sponsorship` with the following fields: * `account_id` - if account sponsorship was revoked, * `claimable_balance_id` - if claimable balance sponsorship was revoked, * `data_account_id` - if account data sponsorship was revoked, * `data_name` - if account data sponsorship was revoked, * `offer_id` - if offer sponsorship was revoked, * `trustline_account_id` - if trustline sponsorship was revoked, * `trustline_asset` - if trustline sponsorship was revoked, * `signer_account_id` - if signer sponsorship was revoked, * `signer_key` - if signer sponsorship was revoked. - Extend effect responses to support new effects ([#572](https://github.com/stellar/js-stellar-sdk/pull/572)). * `claimable_balance_created` with the following fields: * `balance_id` - unique ID of claimable balance, * `asset` - asset available to be claimed (in canonical form), * `amount` - amount available to be claimed. * `claimable_balance_claimant_created` with the following fields: * `balance_id` - unique ID of a claimable balance, * `asset` - asset available to be claimed (in canonical form), * `amount` - amount available to be claimed, * `predicate` - predicate required to claim a balance (see below). * `claimable_balance_claimed` with the following fields: * `balance_id` - unique ID of a claimable balance, * `asset` - asset available to be claimed (in canonical form), * `amount` - amount available to be claimed, * `account_sponsorship_created` with the following fields: * `sponsor` - sponsor of an account. * `account_sponsorship_updated` with the following fields: * `new_sponsor` - new sponsor of an account, * `former_sponsor` - former sponsor of an account. * `account_sponsorship_removed` with the following fields: * `former_sponsor` - former sponsor of an account. * `trustline_sponsorship_created` with the following fields: * `sponsor` - sponsor of a trustline. * `trustline_sponsorship_updated` with the following fields: * `new_sponsor` - new sponsor of a trustline, * `former_sponsor` - former sponsor of a trustline. * `trustline_sponsorship_removed` with the following fields: * `former_sponsor` - former sponsor of a trustline. * `claimable_balance_sponsorship_created` with the following fields: * `sponsor` - sponsor of a claimable balance. * `claimable_balance_sponsorship_updated` with the following fields: * `new_sponsor` - new sponsor of a claimable balance, * `former_sponsor` - former sponsor of a claimable balance. * `claimable_balance_sponsorship_removed` with the following fields: * `former_sponsor` - former sponsor of a claimable balance. * `signer_sponsorship_created` with the following fields: * `signer` - signer being sponsored. * `sponsor` - signer sponsor. * `signer_sponsorship_updated` with the following fields: * `signer` - signer being sponsored. * `former_sponsor` - the former sponsor of the signer. * `new_sponsor` - the new sponsor of the signer. * `signer_sponsorship_removed` with the following fields: * `former_sponsor` - former sponsor of a signer. ### Breaking - Update `stellar-base` to `v4.0.0` which introduces a breaking change in the internal XDR library. The following functions were renamed: - `xdr.OperationBody.setOption()` -> `xdr.OperationBody.setOptions()` - `xdr.OperationBody.manageDatum()` -> `xdr.OperationBody.manageData()` - `xdr.OperationType.setOption()` -> `xdr.OperationType.setOptions()` - `xdr.OperationType.manageDatum()` -> `xdr.OperationType.manageData()` The following enum values were renamed in `OperationType`: - `setOption` -> `setOptions` - `manageDatum` -> `manageData` ## [v5.0.4](https://github.com/stellar/js-stellar-sdk/compare/v5.0.3...v5.0.4) ### Update - Add `tx_set_operation_count` to `ledger` resource ([#559](https://github.com/stellar/js-stellar-sdk/pull/559)). ## [v5.0.3](https://github.com/stellar/js-stellar-sdk/compare/v5.0.2...v5.0.3) ### Fix - Fix regression on `server.offer().forAccount()` which wasn't allowing streaming ([#533](https://github.com/stellar/js-stellar-sdk/pull/553)). ## [v5.0.2](https://github.com/stellar/js-stellar-sdk/compare/v5.0.1...v5.0.2) ### Update - Allow submitTransaction to receive a FeeBumpTransaction ([#548](https://github.com/stellar/js-stellar-sdk/pull/548)). ## [v5.0.1](https://github.com/stellar/js-stellar-sdk/compare/v5.0.0...v5.0.1) ### Update - Skip SEP0029 (memo required check) for multiplexed accounts ([#538](https://github.com/stellar/js-stellar-sdk/pull/538)). ### Fix - Fix missing documentation for `stellar-base` ([#544](https://github.com/stellar/js-stellar-sdk/pull/544)). - Move dom-monkeypatch to root types and publish to npm ([#543](https://github.com/stellar/js-stellar-sdk/pull/543)). ## [v5.0.0](https://github.com/stellar/js-stellar-sdk/compare/v4.1.0...v5.0.0) ### Add - Add fee bump related attributes to `TransactionResponse` ([#532](https://github.com/stellar/js-stellar-sdk/pull/532)): - `fee_account: string`. - `fee_bump_transaction: FeeBumpTransactionResponse`: ```js interface FeeBumpTransactionResponse { hash: string; signatures: string[]; } ``` - `inner_transaction: InnerTransactionResponse`: ```js interface InnerTransactionResponse { hash: string; signatures: string[]; max_fee: string; } ``` - Add `memo_bytes: string` to `TransactionResponse` ([#532](https://github.com/stellar/js-stellar-sdk/pull/532)). - Add `authorize_to_maintain_liabilities: boolean` to `AllowTrustOperation` ([#532](https://github.com/stellar/js-stellar-sdk/pull/532)). - Add `is_authorized_to_maintain_liabilities: boolean` to `BalanceLineNative` ([#532](https://github.com/stellar/js-stellar-sdk/pull/532)). - Add new result codes to `TransactionFailedResultCodes` ([#531](https://github.com/stellar/js-stellar-sdk/pull/531)). ```js TX_FEE_BUMP_INNER_SUCCESS = "tx_fee_bump_inner_success", TX_FEE_BUMP_INNER_FAILED = "tx_fee_bump_inner_failed", TX_NOT_SUPPORTED = "tx_not_supported", TX_SUCCESS = "tx_success", TX_TOO_EARLY = "tx_too_early", TX_TOO_LATE = "tx_too_late", TX_MISSING_OPERATION = "tx_missing_operation", TX_INSUFFICIENT_BALANCE = "tx_insufficient_balance", TX_NO_SOURCE_ACCOUNT = "tx_no_source_account", TX_INSUFFICIENT_FEE = "tx_insufficient_fee", TX_INTERNAL_ERROR = "tx_internal_error", ``` ### Breaking changes - The attributes `max_fee` and `fee_charged` in `TransactionResponse` can be now a `number` or a `string`. Update your code to handle both types since Horizon will start sending `string` in version `1.3.0` ([#528](https://github.com/stellar/js-stellar-sdk/pull/528)). - Bump `stellar-base` to `v3.0.0`: This new version of stellar-base brings support for protocol 13, including multiple breaking changes which might affect your code, please review the list of breaking changes in [stellar-base@3.0.0](https://github.com/stellar/js-stellar-base/releases/tag/v3.0.0) release ([#524](https://github.com/stellar/js-stellar-sdk/pull/524)). - Make `networkPassphrase` a required argument in `Utils.buildChallengeTx` and `Utils.readChallengeTx` ([#524](https://github.com/stellar/js-stellar-sdk/pull/524)). - Remove `Server.paths` ([#525](https://github.com/stellar/js-stellar-sdk/pull/525)). ## [v5.0.0-alpha.2](https://github.com/stellar/js-stellar-sdk/compare/v5.0.0-alpha.1..v5.0.0-alpha.2) ### Update - Update `stellar-base` to `v3.0.0-alpha-1`. ## [v5.0.0-alpha.1](https://github.com/stellar/js-stellar-sdk/compare/v4.1.0...v5.0.0-alpha.1) ### Breaking changes - Bump `stellar-base` to `v3.0.0-alpha-0`: This new version of stellar-base brings support for protocol 13, including multiple breaking changes which might affect your code, please review the list of breaking changes in [stellar-base@3.0.0-alpha.0](https://github.com/stellar/js-stellar-base/releases/tag/v3.0.0-alpha.0) release ([#524](https://github.com/stellar/js-stellar-sdk/pull/524)). - Make `networkPassphrase` a required argument in `Utils.buildChallengeTx` and `Utils.readChallengeTx` ([#524](https://github.com/stellar/js-stellar-sdk/pull/524)). - Remove `Server.paths` ([#525](https://github.com/stellar/js-stellar-sdk/pull/525)). ## [v4.1.0](https://github.com/stellar/js-stellar-sdk/compare/v4.0.2...v4.1.0) ### Add - Add SEP0029 (memo required) support. ([#516](https://github.com/stellar/js-stellar-sdk/issues/516)) Extends `server.submitTransaction` to always run a memo required check before sending the transaction. If any of the destinations require a memo and the transaction doesn't include one, then an `AccountRequiresMemoError` will be thrown. You can skip this check by passing `{skipMemoRequiredCheck: true}` to `server.submitTransaction`: ``` server.submitTransaction(tx, {skipMemoRequiredCheck: true}) ``` The check runs for each operation of type: - `payment` - `pathPaymentStrictReceive` - `pathPaymentStrictSend` - `mergeAccount` If the transaction includes a memo, then memo required checking is skipped. See [SEP0029](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0029.md) for more information about memo required check. ## [v4.0.2](https://github.com/stellar/js-stellar-sdk/compare/v4.0.1...v4.0.2) ### Fix - Fix URI TypeScript reference. ([#509](https://github.com/stellar/js-stellar-sdk/issues/509)) - Fix docs build. ([#503](https://github.com/stellar/js-stellar-sdk/issues/503)) - Fix documentation for method to filter offers by account. ([#507](https://github.com/stellar/js-stellar-sdk/issues/507)) - Fix types and add missing attribute to `account_response`. ([#504](https://github.com/stellar/js-stellar-sdk/issues/504)) ## [v4.0.1](https://github.com/stellar/js-stellar-sdk/compare/v4.0.0...v4.0.1) ### Add - Add `.offer` method to `OfferCallBuilder` which allows fetching a single offer by ID. ([#499](https://github.com/stellar/js-stellar-sdk/issues/499)) ### Fix - Fix broken link to Stellar logo+wordmark. ([#496](https://github.com/stellar/js-stellar-sdk/issues/496)) - Fix `_link` omition for AccountResponse class. ([#495](https://github.com/stellar/js-stellar-sdk/issues/495)) ### Update - Update challenge transaction helpers for SEP0010. ([#497](https://github.com/stellar/js-stellar-sdk/issues/497)) ## [v4.0.0](https://github.com/stellar/js-stellar-sdk/compare/v3.3.0...v4.0.0) ### Added - Add support for top-level offers endpoint with `seller`, `selling`, and `buying` filter. ([#485](https://github.com/stellar/js-stellar-sdk/issues/485)) Horizon 1.0 includes a new `/offers` end-point, which allows you to list all offers, supporting filtering by `seller`, `selling`, or `buying` asset. You can fetch data from this endpoint by doing `server.offers()` and use any of the following filters: - `seller`: `server.offers().forAccount(accountId)` - `buying`: `server.offers().buying(asset)` - `selling`: `server.offers().selling(asset)` This introduced a breaking change since it modified the signature for the function `server.offers()`. Before, if you wanted to list all the offers for a given account, you'd do: ``` server.offers('accounts', accountID) ``` Starting on this version you'll need to do: ``` server.offers().forAccount(accountId) ``` You can do now things that were not possible before, like finding all offers for an account filtering by the selling or buying asset ``` server.offers().forAccount(accountId).selling(assetA).buying(assetB) ``` - Add support for filtering accounts by `signer` or `asset` ([#474](https://github.com/stellar/js-stellar-sdk/issues/474)) Horizon 1.0 includes a new `/accounts` end-point, which allows you to list all accounts who have another account as a signer or hold a given asset. You can fetch data from this endpoint by doing `server.accounts()` and use any of the following filters: - `accountID`: `server.accounts().accountId(accountId)`, returns a single account. - `forSigner`: `server.accounts().forSigner(accountId)`, returns accounts where `accountId` is a signer. - `forAsset`: `server.accounts().forAsset(asset)`, returns accounts which hold the `asset`. - Add TypeScript typings for new fields in `fee_stats`. ([#462](https://github.com/stellar/js-stellar-sdk/issues/462)) ### Changed - Changed TypeScript typing for multiple operations "type", it will match the new value on Horizon. ([#477](https://github.com/stellar/js-stellar-sdk/issues/477)) ### Fixed - Fix fetchTimebounds() ([#487](https://github.com/stellar/js-stellar-sdk/issues/487)) - Clone the passed URI in CallBuilder constructor, to not mutate the outside ref ([#473](https://github.com/stellar/js-stellar-sdk/issues/473)) - Use axios CancelToken to ensure timeout ([#482](https://github.com/stellar/js-stellar-sdk/issues/482)) ### Breaking - Remove `fee_paid` field from transaction response. ([#476](https://github.com/stellar/js-stellar-sdk/issues/476)) - Remove all `*_accepted_fee` from FeeStatsResponse. ([#463](https://github.com/stellar/js-stellar-sdk/issues/463)) - Change function signature for `server.offers`. ([#485](https://github.com/stellar/js-stellar-sdk/issues/485)) The signature for the function `server.offers()` was changed to bring suppport for other filters. Before, if you wanted to list all the offers for a given account, you'd do: ``` server.offers('accounts', accountID) ``` Starting on this version you'll need to do: ``` server.offers().accountId(accountId) ``` ## [v3.3.0](https://github.com/stellar/js-stellar-sdk/compare/v3.2.0...v3.3.0) ### Deprecated ⚠️ - Horizon 0.25.0 will change the data type for multiple attributes from `Int64` to `string`. When the JSON payload includes an `Int64`, there are scenarios where large number data can be incorrectly parsed, since JavaScript doesn't support `Int64` values. You can read more about it in [#1363](https://github.com/stellar/go/issues/1363). This release extends the data types for the following attributes to be of type `string` or `number`: - `EffectRecord#offer_id` - `EffectRecord#new_seq` - `OfferRecord#id` - `TradeAggregationRecord#timestamp` - `TradeAggregationRecord#trade_count` - `ManageOfferOperationResponse#offer_id` - `PassiveOfferOperationResponse#offer_id` We recommend you update your code to handle both `string` or `number` in the fields listed above, so that once Horizon 0.25.0 is released, your application will be able to handle the new type without breaking. ## [v3.2.0](https://github.com/stellar/js-stellar-sdk/compare/v3.1.2...v3.2.0) ### Add ➕ - Add `fee_charged` an `max_fee` to `TransactionResponse` interface. ([455](https://github.com/stellar/js-stellar-sdk/pull/455)) ### Deprecated ⚠️ - Horizon 0.25 will stop sending the property `fee_paid` in the transaction response. Use `fee_charged` and `max_fee`, read more about it in [450](https://github.com/stellar/js-stellar-sdk/issues/450). ## [v3.1.2](https://github.com/stellar/js-stellar-sdk/compare/v3.1.1...v3.1.2) ### Change - Upgrade `stellar-base` to `v2.1.2`. ([452](https://github.com/stellar/js-stellar-sdk/pull/452)) ## [v3.1.1](https://github.com/stellar/js-stellar-sdk/compare/v3.1.0...v3.1.1) ### Change ⚠️ - Change arguments on [server.strictReceivePaths](https://stellar.github.io/js-stellar-sdk/Server.html#strictReceivePaths) since we included `destinationAccount` as an argument, but it is not longer required by Horizon. ([477](https://github.com/stellar/js-stellar-sdk/pull/447)) ## [v3.1.0](https://github.com/stellar/js-stellar-sdk/compare/v3.0.0...v3.1.0) ### Add ➕ - Add `server.strictReceivePaths` which adds support for `/paths/strict-receive`. ([444](https://github.com/stellar/js-stellar-sdk/pull/444)) This function takes a list of source assets or a source address, a destination address, a destination asset and a destination amount. You can call it passing a list of source assets: ``` server.strictReceivePaths(sourceAssets,destinationAsset, destinationAmount) ``` Or a by passing a Stellar source account address: ``` server.strictReceivePaths(sourceAccount,destinationAsset, destinationAmount) ``` When you call this function with a Stellar account address, it will look at the account’s trustlines and use them to determine all payment paths that can satisfy the desired amount. - Add `server.strictSendPaths` which adds support for `/paths/strict-send`. ([444](https://github.com/stellar/js-stellar-sdk/pull/444)) This function takes the asset you want to send, and the amount of that asset, along with either a list of destination assets or a destination address. You can call it passing a list of destination assets: ``` server.strictSendPaths(sourceAsset, sourceAmount, [destinationAsset]).call() ``` Or a by passing a Stellar account address: ``` server.strictSendPaths(sourceAsset, sourceAmount, "GDRREYWHQWJDICNH4SAH4TT2JRBYRPTDYIMLK4UWBDT3X3ZVVYT6I4UQ").call() ``` When you call this function with a Stellar account address, it will look at the account’s trustlines and use them to determine all payment paths that can satisfy the desired amount. ### Deprecated ⚠️ - [Server#paths](https://stellar.github.io/js-stellar-sdk/Server.html#paths) is deprecated in favor of [Server#strictReceivePaths](https://stellar.github.io/js-stellar-sdk/Server.html#strictReceivePaths). ([444](https://github.com/stellar/js-stellar-sdk/pull/444)) ## [v3.0.1](https://github.com/stellar/js-stellar-sdk/compare/v3.0.0...v3.0.1) ### Add - Add join method to call builder. ([#436](https://github.com/stellar/js-stellar-sdk/issues/436)) ## [v3.0.0](https://github.com/stellar/js-stellar-sdk/compare/v2.3.0...v3.0.0) ### BREAKING CHANGES ⚠ - Drop Support for Node 6 since it has been end-of-lifed and no longer in LTS. We now require Node 10 which is the current LTS until April 1st, 2021. ([#424](https://github.com/stellar/js-stellar-sdk/pull/424) ## [v2.3.0](https://github.com/stellar/js-stellar-sdk/compare/v2.2.3...v2.3.0) ### Add - Add feeStats support. ([#409](https://github.com/stellar/js-stellar-sdk/issues/409)) ### Fix - Fix Util.verifyChallengeTx documentation ([#405](https://github.com/stellar/js-stellar-sdk/issues/405)) - Fix: listen to stream events with addEventListener ([#408](https://github.com/stellar/js-stellar-sdk/issues/408)) ## [v2.2.3](https://github.com/stellar/js-stellar-sdk/compare/v2.2.2...v2.2.3) ### Fix - Fix ServerApi's OrderbookRecord type ([#401](https://github.com/stellar/js-stellar-sdk/issues/401)) ### Set - Set `name` in custom errors ([#403](https://github.com/stellar/js-stellar-sdk/issues/403)) ## [v2.2.2](https://github.com/stellar/js-stellar-sdk/compare/v2.2.1...v2.2.2) ### Fix - Fix manage data value in SEP0010 challenge builder. ([#396](https://github.com/stellar/js-stellar-sdk/issues/396)) ### Add - Add support for networkPassphrase in SEP0010 challenge builder. ([#397](https://github.com/stellar/js-stellar-sdk/issues/397)) ## [v2.2.1](https://github.com/stellar/js-stellar-sdk/compare/v2.2.0...v2.2.1) ### Fix - Fix [#391](https://github.com/stellar/js-stellar-sdk/issues/391): Remove instance check for MessageEvent on stream error. ([#392](https://github.com/stellar/js-stellar-sdk/issues/392)) ## [v2.2.0](https://github.com/stellar/js-stellar-sdk/compare/v2.1.1...v2.2.0) ### Add - Add helper `Utils.verifyChallengeTx` to verify SEP0010 "Challenge" Transaction. ([#388](https://github.com/stellar/js-stellar-sdk/issues/388)) - Add helper `Utils.verifyTxSignedBy` to verify that a transaction has been signed by a given account. ([#388](https://github.com/stellar/js-stellar-sdk/pull/388/commits/2cbf36891e529f63867d46bcf321b5bb76acef50)) ### Fix - Check for a global EventSource before deciding what to use. This allows you to inject polyfills in other environments like react-native. ([#389](https://github.com/stellar/js-stellar-sdk/issues/389)) ## [v2.1.1](https://github.com/stellar/js-stellar-sdk/compare/v2.1.0...v2.1.1) ### Fix - Fix CallBuilder onmessage type ([#385](https://github.com/stellar/js-stellar-sdk/issues/385)) ## [v2.1.0](https://github.com/stellar/js-stellar-sdk/compare/v2.0.1...v2.1.0) ### Add - Add single script to build docs and call it when combined with jsdoc. ([#380](https://github.com/stellar/js-stellar-sdk/issues/380)) - Add SEP0010 transaction challenge builder. ([#375](https://github.com/stellar/js-stellar-sdk/issues/375)) - Add `home_domain` to ServerApi.AccountRecord ([#376](https://github.com/stellar/js-stellar-sdk/issues/376)) ### Bump - Bump stellar-base to 1.0.3. ([#378](https://github.com/stellar/js-stellar-sdk/issues/378)) - Bump @stellar/tslint-config ([#377](https://github.com/stellar/js-stellar-sdk/issues/377)) ### Fix - Fix jsdoc's build in after_deploy ([#373](https://github.com/stellar/js-stellar-sdk/issues/373)) - Create new URI instead of passing serverUrl (Fix [#379](https://github.com/stellar/js-stellar-sdk/issues/379)). ([#382](https://github.com/stellar/js-stellar-sdk/issues/382)) ## [v2.0.1](https://github.com/stellar/js-stellar-sdk/compare/v1.0.2...v2.0.1) - **Breaking change** Port stellar-sdk to Typescript. Because we use a slightly different build process, there could be some unanticipated bugs. Additionally, some type definitions have changed: - Types that were once in the `Server` namespace but didn't actually deal with the `Server` class have been broken out into a new namespace, `ServerApi`. So, for example, `Server.AccountRecord` -> `ServerApi.AccountRecord`. - `Server.AccountResponse` is out of the `Server` namespace -> `AccountResponse` - `Server.*CallBuilder` is out of the `Server` namespace -> `*CallBuilder` - `HorizonResponseAccount` is now `Horizon.AccountResponse` - Upgrade Webpack to v4. - Add support for providing app name and version to request headers. - (NPM wouldn't accept the 2.0.0 version, so we're publishing to 2.0.1.) Many thanks to @Ffloriel and @Akuukis for their help with this release! ## [v1.0.5](https://github.com/stellar/js-stellar-sdk/compare/v1.0.4...v1.0.5) - Make CallCollectionFunction return a CollectionPage. - Update Horizon.AccountSigner[] types. ## [v1.0.4](https://github.com/stellar/js-stellar-sdk/compare/v1.0.3...v1.0.4) - Automatically tag alpha / beta releases as "next" in NPM. ## [v1.0.3](https://github.com/stellar/js-stellar-sdk/compare/v1.0.2...v1.0.3) - Upgrade axios to 0.19.0 to close a security vulnerability. - Some type fixes. ## [v1.0.2](https://github.com/stellar/js-stellar-sdk/compare/v1.0.1...v1.0.2) - Upgrade stellar-base to v1.0.2 to fix a bug with the browser bundle. ## [v1.0.1](https://github.com/stellar/js-stellar-sdk/compare/v1.0.0...v1.0.1) - Upgrade stellar-base to v1.0.1, which makes available again the deprecated operation functions `Operation.manageOffer` and `Operation.createPassiveOffer` (with a warning). - Fix the documentation around timebounds. ## [v1.0.0](https://github.com/stellar/js-stellar-sdk/compare/v0.15.4...v1.0.0) - Upgrade stellar-base to [v1.0.0](https://github.com/stellar/js-stellar-base/releases/tag/v1.0.0), which introduces two breaking changes. - Switch stellar-sdk's versioning to true semver! 🎉 ## [v0.15.4](https://github.com/stellar/js-stellar-sdk/compare/v0.15.3...v0.15.4) - Add types for LedgerCallBuilder.ledger. - Add types for Server.operationFeeStats. - Add types for the HorizonAxiosClient export. - Move @types/\* from devDependencies to dependencies. - Pass and use a stream response type to CallBuilders if it's different from the normal call response. - Upgrade stellar-base to a version that includes types, and remove @types/stellar-base as a result. ## [v0.15.3](https://github.com/stellar/js-stellar-sdk/compare/v0.15.2...v0.15.3) - In .travis.yml, try to switch from the encrypted API key to an environment var. ## [v0.15.2](https://github.com/stellar/js-stellar-sdk/compare/v0.15.1...v0.15.2) - Fix Server.transactions and Server.payments definitions to properly return collections - Renew the npm publish key ## [v0.15.1](https://github.com/stellar/js-stellar-sdk/compare/v0.15.0...v0.15.1) - Add Typescript type definitions (imported from DefinitelyTyped). - Make these changes to those definitions: - Add definitions for Server.fetchBaseFee and Server.fetchTimebounds - CallBuilder: No long always returns CollectionPaged results. Interfaces that extend CallBuilder should specify whether their response is a collection or not - CallBuilder: Add inflation_destination and last_modified_ledger property - OfferRecord: Fix the returned properties - TradeRecord: Fix the returned properties - TradesCallBuilder: Add forAccount method - TransactionCallBuilder: Add includeFailed method - Horizon.BalanceLineNative/Asset: Add buying_liabilities / selling_liabilities properties - Fix documentation links. ## [v0.15.0](https://github.com/stellar/js-stellar-sdk/compare/v0.14.0...v0.15.0) - **Breaking change**: `stellar-sdk` no longer ships with an `EventSource` polyfill. If you plan to support IE11 / Edge, please use [`event-source-polyfill`](https://www.npmjs.com/package/event-source-polyfill) to set `window.EventSource`. - Upgrade `stellar-base` to a version that doesn't use the `crypto` library, fixing a bug with Angular 6 - Add `Server.prototype.fetchTimebounds`, a helper function that helps you set the `timebounds` property when initting `TransactionBuilder`. It bases the timebounds on server time rather than local time. ## [v0.14.0](https://github.com/stellar/js-stellar-sdk/compare/v0.13.0...v0.14.0) - Updated some out-of-date dependencies - Update documentation to explicitly set fees - Add `Server.prototype.fetchBaseFee`, which devs can use to fetch the current base fee; we plan to add more functions to help suggest fees in future releases - Add `includeFailed` to `OperationCallBuilder` for including failed transactions in calls - Add `operationFeeStats` to `Server` for the new fee stats endpoint - After submitting a transaction with a `manageOffer` operation, return a new property `offerResults`, which explains what happened to the offer. See [`Server.prototype.submitTransaction`](https://stellar.github.io/js-stellar-sdk/Server.html#submitTransaction) for documentation. ## 0.13.0 - Update `stellar-base` to `0.11.0` - Added ESLint and Prettier to enforce code style - Upgraded dependencies, including Babel to 6 - Bump local node version to 6.14.0 ## 0.12.0 - Update `stellar-base` to `0.10.0`: - **Breaking change** Added [`TransactionBuilder.setTimeout`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html#setTimeout) method that sets `timebounds.max_time` on a 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 TimeBounds with `maxTime` on the transaction (this is what `setTimeout` does internally; if there's `minTime` set but no `maxTime` it will be added). 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 check [`TransactionBuilder.setTimeout`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html#setTimeout) docs for more information. - Fixed decoding empty `homeDomain`. - Add `offset` parameter to TradeAggregationCallBuilder to reflect new changes to the endpoint in horizon-0.15.0 ## 0.11.0 - Update `js-xdr` (by updating `stellar-base`) to support unmarshaling non-utf8 strings. - String fields returned by `Operation.fromXDRObject()` are of type `Buffer` now (except `SetOptions.home_domain` and `ManageData.name` - both required to be ASCII by stellar-core). ## 0.10.3 - Update `stellar-base` and xdr files. ## 0.10.2 - Update `stellar-base` (and `js-xdr`). ## 0.10.1 - Update `stellar-base` to `0.8.1`. ## 0.10.0 - Update `stellar-base` to `0.8.0` with `bump_sequence` support. ## 0.9.2 - Removed `.babelrc` file from the NPM package. ## 0.9.1 ### Breaking changes - `stellar-sdk` is now using native `Promise` instead of `bluebird`. The `catch` function is different. Instead of: ```js .catch(StellarSdk.NotFoundError, function (err) { /* ... */ }) ``` please use the following snippet: ```js .catch(function (err) { if (err instanceof StellarSdk.NotFoundError) { /* ... */ } }) ``` - We no longer support IE 11, Firefox < 42, Chrome < 49. ### Changes - Fixed `_ is undefined` bug. - Browser build is around 130 KB smaller! ## 0.8.2 - Added `timeout` option to `StellarTomlResolver` and `FederationServer` calls (https://github.com/stellar/js-stellar-sdk/issues/158). - Fixed adding random value to URLs multiple times (https://github.com/stellar/js-stellar-sdk/issues/169). - Fixed jsdoc for classes that extend `CallBuilder`. - Updated dependencies. - Added `yarn.lock` file to repository. ## 0.8.1 - Add an allowed trade aggregation resolution of one minute - Various bug fixes - Improved documentation ## 0.8.0 - Modify `/trades` endpoint to reflect changes in horizon. - Add `/trade_aggregations` support. - Add `/assets` support. ## 0.7.3 - Upgrade `stellar-base`. ## 0.7.2 - Allow hex string in setOptions signers. ## 0.7.1 - Upgrade `stellar-base`. ## 0.7.0 - Support for new signer types: `sha256Hash`, `preAuthTx`. - `StrKey` helper class with `strkey` encoding related methods. - Removed deprecated methods: `Keypair.isValidPublicKey` (use `StrKey`), `Keypair.isValidSecretKey` (use `StrKey`), `Keypair.fromSeed`, `Keypair.seed`, `Keypair.rawSeed`. - **Breaking changes**: - `Network` must be explicitly selected. Previously testnet was a default network. - `Operation.setOptions()` method `signer` param changed. - `Keypair.fromAccountId()` renamed to `Keypair.fromPublicKey()`. - `Keypair.accountId()` renamed to `Keypair.publicKey()`. - Dropping support for `End-of-Life` node versions. ## 0.6.2 - Updated `stellar.toml` location ## 0.6.1 - `forUpdate` methods of call builders now accept strings and numbers. - Create a copy of attribute in a response if there is a link with the same name (ex. `transaction.ledger`, `transaction._links.ledger`). ## 0.6.0 - **Breaking change** `CallBuilder.stream` now reconnects when no data was received for a long time. This is to prevent permanent disconnects (more in: [#76](https://github.com/stellar/js-stellar-sdk/pull/76)). Also, this method now returns `close` callback instead of `EventSource` object. - **Breaking change** `Server.loadAccount` now returns the `AccountResponse` object. - **Breaking change** Upgraded `stellar-base` to `0.6.0`. `ed25519` package is now an optional dependency. Check `StellarSdk.FastSigning` variable to check if `ed25519` package is available. More in README file. - New `StellarTomlResolver` class that allows getting `stellar.toml` file for a domain. - New `Config` class to set global config values. ## 0.5.1 - Fixed XDR decoding issue when using firefox ## 0.5.0 - **Breaking change** `Server` and `FederationServer` constructors no longer accept object in `serverUrl` parameter. - **Breaking change** Removed `AccountCallBuilder.address` method. Use `AccountCallBuilder.accountId` instead. - **Breaking change** It's no longer possible to connect to insecure server in `Server` or `FederationServer` unless `allowHttp` flag in `opts` is set. - Updated dependencies. ## 0.4.3 - Updated dependency (`stellar-base`). ## 0.4.2 - Updated dependencies. - Added tests. - Added `CHANGELOG.md` file. ## 0.4.1 - `stellar-base` bump. (c90c68f) ## 0.4.0 - **Breaking change** Bumped `stellar-base` to [0.5.0](https://github.com/stellar/js-stellar-base/blob/master/CHANGELOG.md#050). (b810aef)