diff --git a/.github/workflows/bundle_size.yml b/.github/workflows/bundle_size.yml new file mode 100644 index 000000000..1efbd8b34 --- /dev/null +++ b/.github/workflows/bundle_size.yml @@ -0,0 +1,30 @@ +name: Bundle Size + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + + # Workaround for some `yarn` nonsense, see: + # https://github.com/yarnpkg/yarn/issues/6312#issuecomment-429685210 + - name: Install Dependencies + run: yarn install --network-concurrency 1 + + - name: Build All + run: yarn build:prod + + - name: Report Bundle Size + uses: preactjs/compressed-size-action@v2 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + pattern: "dist/*.js" + compression: "none" \ No newline at end of file diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index ac70cc2f6..8c0ee3467 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -12,10 +12,10 @@ jobs: with: fetch-depth: 0 - - name: Install Node (14.x) + - name: Install Node (16.x) uses: actions/setup-node@v3 with: - node-version: '14.x' + node-version: 16 - name: Install Dependencies run: yarn install diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 9ea86aa64..ca76fabd8 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -13,7 +13,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: '14.x' + node-version: 16 registry-url: 'https://registry.npmjs.org' - name: Install Depencencies @@ -22,7 +22,7 @@ jobs: - name: Test & Build run: yarn preversion - - name: Publish npm package - run: yarn publish + - name: Publish release npm package + run: yarn publish --tag beta env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1b755313..881dbfdeb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false max-parallel: 4 matrix: - node-version: [14, 16, 18] + node-version: [16, 18, 20] steps: - name: Checkout @@ -29,9 +29,6 @@ jobs: - name: Install Dependencies run: yarn install --network-concurrency 1 - - name: Run Linter - run: yarn lint - - name: Build All run: yarn build:prod @@ -40,3 +37,6 @@ jobs: - name: Run Browser Tests run: yarn test:browser + + - name: Run Linter Checks + run: yarn fmt && yarn lint && (git diff-index --quiet HEAD; git diff) diff --git a/.gitignore b/.gitignore index 77e8f70b7..d0c17f74d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /tmp/ /dist/ /config/dist/ +/lib/ /coverage/ /jsdoc/ .DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index c8925be39..274063aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,39 @@ ## Unreleased +## [`v10.0.0-beta.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0-beta.0): Protocol 20 + +### Breaking Changes + * **Node 16 is the new minimum version** to use the SDKs. + * The XDR has been massively overhauled to support [Soroban in Protocol 20](https://soroban.stellar.org/docs/category/fundamentals-and-concepts), which means new operations, data structures, and a transaction format as well as new overlay features ([#538](https://github.com/stellar/js-stellar-base/pull/538)). + +The core data structure of Soroban is a generic type called an `ScVal` (**s**mart **c**ontract **val**ue, which is a union of types that can basically represent anything [numbers, strings, arrays, maps, contract bytecode, etc.]). You can refer to the XDR for details, and you can utilize new APIs to make dealing with these complex values easier: + - `nativeToScVal` helps convert native types to their closest Soroban equivalent + - `scValToNative` helps find the closest native JavaScript type(s) corresponding to a smart contract value + - `scValToBigInt` helps convert numeric `ScVal`s into native `bigint`s + - `ScInt` and `XdrLargeInt` help convert to and from `bigint`s to other types and form sized integer types for smart contract usage + +### Added +The following are new APIs to deal with new Soroban constructs: + - **`Address`, which helps manage "smart" addresses in the Soroban context.** Addresses there (used for auth and identity purposes) can either be contracts (strkey `C...`) or accounts (strkey `G...`). This abstraction helps manage them and distinguish between them easily. + - **`Contract`, which helps manage contract identifiers.** The primary purpose is to build invocations of its methods via the generic `call(...)`, but it also provides utilities for converting to an `Address` or calculating its minimum footprint for state expiration. + - **Three new operations** have been added related to Soroban transactions: + * `invokeHostFunction` for calling contract code + * `bumpFootprintExpiration` for extending the state lifetime of Soroban data + * `restoreFootprint` for restoring expired, off-chain state back onto the ledger + - The `TransactionBuilder` now takes a `sorobanData` parameter (and has a corresponding `.setSorobanData()` builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form of `xdr.LedgerKey`s] it plans to read and write as part of the transaction). + * To facilitate building this out, there's a new `SorobanDataBuilder` factory to set fields individually + - The `TransactionBuilder` now has a `cloneFrom(tx, opts)` constructor method to create an instance from an existing transaction, also allowing parameter overrides via `opts`. + - The following are convenience methods for building out certain types of smart contract-related structures: + * `buildInvocationTree` and `walkInvocationTree` are both ways to visualize invocation calling trees better + * `authorizeInvocation` helps multiple parties sign invocation calling trees + * `humanizeEvents` helps make diagnostic events more readable + - We've added a GHA to track bundle size changes as PRs are made. This protocol upgrade adds +18% to the final, minified bundle size which is significant but acceptable given the size of the upgrade. + +### Fixes +* Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)). + + ## [v9.0.0](https://github.com/stellar/js-stellar-base/compare/v8.2.2..v9.0.0) This is a large update and the following changelog incorporates ALL changes across the `beta.N` versions of this upgrade. @@ -15,7 +48,6 @@ The browser bundle size has decreased **significantly**: * `stellar-base.min.js` is **340 KiB**, down from **1.2 MiB** previously. * the new, unminified `stellar-base.js` is **895 KiB**. - ### Breaking Changes - The build system has been completely overhauled to support Webpack 5 ([#584](https://github.com/stellar/js-stellar-base/pull/584), [#585](https://github.com/stellar/js-stellar-base/pull/585)). diff --git a/Makefile b/Makefile index da7dda119..c80c0a8a6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/curr +XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/9ac02641139e6717924fdad716f6e958d0168491 XDR_BASE_LOCAL_CURR=xdr/curr XDR_FILES_CURR= \ Stellar-SCP.x \ @@ -6,10 +6,15 @@ XDR_FILES_CURR= \ Stellar-ledger.x \ Stellar-overlay.x \ Stellar-transaction.x \ - Stellar-types.x + Stellar-types.x \ + Stellar-contract.x \ + Stellar-contract-env-meta.x \ + Stellar-contract-meta.x \ + Stellar-contract-spec.x \ + Stellar-contract-config-setting.x XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR)) -XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/next +XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/440dc9512b6e72cf84965641c5eb495d6043ed73 XDR_BASE_LOCAL_NEXT=xdr/next XDR_FILES_NEXT= \ Stellar-SCP.x \ @@ -20,7 +25,9 @@ XDR_FILES_NEXT= \ Stellar-types.x \ Stellar-contract.x \ Stellar-contract-env-meta.x \ - Stellar-contract-spec.x + Stellar-contract-meta.x \ + Stellar-contract-spec.x \ + Stellar-contract-config-setting.x XDR_FILES_LOCAL_NEXT=$(addprefix xdr/next/,$(XDR_FILES_NEXT)) XDRGEN_COMMIT=master @@ -33,8 +40,8 @@ generate: src/generated/curr_generated.js types/curr.d.ts src/generated/next_gen src/generated/curr_generated.js: $(XDR_FILES_LOCAL_CURR) mkdir -p $(dir $@) > $@ - docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\ - gem install specific_install -v 0.3.7 && \ + docker run -it --rm -v $$PWD:/wd -w /wd ruby:3.1 /bin/bash -c '\ + gem install specific_install -v 0.3.8 && \ gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_COMMIT) && \ xdrgen --language javascript --namespace curr --output src/generated $^ \ ' @@ -42,8 +49,8 @@ src/generated/curr_generated.js: $(XDR_FILES_LOCAL_CURR) src/generated/next_generated.js: $(XDR_FILES_LOCAL_NEXT) mkdir -p $(dir $@) > $@ - docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\ - gem install specific_install -v 0.3.7 && \ + docker run -it --rm -v $$PWD:/wd -w /wd ruby:3.1 /bin/bash -c '\ + gem install specific_install -v 0.3.8 && \ gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_COMMIT) && \ xdrgen --language javascript --namespace next --output src/generated $^ \ ' @@ -53,7 +60,7 @@ types/curr.d.ts: src/generated/curr_generated.js apk add --update git && \ git clone --depth 1 https://github.com/stellar/dts-xdr -b $(DTSXDR_COMMIT) --single-branch && \ cd /dts-xdr && \ - yarn install && \ + yarn install --network-concurrency 1 && \ OUT=/wd/$@ npx jscodeshift -t src/transform.js /wd/$< && \ cd /wd && \ yarn run prettier --write /wd/$@ \ @@ -64,7 +71,7 @@ types/next.d.ts: src/generated/next_generated.js apk add --update git && \ git clone --depth 1 https://github.com/stellar/dts-xdr -b $(DTSXDR_COMMIT) --single-branch && \ cd /dts-xdr && \ - yarn install && \ + yarn install --network-concurrency 1 && \ OUT=/wd/$@ npx jscodeshift -t src/transform.js /wd/$< && \ cd /wd && \ yarn run prettier --write /wd/$@ \ @@ -83,6 +90,7 @@ $(XDR_FILES_LOCAL_NEXT): reset-xdr: rm -f xdr/*/*.x + rm -f src/generated/*.js rm -f types/curr.d.ts rm -f types/next.d.ts $(MAKE) generate diff --git a/README.md b/README.md index f8fa91ca8..b06019464 100644 --- a/README.md +++ b/README.md @@ -98,9 +98,9 @@ Make sure that you are using the latest version number. They can be found on the ### To develop and test js-stellar-base itself -1. Install Node 14.x +1. Install Node 16.x -We support the oldest LTS release of Node, which is [currently 14.x](https://nodejs.org/en/about/releases/). Please likewise install and develop on Node 14 so you don't get surprised when your code works locally but breaks in CI. +We support the oldest LTS release of Node, which is [currently 16.x](https://nodejs.org/en/about/releases/). Please likewise install and develop on Node 16 so you don't get surprised when your code works locally but breaks in CI. If you work on several projects that use different Node versions, you might find helpful to install a NodeJS version manager: diff --git a/config/.eslintrc.js b/config/.eslintrc.js index c9bd0afc5..1ed1e0a91 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -1,6 +1,7 @@ module.exports = { env: { - es6: true + es6: true, + es2020: true }, extends: ['airbnb-base', 'prettier'], plugins: ['@babel', 'prettier', 'prefer-import'], diff --git a/config/webpack.config.browser.js b/config/webpack.config.browser.js index 89471237f..1cd52e83a 100644 --- a/config/webpack.config.browser.js +++ b/config/webpack.config.browser.js @@ -14,7 +14,6 @@ const config = { }, resolve: { fallback: { - crypto: require.resolve('crypto-browserify'), stream: require.resolve('stream-browserify'), buffer: require.resolve('buffer') }, diff --git a/package.json b/package.json index 944f4d859..c175c524c 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,12 @@ { "name": "stellar-base", - "version": "9.0.0", + "version": "10.0.0-beta.0", "description": "Low-level support library for the Stellar network.", "main": "./lib/index.js", - "browser": "./dist/stellar-base.min.js", + "browser": { + "main": "./dist/stellar-base.min.js", + "sodium-native": false + }, "types": "./types/index.d.ts", "scripts": { "build": "yarn build:node && yarn build:browser", @@ -13,14 +16,15 @@ "build:browser:prod": "cross-env NODE_ENV=production yarn build:browser", "build:prod": "cross-env NODE_ENV=production yarn build", "test": "yarn build && yarn test:node && yarn test:browser", - "test:node": "nyc --nycrc-path ./config/.nycrc mocha", + "test:node": "yarn _nyc mocha", "test:browser": "karma start ./config/karma.conf.js", "docs": "jsdoc -c ./config/.jsdoc.json --verbose", "lint": "eslint -c ./config/.eslintrc.js src/ && dtslint --localTs node_modules/typescript/lib types/", "preversion": "yarn clean && yarn fmt && yarn lint && yarn build:prod && yarn test", "fmt": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'", "prepare": "yarn build:prod", - "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/" + "clean": "rm -rf lib/ dist/ coverage/ .nyc_output/", + "_nyc": "nyc --nycrc-path ./config/.nycrc" }, "mocha": { "require": [ @@ -52,9 +56,6 @@ "yarn lint" ] }, - "browser": { - "sodium-native": false - }, "repository": { "type": "git", "url": "https://github.com/stellar/js-stellar-base.git" @@ -69,60 +70,59 @@ }, "homepage": "https://github.com/stellar/js-stellar-base", "devDependencies": { - "@babel/cli": "^7.21.0", - "@babel/core": "^7.12.0", - "@babel/eslint-parser": "^7.21.3", - "@babel/eslint-plugin": "^7.19.1", - "@babel/preset-env": "^7.21.4", - "@babel/register": "^7.21.0", - "@definitelytyped/dtslint": "^0.0.163", + "@babel/cli": "^7.22.15", + "@babel/core": "^7.22.17", + "@babel/eslint-parser": "^7.22.15", + "@babel/eslint-plugin": "^7.22.10", + "@babel/preset-env": "^7.22.15", + "@babel/register": "^7.22.15", + "@definitelytyped/dtslint": "^0.0.177", "@istanbuljs/nyc-config-babel": "3.0.0", - "@types/node": "^20.1.4", - "@typescript-eslint/parser": "^5.59.6", - "babel-loader": "^9.1.2", + "@types/node": "^20.6.0", + "@typescript-eslint/parser": "^6.7.0", + "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", - "buffer": "^6.0.3", - "chai": "^4.3.7", + "chai": "^4.3.8", "cross-env": "^7.0.3", - "eslint": "^8.37.0", + "eslint": "^8.49.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-import": "^2.25.2", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prefer-import": "^0.0.1", - "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-prettier": "^5.0.0", "eslint-webpack-plugin": "^4.0.0", "ghooks": "^2.0.4", "husky": "^8.0.3", "jsdoc": "^4.0.2", - "karma": "^6.4.1", + "karma": "^6.4.2", "karma-chrome-launcher": "^3.1.0", - "karma-coverage": "^2.2.0", + "karma-coverage": "^2.2.1", "karma-firefox-launcher": "^2.1.1", "karma-mocha": "^2.0.0", "karma-sinon-chai": "^2.0.2", "karma-webpack": "^5.0.0", - "lint-staged": "^13.2.0", + "lint-staged": "^14.0.1", "minami": "^1.1.1", "mocha": "^10.2.0", "node-polyfill-webpack-plugin": "^2.0.1", "nyc": "^15.1.0", - "prettier": "^2.8.7", + "prettier": "^3.0.3", "randombytes": "^2.1.0", "sinon": "^15.0.3", "sinon-chai": "^3.7.0", "taffydb": "^2.7.3", - "terser-webpack-plugin": "^5.3.7", + "terser-webpack-plugin": "^5.3.8", "ts-node": "^10.9.1", - "typescript": "^5.0.3", + "typescript": "^5.2.2", "webpack": "^5.82.1", "webpack-cli": "^5.1.1" }, "dependencies": { "base32.js": "^0.1.0", - "bignumber.js": "^9.1.1", - "crypto-browserify": "^3.12.0", - "js-xdr": "^2.0.0", + "bignumber.js": "^9.1.2", + "buffer": "^6.0.3", + "js-xdr": "^3.0.0", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" }, diff --git a/src/address.js b/src/address.js new file mode 100644 index 000000000..46089a975 --- /dev/null +++ b/src/address.js @@ -0,0 +1,138 @@ +import { StrKey } from './strkey'; +import xdr from './xdr'; + +/** + * Create a new Address object. + * + * `Address` represents a single address in the Stellar network. An address can + * represent an account or a contract. + * + * @constructor + * + * @param {string} address - ID of the account (ex. + * `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA`). If you + * provide a muxed account address, this will throw; use {@link + * MuxedAccount} instead. + */ +export class Address { + constructor(address) { + if (StrKey.isValidEd25519PublicKey(address)) { + this._type = 'account'; + this._key = StrKey.decodeEd25519PublicKey(address); + } else if (StrKey.isValidContract(address)) { + this._type = 'contract'; + this._key = StrKey.decodeContract(address); + } else { + throw new Error('Unsupported address type'); + } + } + + /** + * Parses a string and returns an Address object. + * + * @param {string} address - The address to parse. ex. `GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA` + * @returns {Address} + */ + static fromString(address) { + return new Address(address); + } + + /** + * Creates a new account Address object from a buffer of raw bytes. + * + * @param {Buffer} buffer - The bytes of an address to parse. + * @returns {Address} + */ + static account(buffer) { + return new Address(StrKey.encodeEd25519PublicKey(buffer)); + } + + /** + * Creates a new contract Address object from a buffer of raw bytes. + * + * @param {Buffer} buffer - The bytes of an address to parse. + * @returns {Address} + */ + static contract(buffer) { + return new Address(StrKey.encodeContract(buffer)); + } + + /** + * Convert this from an xdr.ScVal type + * + * @param {xdr.ScVal} scVal - The xdr.ScVal type to parse + * @returns {Address} + */ + static fromScVal(scVal) { + return Address.fromScAddress(scVal.address()); + } + + /** + * Convert this from an xdr.ScAddress type + * + * @param {xdr.ScAddress} scAddress - The xdr.ScAddress type to parse + * @returns {Address} + */ + static fromScAddress(scAddress) { + switch (scAddress.switch()) { + case xdr.ScAddressType.scAddressTypeAccount(): + return Address.account(scAddress.accountId().ed25519()); + case xdr.ScAddressType.scAddressTypeContract(): + return Address.contract(scAddress.contractId()); + default: + throw new Error('Unsupported address type'); + } + } + + /** + * Serialize an address to string. + * + * @returns {string} + */ + toString() { + switch (this._type) { + case 'account': + return StrKey.encodeEd25519PublicKey(this._key); + case 'contract': + return StrKey.encodeContract(this._key); + default: + throw new Error('Unsupported address type'); + } + } + + /** + * Convert this Address to an xdr.ScVal type. + * + * @returns {xdr.ScVal} + */ + toScVal() { + return xdr.ScVal.scvAddress(this.toScAddress()); + } + + /** + * Convert this Address to an xdr.ScAddress type. + * + * @returns {xdr.ScAddress} + */ + toScAddress() { + switch (this._type) { + case 'account': + return xdr.ScAddress.scAddressTypeAccount( + xdr.PublicKey.publicKeyTypeEd25519(this._key) + ); + case 'contract': + return xdr.ScAddress.scAddressTypeContract(this._key); + default: + throw new Error('Unsupported address type'); + } + } + + /** + * Return the raw public key bytes for this address. + * + * @returns {Buffer} + */ + toBuffer() { + return this._key; + } +} diff --git a/src/asset.js b/src/asset.js index 3fcbdf640..5f3b33d02 100644 --- a/src/asset.js +++ b/src/asset.js @@ -2,6 +2,7 @@ import { trimEnd } from './util/util'; import xdr from './xdr'; import { Keypair } from './keypair'; import { StrKey } from './strkey'; +import { hash } from './hashing'; /** * Asset class represents an asset, either the native asset (`XLM`) @@ -95,6 +96,32 @@ export class Asset { return this._toXDRObject(xdr.TrustLineAsset); } + /** + * Returns the would-be contract ID (`C...` format) for this asset on a given + * network. + * + * @param {string} networkPassphrase indicates which network the contract + * ID should refer to, since every network will have a unique ID for the + * same contract (see {@link Networks} for options) + * + * @returns {string} the strkey-encoded (`C...`) contract ID for this asset + * + * @warning This makes no guarantee that this contract actually *exists*. + */ + contractId(networkPassphrase) { + const networkId = hash(Buffer.from(networkPassphrase)); + const preimage = xdr.HashIdPreimage.envelopeTypeContractId( + new xdr.HashIdPreimageContractId({ + networkId, + contractIdPreimage: xdr.ContractIdPreimage.contractIdPreimageFromAsset( + this.toXDRObject() + ) + }) + ); + + return StrKey.encodeContract(hash(preimage.toXDR())); + } + /** * Returns the xdr object for this asset. * @param {xdr.Asset | xdr.ChangeTrustAsset} xdrAsset - The asset xdr object. diff --git a/src/auth.js b/src/auth.js new file mode 100644 index 000000000..34ee23d90 --- /dev/null +++ b/src/auth.js @@ -0,0 +1,200 @@ +import xdr from './xdr'; + +import { StrKey } from './strkey'; +import { Keypair } from './keypair'; +import { hash } from './hashing'; + +import { Address } from './address'; +import { nativeToScVal } from './scval'; + +/** + * This builds an authorization entry that indicates to + * {@link Operation.invokeHostFunction} that a particular identity (i.e. signing + * {@link Keypair} or other signer) approves the execution of an invocation tree + * (i.e. a simulation-acquired {@link xdr.SorobanAuthorizedInvocation}) on a + * particular network (uniquely identified by its passphrase, see + * {@link Networks}) until a particular ledger sequence is reached. + * + * This enables building an {@link xdr.SorobanAuthorizationEntry} without + * worrying about how to combine {@link buildAuthEnvelope} and + * {@link buildAuthEntry}, while those allow advanced, asynchronous, two-step + * building+signing of the authorization entries. + * + * This one lets you pass a either a {@link Keypair} or a callback function to + * handle signing the envelope hash. + * + * @param {Keypair} signer the identity keypair authorizing this invocation + * @param {string} networkPassphrase the network passphrase is incorprated + * into the signature (see {@link Networks} for options) + * @param {number} validUntil the (exclusive) future ledger sequence number + * until which this authorization entry should be valid (if + * `currentLedgerSeq==validUntil`, this is expired)) + * @param {xdr.SorobanAuthorizedInvocation} invocation the invocation tree that + * we're authorizing (likely, this comes from transaction simulation) + * + * @returns {xdr.SorobanAuthorizationEntry} an authorization entry that you can + * pass along to {@link Operation.invokeHostFunction} + */ +export function authorizeInvocation( + signer, + networkPassphrase, + validUntil, + invocation +) { + const preimage = buildAuthEnvelope(networkPassphrase, validUntil, invocation); + const input = hash(preimage.toXDR()); + const signature = signer.sign(input); + return buildAuthEntry(preimage, signature, signer.publicKey()); +} + +/** + * This works like {@link authorizeInvocation}, but allows passing an + * asynchronous callback as a "signing method" (e.g. {@link Keypair.sign}) and a + * public key instead of a specific {@link Keypair}. + * + * This is to make two-step authorization (i.e. custom signing flows) easier. + * + * @borrows authorizeInvocation + * + * @param {string} publicKey the public identity that is authorizing this + * invocation via its signature + * @param {function(Buffer): Buffer} signingMethod a function which takes + * an input bytearray and returns its signature as signed by the private key + * corresponding to the `publicKey` parameter + * @param {string} networkPassphrase the network passphrase is incorprated + * into the signature (see {@link Networks} for options) + * @param {number} validUntil the (exclusive) future ledger sequence number + * until which this authorization entry should be valid (if + * `currentLedgerSeq==validUntil`, this is expired) + * @param {xdr.SorobanAuthorizedInvocation} invocation the invocation tree that + * we're authorizing (likely, this comes from transaction simulation) + * + * @returns {Promise} + * @see authorizeInvocation + */ +export async function authorizeInvocationCallback( + publicKey, + signingMethod, + networkPassphrase, + validUntil, + invocation +) { + const preimage = buildAuthEnvelope(networkPassphrase, validUntil, invocation); + const input = hash(preimage.toXDR()); + const signature = await signingMethod(input); + return buildAuthEntry(preimage, signature, publicKey); +} + +/** + * Builds an {@link xdr.HashIdPreimage} that, when hashed and signed, can be + * used to build an {@link xdr.SorobanAuthorizationEntry} via + * {@link buildAuthEnvelope} to approve {@link Operation.invokeHostFunction} + * invocations. + * + * The envelope built here will approve the execution of an invocation tree + * (i.e. a simulation-acquired {@link xdr.SorobanAuthorizedInvocation}) on a + * particular network (uniquely identified by its passphrase, see + * {@link Networks}) until a particular ledger sequence is reached (exclusive). + * + * @param {string} networkPassphrase the network passphrase is incorprated + * into the signature (see {@link Networks} for options) + * @param {number} validUntil the (exclusive) future ledger sequence number + * until which this authorization entry should be valid + * @param {xdr.SorobanAuthorizedInvocation} invocation the invocation tree that + * we're authorizing (likely, this comes from transaction simulation) + * + * @returns {xdr.HashIdPreimage} a preimage envelope that, when hashed and + * signed, represents the signature necessary to build a proper + * {@link xdr.SorobanAuthorizationEntry} via {@link buildAuthEntry}. + */ +export function buildAuthEnvelope(networkPassphrase, validUntil, invocation) { + // We use keypairs as a source of randomness for the nonce to avoid mucking + // with any crypto dependencies. Note that this just has to be random and + // unique, not cryptographically secure, so it's fine. + const kp = Keypair.random().rawPublicKey(); + const nonce = new xdr.Int64(bytesToInt64(kp)); + + const networkId = hash(Buffer.from(networkPassphrase)); + const envelope = new xdr.HashIdPreimageSorobanAuthorization({ + networkId, + invocation, + nonce, + signatureExpirationLedger: validUntil + }); + + return xdr.HashIdPreimage.envelopeTypeSorobanAuthorization(envelope); +} + +/** + * Builds an auth entry with a signed invocation tree. + * + * You should first build the envelope using {@link buildAuthEnvelope}. If you + * have a signing {@link Keypair}, you can use the more convenient + * {@link authorizeInvocation} to do signing for you. + * + * @param {xdr.HashIdPreimage} envelope an envelope to represent the call tree + * being signed, probably built by {@link buildAuthEnvelope} + * @param {Buffer|Uint8Array} signature a signature of the hash of the + * envelope by the private key corresponding to `publicKey` (in other words, + * `signature = sign(hash(envelope))`) + * @param {string} publicKey the public identity that signed this envelope + * + * @returns {xdr.SorobanAuthorizationEntry} + * + * @throws {Error} if `verify(hash(envelope), signature, publicKey)` does not + * pass, meaning one of the arguments was not passed or built correctly + * @throws {TypeError} if the envelope does not hold an + * {@link xdr.HashIdPreimageSorobanAuthorization} instance + */ +export function buildAuthEntry(envelope, signature, publicKey) { + // ensure this identity signed this envelope correctly + if ( + !Keypair.fromPublicKey(publicKey).verify(hash(envelope.toXDR()), signature) + ) { + throw new Error(`signature does not match envelope or identity`); + } + + if ( + envelope.switch() !== xdr.EnvelopeType.envelopeTypeSorobanAuthorization() + ) { + throw new TypeError( + `expected sorobanAuthorization envelope, got ${envelope.switch().name}` + ); + } + + const auth = envelope.sorobanAuthorization(); + return new xdr.SorobanAuthorizationEntry({ + rootInvocation: auth.invocation(), + credentials: xdr.SorobanCredentials.sorobanCredentialsAddress( + new xdr.SorobanAddressCredentials({ + address: new Address(publicKey).toScAddress(), + nonce: auth.nonce(), + signatureExpirationLedger: auth.signatureExpirationLedger(), + // This structure is defined here: + // https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#stellar-account-signatures + // + // Encoding a contract structure as an ScVal means the keys are supposed + // to be symbols, hence the forced typing here. + signature: xdr.ScVal.scvVec([ + nativeToScVal( + { + public_key: StrKey.decodeEd25519PublicKey(publicKey), + signature + }, + { + type: { + public_key: ['symbol', null], + signature: ['symbol', null] + } + } + ) + ]) + }) + ) + }); +} + +function bytesToInt64(bytes) { + // eslint-disable-next-line no-bitwise + return bytes.subarray(0, 8).reduce((accum, b) => (accum << 8) | b, 0); +} diff --git a/src/contract.js b/src/contract.js new file mode 100644 index 000000000..dd756aa7c --- /dev/null +++ b/src/contract.js @@ -0,0 +1,92 @@ +import { Address } from './address'; +import { Operation } from './operation'; +import xdr from './xdr'; +import { StrKey } from './strkey'; + +/** + * 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. + * + * @constructor + * + * @param {string} contractId - ID of the contract (ex. + * `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`). + */ +export class Contract { + constructor(contractId) { + try { + // First, try it as a strkey + this._id = StrKey.decodeContract(contractId); + } catch (_) { + throw new Error(`Invalid contract ID: ${contractId}`); + } + } + + /** + * Returns Stellar contract ID as a strkey, ex. + * `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`. + * @returns {string} + */ + contractId() { + return StrKey.encodeContract(this._id); + } + + /** @returns {string} the ID as a strkey (C...) */ + toString() { + return this.contractId(); + } + + /** @returns {Address} the wrapped address of this contract */ + address() { + return Address.contract(this._id); + } + + /** + * Returns an operation that will invoke this contract call. + * + * @param {string} method name of the method to call + * @param {...xdr.ScVal} params arguments to pass to the function call + * + * @returns {xdr.Operation} an InvokeHostFunctionOp operation to call the + * contract with the given method and parameters + */ + call(method, ...params) { + return Operation.invokeHostFunction({ + func: xdr.HostFunction.hostFunctionTypeInvokeContract( + new xdr.InvokeContractArgs({ + contractAddress: this.address().toScAddress(), + functionName: xdr.ScVal.scvSymbol(method), + args: params + }) + ), + auth: [] + }); + } + + /** + * Returns the read-only footprint entries necessary for any invocations to + * this contract, for convenience when adding it to your transaction's overall + * footprint or doing bump/restore operations. + * + * @returns {xdr.LedgerKey[]} the ledger keys containing the contract's code + * (first) and its deployed contract instance (second) + */ + getFootprint() { + return [ + xdr.LedgerKey.contractCode( + new xdr.LedgerKeyContractCode({ hash: this._id }) + ), + xdr.LedgerKey.contractData( + new xdr.LedgerKeyContractData({ + contract: this.address().toScAddress(), + key: xdr.ScVal.scvLedgerKeyContractInstance(), + durability: xdr.ContractDataDurability.persistent() + }) + ) + ]; + } +} diff --git a/src/events.js b/src/events.js new file mode 100644 index 000000000..7af8db9a9 --- /dev/null +++ b/src/events.js @@ -0,0 +1,44 @@ +import xdr from './xdr'; + +import { StrKey } from './strkey'; +import { scValToNative } from './scval'; + +/** + * Converts raw diagnostic or contract events into something with a flatter, + * human-readable, and understandable structure. + * + * @param {xdr.DiagnosticEvent[] | xdr.ContractEvent[]} events either contract + * events or diagnostic events to parse into a friendly format + * + * @returns {SorobanEvent[]} a list of human-readable event structures, where + * each element has the following properties: + * - type: a string of one of 'system', 'contract', 'diagnostic + * - contractId?: optionally, a `C...` encoded strkey + * - topics: a list of {@link scValToNative} invocations on the topics + * - data: similarly, a {@link scValToNative} invocation on the raw event data + */ +export function humanizeEvents(events) { + return events.map((e) => { + if (e instanceof xdr.DiagnosticEvent) { + return extractEvent(e.event()); + } + + return extractEvent(e); + }); +} + +function extractEvent(event) { + return { + contractId: + event.contractId() === null + ? '' + : StrKey.encodeContract(event.contractId()), + type: event.type().name, + topics: event + .body() + .value() + .topics() + .map((t) => scValToNative(t)), + data: scValToNative(event.body().value().data()) + }; +} diff --git a/src/fee_bump_transaction.js b/src/fee_bump_transaction.js index e070d366a..ea91d8b1f 100644 --- a/src/fee_bump_transaction.js +++ b/src/fee_bump_transaction.js @@ -61,6 +61,14 @@ export class FeeBumpTransaction extends TransactionBase { return this._innerTransaction; } + /** + * @type {Operation[]} + * @readonly + */ + get operations() { + return this._innerTransaction.operations; + } + /** * @type {string} * @readonly diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index 575fbdecc..713a09356 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -4,7154 +4,9766 @@ /* jshint maxstatements:2147483647 */ /* jshint esnext:true */ -import * as XDR from 'js-xdr'; - - -var types = XDR.config(xdr => { - -// === xdr source ============================================================ -// -// typedef opaque Value<>; -// -// =========================================================================== -xdr.typedef("Value", xdr.varOpaque()); - -// === xdr source ============================================================ -// -// struct SCPBallot -// { -// uint32 counter; // n -// Value value; // x -// }; -// -// =========================================================================== -xdr.struct("ScpBallot", [ - ["counter", xdr.lookup("Uint32")], - ["value", xdr.lookup("Value")], -]); - -// === xdr source ============================================================ -// -// enum SCPStatementType -// { -// SCP_ST_PREPARE = 0, -// SCP_ST_CONFIRM = 1, -// SCP_ST_EXTERNALIZE = 2, -// SCP_ST_NOMINATE = 3 -// }; -// -// =========================================================================== -xdr.enum("ScpStatementType", { - scpStPrepare: 0, - scpStConfirm: 1, - scpStExternalize: 2, - scpStNominate: 3, -}); - -// === xdr source ============================================================ -// -// struct SCPNomination -// { -// Hash quorumSetHash; // D -// Value votes<>; // X -// Value accepted<>; // Y -// }; -// -// =========================================================================== -xdr.struct("ScpNomination", [ - ["quorumSetHash", xdr.lookup("Hash")], - ["votes", xdr.varArray(xdr.lookup("Value"), 2147483647)], - ["accepted", xdr.varArray(xdr.lookup("Value"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } -// -// =========================================================================== -xdr.struct("ScpStatementPrepare", [ - ["quorumSetHash", xdr.lookup("Hash")], - ["ballot", xdr.lookup("ScpBallot")], - ["prepared", xdr.option(xdr.lookup("ScpBallot"))], - ["preparedPrime", xdr.option(xdr.lookup("ScpBallot"))], - ["nC", xdr.lookup("Uint32")], - ["nH", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } -// -// =========================================================================== -xdr.struct("ScpStatementConfirm", [ - ["ballot", xdr.lookup("ScpBallot")], - ["nPrepared", xdr.lookup("Uint32")], - ["nCommit", xdr.lookup("Uint32")], - ["nH", xdr.lookup("Uint32")], - ["quorumSetHash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } -// -// =========================================================================== -xdr.struct("ScpStatementExternalize", [ - ["commit", xdr.lookup("ScpBallot")], - ["nH", xdr.lookup("Uint32")], - ["commitQuorumSetHash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// union switch (SCPStatementType type) -// { -// case SCP_ST_PREPARE: -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } prepare; -// case SCP_ST_CONFIRM: -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } confirm; -// case SCP_ST_EXTERNALIZE: -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } externalize; -// case SCP_ST_NOMINATE: -// SCPNomination nominate; -// } -// -// =========================================================================== -xdr.union("ScpStatementPledges", { - switchOn: xdr.lookup("ScpStatementType"), - switchName: "type", - switches: [ - ["scpStPrepare", "prepare"], - ["scpStConfirm", "confirm"], - ["scpStExternalize", "externalize"], - ["scpStNominate", "nominate"], - ], - arms: { - prepare: xdr.lookup("ScpStatementPrepare"), - confirm: xdr.lookup("ScpStatementConfirm"), - externalize: xdr.lookup("ScpStatementExternalize"), - nominate: xdr.lookup("ScpNomination"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCPStatement -// { -// NodeID nodeID; // v -// uint64 slotIndex; // i -// -// union switch (SCPStatementType type) -// { -// case SCP_ST_PREPARE: -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } prepare; -// case SCP_ST_CONFIRM: -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } confirm; -// case SCP_ST_EXTERNALIZE: -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } externalize; -// case SCP_ST_NOMINATE: -// SCPNomination nominate; -// } -// pledges; -// }; -// -// =========================================================================== -xdr.struct("ScpStatement", [ - ["nodeId", xdr.lookup("NodeId")], - ["slotIndex", xdr.lookup("Uint64")], - ["pledges", xdr.lookup("ScpStatementPledges")], -]); - -// === xdr source ============================================================ -// -// struct SCPEnvelope -// { -// SCPStatement statement; -// Signature signature; -// }; -// -// =========================================================================== -xdr.struct("ScpEnvelope", [ - ["statement", xdr.lookup("ScpStatement")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// struct SCPQuorumSet -// { -// uint32 threshold; -// NodeID validators<>; -// SCPQuorumSet innerSets<>; -// }; -// -// =========================================================================== -xdr.struct("ScpQuorumSet", [ - ["threshold", xdr.lookup("Uint32")], - ["validators", xdr.varArray(xdr.lookup("NodeId"), 2147483647)], - ["innerSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// typedef PublicKey AccountID; -// -// =========================================================================== -xdr.typedef("AccountId", xdr.lookup("PublicKey")); - -// === xdr source ============================================================ -// -// typedef opaque Thresholds[4]; -// -// =========================================================================== -xdr.typedef("Thresholds", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef string string32<32>; -// -// =========================================================================== -xdr.typedef("String32", xdr.string(32)); - -// === xdr source ============================================================ -// -// typedef string string64<64>; -// -// =========================================================================== -xdr.typedef("String64", xdr.string(64)); - -// === xdr source ============================================================ -// -// typedef int64 SequenceNumber; -// -// =========================================================================== -xdr.typedef("SequenceNumber", xdr.lookup("Int64")); - -// === xdr source ============================================================ -// -// typedef uint64 TimePoint; -// -// =========================================================================== -xdr.typedef("TimePoint", xdr.lookup("Uint64")); - -// === xdr source ============================================================ -// -// typedef uint64 Duration; -// -// =========================================================================== -xdr.typedef("Duration", xdr.lookup("Uint64")); - -// === xdr source ============================================================ -// -// typedef opaque DataValue<64>; -// -// =========================================================================== -xdr.typedef("DataValue", xdr.varOpaque(64)); - -// === xdr source ============================================================ -// -// typedef Hash PoolID; -// -// =========================================================================== -xdr.typedef("PoolId", xdr.lookup("Hash")); - -// === xdr source ============================================================ -// -// typedef opaque AssetCode4[4]; -// -// =========================================================================== -xdr.typedef("AssetCode4", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef opaque AssetCode12[12]; -// -// =========================================================================== -xdr.typedef("AssetCode12", xdr.opaque(12)); - -// === xdr source ============================================================ -// -// enum AssetType -// { -// ASSET_TYPE_NATIVE = 0, -// ASSET_TYPE_CREDIT_ALPHANUM4 = 1, -// ASSET_TYPE_CREDIT_ALPHANUM12 = 2, -// ASSET_TYPE_POOL_SHARE = 3 -// }; -// -// =========================================================================== -xdr.enum("AssetType", { - assetTypeNative: 0, - assetTypeCreditAlphanum4: 1, - assetTypeCreditAlphanum12: 2, - assetTypePoolShare: 3, -}); - -// === xdr source ============================================================ -// -// union AssetCode switch (AssetType type) -// { -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AssetCode4 assetCode4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AssetCode12 assetCode12; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("AssetCode", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeCreditAlphanum4", "assetCode4"], - ["assetTypeCreditAlphanum12", "assetCode12"], - ], - arms: { - assetCode4: xdr.lookup("AssetCode4"), - assetCode12: xdr.lookup("AssetCode12"), - }, -}); - -// === xdr source ============================================================ -// -// struct AlphaNum4 -// { -// AssetCode4 assetCode; -// AccountID issuer; -// }; -// -// =========================================================================== -xdr.struct("AlphaNum4", [ - ["assetCode", xdr.lookup("AssetCode4")], - ["issuer", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// struct AlphaNum12 -// { -// AssetCode12 assetCode; -// AccountID issuer; -// }; -// -// =========================================================================== -xdr.struct("AlphaNum12", [ - ["assetCode", xdr.lookup("AssetCode12")], - ["issuer", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// union Asset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("Asset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - }, -}); - -// === xdr source ============================================================ -// -// struct Price -// { -// int32 n; // numerator -// int32 d; // denominator -// }; -// -// =========================================================================== -xdr.struct("Price", [ - ["n", xdr.lookup("Int32")], - ["d", xdr.lookup("Int32")], -]); - -// === xdr source ============================================================ -// -// struct Liabilities -// { -// int64 buying; -// int64 selling; -// }; -// -// =========================================================================== -xdr.struct("Liabilities", [ - ["buying", xdr.lookup("Int64")], - ["selling", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// enum ThresholdIndexes -// { -// THRESHOLD_MASTER_WEIGHT = 0, -// THRESHOLD_LOW = 1, -// THRESHOLD_MED = 2, -// THRESHOLD_HIGH = 3 -// }; -// -// =========================================================================== -xdr.enum("ThresholdIndices", { - thresholdMasterWeight: 0, - thresholdLow: 1, - thresholdMed: 2, - thresholdHigh: 3, -}); - -// === xdr source ============================================================ -// -// enum LedgerEntryType -// { -// ACCOUNT = 0, -// TRUSTLINE = 1, -// OFFER = 2, -// DATA = 3, -// CLAIMABLE_BALANCE = 4, -// LIQUIDITY_POOL = 5 -// }; -// -// =========================================================================== -xdr.enum("LedgerEntryType", { - account: 0, - trustline: 1, - offer: 2, - data: 3, - claimableBalance: 4, - liquidityPool: 5, -}); - -// === xdr source ============================================================ -// -// struct Signer -// { -// SignerKey key; -// uint32 weight; // really only need 1 byte -// }; -// -// =========================================================================== -xdr.struct("Signer", [ - ["key", xdr.lookup("SignerKey")], - ["weight", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// enum AccountFlags -// { // masks for each flag -// -// // Flags set on issuer accounts -// // TrustLines are created with authorized set to "false" requiring -// // the issuer to set it for each TrustLine -// AUTH_REQUIRED_FLAG = 0x1, -// // If set, the authorized flag in TrustLines can be cleared -// // otherwise, authorization cannot be revoked -// AUTH_REVOCABLE_FLAG = 0x2, -// // Once set, causes all AUTH_* flags to be read-only -// AUTH_IMMUTABLE_FLAG = 0x4, -// // Trustlines are created with clawback enabled set to "true", -// // and claimable balances created from those trustlines are created -// // with clawback enabled set to "true" -// AUTH_CLAWBACK_ENABLED_FLAG = 0x8 -// }; -// -// =========================================================================== -xdr.enum("AccountFlags", { - authRequiredFlag: 1, - authRevocableFlag: 2, - authImmutableFlag: 4, - authClawbackEnabledFlag: 8, -}); - -// === xdr source ============================================================ -// -// const MASK_ACCOUNT_FLAGS = 0x7; -// -// =========================================================================== -xdr.const("MASK_ACCOUNT_FLAGS", 0x7); - -// === xdr source ============================================================ -// -// const MASK_ACCOUNT_FLAGS_V17 = 0xF; -// -// =========================================================================== -xdr.const("MASK_ACCOUNT_FLAGS_V17", 0xF); - -// === xdr source ============================================================ -// -// const MAX_SIGNERS = 20; -// -// =========================================================================== -xdr.const("MAX_SIGNERS", 20); - -// === xdr source ============================================================ -// -// typedef AccountID* SponsorshipDescriptor; -// -// =========================================================================== -xdr.typedef("SponsorshipDescriptor", xdr.option(xdr.lookup("AccountId"))); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV3 -// { -// // We can use this to add more fields, or because it is first, to -// // change AccountEntryExtensionV3 into a union. -// ExtensionPoint ext; -// -// // Ledger number at which `seqNum` took on its present value. -// uint32 seqLedger; -// -// // Time at which `seqNum` took on its present value. -// TimePoint seqTime; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV3", [ - ["ext", xdr.lookup("ExtensionPoint")], - ["seqLedger", xdr.lookup("Uint32")], - ["seqTime", xdr.lookup("TimePoint")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 3: -// AccountEntryExtensionV3 v3; -// } -// -// =========================================================================== -xdr.union("AccountEntryExtensionV2Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [3, "v3"], - ], - arms: { - v3: xdr.lookup("AccountEntryExtensionV3"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV2 -// { -// uint32 numSponsored; -// uint32 numSponsoring; -// SponsorshipDescriptor signerSponsoringIDs; -// -// union switch (int v) -// { -// case 0: -// void; -// case 3: -// AccountEntryExtensionV3 v3; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV2", [ - ["numSponsored", xdr.lookup("Uint32")], - ["numSponsoring", xdr.lookup("Uint32")], - ["signerSponsoringIDs", xdr.varArray(xdr.lookup("SponsorshipDescriptor"), xdr.lookup("MAX_SIGNERS"))], - ["ext", xdr.lookup("AccountEntryExtensionV2Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// AccountEntryExtensionV2 v2; -// } -// -// =========================================================================== -xdr.union("AccountEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [2, "v2"], - ], - arms: { - v2: xdr.lookup("AccountEntryExtensionV2"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV1 -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// AccountEntryExtensionV2 v2; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV1", [ - ["liabilities", xdr.lookup("Liabilities")], - ["ext", xdr.lookup("AccountEntryExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// AccountEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("AccountEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("AccountEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntry -// { -// AccountID accountID; // master public key for this account -// int64 balance; // in stroops -// SequenceNumber seqNum; // last sequence number used for this account -// uint32 numSubEntries; // number of sub-entries this account has -// // drives the reserve -// AccountID* inflationDest; // Account to vote for during inflation -// uint32 flags; // see AccountFlags -// -// string32 homeDomain; // can be used for reverse federation and memo lookup -// -// // fields used for signatures -// // thresholds stores unsigned bytes: [weight of master|low|medium|high] -// Thresholds thresholds; -// -// Signer signers; // possible signers for this account -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// AccountEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["balance", xdr.lookup("Int64")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["numSubEntries", xdr.lookup("Uint32")], - ["inflationDest", xdr.option(xdr.lookup("AccountId"))], - ["flags", xdr.lookup("Uint32")], - ["homeDomain", xdr.lookup("String32")], - ["thresholds", xdr.lookup("Thresholds")], - ["signers", xdr.varArray(xdr.lookup("Signer"), xdr.lookup("MAX_SIGNERS"))], - ["ext", xdr.lookup("AccountEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum TrustLineFlags -// { -// // issuer has authorized account to perform transactions with its credit -// AUTHORIZED_FLAG = 1, -// // issuer has authorized account to maintain and reduce liabilities for its -// // credit -// AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, -// // issuer has specified that it may clawback its credit, and that claimable -// // balances created with its credit may also be clawed back -// TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 -// }; -// -// =========================================================================== -xdr.enum("TrustLineFlags", { - authorizedFlag: 1, - authorizedToMaintainLiabilitiesFlag: 2, - trustlineClawbackEnabledFlag: 4, -}); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS = 1; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS", 1); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS_V13 = 3; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS_V13", 3); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS_V17 = 7; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS_V17", 7); - -// === xdr source ============================================================ -// -// enum LiquidityPoolType -// { -// LIQUIDITY_POOL_CONSTANT_PRODUCT = 0 -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolType", { - liquidityPoolConstantProduct: 0, -}); - -// === xdr source ============================================================ -// -// union TrustLineAsset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// case ASSET_TYPE_POOL_SHARE: -// PoolID liquidityPoolID; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("TrustLineAsset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ["assetTypePoolShare", "liquidityPoolId"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - liquidityPoolId: xdr.lookup("PoolId"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryExtensionV2Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TrustLineEntryExtensionV2 -// { -// int32 liquidityPoolUseCount; -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TrustLineEntryExtensionV2", [ - ["liquidityPoolUseCount", xdr.lookup("Int32")], - ["ext", xdr.lookup("TrustLineEntryExtensionV2Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [2, "v2"], - ], - arms: { - v2: xdr.lookup("TrustLineEntryExtensionV2"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } -// -// =========================================================================== -xdr.struct("TrustLineEntryV1", [ - ["liabilities", xdr.lookup("Liabilities")], - ["ext", xdr.lookup("TrustLineEntryV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } v1; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("TrustLineEntryV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct TrustLineEntry -// { -// AccountID accountID; // account this trustline belongs to -// TrustLineAsset asset; // type of asset (with issuer) -// int64 balance; // how much of this asset the user has. -// // Asset defines the unit for this; -// -// int64 limit; // balance cannot be above this -// uint32 flags; // see TrustLineFlags -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TrustLineEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["asset", xdr.lookup("TrustLineAsset")], - ["balance", xdr.lookup("Int64")], - ["limit", xdr.lookup("Int64")], - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("TrustLineEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum OfferEntryFlags -// { -// // an offer with this flag will not act on and take a reverse offer of equal -// // price -// PASSIVE_FLAG = 1 -// }; -// -// =========================================================================== -xdr.enum("OfferEntryFlags", { - passiveFlag: 1, -}); - -// === xdr source ============================================================ -// -// const MASK_OFFERENTRY_FLAGS = 1; -// -// =========================================================================== -xdr.const("MASK_OFFERENTRY_FLAGS", 1); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("OfferEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct OfferEntry -// { -// AccountID sellerID; -// int64 offerID; -// Asset selling; // A -// Asset buying; // B -// int64 amount; // amount of A -// -// /* price for this offer: -// price of A in terms of B -// price=AmountB/AmountA=priceNumerator/priceDenominator -// price is after fees -// */ -// Price price; -// uint32 flags; // see OfferEntryFlags -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("OfferEntry", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("OfferEntryExt")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("DataEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct DataEntry -// { -// AccountID accountID; // account this data belongs to -// string64 dataName; -// DataValue dataValue; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("DataEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["dataName", xdr.lookup("String64")], - ["dataValue", xdr.lookup("DataValue")], - ["ext", xdr.lookup("DataEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum ClaimPredicateType -// { -// CLAIM_PREDICATE_UNCONDITIONAL = 0, -// CLAIM_PREDICATE_AND = 1, -// CLAIM_PREDICATE_OR = 2, -// CLAIM_PREDICATE_NOT = 3, -// CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, -// CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 -// }; -// -// =========================================================================== -xdr.enum("ClaimPredicateType", { - claimPredicateUnconditional: 0, - claimPredicateAnd: 1, - claimPredicateOr: 2, - claimPredicateNot: 3, - claimPredicateBeforeAbsoluteTime: 4, - claimPredicateBeforeRelativeTime: 5, -}); - -// === xdr source ============================================================ -// -// union ClaimPredicate switch (ClaimPredicateType type) -// { -// case CLAIM_PREDICATE_UNCONDITIONAL: -// void; -// case CLAIM_PREDICATE_AND: -// ClaimPredicate andPredicates<2>; -// case CLAIM_PREDICATE_OR: -// ClaimPredicate orPredicates<2>; -// case CLAIM_PREDICATE_NOT: -// ClaimPredicate* notPredicate; -// case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: -// int64 absBefore; // Predicate will be true if closeTime < absBefore -// case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: -// int64 relBefore; // Seconds since closeTime of the ledger in which the -// // ClaimableBalanceEntry was created -// }; -// -// =========================================================================== -xdr.union("ClaimPredicate", { - switchOn: xdr.lookup("ClaimPredicateType"), - switchName: "type", - switches: [ - ["claimPredicateUnconditional", xdr.void()], - ["claimPredicateAnd", "andPredicates"], - ["claimPredicateOr", "orPredicates"], - ["claimPredicateNot", "notPredicate"], - ["claimPredicateBeforeAbsoluteTime", "absBefore"], - ["claimPredicateBeforeRelativeTime", "relBefore"], - ], - arms: { - andPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), - orPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), - notPredicate: xdr.option(xdr.lookup("ClaimPredicate")), - absBefore: xdr.lookup("Int64"), - relBefore: xdr.lookup("Int64"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimantType -// { -// CLAIMANT_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimantType", { - claimantTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID destination; // The account that can use this condition -// ClaimPredicate predicate; // Claimable if predicate is true -// } -// -// =========================================================================== -xdr.struct("ClaimantV0", [ - ["destination", xdr.lookup("AccountId")], - ["predicate", xdr.lookup("ClaimPredicate")], -]); - -// === xdr source ============================================================ -// -// union Claimant switch (ClaimantType type) -// { -// case CLAIMANT_TYPE_V0: -// struct -// { -// AccountID destination; // The account that can use this condition -// ClaimPredicate predicate; // Claimable if predicate is true -// } v0; -// }; -// -// =========================================================================== -xdr.union("Claimant", { - switchOn: xdr.lookup("ClaimantType"), - switchName: "type", - switches: [ - ["claimantTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("ClaimantV0"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimableBalanceIDType -// { -// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceIdType", { - claimableBalanceIdTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// union ClaimableBalanceID switch (ClaimableBalanceIDType type) -// { -// case CLAIMABLE_BALANCE_ID_TYPE_V0: -// Hash v0; -// }; -// -// =========================================================================== -xdr.union("ClaimableBalanceId", { - switchOn: xdr.lookup("ClaimableBalanceIdType"), - switchName: "type", - switches: [ - ["claimableBalanceIdTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimableBalanceFlags -// { -// // If set, the issuer account of the asset held by the claimable balance may -// // clawback the claimable balance -// CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceFlags", { - claimableBalanceClawbackEnabledFlag: 1, -}); - -// === xdr source ============================================================ -// -// const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1; -// -// =========================================================================== -xdr.const("MASK_CLAIMABLE_BALANCE_FLAGS", 0x1); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("ClaimableBalanceEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct ClaimableBalanceEntryExtensionV1 -// { -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// -// uint32 flags; // see ClaimableBalanceFlags -// }; -// -// =========================================================================== -xdr.struct("ClaimableBalanceEntryExtensionV1", [ - ["ext", xdr.lookup("ClaimableBalanceEntryExtensionV1Ext")], - ["flags", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// ClaimableBalanceEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("ClaimableBalanceEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("ClaimableBalanceEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct ClaimableBalanceEntry -// { -// // Unique identifier for this ClaimableBalanceEntry -// ClaimableBalanceID balanceID; -// -// // List of claimants with associated predicate -// Claimant claimants<10>; -// -// // Any asset including native -// Asset asset; -// -// // Amount of asset -// int64 amount; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// ClaimableBalanceEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("ClaimableBalanceEntry", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], - ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["ext", xdr.lookup("ClaimableBalanceEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct LiquidityPoolConstantProductParameters -// { -// Asset assetA; // assetA < assetB -// Asset assetB; -// int32 fee; // Fee is in basis points, so the actual rate is (fee/100)% -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolConstantProductParameters", [ - ["assetA", xdr.lookup("Asset")], - ["assetB", xdr.lookup("Asset")], - ["fee", xdr.lookup("Int32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } -// -// =========================================================================== -xdr.struct("LiquidityPoolEntryConstantProduct", [ - ["params", xdr.lookup("LiquidityPoolConstantProductParameters")], - ["reserveA", xdr.lookup("Int64")], - ["reserveB", xdr.lookup("Int64")], - ["totalPoolShares", xdr.lookup("Int64")], - ["poolSharesTrustLineCount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } constantProduct; -// } -// -// =========================================================================== -xdr.union("LiquidityPoolEntryBody", { - switchOn: xdr.lookup("LiquidityPoolType"), - switchName: "type", - switches: [ - ["liquidityPoolConstantProduct", "constantProduct"], - ], - arms: { - constantProduct: xdr.lookup("LiquidityPoolEntryConstantProduct"), - }, -}); - -// === xdr source ============================================================ -// -// struct LiquidityPoolEntry -// { -// PoolID liquidityPoolID; -// -// union switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } constantProduct; -// } -// body; -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolEntry", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["body", xdr.lookup("LiquidityPoolEntryBody")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerEntryExtensionV1 -// { -// SponsorshipDescriptor sponsoringID; -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerEntryExtensionV1", [ - ["sponsoringId", xdr.lookup("SponsorshipDescriptor")], - ["ext", xdr.lookup("LedgerEntryExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (LedgerEntryType type) -// { -// case ACCOUNT: -// AccountEntry account; -// case TRUSTLINE: -// TrustLineEntry trustLine; -// case OFFER: -// OfferEntry offer; -// case DATA: -// DataEntry data; -// case CLAIMABLE_BALANCE: -// ClaimableBalanceEntry claimableBalance; -// case LIQUIDITY_POOL: -// LiquidityPoolEntry liquidityPool; -// } -// -// =========================================================================== -xdr.union("LedgerEntryData", { - switchOn: xdr.lookup("LedgerEntryType"), - switchName: "type", - switches: [ - ["account", "account"], - ["trustline", "trustLine"], - ["offer", "offer"], - ["data", "data"], - ["claimableBalance", "claimableBalance"], - ["liquidityPool", "liquidityPool"], - ], - arms: { - account: xdr.lookup("AccountEntry"), - trustLine: xdr.lookup("TrustLineEntry"), - offer: xdr.lookup("OfferEntry"), - data: xdr.lookup("DataEntry"), - claimableBalance: xdr.lookup("ClaimableBalanceEntry"), - liquidityPool: xdr.lookup("LiquidityPoolEntry"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("LedgerEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("LedgerEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerEntry -// { -// uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed -// -// union switch (LedgerEntryType type) -// { -// case ACCOUNT: -// AccountEntry account; -// case TRUSTLINE: -// TrustLineEntry trustLine; -// case OFFER: -// OfferEntry offer; -// case DATA: -// DataEntry data; -// case CLAIMABLE_BALANCE: -// ClaimableBalanceEntry claimableBalance; -// case LIQUIDITY_POOL: -// LiquidityPoolEntry liquidityPool; -// } -// data; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerEntry", [ - ["lastModifiedLedgerSeq", xdr.lookup("Uint32")], - ["data", xdr.lookup("LedgerEntryData")], - ["ext", xdr.lookup("LedgerEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyAccount", [ - ["accountId", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// TrustLineAsset asset; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyTrustLine", [ - ["accountId", xdr.lookup("AccountId")], - ["asset", xdr.lookup("TrustLineAsset")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sellerID; -// int64 offerID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyOffer", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// string64 dataName; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyData", [ - ["accountId", xdr.lookup("AccountId")], - ["dataName", xdr.lookup("String64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimableBalanceID balanceID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyClaimableBalance", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// PoolID liquidityPoolID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyLiquidityPool", [ - ["liquidityPoolId", xdr.lookup("PoolId")], -]); - -// === xdr source ============================================================ -// -// union LedgerKey switch (LedgerEntryType type) -// { -// case ACCOUNT: -// struct -// { -// AccountID accountID; -// } account; -// -// case TRUSTLINE: -// struct -// { -// AccountID accountID; -// TrustLineAsset asset; -// } trustLine; -// -// case OFFER: -// struct -// { -// AccountID sellerID; -// int64 offerID; -// } offer; -// -// case DATA: -// struct -// { -// AccountID accountID; -// string64 dataName; -// } data; -// -// case CLAIMABLE_BALANCE: -// struct -// { -// ClaimableBalanceID balanceID; -// } claimableBalance; -// -// case LIQUIDITY_POOL: -// struct -// { -// PoolID liquidityPoolID; -// } liquidityPool; -// }; -// -// =========================================================================== -xdr.union("LedgerKey", { - switchOn: xdr.lookup("LedgerEntryType"), - switchName: "type", - switches: [ - ["account", "account"], - ["trustline", "trustLine"], - ["offer", "offer"], - ["data", "data"], - ["claimableBalance", "claimableBalance"], - ["liquidityPool", "liquidityPool"], - ], - arms: { - account: xdr.lookup("LedgerKeyAccount"), - trustLine: xdr.lookup("LedgerKeyTrustLine"), - offer: xdr.lookup("LedgerKeyOffer"), - data: xdr.lookup("LedgerKeyData"), - claimableBalance: xdr.lookup("LedgerKeyClaimableBalance"), - liquidityPool: xdr.lookup("LedgerKeyLiquidityPool"), - }, -}); - -// === xdr source ============================================================ -// -// enum EnvelopeType -// { -// ENVELOPE_TYPE_TX_V0 = 0, -// ENVELOPE_TYPE_SCP = 1, -// ENVELOPE_TYPE_TX = 2, -// ENVELOPE_TYPE_AUTH = 3, -// ENVELOPE_TYPE_SCPVALUE = 4, -// ENVELOPE_TYPE_TX_FEE_BUMP = 5, -// ENVELOPE_TYPE_OP_ID = 6, -// ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7 -// }; -// -// =========================================================================== -xdr.enum("EnvelopeType", { - envelopeTypeTxV0: 0, - envelopeTypeScp: 1, - envelopeTypeTx: 2, - envelopeTypeAuth: 3, - envelopeTypeScpvalue: 4, - envelopeTypeTxFeeBump: 5, - envelopeTypeOpId: 6, - envelopeTypePoolRevokeOpId: 7, -}); - -// === xdr source ============================================================ -// -// typedef opaque UpgradeType<128>; -// -// =========================================================================== -xdr.typedef("UpgradeType", xdr.varOpaque(128)); - -// === xdr source ============================================================ -// -// enum StellarValueType -// { -// STELLAR_VALUE_BASIC = 0, -// STELLAR_VALUE_SIGNED = 1 -// }; -// -// =========================================================================== -xdr.enum("StellarValueType", { - stellarValueBasic: 0, - stellarValueSigned: 1, -}); - -// === xdr source ============================================================ -// -// struct LedgerCloseValueSignature -// { -// NodeID nodeID; // which node introduced the value -// Signature signature; // nodeID's signature -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseValueSignature", [ - ["nodeId", xdr.lookup("NodeId")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// union switch (StellarValueType v) -// { -// case STELLAR_VALUE_BASIC: -// void; -// case STELLAR_VALUE_SIGNED: -// LedgerCloseValueSignature lcValueSignature; -// } -// -// =========================================================================== -xdr.union("StellarValueExt", { - switchOn: xdr.lookup("StellarValueType"), - switchName: "v", - switches: [ - ["stellarValueBasic", xdr.void()], - ["stellarValueSigned", "lcValueSignature"], - ], - arms: { - lcValueSignature: xdr.lookup("LedgerCloseValueSignature"), - }, -}); - -// === xdr source ============================================================ -// -// struct StellarValue -// { -// Hash txSetHash; // transaction set to apply to previous ledger -// TimePoint closeTime; // network close time -// -// // upgrades to apply to the previous ledger (usually empty) -// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop -// // unknown steps during consensus if needed. -// // see notes below on 'LedgerUpgrade' for more detail -// // max size is dictated by number of upgrade types (+ room for future) -// UpgradeType upgrades<6>; -// -// // reserved for future use -// union switch (StellarValueType v) -// { -// case STELLAR_VALUE_BASIC: -// void; -// case STELLAR_VALUE_SIGNED: -// LedgerCloseValueSignature lcValueSignature; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("StellarValue", [ - ["txSetHash", xdr.lookup("Hash")], - ["closeTime", xdr.lookup("TimePoint")], - ["upgrades", xdr.varArray(xdr.lookup("UpgradeType"), 6)], - ["ext", xdr.lookup("StellarValueExt")], -]); - -// === xdr source ============================================================ -// -// const MASK_LEDGER_HEADER_FLAGS = 0x7; -// -// =========================================================================== -xdr.const("MASK_LEDGER_HEADER_FLAGS", 0x7); - -// === xdr source ============================================================ -// -// enum LedgerHeaderFlags -// { -// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, -// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, -// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 -// }; -// -// =========================================================================== -xdr.enum("LedgerHeaderFlags", { - disableLiquidityPoolTradingFlag: 1, - disableLiquidityPoolDepositFlag: 2, - disableLiquidityPoolWithdrawalFlag: 4, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeaderExtensionV1 -// { -// uint32 flags; // LedgerHeaderFlags -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeaderExtensionV1", [ - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("LedgerHeaderExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerHeaderExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("LedgerHeaderExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeader -// { -// uint32 ledgerVersion; // the protocol version of the ledger -// Hash previousLedgerHash; // hash of the previous ledger header -// StellarValue scpValue; // what consensus agreed to -// Hash txSetResultHash; // the TransactionResultSet that led to this ledger -// Hash bucketListHash; // hash of the ledger state -// -// uint32 ledgerSeq; // sequence number of this ledger -// -// int64 totalCoins; // total number of stroops in existence. -// // 10,000,000 stroops in 1 XLM -// -// int64 feePool; // fees burned since last inflation run -// uint32 inflationSeq; // inflation sequence number -// -// uint64 idPool; // last used global ID, used for generating objects -// -// uint32 baseFee; // base fee per operation in stroops -// uint32 baseReserve; // account base reserve in stroops -// -// uint32 maxTxSetSize; // maximum size a transaction set can be -// -// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back -// // in time without walking the chain back ledger by ledger -// // each slot contains the oldest ledger that is mod of -// // either 50 5000 50000 or 500000 depending on index -// // skipList[0] mod(50), skipList[1] mod(5000), etc -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerHeaderExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeader", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["previousLedgerHash", xdr.lookup("Hash")], - ["scpValue", xdr.lookup("StellarValue")], - ["txSetResultHash", xdr.lookup("Hash")], - ["bucketListHash", xdr.lookup("Hash")], - ["ledgerSeq", xdr.lookup("Uint32")], - ["totalCoins", xdr.lookup("Int64")], - ["feePool", xdr.lookup("Int64")], - ["inflationSeq", xdr.lookup("Uint32")], - ["idPool", xdr.lookup("Uint64")], - ["baseFee", xdr.lookup("Uint32")], - ["baseReserve", xdr.lookup("Uint32")], - ["maxTxSetSize", xdr.lookup("Uint32")], - ["skipList", xdr.array(xdr.lookup("Hash"), 4)], - ["ext", xdr.lookup("LedgerHeaderExt")], -]); - -// === xdr source ============================================================ -// -// enum LedgerUpgradeType -// { -// LEDGER_UPGRADE_VERSION = 1, -// LEDGER_UPGRADE_BASE_FEE = 2, -// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, -// LEDGER_UPGRADE_BASE_RESERVE = 4, -// LEDGER_UPGRADE_FLAGS = 5 -// }; -// -// =========================================================================== -xdr.enum("LedgerUpgradeType", { - ledgerUpgradeVersion: 1, - ledgerUpgradeBaseFee: 2, - ledgerUpgradeMaxTxSetSize: 3, - ledgerUpgradeBaseReserve: 4, - ledgerUpgradeFlags: 5, -}); - -// === xdr source ============================================================ -// -// union LedgerUpgrade switch (LedgerUpgradeType type) -// { -// case LEDGER_UPGRADE_VERSION: -// uint32 newLedgerVersion; // update ledgerVersion -// case LEDGER_UPGRADE_BASE_FEE: -// uint32 newBaseFee; // update baseFee -// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: -// uint32 newMaxTxSetSize; // update maxTxSetSize -// case LEDGER_UPGRADE_BASE_RESERVE: -// uint32 newBaseReserve; // update baseReserve -// case LEDGER_UPGRADE_FLAGS: -// uint32 newFlags; // update flags -// }; -// -// =========================================================================== -xdr.union("LedgerUpgrade", { - switchOn: xdr.lookup("LedgerUpgradeType"), - switchName: "type", - switches: [ - ["ledgerUpgradeVersion", "newLedgerVersion"], - ["ledgerUpgradeBaseFee", "newBaseFee"], - ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], - ["ledgerUpgradeBaseReserve", "newBaseReserve"], - ["ledgerUpgradeFlags", "newFlags"], - ], - arms: { - newLedgerVersion: xdr.lookup("Uint32"), - newBaseFee: xdr.lookup("Uint32"), - newMaxTxSetSize: xdr.lookup("Uint32"), - newBaseReserve: xdr.lookup("Uint32"), - newFlags: xdr.lookup("Uint32"), - }, -}); - -// === xdr source ============================================================ -// -// enum BucketEntryType -// { -// METAENTRY = -// -1, // At-and-after protocol 11: bucket metadata, should come first. -// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -// // At-and-after protocol 11: only updated. -// DEADENTRY = 1, -// INITENTRY = 2 // At-and-after protocol 11: only created. -// }; -// -// =========================================================================== -xdr.enum("BucketEntryType", { - metaentry: -1, - liveentry: 0, - deadentry: 1, - initentry: 2, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("BucketMetadataExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct BucketMetadata -// { -// // Indicates the protocol version used to create / merge this bucket. -// uint32 ledgerVersion; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("BucketMetadata", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["ext", xdr.lookup("BucketMetadataExt")], -]); - -// === xdr source ============================================================ -// -// union BucketEntry switch (BucketEntryType type) -// { -// case LIVEENTRY: -// case INITENTRY: -// LedgerEntry liveEntry; -// -// case DEADENTRY: -// LedgerKey deadEntry; -// case METAENTRY: -// BucketMetadata metaEntry; -// }; -// -// =========================================================================== -xdr.union("BucketEntry", { - switchOn: xdr.lookup("BucketEntryType"), - switchName: "type", - switches: [ - ["liveentry", "liveEntry"], - ["initentry", "liveEntry"], - ["deadentry", "deadEntry"], - ["metaentry", "metaEntry"], - ], - arms: { - liveEntry: xdr.lookup("LedgerEntry"), - deadEntry: xdr.lookup("LedgerKey"), - metaEntry: xdr.lookup("BucketMetadata"), - }, -}); - -// === xdr source ============================================================ -// -// enum TxSetComponentType -// { -// // txs with effective fee <= bid derived from a base fee (if any). -// // If base fee is not specified, no discount is applied. -// TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 -// }; -// -// =========================================================================== -xdr.enum("TxSetComponentType", { - txsetCompTxsMaybeDiscountedFee: 0, -}); - -// === xdr source ============================================================ -// -// struct -// { -// int64* baseFee; -// TransactionEnvelope txs<>; -// } -// -// =========================================================================== -xdr.struct("TxSetComponentTxsMaybeDiscountedFee", [ - ["baseFee", xdr.option(xdr.lookup("Int64"))], - ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union TxSetComponent switch (TxSetComponentType type) -// { -// case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: -// struct -// { -// int64* baseFee; -// TransactionEnvelope txs<>; -// } txsMaybeDiscountedFee; -// }; -// -// =========================================================================== -xdr.union("TxSetComponent", { - switchOn: xdr.lookup("TxSetComponentType"), - switchName: "type", - switches: [ - ["txsetCompTxsMaybeDiscountedFee", "txsMaybeDiscountedFee"], - ], - arms: { - txsMaybeDiscountedFee: xdr.lookup("TxSetComponentTxsMaybeDiscountedFee"), - }, -}); - -// === xdr source ============================================================ -// -// union TransactionPhase switch (int v) -// { -// case 0: -// TxSetComponent v0Components<>; -// }; -// -// =========================================================================== -xdr.union("TransactionPhase", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0Components"], - ], - arms: { - v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionSet -// { -// Hash previousLedgerHash; -// TransactionEnvelope txs<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionSet", [ - ["previousLedgerHash", xdr.lookup("Hash")], - ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct TransactionSetV1 -// { -// Hash previousLedgerHash; -// TransactionPhase phases<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionSetV1", [ - ["previousLedgerHash", xdr.lookup("Hash")], - ["phases", xdr.varArray(xdr.lookup("TransactionPhase"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union GeneralizedTransactionSet switch (int v) -// { -// // We consider the legacy TransactionSet to be v0. -// case 1: -// TransactionSetV1 v1TxSet; -// }; -// -// =========================================================================== -xdr.union("GeneralizedTransactionSet", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [1, "v1TxSet"], - ], - arms: { - v1TxSet: xdr.lookup("TransactionSetV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResultPair -// { -// Hash transactionHash; -// TransactionResult result; // result for the transaction -// }; -// -// =========================================================================== -xdr.struct("TransactionResultPair", [ - ["transactionHash", xdr.lookup("Hash")], - ["result", xdr.lookup("TransactionResult")], -]); - -// === xdr source ============================================================ -// -// struct TransactionResultSet -// { -// TransactionResultPair results<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultSet", [ - ["results", xdr.varArray(xdr.lookup("TransactionResultPair"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// GeneralizedTransactionSet generalizedTxSet; -// } -// -// =========================================================================== -xdr.union("TransactionHistoryEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "generalizedTxSet"], - ], - arms: { - generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionHistoryEntry -// { -// uint32 ledgerSeq; -// TransactionSet txSet; -// -// // when v != 0, txSet must be empty -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// GeneralizedTransactionSet generalizedTxSet; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionHistoryEntry", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["txSet", xdr.lookup("TransactionSet")], - ["ext", xdr.lookup("TransactionHistoryEntryExt")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionHistoryResultEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionHistoryResultEntry -// { -// uint32 ledgerSeq; -// TransactionResultSet txResultSet; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionHistoryResultEntry", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["txResultSet", xdr.lookup("TransactionResultSet")], - ["ext", xdr.lookup("TransactionHistoryResultEntryExt")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderHistoryEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeaderHistoryEntry -// { -// Hash hash; -// LedgerHeader header; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeaderHistoryEntry", [ - ["hash", xdr.lookup("Hash")], - ["header", xdr.lookup("LedgerHeader")], - ["ext", xdr.lookup("LedgerHeaderHistoryEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct LedgerSCPMessages -// { -// uint32 ledgerSeq; -// SCPEnvelope messages<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerScpMessages", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["messages", xdr.varArray(xdr.lookup("ScpEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct SCPHistoryEntryV0 -// { -// SCPQuorumSet quorumSets<>; // additional quorum sets used by ledgerMessages -// LedgerSCPMessages ledgerMessages; -// }; -// -// =========================================================================== -xdr.struct("ScpHistoryEntryV0", [ - ["quorumSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], - ["ledgerMessages", xdr.lookup("LedgerScpMessages")], -]); - -// === xdr source ============================================================ -// -// union SCPHistoryEntry switch (int v) -// { -// case 0: -// SCPHistoryEntryV0 v0; -// }; -// -// =========================================================================== -xdr.union("ScpHistoryEntry", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0"], - ], - arms: { - v0: xdr.lookup("ScpHistoryEntryV0"), - }, -}); - -// === xdr source ============================================================ -// -// enum LedgerEntryChangeType -// { -// LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger -// LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger -// LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger -// LEDGER_ENTRY_STATE = 3 // value of the entry -// }; -// -// =========================================================================== -xdr.enum("LedgerEntryChangeType", { - ledgerEntryCreated: 0, - ledgerEntryUpdated: 1, - ledgerEntryRemoved: 2, - ledgerEntryState: 3, -}); - -// === xdr source ============================================================ -// -// union LedgerEntryChange switch (LedgerEntryChangeType type) -// { -// case LEDGER_ENTRY_CREATED: -// LedgerEntry created; -// case LEDGER_ENTRY_UPDATED: -// LedgerEntry updated; -// case LEDGER_ENTRY_REMOVED: -// LedgerKey removed; -// case LEDGER_ENTRY_STATE: -// LedgerEntry state; -// }; -// -// =========================================================================== -xdr.union("LedgerEntryChange", { - switchOn: xdr.lookup("LedgerEntryChangeType"), - switchName: "type", - switches: [ - ["ledgerEntryCreated", "created"], - ["ledgerEntryUpdated", "updated"], - ["ledgerEntryRemoved", "removed"], - ["ledgerEntryState", "state"], - ], - arms: { - created: xdr.lookup("LedgerEntry"), - updated: xdr.lookup("LedgerEntry"), - removed: xdr.lookup("LedgerKey"), - state: xdr.lookup("LedgerEntry"), - }, -}); - -// === xdr source ============================================================ -// -// typedef LedgerEntryChange LedgerEntryChanges<>; -// -// =========================================================================== -xdr.typedef("LedgerEntryChanges", xdr.varArray(xdr.lookup("LedgerEntryChange"), 2147483647)); - -// === xdr source ============================================================ -// -// struct OperationMeta -// { -// LedgerEntryChanges changes; -// }; -// -// =========================================================================== -xdr.struct("OperationMeta", [ - ["changes", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// struct TransactionMetaV1 -// { -// LedgerEntryChanges txChanges; // tx level changes if any -// OperationMeta operations<>; // meta for each operation -// }; -// -// =========================================================================== -xdr.struct("TransactionMetaV1", [ - ["txChanges", xdr.lookup("LedgerEntryChanges")], - ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct TransactionMetaV2 -// { -// LedgerEntryChanges txChangesBefore; // tx level changes before operations -// // are applied if any -// OperationMeta operations<>; // meta for each operation -// LedgerEntryChanges txChangesAfter; // tx level changes after operations are -// // applied if any -// }; -// -// =========================================================================== -xdr.struct("TransactionMetaV2", [ - ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], - ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], - ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// union TransactionMeta switch (int v) -// { -// case 0: -// OperationMeta operations<>; -// case 1: -// TransactionMetaV1 v1; -// case 2: -// TransactionMetaV2 v2; -// }; -// -// =========================================================================== -xdr.union("TransactionMeta", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "operations"], - [1, "v1"], - [2, "v2"], - ], - arms: { - operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), - v1: xdr.lookup("TransactionMetaV1"), - v2: xdr.lookup("TransactionMetaV2"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResultMeta -// { -// TransactionResultPair result; -// LedgerEntryChanges feeProcessing; -// TransactionMeta txApplyProcessing; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultMeta", [ - ["result", xdr.lookup("TransactionResultPair")], - ["feeProcessing", xdr.lookup("LedgerEntryChanges")], - ["txApplyProcessing", xdr.lookup("TransactionMeta")], -]); - -// === xdr source ============================================================ -// -// struct UpgradeEntryMeta -// { -// LedgerUpgrade upgrade; -// LedgerEntryChanges changes; -// }; -// -// =========================================================================== -xdr.struct("UpgradeEntryMeta", [ - ["upgrade", xdr.lookup("LedgerUpgrade")], - ["changes", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// struct LedgerCloseMetaV0 -// { -// LedgerHeaderHistoryEntry ledgerHeader; -// // NB: txSet is sorted in "Hash order" -// TransactionSet txSet; -// -// // NB: transactions are sorted in apply order here -// // fees for all transactions are processed first -// // followed by applying transactions -// TransactionResultMeta txProcessing<>; -// -// // upgrades are applied last -// UpgradeEntryMeta upgradesProcessing<>; -// -// // other misc information attached to the ledger close -// SCPHistoryEntry scpInfo<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseMetaV0", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("TransactionSet")], - ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], - ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct LedgerCloseMetaV1 -// { -// LedgerHeaderHistoryEntry ledgerHeader; -// -// GeneralizedTransactionSet txSet; -// -// // NB: transactions are sorted in apply order here -// // fees for all transactions are processed first -// // followed by applying transactions -// TransactionResultMeta txProcessing<>; -// -// // upgrades are applied last -// UpgradeEntryMeta upgradesProcessing<>; -// -// // other misc information attached to the ledger close -// SCPHistoryEntry scpInfo<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseMetaV1", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("GeneralizedTransactionSet")], - ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], - ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union LedgerCloseMeta switch (int v) -// { -// case 0: -// LedgerCloseMetaV0 v0; -// case 1: -// LedgerCloseMetaV1 v1; -// }; -// -// =========================================================================== -xdr.union("LedgerCloseMeta", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0"], - [1, "v1"], - ], - arms: { - v0: xdr.lookup("LedgerCloseMetaV0"), - v1: xdr.lookup("LedgerCloseMetaV1"), - }, -}); - -// === xdr source ============================================================ -// -// enum ErrorCode -// { -// ERR_MISC = 0, // Unspecific error -// ERR_DATA = 1, // Malformed data -// ERR_CONF = 2, // Misconfiguration error -// ERR_AUTH = 3, // Authentication failure -// ERR_LOAD = 4 // System overloaded -// }; -// -// =========================================================================== -xdr.enum("ErrorCode", { - errMisc: 0, - errData: 1, - errConf: 2, - errAuth: 3, - errLoad: 4, -}); - -// === xdr source ============================================================ -// -// struct Error -// { -// ErrorCode code; -// string msg<100>; -// }; -// -// =========================================================================== -xdr.struct("Error", [ - ["code", xdr.lookup("ErrorCode")], - ["msg", xdr.string(100)], -]); - -// === xdr source ============================================================ -// -// struct SendMore -// { -// uint32 numMessages; -// }; -// -// =========================================================================== -xdr.struct("SendMore", [ - ["numMessages", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct AuthCert -// { -// Curve25519Public pubkey; -// uint64 expiration; -// Signature sig; -// }; -// -// =========================================================================== -xdr.struct("AuthCert", [ - ["pubkey", xdr.lookup("Curve25519Public")], - ["expiration", xdr.lookup("Uint64")], - ["sig", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// struct Hello -// { -// uint32 ledgerVersion; -// uint32 overlayVersion; -// uint32 overlayMinVersion; -// Hash networkID; -// string versionStr<100>; -// int listeningPort; -// NodeID peerID; -// AuthCert cert; -// uint256 nonce; -// }; -// -// =========================================================================== -xdr.struct("Hello", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["overlayVersion", xdr.lookup("Uint32")], - ["overlayMinVersion", xdr.lookup("Uint32")], - ["networkId", xdr.lookup("Hash")], - ["versionStr", xdr.string(100)], - ["listeningPort", xdr.int()], - ["peerId", xdr.lookup("NodeId")], - ["cert", xdr.lookup("AuthCert")], - ["nonce", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// const AUTH_MSG_FLAG_PULL_MODE_REQUESTED = 100; -// -// =========================================================================== -xdr.const("AUTH_MSG_FLAG_PULL_MODE_REQUESTED", 100); - -// === xdr source ============================================================ -// -// struct Auth -// { -// int flags; -// }; -// -// =========================================================================== -xdr.struct("Auth", [ - ["flags", xdr.int()], -]); - -// === xdr source ============================================================ -// -// enum IPAddrType -// { -// IPv4 = 0, -// IPv6 = 1 -// }; -// -// =========================================================================== -xdr.enum("IpAddrType", { - iPv4: 0, - iPv6: 1, -}); - -// === xdr source ============================================================ -// -// union switch (IPAddrType type) -// { -// case IPv4: -// opaque ipv4[4]; -// case IPv6: -// opaque ipv6[16]; -// } -// -// =========================================================================== -xdr.union("PeerAddressIp", { - switchOn: xdr.lookup("IpAddrType"), - switchName: "type", - switches: [ - ["iPv4", "ipv4"], - ["iPv6", "ipv6"], - ], - arms: { - ipv4: xdr.opaque(4), - ipv6: xdr.opaque(16), - }, -}); - -// === xdr source ============================================================ -// -// struct PeerAddress -// { -// union switch (IPAddrType type) -// { -// case IPv4: -// opaque ipv4[4]; -// case IPv6: -// opaque ipv6[16]; -// } -// ip; -// uint32 port; -// uint32 numFailures; -// }; -// -// =========================================================================== -xdr.struct("PeerAddress", [ - ["ip", xdr.lookup("PeerAddressIp")], - ["port", xdr.lookup("Uint32")], - ["numFailures", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// enum MessageType -// { -// ERROR_MSG = 0, -// AUTH = 2, -// DONT_HAVE = 3, -// -// GET_PEERS = 4, // gets a list of peers this guy knows about -// PEERS = 5, -// -// GET_TX_SET = 6, // gets a particular txset by hash -// TX_SET = 7, -// GENERALIZED_TX_SET = 17, -// -// TRANSACTION = 8, // pass on a tx you have heard about -// -// // SCP -// GET_SCP_QUORUMSET = 9, -// SCP_QUORUMSET = 10, -// SCP_MESSAGE = 11, -// GET_SCP_STATE = 12, -// -// // new messages -// HELLO = 13, -// -// SURVEY_REQUEST = 14, -// SURVEY_RESPONSE = 15, -// -// SEND_MORE = 16, -// FLOOD_ADVERT = 18, -// FLOOD_DEMAND = 19 -// }; -// -// =========================================================================== -xdr.enum("MessageType", { - errorMsg: 0, - auth: 2, - dontHave: 3, - getPeers: 4, - peers: 5, - getTxSet: 6, - txSet: 7, - generalizedTxSet: 17, - transaction: 8, - getScpQuorumset: 9, - scpQuorumset: 10, - scpMessage: 11, - getScpState: 12, - hello: 13, - surveyRequest: 14, - surveyResponse: 15, - sendMore: 16, - floodAdvert: 18, - floodDemand: 19, -}); - -// === xdr source ============================================================ -// -// struct DontHave -// { -// MessageType type; -// uint256 reqHash; -// }; -// -// =========================================================================== -xdr.struct("DontHave", [ - ["type", xdr.lookup("MessageType")], - ["reqHash", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// enum SurveyMessageCommandType -// { -// SURVEY_TOPOLOGY = 0 -// }; -// -// =========================================================================== -xdr.enum("SurveyMessageCommandType", { - surveyTopology: 0, -}); - -// === xdr source ============================================================ -// -// struct SurveyRequestMessage -// { -// NodeID surveyorPeerID; -// NodeID surveyedPeerID; -// uint32 ledgerNum; -// Curve25519Public encryptionKey; -// SurveyMessageCommandType commandType; -// }; -// -// =========================================================================== -xdr.struct("SurveyRequestMessage", [ - ["surveyorPeerId", xdr.lookup("NodeId")], - ["surveyedPeerId", xdr.lookup("NodeId")], - ["ledgerNum", xdr.lookup("Uint32")], - ["encryptionKey", xdr.lookup("Curve25519Public")], - ["commandType", xdr.lookup("SurveyMessageCommandType")], -]); - -// === xdr source ============================================================ -// -// struct SignedSurveyRequestMessage -// { -// Signature requestSignature; -// SurveyRequestMessage request; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyRequestMessage", [ - ["requestSignature", xdr.lookup("Signature")], - ["request", xdr.lookup("SurveyRequestMessage")], -]); - -// === xdr source ============================================================ -// -// typedef opaque EncryptedBody<64000>; -// -// =========================================================================== -xdr.typedef("EncryptedBody", xdr.varOpaque(64000)); - -// === xdr source ============================================================ -// -// struct SurveyResponseMessage -// { -// NodeID surveyorPeerID; -// NodeID surveyedPeerID; -// uint32 ledgerNum; -// SurveyMessageCommandType commandType; -// EncryptedBody encryptedBody; -// }; -// -// =========================================================================== -xdr.struct("SurveyResponseMessage", [ - ["surveyorPeerId", xdr.lookup("NodeId")], - ["surveyedPeerId", xdr.lookup("NodeId")], - ["ledgerNum", xdr.lookup("Uint32")], - ["commandType", xdr.lookup("SurveyMessageCommandType")], - ["encryptedBody", xdr.lookup("EncryptedBody")], -]); - -// === xdr source ============================================================ -// -// struct SignedSurveyResponseMessage -// { -// Signature responseSignature; -// SurveyResponseMessage response; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyResponseMessage", [ - ["responseSignature", xdr.lookup("Signature")], - ["response", xdr.lookup("SurveyResponseMessage")], -]); - -// === xdr source ============================================================ -// -// struct PeerStats -// { -// NodeID id; -// string versionStr<100>; -// uint64 messagesRead; -// uint64 messagesWritten; -// uint64 bytesRead; -// uint64 bytesWritten; -// uint64 secondsConnected; -// -// uint64 uniqueFloodBytesRecv; -// uint64 duplicateFloodBytesRecv; -// uint64 uniqueFetchBytesRecv; -// uint64 duplicateFetchBytesRecv; -// -// uint64 uniqueFloodMessageRecv; -// uint64 duplicateFloodMessageRecv; -// uint64 uniqueFetchMessageRecv; -// uint64 duplicateFetchMessageRecv; -// }; -// -// =========================================================================== -xdr.struct("PeerStats", [ - ["id", xdr.lookup("NodeId")], - ["versionStr", xdr.string(100)], - ["messagesRead", xdr.lookup("Uint64")], - ["messagesWritten", xdr.lookup("Uint64")], - ["bytesRead", xdr.lookup("Uint64")], - ["bytesWritten", xdr.lookup("Uint64")], - ["secondsConnected", xdr.lookup("Uint64")], - ["uniqueFloodBytesRecv", xdr.lookup("Uint64")], - ["duplicateFloodBytesRecv", xdr.lookup("Uint64")], - ["uniqueFetchBytesRecv", xdr.lookup("Uint64")], - ["duplicateFetchBytesRecv", xdr.lookup("Uint64")], - ["uniqueFloodMessageRecv", xdr.lookup("Uint64")], - ["duplicateFloodMessageRecv", xdr.lookup("Uint64")], - ["uniqueFetchMessageRecv", xdr.lookup("Uint64")], - ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// typedef PeerStats PeerStatList<25>; -// -// =========================================================================== -xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); - -// === xdr source ============================================================ -// -// struct TopologyResponseBody -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBody", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// union SurveyResponseBody switch (SurveyMessageCommandType type) -// { -// case SURVEY_TOPOLOGY: -// TopologyResponseBody topologyResponseBody; -// }; -// -// =========================================================================== -xdr.union("SurveyResponseBody", { - switchOn: xdr.lookup("SurveyMessageCommandType"), - switchName: "type", - switches: [ - ["surveyTopology", "topologyResponseBody"], - ], - arms: { - topologyResponseBody: xdr.lookup("TopologyResponseBody"), - }, -}); - -// === xdr source ============================================================ -// -// const TX_ADVERT_VECTOR_MAX_SIZE = 1000; -// -// =========================================================================== -xdr.const("TX_ADVERT_VECTOR_MAX_SIZE", 1000); - -// === xdr source ============================================================ -// -// typedef Hash TxAdvertVector; -// -// =========================================================================== -xdr.typedef("TxAdvertVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))); - -// === xdr source ============================================================ -// -// struct FloodAdvert -// { -// TxAdvertVector txHashes; -// }; -// -// =========================================================================== -xdr.struct("FloodAdvert", [ - ["txHashes", xdr.lookup("TxAdvertVector")], -]); - -// === xdr source ============================================================ -// -// const TX_DEMAND_VECTOR_MAX_SIZE = 1000; -// -// =========================================================================== -xdr.const("TX_DEMAND_VECTOR_MAX_SIZE", 1000); - -// === xdr source ============================================================ -// -// typedef Hash TxDemandVector; -// -// =========================================================================== -xdr.typedef("TxDemandVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))); - -// === xdr source ============================================================ -// -// struct FloodDemand -// { -// TxDemandVector txHashes; -// }; -// -// =========================================================================== -xdr.struct("FloodDemand", [ - ["txHashes", xdr.lookup("TxDemandVector")], -]); - -// === xdr source ============================================================ -// -// union StellarMessage switch (MessageType type) -// { -// case ERROR_MSG: -// Error error; -// case HELLO: -// Hello hello; -// case AUTH: -// Auth auth; -// case DONT_HAVE: -// DontHave dontHave; -// case GET_PEERS: -// void; -// case PEERS: -// PeerAddress peers<100>; -// -// case GET_TX_SET: -// uint256 txSetHash; -// case TX_SET: -// TransactionSet txSet; -// case GENERALIZED_TX_SET: -// GeneralizedTransactionSet generalizedTxSet; -// -// case TRANSACTION: -// TransactionEnvelope transaction; -// -// case SURVEY_REQUEST: -// SignedSurveyRequestMessage signedSurveyRequestMessage; -// -// case SURVEY_RESPONSE: -// SignedSurveyResponseMessage signedSurveyResponseMessage; -// -// // SCP -// case GET_SCP_QUORUMSET: -// uint256 qSetHash; -// case SCP_QUORUMSET: -// SCPQuorumSet qSet; -// case SCP_MESSAGE: -// SCPEnvelope envelope; -// case GET_SCP_STATE: -// uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest -// case SEND_MORE: -// SendMore sendMoreMessage; -// -// // Pull mode -// case FLOOD_ADVERT: -// FloodAdvert floodAdvert; -// case FLOOD_DEMAND: -// FloodDemand floodDemand; -// }; -// -// =========================================================================== -xdr.union("StellarMessage", { - switchOn: xdr.lookup("MessageType"), - switchName: "type", - switches: [ - ["errorMsg", "error"], - ["hello", "hello"], - ["auth", "auth"], - ["dontHave", "dontHave"], - ["getPeers", xdr.void()], - ["peers", "peers"], - ["getTxSet", "txSetHash"], - ["txSet", "txSet"], - ["generalizedTxSet", "generalizedTxSet"], - ["transaction", "transaction"], - ["surveyRequest", "signedSurveyRequestMessage"], - ["surveyResponse", "signedSurveyResponseMessage"], - ["getScpQuorumset", "qSetHash"], - ["scpQuorumset", "qSet"], - ["scpMessage", "envelope"], - ["getScpState", "getScpLedgerSeq"], - ["sendMore", "sendMoreMessage"], - ["floodAdvert", "floodAdvert"], - ["floodDemand", "floodDemand"], - ], - arms: { - error: xdr.lookup("Error"), - hello: xdr.lookup("Hello"), - auth: xdr.lookup("Auth"), - dontHave: xdr.lookup("DontHave"), - peers: xdr.varArray(xdr.lookup("PeerAddress"), 100), - txSetHash: xdr.lookup("Uint256"), - txSet: xdr.lookup("TransactionSet"), - generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), - transaction: xdr.lookup("TransactionEnvelope"), - signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), - signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), - qSetHash: xdr.lookup("Uint256"), - qSet: xdr.lookup("ScpQuorumSet"), - envelope: xdr.lookup("ScpEnvelope"), - getScpLedgerSeq: xdr.lookup("Uint32"), - sendMoreMessage: xdr.lookup("SendMore"), - floodAdvert: xdr.lookup("FloodAdvert"), - floodDemand: xdr.lookup("FloodDemand"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// uint64 sequence; -// StellarMessage message; -// HmacSha256Mac mac; -// } -// -// =========================================================================== -xdr.struct("AuthenticatedMessageV0", [ - ["sequence", xdr.lookup("Uint64")], - ["message", xdr.lookup("StellarMessage")], - ["mac", xdr.lookup("HmacSha256Mac")], -]); - -// === xdr source ============================================================ -// -// union AuthenticatedMessage switch (uint32 v) -// { -// case 0: -// struct -// { -// uint64 sequence; -// StellarMessage message; -// HmacSha256Mac mac; -// } v0; -// }; -// -// =========================================================================== -xdr.union("AuthenticatedMessage", { - switchOn: xdr.lookup("Uint32"), - switchName: "v", - switches: [ - [0, "v0"], - ], - arms: { - v0: xdr.lookup("AuthenticatedMessageV0"), - }, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolParameters switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// LiquidityPoolConstantProductParameters constantProduct; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolParameters", { - switchOn: xdr.lookup("LiquidityPoolType"), - switchName: "type", - switches: [ - ["liquidityPoolConstantProduct", "constantProduct"], - ], - arms: { - constantProduct: xdr.lookup("LiquidityPoolConstantProductParameters"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// uint64 id; -// uint256 ed25519; -// } -// -// =========================================================================== -xdr.struct("MuxedAccountMed25519", [ - ["id", xdr.lookup("Uint64")], - ["ed25519", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// union MuxedAccount switch (CryptoKeyType type) -// { -// case KEY_TYPE_ED25519: -// uint256 ed25519; -// case KEY_TYPE_MUXED_ED25519: -// struct -// { -// uint64 id; -// uint256 ed25519; -// } med25519; -// }; -// -// =========================================================================== -xdr.union("MuxedAccount", { - switchOn: xdr.lookup("CryptoKeyType"), - switchName: "type", - switches: [ - ["keyTypeEd25519", "ed25519"], - ["keyTypeMuxedEd25519", "med25519"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - med25519: xdr.lookup("MuxedAccountMed25519"), - }, -}); - -// === xdr source ============================================================ -// -// struct DecoratedSignature -// { -// SignatureHint hint; // last 4 bytes of the public key, used as a hint -// Signature signature; // actual signature -// }; -// -// =========================================================================== -xdr.struct("DecoratedSignature", [ - ["hint", xdr.lookup("SignatureHint")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// enum OperationType -// { -// CREATE_ACCOUNT = 0, -// PAYMENT = 1, -// PATH_PAYMENT_STRICT_RECEIVE = 2, -// MANAGE_SELL_OFFER = 3, -// CREATE_PASSIVE_SELL_OFFER = 4, -// SET_OPTIONS = 5, -// CHANGE_TRUST = 6, -// ALLOW_TRUST = 7, -// ACCOUNT_MERGE = 8, -// INFLATION = 9, -// MANAGE_DATA = 10, -// BUMP_SEQUENCE = 11, -// MANAGE_BUY_OFFER = 12, -// PATH_PAYMENT_STRICT_SEND = 13, -// CREATE_CLAIMABLE_BALANCE = 14, -// CLAIM_CLAIMABLE_BALANCE = 15, -// BEGIN_SPONSORING_FUTURE_RESERVES = 16, -// END_SPONSORING_FUTURE_RESERVES = 17, -// REVOKE_SPONSORSHIP = 18, -// CLAWBACK = 19, -// CLAWBACK_CLAIMABLE_BALANCE = 20, -// SET_TRUST_LINE_FLAGS = 21, -// LIQUIDITY_POOL_DEPOSIT = 22, -// LIQUIDITY_POOL_WITHDRAW = 23 -// }; -// -// =========================================================================== -xdr.enum("OperationType", { - createAccount: 0, - payment: 1, - pathPaymentStrictReceive: 2, - manageSellOffer: 3, - createPassiveSellOffer: 4, - setOptions: 5, - changeTrust: 6, - allowTrust: 7, - accountMerge: 8, - inflation: 9, - manageData: 10, - bumpSequence: 11, - manageBuyOffer: 12, - pathPaymentStrictSend: 13, - createClaimableBalance: 14, - claimClaimableBalance: 15, - beginSponsoringFutureReserves: 16, - endSponsoringFutureReserves: 17, - revokeSponsorship: 18, - clawback: 19, - clawbackClaimableBalance: 20, - setTrustLineFlags: 21, - liquidityPoolDeposit: 22, - liquidityPoolWithdraw: 23, -}); - -// === xdr source ============================================================ -// -// struct CreateAccountOp -// { -// AccountID destination; // account to create -// int64 startingBalance; // amount they end up with -// }; -// -// =========================================================================== -xdr.struct("CreateAccountOp", [ - ["destination", xdr.lookup("AccountId")], - ["startingBalance", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct PaymentOp -// { -// MuxedAccount destination; // recipient of the payment -// Asset asset; // what they end up with -// int64 amount; // amount they end up with -// }; -// -// =========================================================================== -xdr.struct("PaymentOp", [ - ["destination", xdr.lookup("MuxedAccount")], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct PathPaymentStrictReceiveOp -// { -// Asset sendAsset; // asset we pay with -// int64 sendMax; // the maximum amount of sendAsset to -// // send (excluding fees). -// // The operation will fail if can't be met -// -// MuxedAccount destination; // recipient of the payment -// Asset destAsset; // what they end up with -// int64 destAmount; // amount they end up with -// -// Asset path<5>; // additional hops it must go through to get there -// }; -// -// =========================================================================== -xdr.struct("PathPaymentStrictReceiveOp", [ - ["sendAsset", xdr.lookup("Asset")], - ["sendMax", xdr.lookup("Int64")], - ["destination", xdr.lookup("MuxedAccount")], - ["destAsset", xdr.lookup("Asset")], - ["destAmount", xdr.lookup("Int64")], - ["path", xdr.varArray(xdr.lookup("Asset"), 5)], -]); - -// === xdr source ============================================================ -// -// struct PathPaymentStrictSendOp -// { -// Asset sendAsset; // asset we pay with -// int64 sendAmount; // amount of sendAsset to send (excluding fees) -// -// MuxedAccount destination; // recipient of the payment -// Asset destAsset; // what they end up with -// int64 destMin; // the minimum amount of dest asset to -// // be received -// // The operation will fail if it can't be met -// -// Asset path<5>; // additional hops it must go through to get there -// }; -// -// =========================================================================== -xdr.struct("PathPaymentStrictSendOp", [ - ["sendAsset", xdr.lookup("Asset")], - ["sendAmount", xdr.lookup("Int64")], - ["destination", xdr.lookup("MuxedAccount")], - ["destAsset", xdr.lookup("Asset")], - ["destMin", xdr.lookup("Int64")], - ["path", xdr.varArray(xdr.lookup("Asset"), 5)], -]); - -// === xdr source ============================================================ -// -// struct ManageSellOfferOp -// { -// Asset selling; -// Asset buying; -// int64 amount; // amount being sold. if set to 0, delete the offer -// Price price; // price of thing being sold in terms of what you are buying -// -// // 0=create a new offer, otherwise edit an existing offer -// int64 offerID; -// }; -// -// =========================================================================== -xdr.struct("ManageSellOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ManageBuyOfferOp -// { -// Asset selling; -// Asset buying; -// int64 buyAmount; // amount being bought. if set to 0, delete the offer -// Price price; // price of thing being bought in terms of what you are -// // selling -// -// // 0=create a new offer, otherwise edit an existing offer -// int64 offerID; -// }; -// -// =========================================================================== -xdr.struct("ManageBuyOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["buyAmount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct CreatePassiveSellOfferOp -// { -// Asset selling; // A -// Asset buying; // B -// int64 amount; // amount taker gets -// Price price; // cost of A in terms of B -// }; -// -// =========================================================================== -xdr.struct("CreatePassiveSellOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], -]); - -// === xdr source ============================================================ -// -// struct SetOptionsOp -// { -// AccountID* inflationDest; // sets the inflation destination -// -// uint32* clearFlags; // which flags to clear -// uint32* setFlags; // which flags to set -// -// // account threshold manipulation -// uint32* masterWeight; // weight of the master account -// uint32* lowThreshold; -// uint32* medThreshold; -// uint32* highThreshold; -// -// string32* homeDomain; // sets the home domain -// -// // Add, update or remove a signer for the account -// // signer is deleted if the weight is 0 -// Signer* signer; -// }; -// -// =========================================================================== -xdr.struct("SetOptionsOp", [ - ["inflationDest", xdr.option(xdr.lookup("AccountId"))], - ["clearFlags", xdr.option(xdr.lookup("Uint32"))], - ["setFlags", xdr.option(xdr.lookup("Uint32"))], - ["masterWeight", xdr.option(xdr.lookup("Uint32"))], - ["lowThreshold", xdr.option(xdr.lookup("Uint32"))], - ["medThreshold", xdr.option(xdr.lookup("Uint32"))], - ["highThreshold", xdr.option(xdr.lookup("Uint32"))], - ["homeDomain", xdr.option(xdr.lookup("String32"))], - ["signer", xdr.option(xdr.lookup("Signer"))], -]); - -// === xdr source ============================================================ -// -// union ChangeTrustAsset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// case ASSET_TYPE_POOL_SHARE: -// LiquidityPoolParameters liquidityPool; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("ChangeTrustAsset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ["assetTypePoolShare", "liquidityPool"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - liquidityPool: xdr.lookup("LiquidityPoolParameters"), - }, -}); - -// === xdr source ============================================================ -// -// struct ChangeTrustOp -// { -// ChangeTrustAsset line; -// -// // if limit is set to 0, deletes the trust line -// int64 limit; -// }; -// -// =========================================================================== -xdr.struct("ChangeTrustOp", [ - ["line", xdr.lookup("ChangeTrustAsset")], - ["limit", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct AllowTrustOp -// { -// AccountID trustor; -// AssetCode asset; -// -// // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG -// uint32 authorize; -// }; -// -// =========================================================================== -xdr.struct("AllowTrustOp", [ - ["trustor", xdr.lookup("AccountId")], - ["asset", xdr.lookup("AssetCode")], - ["authorize", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct ManageDataOp -// { -// string64 dataName; -// DataValue* dataValue; // set to null to clear -// }; -// -// =========================================================================== -xdr.struct("ManageDataOp", [ - ["dataName", xdr.lookup("String64")], - ["dataValue", xdr.option(xdr.lookup("DataValue"))], -]); - -// === xdr source ============================================================ -// -// struct BumpSequenceOp -// { -// SequenceNumber bumpTo; -// }; -// -// =========================================================================== -xdr.struct("BumpSequenceOp", [ - ["bumpTo", xdr.lookup("SequenceNumber")], -]); - -// === xdr source ============================================================ -// -// struct CreateClaimableBalanceOp -// { -// Asset asset; -// int64 amount; -// Claimant claimants<10>; -// }; -// -// =========================================================================== -xdr.struct("CreateClaimableBalanceOp", [ - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], -]); - -// === xdr source ============================================================ -// -// struct ClaimClaimableBalanceOp -// { -// ClaimableBalanceID balanceID; -// }; -// -// =========================================================================== -xdr.struct("ClaimClaimableBalanceOp", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct BeginSponsoringFutureReservesOp -// { -// AccountID sponsoredID; -// }; -// -// =========================================================================== -xdr.struct("BeginSponsoringFutureReservesOp", [ - ["sponsoredId", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// enum RevokeSponsorshipType -// { -// REVOKE_SPONSORSHIP_LEDGER_ENTRY = 0, -// REVOKE_SPONSORSHIP_SIGNER = 1 -// }; -// -// =========================================================================== -xdr.enum("RevokeSponsorshipType", { - revokeSponsorshipLedgerEntry: 0, - revokeSponsorshipSigner: 1, -}); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// SignerKey signerKey; -// } -// -// =========================================================================== -xdr.struct("RevokeSponsorshipOpSigner", [ - ["accountId", xdr.lookup("AccountId")], - ["signerKey", xdr.lookup("SignerKey")], -]); - -// === xdr source ============================================================ -// -// union RevokeSponsorshipOp switch (RevokeSponsorshipType type) -// { -// case REVOKE_SPONSORSHIP_LEDGER_ENTRY: -// LedgerKey ledgerKey; -// case REVOKE_SPONSORSHIP_SIGNER: -// struct -// { -// AccountID accountID; -// SignerKey signerKey; -// } signer; -// }; -// -// =========================================================================== -xdr.union("RevokeSponsorshipOp", { - switchOn: xdr.lookup("RevokeSponsorshipType"), - switchName: "type", - switches: [ - ["revokeSponsorshipLedgerEntry", "ledgerKey"], - ["revokeSponsorshipSigner", "signer"], - ], - arms: { - ledgerKey: xdr.lookup("LedgerKey"), - signer: xdr.lookup("RevokeSponsorshipOpSigner"), - }, -}); - -// === xdr source ============================================================ -// -// struct ClawbackOp -// { -// Asset asset; -// MuxedAccount from; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("ClawbackOp", [ - ["asset", xdr.lookup("Asset")], - ["from", xdr.lookup("MuxedAccount")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClawbackClaimableBalanceOp -// { -// ClaimableBalanceID balanceID; -// }; -// -// =========================================================================== -xdr.struct("ClawbackClaimableBalanceOp", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct SetTrustLineFlagsOp -// { -// AccountID trustor; -// Asset asset; -// -// uint32 clearFlags; // which flags to clear -// uint32 setFlags; // which flags to set -// }; -// -// =========================================================================== -xdr.struct("SetTrustLineFlagsOp", [ - ["trustor", xdr.lookup("AccountId")], - ["asset", xdr.lookup("Asset")], - ["clearFlags", xdr.lookup("Uint32")], - ["setFlags", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// const LIQUIDITY_POOL_FEE_V18 = 30; -// -// =========================================================================== -xdr.const("LIQUIDITY_POOL_FEE_V18", 30); - -// === xdr source ============================================================ -// -// struct LiquidityPoolDepositOp -// { -// PoolID liquidityPoolID; -// int64 maxAmountA; // maximum amount of first asset to deposit -// int64 maxAmountB; // maximum amount of second asset to deposit -// Price minPrice; // minimum depositA/depositB -// Price maxPrice; // maximum depositA/depositB -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolDepositOp", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["maxAmountA", xdr.lookup("Int64")], - ["maxAmountB", xdr.lookup("Int64")], - ["minPrice", xdr.lookup("Price")], - ["maxPrice", xdr.lookup("Price")], -]); - -// === xdr source ============================================================ -// -// struct LiquidityPoolWithdrawOp -// { -// PoolID liquidityPoolID; -// int64 amount; // amount of pool shares to withdraw -// int64 minAmountA; // minimum amount of first asset to withdraw -// int64 minAmountB; // minimum amount of second asset to withdraw -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolWithdrawOp", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["amount", xdr.lookup("Int64")], - ["minAmountA", xdr.lookup("Int64")], - ["minAmountB", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountOp createAccountOp; -// case PAYMENT: -// PaymentOp paymentOp; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; -// case MANAGE_SELL_OFFER: -// ManageSellOfferOp manageSellOfferOp; -// case CREATE_PASSIVE_SELL_OFFER: -// CreatePassiveSellOfferOp createPassiveSellOfferOp; -// case SET_OPTIONS: -// SetOptionsOp setOptionsOp; -// case CHANGE_TRUST: -// ChangeTrustOp changeTrustOp; -// case ALLOW_TRUST: -// AllowTrustOp allowTrustOp; -// case ACCOUNT_MERGE: -// MuxedAccount destination; -// case INFLATION: -// void; -// case MANAGE_DATA: -// ManageDataOp manageDataOp; -// case BUMP_SEQUENCE: -// BumpSequenceOp bumpSequenceOp; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferOp manageBuyOfferOp; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendOp pathPaymentStrictSendOp; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceOp createClaimableBalanceOp; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceOp claimClaimableBalanceOp; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; -// case END_SPONSORING_FUTURE_RESERVES: -// void; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipOp revokeSponsorshipOp; -// case CLAWBACK: -// ClawbackOp clawbackOp; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsOp setTrustLineFlagsOp; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositOp liquidityPoolDepositOp; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; -// } -// -// =========================================================================== -xdr.union("OperationBody", { - switchOn: xdr.lookup("OperationType"), - switchName: "type", - switches: [ - ["createAccount", "createAccountOp"], - ["payment", "paymentOp"], - ["pathPaymentStrictReceive", "pathPaymentStrictReceiveOp"], - ["manageSellOffer", "manageSellOfferOp"], - ["createPassiveSellOffer", "createPassiveSellOfferOp"], - ["setOptions", "setOptionsOp"], - ["changeTrust", "changeTrustOp"], - ["allowTrust", "allowTrustOp"], - ["accountMerge", "destination"], - ["inflation", xdr.void()], - ["manageData", "manageDataOp"], - ["bumpSequence", "bumpSequenceOp"], - ["manageBuyOffer", "manageBuyOfferOp"], - ["pathPaymentStrictSend", "pathPaymentStrictSendOp"], - ["createClaimableBalance", "createClaimableBalanceOp"], - ["claimClaimableBalance", "claimClaimableBalanceOp"], - ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesOp"], - ["endSponsoringFutureReserves", xdr.void()], - ["revokeSponsorship", "revokeSponsorshipOp"], - ["clawback", "clawbackOp"], - ["clawbackClaimableBalance", "clawbackClaimableBalanceOp"], - ["setTrustLineFlags", "setTrustLineFlagsOp"], - ["liquidityPoolDeposit", "liquidityPoolDepositOp"], - ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], - ], - arms: { - createAccountOp: xdr.lookup("CreateAccountOp"), - paymentOp: xdr.lookup("PaymentOp"), - pathPaymentStrictReceiveOp: xdr.lookup("PathPaymentStrictReceiveOp"), - manageSellOfferOp: xdr.lookup("ManageSellOfferOp"), - createPassiveSellOfferOp: xdr.lookup("CreatePassiveSellOfferOp"), - setOptionsOp: xdr.lookup("SetOptionsOp"), - changeTrustOp: xdr.lookup("ChangeTrustOp"), - allowTrustOp: xdr.lookup("AllowTrustOp"), - destination: xdr.lookup("MuxedAccount"), - manageDataOp: xdr.lookup("ManageDataOp"), - bumpSequenceOp: xdr.lookup("BumpSequenceOp"), - manageBuyOfferOp: xdr.lookup("ManageBuyOfferOp"), - pathPaymentStrictSendOp: xdr.lookup("PathPaymentStrictSendOp"), - createClaimableBalanceOp: xdr.lookup("CreateClaimableBalanceOp"), - claimClaimableBalanceOp: xdr.lookup("ClaimClaimableBalanceOp"), - beginSponsoringFutureReservesOp: xdr.lookup("BeginSponsoringFutureReservesOp"), - revokeSponsorshipOp: xdr.lookup("RevokeSponsorshipOp"), - clawbackOp: xdr.lookup("ClawbackOp"), - clawbackClaimableBalanceOp: xdr.lookup("ClawbackClaimableBalanceOp"), - setTrustLineFlagsOp: xdr.lookup("SetTrustLineFlagsOp"), - liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), - liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), - }, -}); - -// === xdr source ============================================================ -// -// struct Operation -// { -// // sourceAccount is the account used to run the operation -// // if not set, the runtime defaults to "sourceAccount" specified at -// // the transaction level -// MuxedAccount* sourceAccount; -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountOp createAccountOp; -// case PAYMENT: -// PaymentOp paymentOp; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; -// case MANAGE_SELL_OFFER: -// ManageSellOfferOp manageSellOfferOp; -// case CREATE_PASSIVE_SELL_OFFER: -// CreatePassiveSellOfferOp createPassiveSellOfferOp; -// case SET_OPTIONS: -// SetOptionsOp setOptionsOp; -// case CHANGE_TRUST: -// ChangeTrustOp changeTrustOp; -// case ALLOW_TRUST: -// AllowTrustOp allowTrustOp; -// case ACCOUNT_MERGE: -// MuxedAccount destination; -// case INFLATION: -// void; -// case MANAGE_DATA: -// ManageDataOp manageDataOp; -// case BUMP_SEQUENCE: -// BumpSequenceOp bumpSequenceOp; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferOp manageBuyOfferOp; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendOp pathPaymentStrictSendOp; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceOp createClaimableBalanceOp; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceOp claimClaimableBalanceOp; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; -// case END_SPONSORING_FUTURE_RESERVES: -// void; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipOp revokeSponsorshipOp; -// case CLAWBACK: -// ClawbackOp clawbackOp; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsOp setTrustLineFlagsOp; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositOp liquidityPoolDepositOp; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; -// } -// body; -// }; -// -// =========================================================================== -xdr.struct("Operation", [ - ["sourceAccount", xdr.option(xdr.lookup("MuxedAccount"))], - ["body", xdr.lookup("OperationBody")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageOperationId", [ - ["sourceAccount", xdr.lookup("AccountId")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["opNum", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// PoolID liquidityPoolID; -// Asset asset; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageRevokeId", [ - ["sourceAccount", xdr.lookup("AccountId")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["opNum", xdr.lookup("Uint32")], - ["liquidityPoolId", xdr.lookup("PoolId")], - ["asset", xdr.lookup("Asset")], -]); - -// === xdr source ============================================================ -// -// union HashIDPreimage switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_OP_ID: -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// } operationID; -// case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// PoolID liquidityPoolID; -// Asset asset; -// } revokeID; -// }; -// -// =========================================================================== -xdr.union("HashIdPreimage", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeOpId", "operationId"], - ["envelopeTypePoolRevokeOpId", "revokeId"], - ], - arms: { - operationId: xdr.lookup("HashIdPreimageOperationId"), - revokeId: xdr.lookup("HashIdPreimageRevokeId"), - }, -}); - -// === xdr source ============================================================ -// -// enum MemoType -// { -// MEMO_NONE = 0, -// MEMO_TEXT = 1, -// MEMO_ID = 2, -// MEMO_HASH = 3, -// MEMO_RETURN = 4 -// }; -// -// =========================================================================== -xdr.enum("MemoType", { - memoNone: 0, - memoText: 1, - memoId: 2, - memoHash: 3, - memoReturn: 4, -}); - -// === xdr source ============================================================ -// -// union Memo switch (MemoType type) -// { -// case MEMO_NONE: -// void; -// case MEMO_TEXT: -// string text<28>; -// case MEMO_ID: -// uint64 id; -// case MEMO_HASH: -// Hash hash; // the hash of what to pull from the content server -// case MEMO_RETURN: -// Hash retHash; // the hash of the tx you are rejecting -// }; -// -// =========================================================================== -xdr.union("Memo", { - switchOn: xdr.lookup("MemoType"), - switchName: "type", - switches: [ - ["memoNone", xdr.void()], - ["memoText", "text"], - ["memoId", "id"], - ["memoHash", "hash"], - ["memoReturn", "retHash"], - ], - arms: { - text: xdr.string(28), - id: xdr.lookup("Uint64"), - hash: xdr.lookup("Hash"), - retHash: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// struct TimeBounds -// { -// TimePoint minTime; -// TimePoint maxTime; // 0 here means no maxTime -// }; -// -// =========================================================================== -xdr.struct("TimeBounds", [ - ["minTime", xdr.lookup("TimePoint")], - ["maxTime", xdr.lookup("TimePoint")], -]); - -// === xdr source ============================================================ -// -// struct LedgerBounds -// { -// uint32 minLedger; -// uint32 maxLedger; // 0 here means no maxLedger -// }; -// -// =========================================================================== -xdr.struct("LedgerBounds", [ - ["minLedger", xdr.lookup("Uint32")], - ["maxLedger", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct PreconditionsV2 -// { -// TimeBounds* timeBounds; -// -// // Transaction only valid for ledger numbers n such that -// // minLedger <= n < maxLedger (if maxLedger == 0, then -// // only minLedger is checked) -// LedgerBounds* ledgerBounds; -// -// // If NULL, only valid when sourceAccount's sequence number -// // is seqNum - 1. Otherwise, valid when sourceAccount's -// // sequence number n satisfies minSeqNum <= n < tx.seqNum. -// // Note that after execution the account's sequence number -// // is always raised to tx.seqNum, and a transaction is not -// // valid if tx.seqNum is too high to ensure replay protection. -// SequenceNumber* minSeqNum; -// -// // For the transaction to be valid, the current ledger time must -// // be at least minSeqAge greater than sourceAccount's seqTime. -// Duration minSeqAge; -// -// // For the transaction to be valid, the current ledger number -// // must be at least minSeqLedgerGap greater than sourceAccount's -// // seqLedger. -// uint32 minSeqLedgerGap; -// -// // 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. -// SignerKey extraSigners<2>; -// }; -// -// =========================================================================== -xdr.struct("PreconditionsV2", [ - ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], - ["ledgerBounds", xdr.option(xdr.lookup("LedgerBounds"))], - ["minSeqNum", xdr.option(xdr.lookup("SequenceNumber"))], - ["minSeqAge", xdr.lookup("Duration")], - ["minSeqLedgerGap", xdr.lookup("Uint32")], - ["extraSigners", xdr.varArray(xdr.lookup("SignerKey"), 2)], -]); - -// === xdr source ============================================================ -// -// enum PreconditionType -// { -// PRECOND_NONE = 0, -// PRECOND_TIME = 1, -// PRECOND_V2 = 2 -// }; -// -// =========================================================================== -xdr.enum("PreconditionType", { - precondNone: 0, - precondTime: 1, - precondV2: 2, -}); - -// === xdr source ============================================================ -// -// union Preconditions switch (PreconditionType type) -// { -// case PRECOND_NONE: -// void; -// case PRECOND_TIME: -// TimeBounds timeBounds; -// case PRECOND_V2: -// PreconditionsV2 v2; -// }; -// -// =========================================================================== -xdr.union("Preconditions", { - switchOn: xdr.lookup("PreconditionType"), - switchName: "type", - switches: [ - ["precondNone", xdr.void()], - ["precondTime", "timeBounds"], - ["precondV2", "v2"], - ], - arms: { - timeBounds: xdr.lookup("TimeBounds"), - v2: xdr.lookup("PreconditionsV2"), - }, -}); - -// === xdr source ============================================================ -// -// const MAX_OPS_PER_TX = 100; -// -// =========================================================================== -xdr.const("MAX_OPS_PER_TX", 100); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionV0Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionV0 -// { -// uint256 sourceAccountEd25519; -// uint32 fee; -// SequenceNumber seqNum; -// TimeBounds* timeBounds; -// Memo memo; -// Operation operations; -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionV0", [ - ["sourceAccountEd25519", xdr.lookup("Uint256")], - ["fee", xdr.lookup("Uint32")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], - ["memo", xdr.lookup("Memo")], - ["operations", xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX"))], - ["ext", xdr.lookup("TransactionV0Ext")], -]); - -// === xdr source ============================================================ -// -// struct TransactionV0Envelope -// { -// TransactionV0 tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("TransactionV0Envelope", [ - ["tx", xdr.lookup("TransactionV0")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct Transaction -// { -// // account used to run the transaction -// MuxedAccount sourceAccount; -// -// // the fee the sourceAccount will pay -// uint32 fee; -// -// // sequence number to consume in the account -// SequenceNumber seqNum; -// -// // validity conditions -// Preconditions cond; -// -// Memo memo; -// -// Operation operations; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("Transaction", [ - ["sourceAccount", xdr.lookup("MuxedAccount")], - ["fee", xdr.lookup("Uint32")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["cond", xdr.lookup("Preconditions")], - ["memo", xdr.lookup("Memo")], - ["operations", xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX"))], - ["ext", xdr.lookup("TransactionExt")], -]); - -// === xdr source ============================================================ -// -// struct TransactionV1Envelope -// { -// Transaction tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("TransactionV1Envelope", [ - ["tx", xdr.lookup("Transaction")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// } -// -// =========================================================================== -xdr.union("FeeBumpTransactionInnerTx", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTx", "v1"], - ], - arms: { - v1: xdr.lookup("TransactionV1Envelope"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("FeeBumpTransactionExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct FeeBumpTransaction -// { -// MuxedAccount feeSource; -// int64 fee; -// union switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// } -// innerTx; -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("FeeBumpTransaction", [ - ["feeSource", xdr.lookup("MuxedAccount")], - ["fee", xdr.lookup("Int64")], - ["innerTx", xdr.lookup("FeeBumpTransactionInnerTx")], - ["ext", xdr.lookup("FeeBumpTransactionExt")], -]); - -// === xdr source ============================================================ -// -// struct FeeBumpTransactionEnvelope -// { -// FeeBumpTransaction tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("FeeBumpTransactionEnvelope", [ - ["tx", xdr.lookup("FeeBumpTransaction")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union TransactionEnvelope switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX_V0: -// TransactionV0Envelope v0; -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransactionEnvelope feeBump; -// }; -// -// =========================================================================== -xdr.union("TransactionEnvelope", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTxV0", "v0"], - ["envelopeTypeTx", "v1"], - ["envelopeTypeTxFeeBump", "feeBump"], - ], - arms: { - v0: xdr.lookup("TransactionV0Envelope"), - v1: xdr.lookup("TransactionV1Envelope"), - feeBump: xdr.lookup("FeeBumpTransactionEnvelope"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (EnvelopeType type) -// { -// // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 -// case ENVELOPE_TYPE_TX: -// Transaction tx; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransaction feeBump; -// } -// -// =========================================================================== -xdr.union("TransactionSignaturePayloadTaggedTransaction", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTx", "tx"], - ["envelopeTypeTxFeeBump", "feeBump"], - ], - arms: { - tx: xdr.lookup("Transaction"), - feeBump: xdr.lookup("FeeBumpTransaction"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionSignaturePayload -// { -// Hash networkId; -// union switch (EnvelopeType type) -// { -// // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 -// case ENVELOPE_TYPE_TX: -// Transaction tx; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransaction feeBump; -// } -// taggedTransaction; -// }; -// -// =========================================================================== -xdr.struct("TransactionSignaturePayload", [ - ["networkId", xdr.lookup("Hash")], - ["taggedTransaction", xdr.lookup("TransactionSignaturePayloadTaggedTransaction")], -]); - -// === xdr source ============================================================ -// -// enum ClaimAtomType -// { -// CLAIM_ATOM_TYPE_V0 = 0, -// CLAIM_ATOM_TYPE_ORDER_BOOK = 1, -// CLAIM_ATOM_TYPE_LIQUIDITY_POOL = 2 -// }; -// -// =========================================================================== -xdr.enum("ClaimAtomType", { - claimAtomTypeV0: 0, - claimAtomTypeOrderBook: 1, - claimAtomTypeLiquidityPool: 2, -}); - -// === xdr source ============================================================ -// -// struct ClaimOfferAtomV0 -// { -// // emitted to identify the offer -// uint256 sellerEd25519; // Account that owns the offer -// int64 offerID; -// -// // amount and asset taken from the owner -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the owner -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimOfferAtomV0", [ - ["sellerEd25519", xdr.lookup("Uint256")], - ["offerId", xdr.lookup("Int64")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClaimOfferAtom -// { -// // emitted to identify the offer -// AccountID sellerID; // Account that owns the offer -// int64 offerID; -// -// // amount and asset taken from the owner -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the owner -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimOfferAtom", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClaimLiquidityAtom -// { -// PoolID liquidityPoolID; -// -// // amount and asset taken from the pool -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the pool -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimLiquidityAtom", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union ClaimAtom switch (ClaimAtomType type) -// { -// case CLAIM_ATOM_TYPE_V0: -// ClaimOfferAtomV0 v0; -// case CLAIM_ATOM_TYPE_ORDER_BOOK: -// ClaimOfferAtom orderBook; -// case CLAIM_ATOM_TYPE_LIQUIDITY_POOL: -// ClaimLiquidityAtom liquidityPool; -// }; -// -// =========================================================================== -xdr.union("ClaimAtom", { - switchOn: xdr.lookup("ClaimAtomType"), - switchName: "type", - switches: [ - ["claimAtomTypeV0", "v0"], - ["claimAtomTypeOrderBook", "orderBook"], - ["claimAtomTypeLiquidityPool", "liquidityPool"], - ], - arms: { - v0: xdr.lookup("ClaimOfferAtomV0"), - orderBook: xdr.lookup("ClaimOfferAtom"), - liquidityPool: xdr.lookup("ClaimLiquidityAtom"), - }, -}); - -// === xdr source ============================================================ -// -// enum CreateAccountResultCode -// { -// // codes considered as "success" for the operation -// CREATE_ACCOUNT_SUCCESS = 0, // account was created -// -// // codes considered as "failure" for the operation -// CREATE_ACCOUNT_MALFORMED = -1, // invalid destination -// CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account -// CREATE_ACCOUNT_LOW_RESERVE = -// -3, // would create an account below the min reserve -// CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists -// }; -// -// =========================================================================== -xdr.enum("CreateAccountResultCode", { - createAccountSuccess: 0, - createAccountMalformed: -1, - createAccountUnderfunded: -2, - createAccountLowReserve: -3, - createAccountAlreadyExist: -4, -}); - -// === xdr source ============================================================ -// -// union CreateAccountResult switch (CreateAccountResultCode code) -// { -// case CREATE_ACCOUNT_SUCCESS: -// void; -// case CREATE_ACCOUNT_MALFORMED: -// case CREATE_ACCOUNT_UNDERFUNDED: -// case CREATE_ACCOUNT_LOW_RESERVE: -// case CREATE_ACCOUNT_ALREADY_EXIST: -// void; -// }; -// -// =========================================================================== -xdr.union("CreateAccountResult", { - switchOn: xdr.lookup("CreateAccountResultCode"), - switchName: "code", - switches: [ - ["createAccountSuccess", xdr.void()], - ["createAccountMalformed", xdr.void()], - ["createAccountUnderfunded", xdr.void()], - ["createAccountLowReserve", xdr.void()], - ["createAccountAlreadyExist", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum PaymentResultCode -// { -// // codes considered as "success" for the operation -// PAYMENT_SUCCESS = 0, // payment successfully completed -// -// // codes considered as "failure" for the operation -// PAYMENT_MALFORMED = -1, // bad input -// PAYMENT_UNDERFUNDED = -2, // not enough funds in source account -// PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account -// PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer -// PAYMENT_NO_DESTINATION = -5, // destination account does not exist -// PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset -// PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset -// PAYMENT_LINE_FULL = -8, // destination would go above their limit -// PAYMENT_NO_ISSUER = -9 // missing issuer on asset -// }; -// -// =========================================================================== -xdr.enum("PaymentResultCode", { - paymentSuccess: 0, - paymentMalformed: -1, - paymentUnderfunded: -2, - paymentSrcNoTrust: -3, - paymentSrcNotAuthorized: -4, - paymentNoDestination: -5, - paymentNoTrust: -6, - paymentNotAuthorized: -7, - paymentLineFull: -8, - paymentNoIssuer: -9, -}); - -// === xdr source ============================================================ -// -// union PaymentResult switch (PaymentResultCode code) -// { -// case PAYMENT_SUCCESS: -// void; -// case PAYMENT_MALFORMED: -// case PAYMENT_UNDERFUNDED: -// case PAYMENT_SRC_NO_TRUST: -// case PAYMENT_SRC_NOT_AUTHORIZED: -// case PAYMENT_NO_DESTINATION: -// case PAYMENT_NO_TRUST: -// case PAYMENT_NOT_AUTHORIZED: -// case PAYMENT_LINE_FULL: -// case PAYMENT_NO_ISSUER: -// void; -// }; -// -// =========================================================================== -xdr.union("PaymentResult", { - switchOn: xdr.lookup("PaymentResultCode"), - switchName: "code", - switches: [ - ["paymentSuccess", xdr.void()], - ["paymentMalformed", xdr.void()], - ["paymentUnderfunded", xdr.void()], - ["paymentSrcNoTrust", xdr.void()], - ["paymentSrcNotAuthorized", xdr.void()], - ["paymentNoDestination", xdr.void()], - ["paymentNoTrust", xdr.void()], - ["paymentNotAuthorized", xdr.void()], - ["paymentLineFull", xdr.void()], - ["paymentNoIssuer", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum PathPaymentStrictReceiveResultCode -// { -// // codes considered as "success" for the operation -// PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success -// -// // codes considered as "failure" for the operation -// PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input -// PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = -// -2, // not enough funds in source account -// PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = -// -3, // no trust line on source account -// PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = -// -4, // source not authorized to transfer -// PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = -// -5, // destination account does not exist -// PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = -// -6, // dest missing a trust line for asset -// PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = -// -7, // dest not authorized to hold asset -// PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = -// -8, // dest would go above their limit -// PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset -// PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = -// -10, // not enough offers to satisfy path -// PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = -// -11, // would cross one of its own offers -// PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax -// }; -// -// =========================================================================== -xdr.enum("PathPaymentStrictReceiveResultCode", { - pathPaymentStrictReceiveSuccess: 0, - pathPaymentStrictReceiveMalformed: -1, - pathPaymentStrictReceiveUnderfunded: -2, - pathPaymentStrictReceiveSrcNoTrust: -3, - pathPaymentStrictReceiveSrcNotAuthorized: -4, - pathPaymentStrictReceiveNoDestination: -5, - pathPaymentStrictReceiveNoTrust: -6, - pathPaymentStrictReceiveNotAuthorized: -7, - pathPaymentStrictReceiveLineFull: -8, - pathPaymentStrictReceiveNoIssuer: -9, - pathPaymentStrictReceiveTooFewOffers: -10, - pathPaymentStrictReceiveOfferCrossSelf: -11, - pathPaymentStrictReceiveOverSendmax: -12, -}); - -// === xdr source ============================================================ -// -// struct SimplePaymentResult -// { -// AccountID destination; -// Asset asset; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("SimplePaymentResult", [ - ["destination", xdr.lookup("AccountId")], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } -// -// =========================================================================== -xdr.struct("PathPaymentStrictReceiveResultSuccess", [ - ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["last", xdr.lookup("SimplePaymentResult")], -]); - -// === xdr source ============================================================ -// -// union PathPaymentStrictReceiveResult switch ( -// PathPaymentStrictReceiveResultCode code) -// { -// case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS: -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } success; -// case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED: -// case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED: -// case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST: -// case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION: -// case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST: -// case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL: -// void; -// case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER: -// Asset noIssuer; // the asset that caused the error -// case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS: -// case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF: -// case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX: -// void; -// }; -// -// =========================================================================== -xdr.union("PathPaymentStrictReceiveResult", { - switchOn: xdr.lookup("PathPaymentStrictReceiveResultCode"), - switchName: "code", - switches: [ - ["pathPaymentStrictReceiveSuccess", "success"], - ["pathPaymentStrictReceiveMalformed", xdr.void()], - ["pathPaymentStrictReceiveUnderfunded", xdr.void()], - ["pathPaymentStrictReceiveSrcNoTrust", xdr.void()], - ["pathPaymentStrictReceiveSrcNotAuthorized", xdr.void()], - ["pathPaymentStrictReceiveNoDestination", xdr.void()], - ["pathPaymentStrictReceiveNoTrust", xdr.void()], - ["pathPaymentStrictReceiveNotAuthorized", xdr.void()], - ["pathPaymentStrictReceiveLineFull", xdr.void()], - ["pathPaymentStrictReceiveNoIssuer", "noIssuer"], - ["pathPaymentStrictReceiveTooFewOffers", xdr.void()], - ["pathPaymentStrictReceiveOfferCrossSelf", xdr.void()], - ["pathPaymentStrictReceiveOverSendmax", xdr.void()], - ], - arms: { - success: xdr.lookup("PathPaymentStrictReceiveResultSuccess"), - noIssuer: xdr.lookup("Asset"), - }, -}); - -// === xdr source ============================================================ -// -// enum PathPaymentStrictSendResultCode -// { -// // codes considered as "success" for the operation -// PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success -// -// // codes considered as "failure" for the operation -// PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input -// PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = -// -2, // not enough funds in source account -// PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = -// -3, // no trust line on source account -// PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = -// -4, // source not authorized to transfer -// PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = -// -5, // destination account does not exist -// PATH_PAYMENT_STRICT_SEND_NO_TRUST = -// -6, // dest missing a trust line for asset -// PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = -// -7, // dest not authorized to hold asset -// PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit -// PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset -// PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = -// -10, // not enough offers to satisfy path -// PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = -// -11, // would cross one of its own offers -// PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin -// }; -// -// =========================================================================== -xdr.enum("PathPaymentStrictSendResultCode", { - pathPaymentStrictSendSuccess: 0, - pathPaymentStrictSendMalformed: -1, - pathPaymentStrictSendUnderfunded: -2, - pathPaymentStrictSendSrcNoTrust: -3, - pathPaymentStrictSendSrcNotAuthorized: -4, - pathPaymentStrictSendNoDestination: -5, - pathPaymentStrictSendNoTrust: -6, - pathPaymentStrictSendNotAuthorized: -7, - pathPaymentStrictSendLineFull: -8, - pathPaymentStrictSendNoIssuer: -9, - pathPaymentStrictSendTooFewOffers: -10, - pathPaymentStrictSendOfferCrossSelf: -11, - pathPaymentStrictSendUnderDestmin: -12, -}); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } -// -// =========================================================================== -xdr.struct("PathPaymentStrictSendResultSuccess", [ - ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["last", xdr.lookup("SimplePaymentResult")], -]); - -// === xdr source ============================================================ -// -// union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code) -// { -// case PATH_PAYMENT_STRICT_SEND_SUCCESS: -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } success; -// case PATH_PAYMENT_STRICT_SEND_MALFORMED: -// case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED: -// case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST: -// case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION: -// case PATH_PAYMENT_STRICT_SEND_NO_TRUST: -// case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_SEND_LINE_FULL: -// void; -// case PATH_PAYMENT_STRICT_SEND_NO_ISSUER: -// Asset noIssuer; // the asset that caused the error -// case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS: -// case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF: -// case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN: -// void; -// }; -// -// =========================================================================== -xdr.union("PathPaymentStrictSendResult", { - switchOn: xdr.lookup("PathPaymentStrictSendResultCode"), - switchName: "code", - switches: [ - ["pathPaymentStrictSendSuccess", "success"], - ["pathPaymentStrictSendMalformed", xdr.void()], - ["pathPaymentStrictSendUnderfunded", xdr.void()], - ["pathPaymentStrictSendSrcNoTrust", xdr.void()], - ["pathPaymentStrictSendSrcNotAuthorized", xdr.void()], - ["pathPaymentStrictSendNoDestination", xdr.void()], - ["pathPaymentStrictSendNoTrust", xdr.void()], - ["pathPaymentStrictSendNotAuthorized", xdr.void()], - ["pathPaymentStrictSendLineFull", xdr.void()], - ["pathPaymentStrictSendNoIssuer", "noIssuer"], - ["pathPaymentStrictSendTooFewOffers", xdr.void()], - ["pathPaymentStrictSendOfferCrossSelf", xdr.void()], - ["pathPaymentStrictSendUnderDestmin", xdr.void()], - ], - arms: { - success: xdr.lookup("PathPaymentStrictSendResultSuccess"), - noIssuer: xdr.lookup("Asset"), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageSellOfferResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_SELL_OFFER_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid -// MANAGE_SELL_OFFER_SELL_NO_TRUST = -// -2, // no trust line for what we're selling -// MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying -// MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell -// MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy -// MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying -// MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell -// MANAGE_SELL_OFFER_CROSS_SELF = -// -8, // would cross an offer from the same user -// MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling -// MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying -// -// // update errors -// MANAGE_SELL_OFFER_NOT_FOUND = -// -11, // offerID does not match an existing offer -// -// MANAGE_SELL_OFFER_LOW_RESERVE = -// -12 // not enough funds to create a new Offer -// }; -// -// =========================================================================== -xdr.enum("ManageSellOfferResultCode", { - manageSellOfferSuccess: 0, - manageSellOfferMalformed: -1, - manageSellOfferSellNoTrust: -2, - manageSellOfferBuyNoTrust: -3, - manageSellOfferSellNotAuthorized: -4, - manageSellOfferBuyNotAuthorized: -5, - manageSellOfferLineFull: -6, - manageSellOfferUnderfunded: -7, - manageSellOfferCrossSelf: -8, - manageSellOfferSellNoIssuer: -9, - manageSellOfferBuyNoIssuer: -10, - manageSellOfferNotFound: -11, - manageSellOfferLowReserve: -12, -}); - -// === xdr source ============================================================ -// -// enum ManageOfferEffect -// { -// MANAGE_OFFER_CREATED = 0, -// MANAGE_OFFER_UPDATED = 1, -// MANAGE_OFFER_DELETED = 2 -// }; -// -// =========================================================================== -xdr.enum("ManageOfferEffect", { - manageOfferCreated: 0, - manageOfferUpdated: 1, - manageOfferDeleted: 2, -}); - -// === xdr source ============================================================ -// -// union switch (ManageOfferEffect effect) -// { -// case MANAGE_OFFER_CREATED: -// case MANAGE_OFFER_UPDATED: -// OfferEntry offer; -// case MANAGE_OFFER_DELETED: -// void; -// } -// -// =========================================================================== -xdr.union("ManageOfferSuccessResultOffer", { - switchOn: xdr.lookup("ManageOfferEffect"), - switchName: "effect", - switches: [ - ["manageOfferCreated", "offer"], - ["manageOfferUpdated", "offer"], - ["manageOfferDeleted", xdr.void()], - ], - arms: { - offer: xdr.lookup("OfferEntry"), - }, -}); - -// === xdr source ============================================================ -// -// struct ManageOfferSuccessResult -// { -// // offers that got claimed while creating this offer -// ClaimAtom offersClaimed<>; -// -// union switch (ManageOfferEffect effect) -// { -// case MANAGE_OFFER_CREATED: -// case MANAGE_OFFER_UPDATED: -// OfferEntry offer; -// case MANAGE_OFFER_DELETED: -// void; -// } -// offer; -// }; -// -// =========================================================================== -xdr.struct("ManageOfferSuccessResult", [ - ["offersClaimed", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["offer", xdr.lookup("ManageOfferSuccessResultOffer")], -]); - -// === xdr source ============================================================ -// -// union ManageSellOfferResult switch (ManageSellOfferResultCode code) -// { -// case MANAGE_SELL_OFFER_SUCCESS: -// ManageOfferSuccessResult success; -// case MANAGE_SELL_OFFER_MALFORMED: -// case MANAGE_SELL_OFFER_SELL_NO_TRUST: -// case MANAGE_SELL_OFFER_BUY_NO_TRUST: -// case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED: -// case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED: -// case MANAGE_SELL_OFFER_LINE_FULL: -// case MANAGE_SELL_OFFER_UNDERFUNDED: -// case MANAGE_SELL_OFFER_CROSS_SELF: -// case MANAGE_SELL_OFFER_SELL_NO_ISSUER: -// case MANAGE_SELL_OFFER_BUY_NO_ISSUER: -// case MANAGE_SELL_OFFER_NOT_FOUND: -// case MANAGE_SELL_OFFER_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageSellOfferResult", { - switchOn: xdr.lookup("ManageSellOfferResultCode"), - switchName: "code", - switches: [ - ["manageSellOfferSuccess", "success"], - ["manageSellOfferMalformed", xdr.void()], - ["manageSellOfferSellNoTrust", xdr.void()], - ["manageSellOfferBuyNoTrust", xdr.void()], - ["manageSellOfferSellNotAuthorized", xdr.void()], - ["manageSellOfferBuyNotAuthorized", xdr.void()], - ["manageSellOfferLineFull", xdr.void()], - ["manageSellOfferUnderfunded", xdr.void()], - ["manageSellOfferCrossSelf", xdr.void()], - ["manageSellOfferSellNoIssuer", xdr.void()], - ["manageSellOfferBuyNoIssuer", xdr.void()], - ["manageSellOfferNotFound", xdr.void()], - ["manageSellOfferLowReserve", xdr.void()], - ], - arms: { - success: xdr.lookup("ManageOfferSuccessResult"), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageBuyOfferResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_BUY_OFFER_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// MANAGE_BUY_OFFER_MALFORMED = -1, // generated offer would be invalid -// MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling -// MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying -// MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell -// MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy -// MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying -// MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell -// MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user -// MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling -// MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying -// -// // update errors -// MANAGE_BUY_OFFER_NOT_FOUND = -// -11, // offerID does not match an existing offer -// -// MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer -// }; -// -// =========================================================================== -xdr.enum("ManageBuyOfferResultCode", { - manageBuyOfferSuccess: 0, - manageBuyOfferMalformed: -1, - manageBuyOfferSellNoTrust: -2, - manageBuyOfferBuyNoTrust: -3, - manageBuyOfferSellNotAuthorized: -4, - manageBuyOfferBuyNotAuthorized: -5, - manageBuyOfferLineFull: -6, - manageBuyOfferUnderfunded: -7, - manageBuyOfferCrossSelf: -8, - manageBuyOfferSellNoIssuer: -9, - manageBuyOfferBuyNoIssuer: -10, - manageBuyOfferNotFound: -11, - manageBuyOfferLowReserve: -12, -}); - -// === xdr source ============================================================ -// -// union ManageBuyOfferResult switch (ManageBuyOfferResultCode code) -// { -// case MANAGE_BUY_OFFER_SUCCESS: -// ManageOfferSuccessResult success; -// case MANAGE_BUY_OFFER_MALFORMED: -// case MANAGE_BUY_OFFER_SELL_NO_TRUST: -// case MANAGE_BUY_OFFER_BUY_NO_TRUST: -// case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED: -// case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED: -// case MANAGE_BUY_OFFER_LINE_FULL: -// case MANAGE_BUY_OFFER_UNDERFUNDED: -// case MANAGE_BUY_OFFER_CROSS_SELF: -// case MANAGE_BUY_OFFER_SELL_NO_ISSUER: -// case MANAGE_BUY_OFFER_BUY_NO_ISSUER: -// case MANAGE_BUY_OFFER_NOT_FOUND: -// case MANAGE_BUY_OFFER_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageBuyOfferResult", { - switchOn: xdr.lookup("ManageBuyOfferResultCode"), - switchName: "code", - switches: [ - ["manageBuyOfferSuccess", "success"], - ["manageBuyOfferMalformed", xdr.void()], - ["manageBuyOfferSellNoTrust", xdr.void()], - ["manageBuyOfferBuyNoTrust", xdr.void()], - ["manageBuyOfferSellNotAuthorized", xdr.void()], - ["manageBuyOfferBuyNotAuthorized", xdr.void()], - ["manageBuyOfferLineFull", xdr.void()], - ["manageBuyOfferUnderfunded", xdr.void()], - ["manageBuyOfferCrossSelf", xdr.void()], - ["manageBuyOfferSellNoIssuer", xdr.void()], - ["manageBuyOfferBuyNoIssuer", xdr.void()], - ["manageBuyOfferNotFound", xdr.void()], - ["manageBuyOfferLowReserve", xdr.void()], - ], - arms: { - success: xdr.lookup("ManageOfferSuccessResult"), - }, -}); - -// === xdr source ============================================================ -// -// enum SetOptionsResultCode -// { -// // codes considered as "success" for the operation -// SET_OPTIONS_SUCCESS = 0, -// // codes considered as "failure" for the operation -// SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer -// SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached -// SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags -// SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist -// SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option -// SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag -// SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold -// SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey -// SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain -// SET_OPTIONS_AUTH_REVOCABLE_REQUIRED = -// -10 // auth revocable is required for clawback -// }; -// -// =========================================================================== -xdr.enum("SetOptionsResultCode", { - setOptionsSuccess: 0, - setOptionsLowReserve: -1, - setOptionsTooManySigners: -2, - setOptionsBadFlags: -3, - setOptionsInvalidInflation: -4, - setOptionsCantChange: -5, - setOptionsUnknownFlag: -6, - setOptionsThresholdOutOfRange: -7, - setOptionsBadSigner: -8, - setOptionsInvalidHomeDomain: -9, - setOptionsAuthRevocableRequired: -10, -}); - -// === xdr source ============================================================ -// -// union SetOptionsResult switch (SetOptionsResultCode code) -// { -// case SET_OPTIONS_SUCCESS: -// void; -// case SET_OPTIONS_LOW_RESERVE: -// case SET_OPTIONS_TOO_MANY_SIGNERS: -// case SET_OPTIONS_BAD_FLAGS: -// case SET_OPTIONS_INVALID_INFLATION: -// case SET_OPTIONS_CANT_CHANGE: -// case SET_OPTIONS_UNKNOWN_FLAG: -// case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE: -// case SET_OPTIONS_BAD_SIGNER: -// case SET_OPTIONS_INVALID_HOME_DOMAIN: -// case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED: -// void; -// }; -// -// =========================================================================== -xdr.union("SetOptionsResult", { - switchOn: xdr.lookup("SetOptionsResultCode"), - switchName: "code", - switches: [ - ["setOptionsSuccess", xdr.void()], - ["setOptionsLowReserve", xdr.void()], - ["setOptionsTooManySigners", xdr.void()], - ["setOptionsBadFlags", xdr.void()], - ["setOptionsInvalidInflation", xdr.void()], - ["setOptionsCantChange", xdr.void()], - ["setOptionsUnknownFlag", xdr.void()], - ["setOptionsThresholdOutOfRange", xdr.void()], - ["setOptionsBadSigner", xdr.void()], - ["setOptionsInvalidHomeDomain", xdr.void()], - ["setOptionsAuthRevocableRequired", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ChangeTrustResultCode -// { -// // codes considered as "success" for the operation -// CHANGE_TRUST_SUCCESS = 0, -// // codes considered as "failure" for the operation -// CHANGE_TRUST_MALFORMED = -1, // bad input -// CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer -// CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance -// // cannot create with a limit of 0 -// CHANGE_TRUST_LOW_RESERVE = -// -4, // not enough funds to create a new trust line, -// CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed -// CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool -// CHANGE_TRUST_CANNOT_DELETE = -// -7, // Asset trustline is still referenced in a pool -// CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -// -8 // Asset trustline is deauthorized -// }; -// -// =========================================================================== -xdr.enum("ChangeTrustResultCode", { - changeTrustSuccess: 0, - changeTrustMalformed: -1, - changeTrustNoIssuer: -2, - changeTrustInvalidLimit: -3, - changeTrustLowReserve: -4, - changeTrustSelfNotAllowed: -5, - changeTrustTrustLineMissing: -6, - changeTrustCannotDelete: -7, - changeTrustNotAuthMaintainLiabilities: -8, -}); - -// === xdr source ============================================================ -// -// union ChangeTrustResult switch (ChangeTrustResultCode code) -// { -// case CHANGE_TRUST_SUCCESS: -// void; -// case CHANGE_TRUST_MALFORMED: -// case CHANGE_TRUST_NO_ISSUER: -// case CHANGE_TRUST_INVALID_LIMIT: -// case CHANGE_TRUST_LOW_RESERVE: -// case CHANGE_TRUST_SELF_NOT_ALLOWED: -// case CHANGE_TRUST_TRUST_LINE_MISSING: -// case CHANGE_TRUST_CANNOT_DELETE: -// case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES: -// void; -// }; -// -// =========================================================================== -xdr.union("ChangeTrustResult", { - switchOn: xdr.lookup("ChangeTrustResultCode"), - switchName: "code", - switches: [ - ["changeTrustSuccess", xdr.void()], - ["changeTrustMalformed", xdr.void()], - ["changeTrustNoIssuer", xdr.void()], - ["changeTrustInvalidLimit", xdr.void()], - ["changeTrustLowReserve", xdr.void()], - ["changeTrustSelfNotAllowed", xdr.void()], - ["changeTrustTrustLineMissing", xdr.void()], - ["changeTrustCannotDelete", xdr.void()], - ["changeTrustNotAuthMaintainLiabilities", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum AllowTrustResultCode -// { -// // codes considered as "success" for the operation -// ALLOW_TRUST_SUCCESS = 0, -// // codes considered as "failure" for the operation -// ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM -// ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline -// // source account does not require trust -// ALLOW_TRUST_TRUST_NOT_REQUIRED = -3, -// ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust, -// ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed -// ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created -// // on revoke due to low reserves -// }; -// -// =========================================================================== -xdr.enum("AllowTrustResultCode", { - allowTrustSuccess: 0, - allowTrustMalformed: -1, - allowTrustNoTrustLine: -2, - allowTrustTrustNotRequired: -3, - allowTrustCantRevoke: -4, - allowTrustSelfNotAllowed: -5, - allowTrustLowReserve: -6, -}); - -// === xdr source ============================================================ -// -// union AllowTrustResult switch (AllowTrustResultCode code) -// { -// case ALLOW_TRUST_SUCCESS: -// void; -// case ALLOW_TRUST_MALFORMED: -// case ALLOW_TRUST_NO_TRUST_LINE: -// case ALLOW_TRUST_TRUST_NOT_REQUIRED: -// case ALLOW_TRUST_CANT_REVOKE: -// case ALLOW_TRUST_SELF_NOT_ALLOWED: -// case ALLOW_TRUST_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("AllowTrustResult", { - switchOn: xdr.lookup("AllowTrustResultCode"), - switchName: "code", - switches: [ - ["allowTrustSuccess", xdr.void()], - ["allowTrustMalformed", xdr.void()], - ["allowTrustNoTrustLine", xdr.void()], - ["allowTrustTrustNotRequired", xdr.void()], - ["allowTrustCantRevoke", xdr.void()], - ["allowTrustSelfNotAllowed", xdr.void()], - ["allowTrustLowReserve", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum AccountMergeResultCode -// { -// // codes considered as "success" for the operation -// ACCOUNT_MERGE_SUCCESS = 0, -// // codes considered as "failure" for the operation -// ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself -// ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist -// ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set -// ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers -// ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed -// ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to -// // destination balance -// ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor -// }; -// -// =========================================================================== -xdr.enum("AccountMergeResultCode", { - accountMergeSuccess: 0, - accountMergeMalformed: -1, - accountMergeNoAccount: -2, - accountMergeImmutableSet: -3, - accountMergeHasSubEntries: -4, - accountMergeSeqnumTooFar: -5, - accountMergeDestFull: -6, - accountMergeIsSponsor: -7, -}); - -// === xdr source ============================================================ -// -// union AccountMergeResult switch (AccountMergeResultCode code) -// { -// case ACCOUNT_MERGE_SUCCESS: -// int64 sourceAccountBalance; // how much got transferred from source account -// case ACCOUNT_MERGE_MALFORMED: -// case ACCOUNT_MERGE_NO_ACCOUNT: -// case ACCOUNT_MERGE_IMMUTABLE_SET: -// case ACCOUNT_MERGE_HAS_SUB_ENTRIES: -// case ACCOUNT_MERGE_SEQNUM_TOO_FAR: -// case ACCOUNT_MERGE_DEST_FULL: -// case ACCOUNT_MERGE_IS_SPONSOR: -// void; -// }; -// -// =========================================================================== -xdr.union("AccountMergeResult", { - switchOn: xdr.lookup("AccountMergeResultCode"), - switchName: "code", - switches: [ - ["accountMergeSuccess", "sourceAccountBalance"], - ["accountMergeMalformed", xdr.void()], - ["accountMergeNoAccount", xdr.void()], - ["accountMergeImmutableSet", xdr.void()], - ["accountMergeHasSubEntries", xdr.void()], - ["accountMergeSeqnumTooFar", xdr.void()], - ["accountMergeDestFull", xdr.void()], - ["accountMergeIsSponsor", xdr.void()], - ], - arms: { - sourceAccountBalance: xdr.lookup("Int64"), - }, -}); - -// === xdr source ============================================================ -// -// enum InflationResultCode -// { -// // codes considered as "success" for the operation -// INFLATION_SUCCESS = 0, -// // codes considered as "failure" for the operation -// INFLATION_NOT_TIME = -1 -// }; -// -// =========================================================================== -xdr.enum("InflationResultCode", { - inflationSuccess: 0, - inflationNotTime: -1, -}); - -// === xdr source ============================================================ -// -// struct InflationPayout // or use PaymentResultAtom to limit types? -// { -// AccountID destination; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("InflationPayout", [ - ["destination", xdr.lookup("AccountId")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union InflationResult switch (InflationResultCode code) -// { -// case INFLATION_SUCCESS: -// InflationPayout payouts<>; -// case INFLATION_NOT_TIME: -// void; -// }; -// -// =========================================================================== -xdr.union("InflationResult", { - switchOn: xdr.lookup("InflationResultCode"), - switchName: "code", - switches: [ - ["inflationSuccess", "payouts"], - ["inflationNotTime", xdr.void()], - ], - arms: { - payouts: xdr.varArray(xdr.lookup("InflationPayout"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageDataResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_DATA_SUCCESS = 0, -// // codes considered as "failure" for the operation -// MANAGE_DATA_NOT_SUPPORTED_YET = -// -1, // The network hasn't moved to this protocol change yet -// MANAGE_DATA_NAME_NOT_FOUND = -// -2, // Trying to remove a Data Entry that isn't there -// MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry -// MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string -// }; -// -// =========================================================================== -xdr.enum("ManageDataResultCode", { - manageDataSuccess: 0, - manageDataNotSupportedYet: -1, - manageDataNameNotFound: -2, - manageDataLowReserve: -3, - manageDataInvalidName: -4, -}); - -// === xdr source ============================================================ -// -// union ManageDataResult switch (ManageDataResultCode code) -// { -// case MANAGE_DATA_SUCCESS: -// void; -// case MANAGE_DATA_NOT_SUPPORTED_YET: -// case MANAGE_DATA_NAME_NOT_FOUND: -// case MANAGE_DATA_LOW_RESERVE: -// case MANAGE_DATA_INVALID_NAME: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageDataResult", { - switchOn: xdr.lookup("ManageDataResultCode"), - switchName: "code", - switches: [ - ["manageDataSuccess", xdr.void()], - ["manageDataNotSupportedYet", xdr.void()], - ["manageDataNameNotFound", xdr.void()], - ["manageDataLowReserve", xdr.void()], - ["manageDataInvalidName", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum BumpSequenceResultCode -// { -// // codes considered as "success" for the operation -// BUMP_SEQUENCE_SUCCESS = 0, -// // codes considered as "failure" for the operation -// BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds -// }; -// -// =========================================================================== -xdr.enum("BumpSequenceResultCode", { - bumpSequenceSuccess: 0, - bumpSequenceBadSeq: -1, -}); - -// === xdr source ============================================================ -// -// union BumpSequenceResult switch (BumpSequenceResultCode code) -// { -// case BUMP_SEQUENCE_SUCCESS: -// void; -// case BUMP_SEQUENCE_BAD_SEQ: -// void; -// }; -// -// =========================================================================== -xdr.union("BumpSequenceResult", { - switchOn: xdr.lookup("BumpSequenceResultCode"), - switchName: "code", - switches: [ - ["bumpSequenceSuccess", xdr.void()], - ["bumpSequenceBadSeq", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum CreateClaimableBalanceResultCode -// { -// CREATE_CLAIMABLE_BALANCE_SUCCESS = 0, -// CREATE_CLAIMABLE_BALANCE_MALFORMED = -1, -// CREATE_CLAIMABLE_BALANCE_LOW_RESERVE = -2, -// CREATE_CLAIMABLE_BALANCE_NO_TRUST = -3, -// CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -4, -// CREATE_CLAIMABLE_BALANCE_UNDERFUNDED = -5 -// }; -// -// =========================================================================== -xdr.enum("CreateClaimableBalanceResultCode", { - createClaimableBalanceSuccess: 0, - createClaimableBalanceMalformed: -1, - createClaimableBalanceLowReserve: -2, - createClaimableBalanceNoTrust: -3, - createClaimableBalanceNotAuthorized: -4, - createClaimableBalanceUnderfunded: -5, -}); - -// === xdr source ============================================================ -// -// union CreateClaimableBalanceResult switch ( -// CreateClaimableBalanceResultCode code) -// { -// case CREATE_CLAIMABLE_BALANCE_SUCCESS: -// ClaimableBalanceID balanceID; -// case CREATE_CLAIMABLE_BALANCE_MALFORMED: -// case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE: -// case CREATE_CLAIMABLE_BALANCE_NO_TRUST: -// case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED: -// case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED: -// void; -// }; -// -// =========================================================================== -xdr.union("CreateClaimableBalanceResult", { - switchOn: xdr.lookup("CreateClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["createClaimableBalanceSuccess", "balanceId"], - ["createClaimableBalanceMalformed", xdr.void()], - ["createClaimableBalanceLowReserve", xdr.void()], - ["createClaimableBalanceNoTrust", xdr.void()], - ["createClaimableBalanceNotAuthorized", xdr.void()], - ["createClaimableBalanceUnderfunded", xdr.void()], - ], - arms: { - balanceId: xdr.lookup("ClaimableBalanceId"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimClaimableBalanceResultCode -// { -// CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0, -// CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, -// CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2, -// CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3, -// CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4, -// CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5 -// }; -// -// =========================================================================== -xdr.enum("ClaimClaimableBalanceResultCode", { - claimClaimableBalanceSuccess: 0, - claimClaimableBalanceDoesNotExist: -1, - claimClaimableBalanceCannotClaim: -2, - claimClaimableBalanceLineFull: -3, - claimClaimableBalanceNoTrust: -4, - claimClaimableBalanceNotAuthorized: -5, -}); - -// === xdr source ============================================================ -// -// union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code) -// { -// case CLAIM_CLAIMABLE_BALANCE_SUCCESS: -// void; -// case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST: -// case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM: -// case CLAIM_CLAIMABLE_BALANCE_LINE_FULL: -// case CLAIM_CLAIMABLE_BALANCE_NO_TRUST: -// case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClaimClaimableBalanceResult", { - switchOn: xdr.lookup("ClaimClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["claimClaimableBalanceSuccess", xdr.void()], - ["claimClaimableBalanceDoesNotExist", xdr.void()], - ["claimClaimableBalanceCannotClaim", xdr.void()], - ["claimClaimableBalanceLineFull", xdr.void()], - ["claimClaimableBalanceNoTrust", xdr.void()], - ["claimClaimableBalanceNotAuthorized", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum BeginSponsoringFutureReservesResultCode -// { -// // codes considered as "success" for the operation -// BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1, -// BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2, -// BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3 -// }; -// -// =========================================================================== -xdr.enum("BeginSponsoringFutureReservesResultCode", { - beginSponsoringFutureReservesSuccess: 0, - beginSponsoringFutureReservesMalformed: -1, - beginSponsoringFutureReservesAlreadySponsored: -2, - beginSponsoringFutureReservesRecursive: -3, -}); - -// === xdr source ============================================================ -// -// union BeginSponsoringFutureReservesResult switch ( -// BeginSponsoringFutureReservesResultCode code) -// { -// case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS: -// void; -// case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED: -// case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED: -// case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE: -// void; -// }; -// -// =========================================================================== -xdr.union("BeginSponsoringFutureReservesResult", { - switchOn: xdr.lookup("BeginSponsoringFutureReservesResultCode"), - switchName: "code", - switches: [ - ["beginSponsoringFutureReservesSuccess", xdr.void()], - ["beginSponsoringFutureReservesMalformed", xdr.void()], - ["beginSponsoringFutureReservesAlreadySponsored", xdr.void()], - ["beginSponsoringFutureReservesRecursive", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum EndSponsoringFutureReservesResultCode -// { -// // codes considered as "success" for the operation -// END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1 -// }; -// -// =========================================================================== -xdr.enum("EndSponsoringFutureReservesResultCode", { - endSponsoringFutureReservesSuccess: 0, - endSponsoringFutureReservesNotSponsored: -1, -}); - -// === xdr source ============================================================ -// -// union EndSponsoringFutureReservesResult switch ( -// EndSponsoringFutureReservesResultCode code) -// { -// case END_SPONSORING_FUTURE_RESERVES_SUCCESS: -// void; -// case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED: -// void; -// }; -// -// =========================================================================== -xdr.union("EndSponsoringFutureReservesResult", { - switchOn: xdr.lookup("EndSponsoringFutureReservesResultCode"), - switchName: "code", - switches: [ - ["endSponsoringFutureReservesSuccess", xdr.void()], - ["endSponsoringFutureReservesNotSponsored", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum RevokeSponsorshipResultCode -// { -// // codes considered as "success" for the operation -// REVOKE_SPONSORSHIP_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1, -// REVOKE_SPONSORSHIP_NOT_SPONSOR = -2, -// REVOKE_SPONSORSHIP_LOW_RESERVE = -3, -// REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4, -// REVOKE_SPONSORSHIP_MALFORMED = -5 -// }; -// -// =========================================================================== -xdr.enum("RevokeSponsorshipResultCode", { - revokeSponsorshipSuccess: 0, - revokeSponsorshipDoesNotExist: -1, - revokeSponsorshipNotSponsor: -2, - revokeSponsorshipLowReserve: -3, - revokeSponsorshipOnlyTransferable: -4, - revokeSponsorshipMalformed: -5, -}); - -// === xdr source ============================================================ -// -// union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code) -// { -// case REVOKE_SPONSORSHIP_SUCCESS: -// void; -// case REVOKE_SPONSORSHIP_DOES_NOT_EXIST: -// case REVOKE_SPONSORSHIP_NOT_SPONSOR: -// case REVOKE_SPONSORSHIP_LOW_RESERVE: -// case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE: -// case REVOKE_SPONSORSHIP_MALFORMED: -// void; -// }; -// -// =========================================================================== -xdr.union("RevokeSponsorshipResult", { - switchOn: xdr.lookup("RevokeSponsorshipResultCode"), - switchName: "code", - switches: [ - ["revokeSponsorshipSuccess", xdr.void()], - ["revokeSponsorshipDoesNotExist", xdr.void()], - ["revokeSponsorshipNotSponsor", xdr.void()], - ["revokeSponsorshipLowReserve", xdr.void()], - ["revokeSponsorshipOnlyTransferable", xdr.void()], - ["revokeSponsorshipMalformed", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ClawbackResultCode -// { -// // codes considered as "success" for the operation -// CLAWBACK_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// CLAWBACK_MALFORMED = -1, -// CLAWBACK_NOT_CLAWBACK_ENABLED = -2, -// CLAWBACK_NO_TRUST = -3, -// CLAWBACK_UNDERFUNDED = -4 -// }; -// -// =========================================================================== -xdr.enum("ClawbackResultCode", { - clawbackSuccess: 0, - clawbackMalformed: -1, - clawbackNotClawbackEnabled: -2, - clawbackNoTrust: -3, - clawbackUnderfunded: -4, -}); - -// === xdr source ============================================================ -// -// union ClawbackResult switch (ClawbackResultCode code) -// { -// case CLAWBACK_SUCCESS: -// void; -// case CLAWBACK_MALFORMED: -// case CLAWBACK_NOT_CLAWBACK_ENABLED: -// case CLAWBACK_NO_TRUST: -// case CLAWBACK_UNDERFUNDED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClawbackResult", { - switchOn: xdr.lookup("ClawbackResultCode"), - switchName: "code", - switches: [ - ["clawbackSuccess", xdr.void()], - ["clawbackMalformed", xdr.void()], - ["clawbackNotClawbackEnabled", xdr.void()], - ["clawbackNoTrust", xdr.void()], - ["clawbackUnderfunded", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ClawbackClaimableBalanceResultCode -// { -// // codes considered as "success" for the operation -// CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, -// CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2, -// CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3 -// }; -// -// =========================================================================== -xdr.enum("ClawbackClaimableBalanceResultCode", { - clawbackClaimableBalanceSuccess: 0, - clawbackClaimableBalanceDoesNotExist: -1, - clawbackClaimableBalanceNotIssuer: -2, - clawbackClaimableBalanceNotClawbackEnabled: -3, -}); - -// === xdr source ============================================================ -// -// union ClawbackClaimableBalanceResult switch ( -// ClawbackClaimableBalanceResultCode code) -// { -// case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS: -// void; -// case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST: -// case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER: -// case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClawbackClaimableBalanceResult", { - switchOn: xdr.lookup("ClawbackClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["clawbackClaimableBalanceSuccess", xdr.void()], - ["clawbackClaimableBalanceDoesNotExist", xdr.void()], - ["clawbackClaimableBalanceNotIssuer", xdr.void()], - ["clawbackClaimableBalanceNotClawbackEnabled", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum SetTrustLineFlagsResultCode -// { -// // codes considered as "success" for the operation -// SET_TRUST_LINE_FLAGS_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// SET_TRUST_LINE_FLAGS_MALFORMED = -1, -// SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2, -// SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3, -// SET_TRUST_LINE_FLAGS_INVALID_STATE = -4, -// SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created -// // on revoke due to low reserves -// }; -// -// =========================================================================== -xdr.enum("SetTrustLineFlagsResultCode", { - setTrustLineFlagsSuccess: 0, - setTrustLineFlagsMalformed: -1, - setTrustLineFlagsNoTrustLine: -2, - setTrustLineFlagsCantRevoke: -3, - setTrustLineFlagsInvalidState: -4, - setTrustLineFlagsLowReserve: -5, -}); - -// === xdr source ============================================================ -// -// union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code) -// { -// case SET_TRUST_LINE_FLAGS_SUCCESS: -// void; -// case SET_TRUST_LINE_FLAGS_MALFORMED: -// case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE: -// case SET_TRUST_LINE_FLAGS_CANT_REVOKE: -// case SET_TRUST_LINE_FLAGS_INVALID_STATE: -// case SET_TRUST_LINE_FLAGS_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("SetTrustLineFlagsResult", { - switchOn: xdr.lookup("SetTrustLineFlagsResultCode"), - switchName: "code", - switches: [ - ["setTrustLineFlagsSuccess", xdr.void()], - ["setTrustLineFlagsMalformed", xdr.void()], - ["setTrustLineFlagsNoTrustLine", xdr.void()], - ["setTrustLineFlagsCantRevoke", xdr.void()], - ["setTrustLineFlagsInvalidState", xdr.void()], - ["setTrustLineFlagsLowReserve", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum LiquidityPoolDepositResultCode -// { -// // codes considered as "success" for the operation -// LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input -// LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the -// // assets -// LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the -// // assets -// LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of -// // the assets -// LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't -// // have sufficient limit -// LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds -// LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolDepositResultCode", { - liquidityPoolDepositSuccess: 0, - liquidityPoolDepositMalformed: -1, - liquidityPoolDepositNoTrust: -2, - liquidityPoolDepositNotAuthorized: -3, - liquidityPoolDepositUnderfunded: -4, - liquidityPoolDepositLineFull: -5, - liquidityPoolDepositBadPrice: -6, - liquidityPoolDepositPoolFull: -7, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code) -// { -// case LIQUIDITY_POOL_DEPOSIT_SUCCESS: -// void; -// case LIQUIDITY_POOL_DEPOSIT_MALFORMED: -// case LIQUIDITY_POOL_DEPOSIT_NO_TRUST: -// case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED: -// case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED: -// case LIQUIDITY_POOL_DEPOSIT_LINE_FULL: -// case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE: -// case LIQUIDITY_POOL_DEPOSIT_POOL_FULL: -// void; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolDepositResult", { - switchOn: xdr.lookup("LiquidityPoolDepositResultCode"), - switchName: "code", - switches: [ - ["liquidityPoolDepositSuccess", xdr.void()], - ["liquidityPoolDepositMalformed", xdr.void()], - ["liquidityPoolDepositNoTrust", xdr.void()], - ["liquidityPoolDepositNotAuthorized", xdr.void()], - ["liquidityPoolDepositUnderfunded", xdr.void()], - ["liquidityPoolDepositLineFull", xdr.void()], - ["liquidityPoolDepositBadPrice", xdr.void()], - ["liquidityPoolDepositPoolFull", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum LiquidityPoolWithdrawResultCode -// { -// // codes considered as "success" for the operation -// LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input -// LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the -// // assets -// LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the -// // pool share -// LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one -// // of the assets -// LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolWithdrawResultCode", { - liquidityPoolWithdrawSuccess: 0, - liquidityPoolWithdrawMalformed: -1, - liquidityPoolWithdrawNoTrust: -2, - liquidityPoolWithdrawUnderfunded: -3, - liquidityPoolWithdrawLineFull: -4, - liquidityPoolWithdrawUnderMinimum: -5, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code) -// { -// case LIQUIDITY_POOL_WITHDRAW_SUCCESS: -// void; -// case LIQUIDITY_POOL_WITHDRAW_MALFORMED: -// case LIQUIDITY_POOL_WITHDRAW_NO_TRUST: -// case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED: -// case LIQUIDITY_POOL_WITHDRAW_LINE_FULL: -// case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: -// void; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolWithdrawResult", { - switchOn: xdr.lookup("LiquidityPoolWithdrawResultCode"), - switchName: "code", - switches: [ - ["liquidityPoolWithdrawSuccess", xdr.void()], - ["liquidityPoolWithdrawMalformed", xdr.void()], - ["liquidityPoolWithdrawNoTrust", xdr.void()], - ["liquidityPoolWithdrawUnderfunded", xdr.void()], - ["liquidityPoolWithdrawLineFull", xdr.void()], - ["liquidityPoolWithdrawUnderMinimum", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum OperationResultCode -// { -// opINNER = 0, // inner object result is valid -// -// opBAD_AUTH = -1, // too few valid signatures / wrong network -// opNO_ACCOUNT = -2, // source account was not found -// opNOT_SUPPORTED = -3, // operation not supported at this time -// opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached -// opEXCEEDED_WORK_LIMIT = -5, // operation did too much work -// opTOO_MANY_SPONSORING = -6 // account is sponsoring too many entries -// }; -// -// =========================================================================== -xdr.enum("OperationResultCode", { - opInner: 0, - opBadAuth: -1, - opNoAccount: -2, - opNotSupported: -3, - opTooManySubentries: -4, - opExceededWorkLimit: -5, - opTooManySponsoring: -6, -}); - -// === xdr source ============================================================ -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountResult createAccountResult; -// case PAYMENT: -// PaymentResult paymentResult; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; -// case MANAGE_SELL_OFFER: -// ManageSellOfferResult manageSellOfferResult; -// case CREATE_PASSIVE_SELL_OFFER: -// ManageSellOfferResult createPassiveSellOfferResult; -// case SET_OPTIONS: -// SetOptionsResult setOptionsResult; -// case CHANGE_TRUST: -// ChangeTrustResult changeTrustResult; -// case ALLOW_TRUST: -// AllowTrustResult allowTrustResult; -// case ACCOUNT_MERGE: -// AccountMergeResult accountMergeResult; -// case INFLATION: -// InflationResult inflationResult; -// case MANAGE_DATA: -// ManageDataResult manageDataResult; -// case BUMP_SEQUENCE: -// BumpSequenceResult bumpSeqResult; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferResult manageBuyOfferResult; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendResult pathPaymentStrictSendResult; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceResult createClaimableBalanceResult; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceResult claimClaimableBalanceResult; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; -// case END_SPONSORING_FUTURE_RESERVES: -// EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipResult revokeSponsorshipResult; -// case CLAWBACK: -// ClawbackResult clawbackResult; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsResult setTrustLineFlagsResult; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositResult liquidityPoolDepositResult; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; -// } -// -// =========================================================================== -xdr.union("OperationResultTr", { - switchOn: xdr.lookup("OperationType"), - switchName: "type", - switches: [ - ["createAccount", "createAccountResult"], - ["payment", "paymentResult"], - ["pathPaymentStrictReceive", "pathPaymentStrictReceiveResult"], - ["manageSellOffer", "manageSellOfferResult"], - ["createPassiveSellOffer", "createPassiveSellOfferResult"], - ["setOptions", "setOptionsResult"], - ["changeTrust", "changeTrustResult"], - ["allowTrust", "allowTrustResult"], - ["accountMerge", "accountMergeResult"], - ["inflation", "inflationResult"], - ["manageData", "manageDataResult"], - ["bumpSequence", "bumpSeqResult"], - ["manageBuyOffer", "manageBuyOfferResult"], - ["pathPaymentStrictSend", "pathPaymentStrictSendResult"], - ["createClaimableBalance", "createClaimableBalanceResult"], - ["claimClaimableBalance", "claimClaimableBalanceResult"], - ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesResult"], - ["endSponsoringFutureReserves", "endSponsoringFutureReservesResult"], - ["revokeSponsorship", "revokeSponsorshipResult"], - ["clawback", "clawbackResult"], - ["clawbackClaimableBalance", "clawbackClaimableBalanceResult"], - ["setTrustLineFlags", "setTrustLineFlagsResult"], - ["liquidityPoolDeposit", "liquidityPoolDepositResult"], - ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], - ], - arms: { - createAccountResult: xdr.lookup("CreateAccountResult"), - paymentResult: xdr.lookup("PaymentResult"), - pathPaymentStrictReceiveResult: xdr.lookup("PathPaymentStrictReceiveResult"), - manageSellOfferResult: xdr.lookup("ManageSellOfferResult"), - createPassiveSellOfferResult: xdr.lookup("ManageSellOfferResult"), - setOptionsResult: xdr.lookup("SetOptionsResult"), - changeTrustResult: xdr.lookup("ChangeTrustResult"), - allowTrustResult: xdr.lookup("AllowTrustResult"), - accountMergeResult: xdr.lookup("AccountMergeResult"), - inflationResult: xdr.lookup("InflationResult"), - manageDataResult: xdr.lookup("ManageDataResult"), - bumpSeqResult: xdr.lookup("BumpSequenceResult"), - manageBuyOfferResult: xdr.lookup("ManageBuyOfferResult"), - pathPaymentStrictSendResult: xdr.lookup("PathPaymentStrictSendResult"), - createClaimableBalanceResult: xdr.lookup("CreateClaimableBalanceResult"), - claimClaimableBalanceResult: xdr.lookup("ClaimClaimableBalanceResult"), - beginSponsoringFutureReservesResult: xdr.lookup("BeginSponsoringFutureReservesResult"), - endSponsoringFutureReservesResult: xdr.lookup("EndSponsoringFutureReservesResult"), - revokeSponsorshipResult: xdr.lookup("RevokeSponsorshipResult"), - clawbackResult: xdr.lookup("ClawbackResult"), - clawbackClaimableBalanceResult: xdr.lookup("ClawbackClaimableBalanceResult"), - setTrustLineFlagsResult: xdr.lookup("SetTrustLineFlagsResult"), - liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), - liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), - }, -}); - -// === xdr source ============================================================ -// -// union OperationResult switch (OperationResultCode code) -// { -// case opINNER: -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountResult createAccountResult; -// case PAYMENT: -// PaymentResult paymentResult; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; -// case MANAGE_SELL_OFFER: -// ManageSellOfferResult manageSellOfferResult; -// case CREATE_PASSIVE_SELL_OFFER: -// ManageSellOfferResult createPassiveSellOfferResult; -// case SET_OPTIONS: -// SetOptionsResult setOptionsResult; -// case CHANGE_TRUST: -// ChangeTrustResult changeTrustResult; -// case ALLOW_TRUST: -// AllowTrustResult allowTrustResult; -// case ACCOUNT_MERGE: -// AccountMergeResult accountMergeResult; -// case INFLATION: -// InflationResult inflationResult; -// case MANAGE_DATA: -// ManageDataResult manageDataResult; -// case BUMP_SEQUENCE: -// BumpSequenceResult bumpSeqResult; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferResult manageBuyOfferResult; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendResult pathPaymentStrictSendResult; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceResult createClaimableBalanceResult; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceResult claimClaimableBalanceResult; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; -// case END_SPONSORING_FUTURE_RESERVES: -// EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipResult revokeSponsorshipResult; -// case CLAWBACK: -// ClawbackResult clawbackResult; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsResult setTrustLineFlagsResult; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositResult liquidityPoolDepositResult; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; -// } -// tr; -// case opBAD_AUTH: -// case opNO_ACCOUNT: -// case opNOT_SUPPORTED: -// case opTOO_MANY_SUBENTRIES: -// case opEXCEEDED_WORK_LIMIT: -// case opTOO_MANY_SPONSORING: -// void; -// }; -// -// =========================================================================== -xdr.union("OperationResult", { - switchOn: xdr.lookup("OperationResultCode"), - switchName: "code", - switches: [ - ["opInner", "tr"], - ["opBadAuth", xdr.void()], - ["opNoAccount", xdr.void()], - ["opNotSupported", xdr.void()], - ["opTooManySubentries", xdr.void()], - ["opExceededWorkLimit", xdr.void()], - ["opTooManySponsoring", xdr.void()], - ], - arms: { - tr: xdr.lookup("OperationResultTr"), - }, -}); - -// === xdr source ============================================================ -// -// enum TransactionResultCode -// { -// txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded -// txSUCCESS = 0, // all operations succeeded -// -// txFAILED = -1, // one of the operations failed (none were applied) -// -// txTOO_EARLY = -2, // ledger closeTime before minTime -// txTOO_LATE = -3, // ledger closeTime after maxTime -// txMISSING_OPERATION = -4, // no operation was specified -// txBAD_SEQ = -5, // sequence number does not match source account -// -// txBAD_AUTH = -6, // too few valid signatures / wrong network -// txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve -// txNO_ACCOUNT = -8, // source account not found -// txINSUFFICIENT_FEE = -9, // fee is too small -// txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction -// txINTERNAL_ERROR = -11, // an unknown error occurred -// -// txNOT_SUPPORTED = -12, // transaction type not supported -// txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed -// txBAD_SPONSORSHIP = -14, // sponsorship not confirmed -// txBAD_MIN_SEQ_AGE_OR_GAP = -// -15, // minSeqAge or minSeqLedgerGap conditions not met -// txMALFORMED = -16 // precondition is invalid -// }; -// -// =========================================================================== -xdr.enum("TransactionResultCode", { - txFeeBumpInnerSuccess: 1, - txSuccess: 0, - txFailed: -1, - txTooEarly: -2, - txTooLate: -3, - txMissingOperation: -4, - txBadSeq: -5, - txBadAuth: -6, - txInsufficientBalance: -7, - txNoAccount: -8, - txInsufficientFee: -9, - txBadAuthExtra: -10, - txInternalError: -11, - txNotSupported: -12, - txFeeBumpInnerFailed: -13, - txBadSponsorship: -14, - txBadMinSeqAgeOrGap: -15, - txMalformed: -16, -}); - -// === xdr source ============================================================ -// -// union switch (TransactionResultCode code) -// { -// // txFEE_BUMP_INNER_SUCCESS is not included -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // txFEE_BUMP_INNER_FAILED is not included -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// -// =========================================================================== -xdr.union("InnerTransactionResultResult", { - switchOn: xdr.lookup("TransactionResultCode"), - switchName: "code", - switches: [ - ["txSuccess", "results"], - ["txFailed", "results"], - ["txTooEarly", xdr.void()], - ["txTooLate", xdr.void()], - ["txMissingOperation", xdr.void()], - ["txBadSeq", xdr.void()], - ["txBadAuth", xdr.void()], - ["txInsufficientBalance", xdr.void()], - ["txNoAccount", xdr.void()], - ["txInsufficientFee", xdr.void()], - ["txBadAuthExtra", xdr.void()], - ["txInternalError", xdr.void()], - ["txNotSupported", xdr.void()], - ["txBadSponsorship", xdr.void()], - ["txBadMinSeqAgeOrGap", xdr.void()], - ["txMalformed", xdr.void()], - ], - arms: { - results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("InnerTransactionResultExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct InnerTransactionResult -// { -// // Always 0. Here for binary compatibility. -// int64 feeCharged; -// -// union switch (TransactionResultCode code) -// { -// // txFEE_BUMP_INNER_SUCCESS is not included -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // txFEE_BUMP_INNER_FAILED is not included -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// result; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("InnerTransactionResult", [ - ["feeCharged", xdr.lookup("Int64")], - ["result", xdr.lookup("InnerTransactionResultResult")], - ["ext", xdr.lookup("InnerTransactionResultExt")], -]); - -// === xdr source ============================================================ -// -// struct InnerTransactionResultPair -// { -// Hash transactionHash; // hash of the inner transaction -// InnerTransactionResult result; // result for the inner transaction -// }; -// -// =========================================================================== -xdr.struct("InnerTransactionResultPair", [ - ["transactionHash", xdr.lookup("Hash")], - ["result", xdr.lookup("InnerTransactionResult")], -]); - -// === xdr source ============================================================ -// -// union switch (TransactionResultCode code) -// { -// case txFEE_BUMP_INNER_SUCCESS: -// case txFEE_BUMP_INNER_FAILED: -// InnerTransactionResultPair innerResultPair; -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // case txFEE_BUMP_INNER_FAILED: handled above -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionResultResult", { - switchOn: xdr.lookup("TransactionResultCode"), - switchName: "code", - switches: [ - ["txFeeBumpInnerSuccess", "innerResultPair"], - ["txFeeBumpInnerFailed", "innerResultPair"], - ["txSuccess", "results"], - ["txFailed", "results"], - ["txTooEarly", xdr.void()], - ["txTooLate", xdr.void()], - ["txMissingOperation", xdr.void()], - ["txBadSeq", xdr.void()], - ["txBadAuth", xdr.void()], - ["txInsufficientBalance", xdr.void()], - ["txNoAccount", xdr.void()], - ["txInsufficientFee", xdr.void()], - ["txBadAuthExtra", xdr.void()], - ["txInternalError", xdr.void()], - ["txNotSupported", xdr.void()], - ["txBadSponsorship", xdr.void()], - ["txBadMinSeqAgeOrGap", xdr.void()], - ["txMalformed", xdr.void()], - ], - arms: { - innerResultPair: xdr.lookup("InnerTransactionResultPair"), - results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionResultExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResult -// { -// int64 feeCharged; // actual fee charged for the transaction -// -// union switch (TransactionResultCode code) -// { -// case txFEE_BUMP_INNER_SUCCESS: -// case txFEE_BUMP_INNER_FAILED: -// InnerTransactionResultPair innerResultPair; -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // case txFEE_BUMP_INNER_FAILED: handled above -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// result; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionResult", [ - ["feeCharged", xdr.lookup("Int64")], - ["result", xdr.lookup("TransactionResultResult")], - ["ext", xdr.lookup("TransactionResultExt")], -]); - -// === xdr source ============================================================ -// -// typedef opaque Hash[32]; -// -// =========================================================================== -xdr.typedef("Hash", xdr.opaque(32)); - -// === xdr source ============================================================ -// -// typedef opaque uint256[32]; -// -// =========================================================================== -xdr.typedef("Uint256", xdr.opaque(32)); - -// === xdr source ============================================================ -// -// typedef unsigned int uint32; -// -// =========================================================================== -xdr.typedef("Uint32", xdr.uint()); - -// === xdr source ============================================================ -// -// typedef int int32; -// -// =========================================================================== -xdr.typedef("Int32", xdr.int()); - -// === xdr source ============================================================ -// -// typedef unsigned hyper uint64; -// -// =========================================================================== -xdr.typedef("Uint64", xdr.uhyper()); - -// === xdr source ============================================================ -// -// typedef hyper int64; -// -// =========================================================================== -xdr.typedef("Int64", xdr.hyper()); - -// === xdr source ============================================================ -// -// union ExtensionPoint switch (int v) -// { -// case 0: -// void; -// }; -// -// =========================================================================== -xdr.union("ExtensionPoint", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum CryptoKeyType -// { -// KEY_TYPE_ED25519 = 0, -// KEY_TYPE_PRE_AUTH_TX = 1, -// KEY_TYPE_HASH_X = 2, -// KEY_TYPE_ED25519_SIGNED_PAYLOAD = 3, -// // MUXED enum values for supported type are derived from the enum values -// // above by ORing them with 0x100 -// KEY_TYPE_MUXED_ED25519 = 0x100 -// }; -// -// =========================================================================== -xdr.enum("CryptoKeyType", { - keyTypeEd25519: 0, - keyTypePreAuthTx: 1, - keyTypeHashX: 2, - keyTypeEd25519SignedPayload: 3, - keyTypeMuxedEd25519: 256, -}); - -// === xdr source ============================================================ -// -// enum PublicKeyType -// { -// PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519 -// }; -// -// =========================================================================== -xdr.enum("PublicKeyType", { - publicKeyTypeEd25519: 0, -}); - -// === xdr source ============================================================ -// -// enum SignerKeyType -// { -// SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, -// SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, -// SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X, -// SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD -// }; -// -// =========================================================================== -xdr.enum("SignerKeyType", { - signerKeyTypeEd25519: 0, - signerKeyTypePreAuthTx: 1, - signerKeyTypeHashX: 2, - signerKeyTypeEd25519SignedPayload: 3, -}); - -// === xdr source ============================================================ -// -// union PublicKey switch (PublicKeyType type) -// { -// case PUBLIC_KEY_TYPE_ED25519: -// uint256 ed25519; -// }; -// -// =========================================================================== -xdr.union("PublicKey", { - switchOn: xdr.lookup("PublicKeyType"), - switchName: "type", - switches: [ - ["publicKeyTypeEd25519", "ed25519"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// /* Public key that must sign the payload. */ -// uint256 ed25519; -// /* Payload to be raw signed by ed25519. */ -// opaque payload<64>; -// } -// -// =========================================================================== -xdr.struct("SignerKeyEd25519SignedPayload", [ - ["ed25519", xdr.lookup("Uint256")], - ["payload", xdr.varOpaque(64)], -]); - -// === xdr source ============================================================ -// -// union SignerKey switch (SignerKeyType type) -// { -// case SIGNER_KEY_TYPE_ED25519: -// uint256 ed25519; -// case SIGNER_KEY_TYPE_PRE_AUTH_TX: -// /* SHA-256 Hash of TransactionSignaturePayload structure */ -// uint256 preAuthTx; -// case SIGNER_KEY_TYPE_HASH_X: -// /* Hash of random 256 bit preimage X */ -// uint256 hashX; -// case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD: -// struct -// { -// /* Public key that must sign the payload. */ -// uint256 ed25519; -// /* Payload to be raw signed by ed25519. */ -// opaque payload<64>; -// } ed25519SignedPayload; -// }; -// -// =========================================================================== -xdr.union("SignerKey", { - switchOn: xdr.lookup("SignerKeyType"), - switchName: "type", - switches: [ - ["signerKeyTypeEd25519", "ed25519"], - ["signerKeyTypePreAuthTx", "preAuthTx"], - ["signerKeyTypeHashX", "hashX"], - ["signerKeyTypeEd25519SignedPayload", "ed25519SignedPayload"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - preAuthTx: xdr.lookup("Uint256"), - hashX: xdr.lookup("Uint256"), - ed25519SignedPayload: xdr.lookup("SignerKeyEd25519SignedPayload"), - }, -}); - -// === xdr source ============================================================ -// -// typedef opaque Signature<64>; -// -// =========================================================================== -xdr.typedef("Signature", xdr.varOpaque(64)); - -// === xdr source ============================================================ -// -// typedef opaque SignatureHint[4]; -// -// =========================================================================== -xdr.typedef("SignatureHint", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef PublicKey NodeID; -// -// =========================================================================== -xdr.typedef("NodeId", xdr.lookup("PublicKey")); - -// === xdr source ============================================================ -// -// struct Curve25519Secret -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("Curve25519Secret", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct Curve25519Public -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("Curve25519Public", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct HmacSha256Key -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("HmacSha256Key", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct HmacSha256Mac -// { -// opaque mac[32]; -// }; -// -// =========================================================================== -xdr.struct("HmacSha256Mac", [ - ["mac", xdr.opaque(32)], -]); - +import * as XDR from "js-xdr"; + +var types = XDR.config((xdr) => { + // Workaround for https://github.com/stellar/xdrgen/issues/152 + // + // The "correct" way would be to replace bare instances of each constant with + // xdr.lookup("..."), but that's more error-prone. + const SCSYMBOL_LIMIT = 32; + const SC_SPEC_DOC_LIMIT = 1024; + + // === xdr source ============================================================ + // + // typedef opaque Value<>; + // + // =========================================================================== + xdr.typedef("Value", xdr.varOpaque()); + + // === xdr source ============================================================ + // + // struct SCPBallot + // { + // uint32 counter; // n + // Value value; // x + // }; + // + // =========================================================================== + xdr.struct("ScpBallot", [ + ["counter", xdr.lookup("Uint32")], + ["value", xdr.lookup("Value")], + ]); + + // === xdr source ============================================================ + // + // enum SCPStatementType + // { + // SCP_ST_PREPARE = 0, + // SCP_ST_CONFIRM = 1, + // SCP_ST_EXTERNALIZE = 2, + // SCP_ST_NOMINATE = 3 + // }; + // + // =========================================================================== + xdr.enum("ScpStatementType", { + scpStPrepare: 0, + scpStConfirm: 1, + scpStExternalize: 2, + scpStNominate: 3, + }); + + // === xdr source ============================================================ + // + // struct SCPNomination + // { + // Hash quorumSetHash; // D + // Value votes<>; // X + // Value accepted<>; // Y + // }; + // + // =========================================================================== + xdr.struct("ScpNomination", [ + ["quorumSetHash", xdr.lookup("Hash")], + ["votes", xdr.varArray(xdr.lookup("Value"), 2147483647)], + ["accepted", xdr.varArray(xdr.lookup("Value"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } + // + // =========================================================================== + xdr.struct("ScpStatementPrepare", [ + ["quorumSetHash", xdr.lookup("Hash")], + ["ballot", xdr.lookup("ScpBallot")], + ["prepared", xdr.option(xdr.lookup("ScpBallot"))], + ["preparedPrime", xdr.option(xdr.lookup("ScpBallot"))], + ["nC", xdr.lookup("Uint32")], + ["nH", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } + // + // =========================================================================== + xdr.struct("ScpStatementConfirm", [ + ["ballot", xdr.lookup("ScpBallot")], + ["nPrepared", xdr.lookup("Uint32")], + ["nCommit", xdr.lookup("Uint32")], + ["nH", xdr.lookup("Uint32")], + ["quorumSetHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } + // + // =========================================================================== + xdr.struct("ScpStatementExternalize", [ + ["commit", xdr.lookup("ScpBallot")], + ["nH", xdr.lookup("Uint32")], + ["commitQuorumSetHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // union switch (SCPStatementType type) + // { + // case SCP_ST_PREPARE: + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } prepare; + // case SCP_ST_CONFIRM: + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } confirm; + // case SCP_ST_EXTERNALIZE: + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } externalize; + // case SCP_ST_NOMINATE: + // SCPNomination nominate; + // } + // + // =========================================================================== + xdr.union("ScpStatementPledges", { + switchOn: xdr.lookup("ScpStatementType"), + switchName: "type", + switches: [ + ["scpStPrepare", "prepare"], + ["scpStConfirm", "confirm"], + ["scpStExternalize", "externalize"], + ["scpStNominate", "nominate"], + ], + arms: { + prepare: xdr.lookup("ScpStatementPrepare"), + confirm: xdr.lookup("ScpStatementConfirm"), + externalize: xdr.lookup("ScpStatementExternalize"), + nominate: xdr.lookup("ScpNomination"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCPStatement + // { + // NodeID nodeID; // v + // uint64 slotIndex; // i + // + // union switch (SCPStatementType type) + // { + // case SCP_ST_PREPARE: + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } prepare; + // case SCP_ST_CONFIRM: + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } confirm; + // case SCP_ST_EXTERNALIZE: + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } externalize; + // case SCP_ST_NOMINATE: + // SCPNomination nominate; + // } + // pledges; + // }; + // + // =========================================================================== + xdr.struct("ScpStatement", [ + ["nodeId", xdr.lookup("NodeId")], + ["slotIndex", xdr.lookup("Uint64")], + ["pledges", xdr.lookup("ScpStatementPledges")], + ]); + + // === xdr source ============================================================ + // + // struct SCPEnvelope + // { + // SCPStatement statement; + // Signature signature; + // }; + // + // =========================================================================== + xdr.struct("ScpEnvelope", [ + ["statement", xdr.lookup("ScpStatement")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // struct SCPQuorumSet + // { + // uint32 threshold; + // NodeID validators<>; + // SCPQuorumSet innerSets<>; + // }; + // + // =========================================================================== + xdr.struct("ScpQuorumSet", [ + ["threshold", xdr.lookup("Uint32")], + ["validators", xdr.varArray(xdr.lookup("NodeId"), 2147483647)], + ["innerSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // typedef opaque Thresholds[4]; + // + // =========================================================================== + xdr.typedef("Thresholds", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef string string32<32>; + // + // =========================================================================== + xdr.typedef("String32", xdr.string(32)); + + // === xdr source ============================================================ + // + // typedef string string64<64>; + // + // =========================================================================== + xdr.typedef("String64", xdr.string(64)); + + // === xdr source ============================================================ + // + // typedef int64 SequenceNumber; + // + // =========================================================================== + xdr.typedef("SequenceNumber", xdr.lookup("Int64")); + + // === xdr source ============================================================ + // + // typedef opaque DataValue<64>; + // + // =========================================================================== + xdr.typedef("DataValue", xdr.varOpaque(64)); + + // === xdr source ============================================================ + // + // typedef Hash PoolID; + // + // =========================================================================== + xdr.typedef("PoolId", xdr.lookup("Hash")); + + // === xdr source ============================================================ + // + // typedef opaque AssetCode4[4]; + // + // =========================================================================== + xdr.typedef("AssetCode4", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef opaque AssetCode12[12]; + // + // =========================================================================== + xdr.typedef("AssetCode12", xdr.opaque(12)); + + // === xdr source ============================================================ + // + // enum AssetType + // { + // ASSET_TYPE_NATIVE = 0, + // ASSET_TYPE_CREDIT_ALPHANUM4 = 1, + // ASSET_TYPE_CREDIT_ALPHANUM12 = 2, + // ASSET_TYPE_POOL_SHARE = 3 + // }; + // + // =========================================================================== + xdr.enum("AssetType", { + assetTypeNative: 0, + assetTypeCreditAlphanum4: 1, + assetTypeCreditAlphanum12: 2, + assetTypePoolShare: 3, + }); + + // === xdr source ============================================================ + // + // union AssetCode switch (AssetType type) + // { + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AssetCode4 assetCode4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AssetCode12 assetCode12; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("AssetCode", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeCreditAlphanum4", "assetCode4"], + ["assetTypeCreditAlphanum12", "assetCode12"], + ], + arms: { + assetCode4: xdr.lookup("AssetCode4"), + assetCode12: xdr.lookup("AssetCode12"), + }, + }); + + // === xdr source ============================================================ + // + // struct AlphaNum4 + // { + // AssetCode4 assetCode; + // AccountID issuer; + // }; + // + // =========================================================================== + xdr.struct("AlphaNum4", [ + ["assetCode", xdr.lookup("AssetCode4")], + ["issuer", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // struct AlphaNum12 + // { + // AssetCode12 assetCode; + // AccountID issuer; + // }; + // + // =========================================================================== + xdr.struct("AlphaNum12", [ + ["assetCode", xdr.lookup("AssetCode12")], + ["issuer", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // union Asset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("Asset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + }, + }); + + // === xdr source ============================================================ + // + // struct Price + // { + // int32 n; // numerator + // int32 d; // denominator + // }; + // + // =========================================================================== + xdr.struct("Price", [ + ["n", xdr.lookup("Int32")], + ["d", xdr.lookup("Int32")], + ]); + + // === xdr source ============================================================ + // + // struct Liabilities + // { + // int64 buying; + // int64 selling; + // }; + // + // =========================================================================== + xdr.struct("Liabilities", [ + ["buying", xdr.lookup("Int64")], + ["selling", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum ThresholdIndexes + // { + // THRESHOLD_MASTER_WEIGHT = 0, + // THRESHOLD_LOW = 1, + // THRESHOLD_MED = 2, + // THRESHOLD_HIGH = 3 + // }; + // + // =========================================================================== + xdr.enum("ThresholdIndices", { + thresholdMasterWeight: 0, + thresholdLow: 1, + thresholdMed: 2, + thresholdHigh: 3, + }); + + // === xdr source ============================================================ + // + // enum LedgerEntryType + // { + // ACCOUNT = 0, + // TRUSTLINE = 1, + // OFFER = 2, + // DATA = 3, + // CLAIMABLE_BALANCE = 4, + // LIQUIDITY_POOL = 5, + // CONTRACT_DATA = 6, + // CONTRACT_CODE = 7, + // CONFIG_SETTING = 8, + // EXPIRATION = 9 + // }; + // + // =========================================================================== + xdr.enum("LedgerEntryType", { + account: 0, + trustline: 1, + offer: 2, + data: 3, + claimableBalance: 4, + liquidityPool: 5, + contractData: 6, + contractCode: 7, + configSetting: 8, + expiration: 9, + }); + + // === xdr source ============================================================ + // + // struct Signer + // { + // SignerKey key; + // uint32 weight; // really only need 1 byte + // }; + // + // =========================================================================== + xdr.struct("Signer", [ + ["key", xdr.lookup("SignerKey")], + ["weight", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // enum AccountFlags + // { // masks for each flag + // + // // Flags set on issuer accounts + // // TrustLines are created with authorized set to "false" requiring + // // the issuer to set it for each TrustLine + // AUTH_REQUIRED_FLAG = 0x1, + // // If set, the authorized flag in TrustLines can be cleared + // // otherwise, authorization cannot be revoked + // AUTH_REVOCABLE_FLAG = 0x2, + // // Once set, causes all AUTH_* flags to be read-only + // AUTH_IMMUTABLE_FLAG = 0x4, + // // Trustlines are created with clawback enabled set to "true", + // // and claimable balances created from those trustlines are created + // // with clawback enabled set to "true" + // AUTH_CLAWBACK_ENABLED_FLAG = 0x8 + // }; + // + // =========================================================================== + xdr.enum("AccountFlags", { + authRequiredFlag: 1, + authRevocableFlag: 2, + authImmutableFlag: 4, + authClawbackEnabledFlag: 8, + }); + + // === xdr source ============================================================ + // + // const MASK_ACCOUNT_FLAGS = 0x7; + // + // =========================================================================== + xdr.const("MASK_ACCOUNT_FLAGS", 0x7); + + // === xdr source ============================================================ + // + // const MASK_ACCOUNT_FLAGS_V17 = 0xF; + // + // =========================================================================== + xdr.const("MASK_ACCOUNT_FLAGS_V17", 0xf); + + // === xdr source ============================================================ + // + // const MAX_SIGNERS = 20; + // + // =========================================================================== + xdr.const("MAX_SIGNERS", 20); + + // === xdr source ============================================================ + // + // typedef AccountID* SponsorshipDescriptor; + // + // =========================================================================== + xdr.typedef("SponsorshipDescriptor", xdr.option(xdr.lookup("AccountId"))); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV3 + // { + // // We can use this to add more fields, or because it is first, to + // // change AccountEntryExtensionV3 into a union. + // ExtensionPoint ext; + // + // // Ledger number at which `seqNum` took on its present value. + // uint32 seqLedger; + // + // // Time at which `seqNum` took on its present value. + // TimePoint seqTime; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV3", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["seqLedger", xdr.lookup("Uint32")], + ["seqTime", xdr.lookup("TimePoint")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 3: + // AccountEntryExtensionV3 v3; + // } + // + // =========================================================================== + xdr.union("AccountEntryExtensionV2Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [3, "v3"], + ], + arms: { + v3: xdr.lookup("AccountEntryExtensionV3"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV2 + // { + // uint32 numSponsored; + // uint32 numSponsoring; + // SponsorshipDescriptor signerSponsoringIDs; + // + // union switch (int v) + // { + // case 0: + // void; + // case 3: + // AccountEntryExtensionV3 v3; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV2", [ + ["numSponsored", xdr.lookup("Uint32")], + ["numSponsoring", xdr.lookup("Uint32")], + [ + "signerSponsoringIDs", + xdr.varArray( + xdr.lookup("SponsorshipDescriptor"), + xdr.lookup("MAX_SIGNERS") + ), + ], + ["ext", xdr.lookup("AccountEntryExtensionV2Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // AccountEntryExtensionV2 v2; + // } + // + // =========================================================================== + xdr.union("AccountEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [2, "v2"], + ], + arms: { + v2: xdr.lookup("AccountEntryExtensionV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV1 + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // AccountEntryExtensionV2 v2; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV1", [ + ["liabilities", xdr.lookup("Liabilities")], + ["ext", xdr.lookup("AccountEntryExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // AccountEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("AccountEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("AccountEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntry + // { + // AccountID accountID; // master public key for this account + // int64 balance; // in stroops + // SequenceNumber seqNum; // last sequence number used for this account + // uint32 numSubEntries; // number of sub-entries this account has + // // drives the reserve + // AccountID* inflationDest; // Account to vote for during inflation + // uint32 flags; // see AccountFlags + // + // string32 homeDomain; // can be used for reverse federation and memo lookup + // + // // fields used for signatures + // // thresholds stores unsigned bytes: [weight of master|low|medium|high] + // Thresholds thresholds; + // + // Signer signers; // possible signers for this account + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // AccountEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["balance", xdr.lookup("Int64")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["numSubEntries", xdr.lookup("Uint32")], + ["inflationDest", xdr.option(xdr.lookup("AccountId"))], + ["flags", xdr.lookup("Uint32")], + ["homeDomain", xdr.lookup("String32")], + ["thresholds", xdr.lookup("Thresholds")], + ["signers", xdr.varArray(xdr.lookup("Signer"), xdr.lookup("MAX_SIGNERS"))], + ["ext", xdr.lookup("AccountEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum TrustLineFlags + // { + // // issuer has authorized account to perform transactions with its credit + // AUTHORIZED_FLAG = 1, + // // issuer has authorized account to maintain and reduce liabilities for its + // // credit + // AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, + // // issuer has specified that it may clawback its credit, and that claimable + // // balances created with its credit may also be clawed back + // TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 + // }; + // + // =========================================================================== + xdr.enum("TrustLineFlags", { + authorizedFlag: 1, + authorizedToMaintainLiabilitiesFlag: 2, + trustlineClawbackEnabledFlag: 4, + }); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS = 1; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS", 1); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS_V13 = 3; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS_V13", 3); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS_V17 = 7; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS_V17", 7); + + // === xdr source ============================================================ + // + // enum LiquidityPoolType + // { + // LIQUIDITY_POOL_CONSTANT_PRODUCT = 0 + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolType", { + liquidityPoolConstantProduct: 0, + }); + + // === xdr source ============================================================ + // + // union TrustLineAsset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // case ASSET_TYPE_POOL_SHARE: + // PoolID liquidityPoolID; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("TrustLineAsset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ["assetTypePoolShare", "liquidityPoolId"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + liquidityPoolId: xdr.lookup("PoolId"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryExtensionV2Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TrustLineEntryExtensionV2 + // { + // int32 liquidityPoolUseCount; + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TrustLineEntryExtensionV2", [ + ["liquidityPoolUseCount", xdr.lookup("Int32")], + ["ext", xdr.lookup("TrustLineEntryExtensionV2Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [2, "v2"], + ], + arms: { + v2: xdr.lookup("TrustLineEntryExtensionV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } + // + // =========================================================================== + xdr.struct("TrustLineEntryV1", [ + ["liabilities", xdr.lookup("Liabilities")], + ["ext", xdr.lookup("TrustLineEntryV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } v1; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("TrustLineEntryV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct TrustLineEntry + // { + // AccountID accountID; // account this trustline belongs to + // TrustLineAsset asset; // type of asset (with issuer) + // int64 balance; // how much of this asset the user has. + // // Asset defines the unit for this; + // + // int64 limit; // balance cannot be above this + // uint32 flags; // see TrustLineFlags + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TrustLineEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["asset", xdr.lookup("TrustLineAsset")], + ["balance", xdr.lookup("Int64")], + ["limit", xdr.lookup("Int64")], + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("TrustLineEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum OfferEntryFlags + // { + // // an offer with this flag will not act on and take a reverse offer of equal + // // price + // PASSIVE_FLAG = 1 + // }; + // + // =========================================================================== + xdr.enum("OfferEntryFlags", { + passiveFlag: 1, + }); + + // === xdr source ============================================================ + // + // const MASK_OFFERENTRY_FLAGS = 1; + // + // =========================================================================== + xdr.const("MASK_OFFERENTRY_FLAGS", 1); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("OfferEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct OfferEntry + // { + // AccountID sellerID; + // int64 offerID; + // Asset selling; // A + // Asset buying; // B + // int64 amount; // amount of A + // + // /* price for this offer: + // price of A in terms of B + // price=AmountB/AmountA=priceNumerator/priceDenominator + // price is after fees + // */ + // Price price; + // uint32 flags; // see OfferEntryFlags + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("OfferEntry", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("OfferEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("DataEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct DataEntry + // { + // AccountID accountID; // account this data belongs to + // string64 dataName; + // DataValue dataValue; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("DataEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["dataName", xdr.lookup("String64")], + ["dataValue", xdr.lookup("DataValue")], + ["ext", xdr.lookup("DataEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum ClaimPredicateType + // { + // CLAIM_PREDICATE_UNCONDITIONAL = 0, + // CLAIM_PREDICATE_AND = 1, + // CLAIM_PREDICATE_OR = 2, + // CLAIM_PREDICATE_NOT = 3, + // CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, + // CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 + // }; + // + // =========================================================================== + xdr.enum("ClaimPredicateType", { + claimPredicateUnconditional: 0, + claimPredicateAnd: 1, + claimPredicateOr: 2, + claimPredicateNot: 3, + claimPredicateBeforeAbsoluteTime: 4, + claimPredicateBeforeRelativeTime: 5, + }); + + // === xdr source ============================================================ + // + // union ClaimPredicate switch (ClaimPredicateType type) + // { + // case CLAIM_PREDICATE_UNCONDITIONAL: + // void; + // case CLAIM_PREDICATE_AND: + // ClaimPredicate andPredicates<2>; + // case CLAIM_PREDICATE_OR: + // ClaimPredicate orPredicates<2>; + // case CLAIM_PREDICATE_NOT: + // ClaimPredicate* notPredicate; + // case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: + // int64 absBefore; // Predicate will be true if closeTime < absBefore + // case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: + // int64 relBefore; // Seconds since closeTime of the ledger in which the + // // ClaimableBalanceEntry was created + // }; + // + // =========================================================================== + xdr.union("ClaimPredicate", { + switchOn: xdr.lookup("ClaimPredicateType"), + switchName: "type", + switches: [ + ["claimPredicateUnconditional", xdr.void()], + ["claimPredicateAnd", "andPredicates"], + ["claimPredicateOr", "orPredicates"], + ["claimPredicateNot", "notPredicate"], + ["claimPredicateBeforeAbsoluteTime", "absBefore"], + ["claimPredicateBeforeRelativeTime", "relBefore"], + ], + arms: { + andPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), + orPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), + notPredicate: xdr.option(xdr.lookup("ClaimPredicate")), + absBefore: xdr.lookup("Int64"), + relBefore: xdr.lookup("Int64"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimantType + // { + // CLAIMANT_TYPE_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ClaimantType", { + claimantTypeV0: 0, + }); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID destination; // The account that can use this condition + // ClaimPredicate predicate; // Claimable if predicate is true + // } + // + // =========================================================================== + xdr.struct("ClaimantV0", [ + ["destination", xdr.lookup("AccountId")], + ["predicate", xdr.lookup("ClaimPredicate")], + ]); + + // === xdr source ============================================================ + // + // union Claimant switch (ClaimantType type) + // { + // case CLAIMANT_TYPE_V0: + // struct + // { + // AccountID destination; // The account that can use this condition + // ClaimPredicate predicate; // Claimable if predicate is true + // } v0; + // }; + // + // =========================================================================== + xdr.union("Claimant", { + switchOn: xdr.lookup("ClaimantType"), + switchName: "type", + switches: [["claimantTypeV0", "v0"]], + arms: { + v0: xdr.lookup("ClaimantV0"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimableBalanceIDType + // { + // CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ClaimableBalanceIdType", { + claimableBalanceIdTypeV0: 0, + }); + + // === xdr source ============================================================ + // + // union ClaimableBalanceID switch (ClaimableBalanceIDType type) + // { + // case CLAIMABLE_BALANCE_ID_TYPE_V0: + // Hash v0; + // }; + // + // =========================================================================== + xdr.union("ClaimableBalanceId", { + switchOn: xdr.lookup("ClaimableBalanceIdType"), + switchName: "type", + switches: [["claimableBalanceIdTypeV0", "v0"]], + arms: { + v0: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimableBalanceFlags + // { + // // If set, the issuer account of the asset held by the claimable balance may + // // clawback the claimable balance + // CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1 + // }; + // + // =========================================================================== + xdr.enum("ClaimableBalanceFlags", { + claimableBalanceClawbackEnabledFlag: 1, + }); + + // === xdr source ============================================================ + // + // const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1; + // + // =========================================================================== + xdr.const("MASK_CLAIMABLE_BALANCE_FLAGS", 0x1); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("ClaimableBalanceEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct ClaimableBalanceEntryExtensionV1 + // { + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // + // uint32 flags; // see ClaimableBalanceFlags + // }; + // + // =========================================================================== + xdr.struct("ClaimableBalanceEntryExtensionV1", [ + ["ext", xdr.lookup("ClaimableBalanceEntryExtensionV1Ext")], + ["flags", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // ClaimableBalanceEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("ClaimableBalanceEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("ClaimableBalanceEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct ClaimableBalanceEntry + // { + // // Unique identifier for this ClaimableBalanceEntry + // ClaimableBalanceID balanceID; + // + // // List of claimants with associated predicate + // Claimant claimants<10>; + // + // // Any asset including native + // Asset asset; + // + // // Amount of asset + // int64 amount; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // ClaimableBalanceEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("ClaimableBalanceEntry", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["ext", xdr.lookup("ClaimableBalanceEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct LiquidityPoolConstantProductParameters + // { + // Asset assetA; // assetA < assetB + // Asset assetB; + // int32 fee; // Fee is in basis points, so the actual rate is (fee/100)% + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolConstantProductParameters", [ + ["assetA", xdr.lookup("Asset")], + ["assetB", xdr.lookup("Asset")], + ["fee", xdr.lookup("Int32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } + // + // =========================================================================== + xdr.struct("LiquidityPoolEntryConstantProduct", [ + ["params", xdr.lookup("LiquidityPoolConstantProductParameters")], + ["reserveA", xdr.lookup("Int64")], + ["reserveB", xdr.lookup("Int64")], + ["totalPoolShares", xdr.lookup("Int64")], + ["poolSharesTrustLineCount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } constantProduct; + // } + // + // =========================================================================== + xdr.union("LiquidityPoolEntryBody", { + switchOn: xdr.lookup("LiquidityPoolType"), + switchName: "type", + switches: [["liquidityPoolConstantProduct", "constantProduct"]], + arms: { + constantProduct: xdr.lookup("LiquidityPoolEntryConstantProduct"), + }, + }); + + // === xdr source ============================================================ + // + // struct LiquidityPoolEntry + // { + // PoolID liquidityPoolID; + // + // union switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } constantProduct; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolEntry", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["body", xdr.lookup("LiquidityPoolEntryBody")], + ]); + + // === xdr source ============================================================ + // + // enum ContractDataDurability { + // TEMPORARY = 0, + // PERSISTENT = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractDataDurability", { + temporary: 0, + persistent: 1, + }); + + // === xdr source ============================================================ + // + // struct ContractDataEntry { + // ExtensionPoint ext; + // + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // SCVal val; + // }; + // + // =========================================================================== + xdr.struct("ContractDataEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["contract", xdr.lookup("ScAddress")], + ["key", xdr.lookup("ScVal")], + ["durability", xdr.lookup("ContractDataDurability")], + ["val", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // struct ContractCodeEntry { + // ExtensionPoint ext; + // + // Hash hash; + // opaque code<>; + // }; + // + // =========================================================================== + xdr.struct("ContractCodeEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["hash", xdr.lookup("Hash")], + ["code", xdr.varOpaque()], + ]); + + // === xdr source ============================================================ + // + // struct ExpirationEntry { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // uint32 expirationLedgerSeq; + // }; + // + // =========================================================================== + xdr.struct("ExpirationEntry", [ + ["keyHash", xdr.lookup("Hash")], + ["expirationLedgerSeq", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerEntryExtensionV1 + // { + // SponsorshipDescriptor sponsoringID; + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerEntryExtensionV1", [ + ["sponsoringId", xdr.lookup("SponsorshipDescriptor")], + ["ext", xdr.lookup("LedgerEntryExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (LedgerEntryType type) + // { + // case ACCOUNT: + // AccountEntry account; + // case TRUSTLINE: + // TrustLineEntry trustLine; + // case OFFER: + // OfferEntry offer; + // case DATA: + // DataEntry data; + // case CLAIMABLE_BALANCE: + // ClaimableBalanceEntry claimableBalance; + // case LIQUIDITY_POOL: + // LiquidityPoolEntry liquidityPool; + // case CONTRACT_DATA: + // ContractDataEntry contractData; + // case CONTRACT_CODE: + // ContractCodeEntry contractCode; + // case CONFIG_SETTING: + // ConfigSettingEntry configSetting; + // case EXPIRATION: + // ExpirationEntry expiration; + // } + // + // =========================================================================== + xdr.union("LedgerEntryData", { + switchOn: xdr.lookup("LedgerEntryType"), + switchName: "type", + switches: [ + ["account", "account"], + ["trustline", "trustLine"], + ["offer", "offer"], + ["data", "data"], + ["claimableBalance", "claimableBalance"], + ["liquidityPool", "liquidityPool"], + ["contractData", "contractData"], + ["contractCode", "contractCode"], + ["configSetting", "configSetting"], + ["expiration", "expiration"], + ], + arms: { + account: xdr.lookup("AccountEntry"), + trustLine: xdr.lookup("TrustLineEntry"), + offer: xdr.lookup("OfferEntry"), + data: xdr.lookup("DataEntry"), + claimableBalance: xdr.lookup("ClaimableBalanceEntry"), + liquidityPool: xdr.lookup("LiquidityPoolEntry"), + contractData: xdr.lookup("ContractDataEntry"), + contractCode: xdr.lookup("ContractCodeEntry"), + configSetting: xdr.lookup("ConfigSettingEntry"), + expiration: xdr.lookup("ExpirationEntry"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("LedgerEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("LedgerEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerEntry + // { + // uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed + // + // union switch (LedgerEntryType type) + // { + // case ACCOUNT: + // AccountEntry account; + // case TRUSTLINE: + // TrustLineEntry trustLine; + // case OFFER: + // OfferEntry offer; + // case DATA: + // DataEntry data; + // case CLAIMABLE_BALANCE: + // ClaimableBalanceEntry claimableBalance; + // case LIQUIDITY_POOL: + // LiquidityPoolEntry liquidityPool; + // case CONTRACT_DATA: + // ContractDataEntry contractData; + // case CONTRACT_CODE: + // ContractCodeEntry contractCode; + // case CONFIG_SETTING: + // ConfigSettingEntry configSetting; + // case EXPIRATION: + // ExpirationEntry expiration; + // } + // data; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerEntry", [ + ["lastModifiedLedgerSeq", xdr.lookup("Uint32")], + ["data", xdr.lookup("LedgerEntryData")], + ["ext", xdr.lookup("LedgerEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyAccount", [["accountId", xdr.lookup("AccountId")]]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // TrustLineAsset asset; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyTrustLine", [ + ["accountId", xdr.lookup("AccountId")], + ["asset", xdr.lookup("TrustLineAsset")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sellerID; + // int64 offerID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyOffer", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // string64 dataName; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyData", [ + ["accountId", xdr.lookup("AccountId")], + ["dataName", xdr.lookup("String64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimableBalanceID balanceID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyClaimableBalance", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // PoolID liquidityPoolID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyLiquidityPool", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyContractData", [ + ["contract", xdr.lookup("ScAddress")], + ["key", xdr.lookup("ScVal")], + ["durability", xdr.lookup("ContractDataDurability")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash hash; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyContractCode", [["hash", xdr.lookup("Hash")]]); + + // === xdr source ============================================================ + // + // struct + // { + // ConfigSettingID configSettingID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyConfigSetting", [ + ["configSettingId", xdr.lookup("ConfigSettingId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyExpiration", [["keyHash", xdr.lookup("Hash")]]); + + // === xdr source ============================================================ + // + // union LedgerKey switch (LedgerEntryType type) + // { + // case ACCOUNT: + // struct + // { + // AccountID accountID; + // } account; + // + // case TRUSTLINE: + // struct + // { + // AccountID accountID; + // TrustLineAsset asset; + // } trustLine; + // + // case OFFER: + // struct + // { + // AccountID sellerID; + // int64 offerID; + // } offer; + // + // case DATA: + // struct + // { + // AccountID accountID; + // string64 dataName; + // } data; + // + // case CLAIMABLE_BALANCE: + // struct + // { + // ClaimableBalanceID balanceID; + // } claimableBalance; + // + // case LIQUIDITY_POOL: + // struct + // { + // PoolID liquidityPoolID; + // } liquidityPool; + // case CONTRACT_DATA: + // struct + // { + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // } contractData; + // case CONTRACT_CODE: + // struct + // { + // Hash hash; + // } contractCode; + // case CONFIG_SETTING: + // struct + // { + // ConfigSettingID configSettingID; + // } configSetting; + // case EXPIRATION: + // struct + // { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // } expiration; + // }; + // + // =========================================================================== + xdr.union("LedgerKey", { + switchOn: xdr.lookup("LedgerEntryType"), + switchName: "type", + switches: [ + ["account", "account"], + ["trustline", "trustLine"], + ["offer", "offer"], + ["data", "data"], + ["claimableBalance", "claimableBalance"], + ["liquidityPool", "liquidityPool"], + ["contractData", "contractData"], + ["contractCode", "contractCode"], + ["configSetting", "configSetting"], + ["expiration", "expiration"], + ], + arms: { + account: xdr.lookup("LedgerKeyAccount"), + trustLine: xdr.lookup("LedgerKeyTrustLine"), + offer: xdr.lookup("LedgerKeyOffer"), + data: xdr.lookup("LedgerKeyData"), + claimableBalance: xdr.lookup("LedgerKeyClaimableBalance"), + liquidityPool: xdr.lookup("LedgerKeyLiquidityPool"), + contractData: xdr.lookup("LedgerKeyContractData"), + contractCode: xdr.lookup("LedgerKeyContractCode"), + configSetting: xdr.lookup("LedgerKeyConfigSetting"), + expiration: xdr.lookup("LedgerKeyExpiration"), + }, + }); + + // === xdr source ============================================================ + // + // enum EnvelopeType + // { + // ENVELOPE_TYPE_TX_V0 = 0, + // ENVELOPE_TYPE_SCP = 1, + // ENVELOPE_TYPE_TX = 2, + // ENVELOPE_TYPE_AUTH = 3, + // ENVELOPE_TYPE_SCPVALUE = 4, + // ENVELOPE_TYPE_TX_FEE_BUMP = 5, + // ENVELOPE_TYPE_OP_ID = 6, + // ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, + // ENVELOPE_TYPE_CONTRACT_ID = 8, + // ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 + // }; + // + // =========================================================================== + xdr.enum("EnvelopeType", { + envelopeTypeTxV0: 0, + envelopeTypeScp: 1, + envelopeTypeTx: 2, + envelopeTypeAuth: 3, + envelopeTypeScpvalue: 4, + envelopeTypeTxFeeBump: 5, + envelopeTypeOpId: 6, + envelopeTypePoolRevokeOpId: 7, + envelopeTypeContractId: 8, + envelopeTypeSorobanAuthorization: 9, + }); + + // === xdr source ============================================================ + // + // typedef opaque UpgradeType<128>; + // + // =========================================================================== + xdr.typedef("UpgradeType", xdr.varOpaque(128)); + + // === xdr source ============================================================ + // + // enum StellarValueType + // { + // STELLAR_VALUE_BASIC = 0, + // STELLAR_VALUE_SIGNED = 1 + // }; + // + // =========================================================================== + xdr.enum("StellarValueType", { + stellarValueBasic: 0, + stellarValueSigned: 1, + }); + + // === xdr source ============================================================ + // + // struct LedgerCloseValueSignature + // { + // NodeID nodeID; // which node introduced the value + // Signature signature; // nodeID's signature + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseValueSignature", [ + ["nodeId", xdr.lookup("NodeId")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // union switch (StellarValueType v) + // { + // case STELLAR_VALUE_BASIC: + // void; + // case STELLAR_VALUE_SIGNED: + // LedgerCloseValueSignature lcValueSignature; + // } + // + // =========================================================================== + xdr.union("StellarValueExt", { + switchOn: xdr.lookup("StellarValueType"), + switchName: "v", + switches: [ + ["stellarValueBasic", xdr.void()], + ["stellarValueSigned", "lcValueSignature"], + ], + arms: { + lcValueSignature: xdr.lookup("LedgerCloseValueSignature"), + }, + }); + + // === xdr source ============================================================ + // + // struct StellarValue + // { + // Hash txSetHash; // transaction set to apply to previous ledger + // TimePoint closeTime; // network close time + // + // // upgrades to apply to the previous ledger (usually empty) + // // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop + // // unknown steps during consensus if needed. + // // see notes below on 'LedgerUpgrade' for more detail + // // max size is dictated by number of upgrade types (+ room for future) + // UpgradeType upgrades<6>; + // + // // reserved for future use + // union switch (StellarValueType v) + // { + // case STELLAR_VALUE_BASIC: + // void; + // case STELLAR_VALUE_SIGNED: + // LedgerCloseValueSignature lcValueSignature; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("StellarValue", [ + ["txSetHash", xdr.lookup("Hash")], + ["closeTime", xdr.lookup("TimePoint")], + ["upgrades", xdr.varArray(xdr.lookup("UpgradeType"), 6)], + ["ext", xdr.lookup("StellarValueExt")], + ]); + + // === xdr source ============================================================ + // + // const MASK_LEDGER_HEADER_FLAGS = 0x7; + // + // =========================================================================== + xdr.const("MASK_LEDGER_HEADER_FLAGS", 0x7); + + // === xdr source ============================================================ + // + // enum LedgerHeaderFlags + // { + // DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, + // DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, + // DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 + // }; + // + // =========================================================================== + xdr.enum("LedgerHeaderFlags", { + disableLiquidityPoolTradingFlag: 1, + disableLiquidityPoolDepositFlag: 2, + disableLiquidityPoolWithdrawalFlag: 4, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeaderExtensionV1 + // { + // uint32 flags; // LedgerHeaderFlags + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeaderExtensionV1", [ + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("LedgerHeaderExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerHeaderExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("LedgerHeaderExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeader + // { + // uint32 ledgerVersion; // the protocol version of the ledger + // Hash previousLedgerHash; // hash of the previous ledger header + // StellarValue scpValue; // what consensus agreed to + // Hash txSetResultHash; // the TransactionResultSet that led to this ledger + // Hash bucketListHash; // hash of the ledger state + // + // uint32 ledgerSeq; // sequence number of this ledger + // + // int64 totalCoins; // total number of stroops in existence. + // // 10,000,000 stroops in 1 XLM + // + // int64 feePool; // fees burned since last inflation run + // uint32 inflationSeq; // inflation sequence number + // + // uint64 idPool; // last used global ID, used for generating objects + // + // uint32 baseFee; // base fee per operation in stroops + // uint32 baseReserve; // account base reserve in stroops + // + // uint32 maxTxSetSize; // maximum size a transaction set can be + // + // Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back + // // in time without walking the chain back ledger by ledger + // // each slot contains the oldest ledger that is mod of + // // either 50 5000 50000 or 500000 depending on index + // // skipList[0] mod(50), skipList[1] mod(5000), etc + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerHeaderExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeader", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["previousLedgerHash", xdr.lookup("Hash")], + ["scpValue", xdr.lookup("StellarValue")], + ["txSetResultHash", xdr.lookup("Hash")], + ["bucketListHash", xdr.lookup("Hash")], + ["ledgerSeq", xdr.lookup("Uint32")], + ["totalCoins", xdr.lookup("Int64")], + ["feePool", xdr.lookup("Int64")], + ["inflationSeq", xdr.lookup("Uint32")], + ["idPool", xdr.lookup("Uint64")], + ["baseFee", xdr.lookup("Uint32")], + ["baseReserve", xdr.lookup("Uint32")], + ["maxTxSetSize", xdr.lookup("Uint32")], + ["skipList", xdr.array(xdr.lookup("Hash"), 4)], + ["ext", xdr.lookup("LedgerHeaderExt")], + ]); + + // === xdr source ============================================================ + // + // enum LedgerUpgradeType + // { + // LEDGER_UPGRADE_VERSION = 1, + // LEDGER_UPGRADE_BASE_FEE = 2, + // LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, + // LEDGER_UPGRADE_BASE_RESERVE = 4, + // LEDGER_UPGRADE_FLAGS = 5, + // LEDGER_UPGRADE_CONFIG = 6, + // LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 + // }; + // + // =========================================================================== + xdr.enum("LedgerUpgradeType", { + ledgerUpgradeVersion: 1, + ledgerUpgradeBaseFee: 2, + ledgerUpgradeMaxTxSetSize: 3, + ledgerUpgradeBaseReserve: 4, + ledgerUpgradeFlags: 5, + ledgerUpgradeConfig: 6, + ledgerUpgradeMaxSorobanTxSetSize: 7, + }); + + // === xdr source ============================================================ + // + // struct ConfigUpgradeSetKey { + // Hash contractID; + // Hash contentHash; + // }; + // + // =========================================================================== + xdr.struct("ConfigUpgradeSetKey", [ + ["contractId", xdr.lookup("Hash")], + ["contentHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // union LedgerUpgrade switch (LedgerUpgradeType type) + // { + // case LEDGER_UPGRADE_VERSION: + // uint32 newLedgerVersion; // update ledgerVersion + // case LEDGER_UPGRADE_BASE_FEE: + // uint32 newBaseFee; // update baseFee + // case LEDGER_UPGRADE_MAX_TX_SET_SIZE: + // uint32 newMaxTxSetSize; // update maxTxSetSize + // case LEDGER_UPGRADE_BASE_RESERVE: + // uint32 newBaseReserve; // update baseReserve + // case LEDGER_UPGRADE_FLAGS: + // uint32 newFlags; // update flags + // case LEDGER_UPGRADE_CONFIG: + // // Update arbitrary `ConfigSetting` entries identified by the key. + // ConfigUpgradeSetKey newConfig; + // case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: + // // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without + // // using `LEDGER_UPGRADE_CONFIG`. + // uint32 newMaxSorobanTxSetSize; + // }; + // + // =========================================================================== + xdr.union("LedgerUpgrade", { + switchOn: xdr.lookup("LedgerUpgradeType"), + switchName: "type", + switches: [ + ["ledgerUpgradeVersion", "newLedgerVersion"], + ["ledgerUpgradeBaseFee", "newBaseFee"], + ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], + ["ledgerUpgradeBaseReserve", "newBaseReserve"], + ["ledgerUpgradeFlags", "newFlags"], + ["ledgerUpgradeConfig", "newConfig"], + ["ledgerUpgradeMaxSorobanTxSetSize", "newMaxSorobanTxSetSize"], + ], + arms: { + newLedgerVersion: xdr.lookup("Uint32"), + newBaseFee: xdr.lookup("Uint32"), + newMaxTxSetSize: xdr.lookup("Uint32"), + newBaseReserve: xdr.lookup("Uint32"), + newFlags: xdr.lookup("Uint32"), + newConfig: xdr.lookup("ConfigUpgradeSetKey"), + newMaxSorobanTxSetSize: xdr.lookup("Uint32"), + }, + }); + + // === xdr source ============================================================ + // + // struct ConfigUpgradeSet { + // ConfigSettingEntry updatedEntry<>; + // }; + // + // =========================================================================== + xdr.struct("ConfigUpgradeSet", [ + [ + "updatedEntry", + xdr.varArray(xdr.lookup("ConfigSettingEntry"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // enum BucketEntryType + // { + // METAENTRY = + // -1, // At-and-after protocol 11: bucket metadata, should come first. + // LIVEENTRY = 0, // Before protocol 11: created-or-updated; + // // At-and-after protocol 11: only updated. + // DEADENTRY = 1, + // INITENTRY = 2 // At-and-after protocol 11: only created. + // }; + // + // =========================================================================== + xdr.enum("BucketEntryType", { + metaentry: -1, + liveentry: 0, + deadentry: 1, + initentry: 2, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("BucketMetadataExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct BucketMetadata + // { + // // Indicates the protocol version used to create / merge this bucket. + // uint32 ledgerVersion; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("BucketMetadata", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["ext", xdr.lookup("BucketMetadataExt")], + ]); + + // === xdr source ============================================================ + // + // union BucketEntry switch (BucketEntryType type) + // { + // case LIVEENTRY: + // case INITENTRY: + // LedgerEntry liveEntry; + // + // case DEADENTRY: + // LedgerKey deadEntry; + // case METAENTRY: + // BucketMetadata metaEntry; + // }; + // + // =========================================================================== + xdr.union("BucketEntry", { + switchOn: xdr.lookup("BucketEntryType"), + switchName: "type", + switches: [ + ["liveentry", "liveEntry"], + ["initentry", "liveEntry"], + ["deadentry", "deadEntry"], + ["metaentry", "metaEntry"], + ], + arms: { + liveEntry: xdr.lookup("LedgerEntry"), + deadEntry: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, + }); + + // === xdr source ============================================================ + // + // enum TxSetComponentType + // { + // // txs with effective fee <= bid derived from a base fee (if any). + // // If base fee is not specified, no discount is applied. + // TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 + // }; + // + // =========================================================================== + xdr.enum("TxSetComponentType", { + txsetCompTxsMaybeDiscountedFee: 0, + }); + + // === xdr source ============================================================ + // + // struct + // { + // int64* baseFee; + // TransactionEnvelope txs<>; + // } + // + // =========================================================================== + xdr.struct("TxSetComponentTxsMaybeDiscountedFee", [ + ["baseFee", xdr.option(xdr.lookup("Int64"))], + ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union TxSetComponent switch (TxSetComponentType type) + // { + // case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: + // struct + // { + // int64* baseFee; + // TransactionEnvelope txs<>; + // } txsMaybeDiscountedFee; + // }; + // + // =========================================================================== + xdr.union("TxSetComponent", { + switchOn: xdr.lookup("TxSetComponentType"), + switchName: "type", + switches: [["txsetCompTxsMaybeDiscountedFee", "txsMaybeDiscountedFee"]], + arms: { + txsMaybeDiscountedFee: xdr.lookup("TxSetComponentTxsMaybeDiscountedFee"), + }, + }); + + // === xdr source ============================================================ + // + // union TransactionPhase switch (int v) + // { + // case 0: + // TxSetComponent v0Components<>; + // }; + // + // =========================================================================== + xdr.union("TransactionPhase", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0Components"]], + arms: { + v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionSet + // { + // Hash previousLedgerHash; + // TransactionEnvelope txs<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionSet", [ + ["previousLedgerHash", xdr.lookup("Hash")], + ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct TransactionSetV1 + // { + // Hash previousLedgerHash; + // TransactionPhase phases<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionSetV1", [ + ["previousLedgerHash", xdr.lookup("Hash")], + ["phases", xdr.varArray(xdr.lookup("TransactionPhase"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union GeneralizedTransactionSet switch (int v) + // { + // // We consider the legacy TransactionSet to be v0. + // case 1: + // TransactionSetV1 v1TxSet; + // }; + // + // =========================================================================== + xdr.union("GeneralizedTransactionSet", { + switchOn: xdr.int(), + switchName: "v", + switches: [[1, "v1TxSet"]], + arms: { + v1TxSet: xdr.lookup("TransactionSetV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionResultPair + // { + // Hash transactionHash; + // TransactionResult result; // result for the transaction + // }; + // + // =========================================================================== + xdr.struct("TransactionResultPair", [ + ["transactionHash", xdr.lookup("Hash")], + ["result", xdr.lookup("TransactionResult")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionResultSet + // { + // TransactionResultPair results<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionResultSet", [ + ["results", xdr.varArray(xdr.lookup("TransactionResultPair"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // GeneralizedTransactionSet generalizedTxSet; + // } + // + // =========================================================================== + xdr.union("TransactionHistoryEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "generalizedTxSet"], + ], + arms: { + generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionHistoryEntry + // { + // uint32 ledgerSeq; + // TransactionSet txSet; + // + // // when v != 0, txSet must be empty + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // GeneralizedTransactionSet generalizedTxSet; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionHistoryEntry", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["txSet", xdr.lookup("TransactionSet")], + ["ext", xdr.lookup("TransactionHistoryEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionHistoryResultEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionHistoryResultEntry + // { + // uint32 ledgerSeq; + // TransactionResultSet txResultSet; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionHistoryResultEntry", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["txResultSet", xdr.lookup("TransactionResultSet")], + ["ext", xdr.lookup("TransactionHistoryResultEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderHistoryEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeaderHistoryEntry + // { + // Hash hash; + // LedgerHeader header; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeaderHistoryEntry", [ + ["hash", xdr.lookup("Hash")], + ["header", xdr.lookup("LedgerHeader")], + ["ext", xdr.lookup("LedgerHeaderHistoryEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerSCPMessages + // { + // uint32 ledgerSeq; + // SCPEnvelope messages<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerScpMessages", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["messages", xdr.varArray(xdr.lookup("ScpEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct SCPHistoryEntryV0 + // { + // SCPQuorumSet quorumSets<>; // additional quorum sets used by ledgerMessages + // LedgerSCPMessages ledgerMessages; + // }; + // + // =========================================================================== + xdr.struct("ScpHistoryEntryV0", [ + ["quorumSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], + ["ledgerMessages", xdr.lookup("LedgerScpMessages")], + ]); + + // === xdr source ============================================================ + // + // union SCPHistoryEntry switch (int v) + // { + // case 0: + // SCPHistoryEntryV0 v0; + // }; + // + // =========================================================================== + xdr.union("ScpHistoryEntry", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("ScpHistoryEntryV0"), + }, + }); + + // === xdr source ============================================================ + // + // enum LedgerEntryChangeType + // { + // LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger + // LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger + // LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger + // LEDGER_ENTRY_STATE = 3 // value of the entry + // }; + // + // =========================================================================== + xdr.enum("LedgerEntryChangeType", { + ledgerEntryCreated: 0, + ledgerEntryUpdated: 1, + ledgerEntryRemoved: 2, + ledgerEntryState: 3, + }); + + // === xdr source ============================================================ + // + // union LedgerEntryChange switch (LedgerEntryChangeType type) + // { + // case LEDGER_ENTRY_CREATED: + // LedgerEntry created; + // case LEDGER_ENTRY_UPDATED: + // LedgerEntry updated; + // case LEDGER_ENTRY_REMOVED: + // LedgerKey removed; + // case LEDGER_ENTRY_STATE: + // LedgerEntry state; + // }; + // + // =========================================================================== + xdr.union("LedgerEntryChange", { + switchOn: xdr.lookup("LedgerEntryChangeType"), + switchName: "type", + switches: [ + ["ledgerEntryCreated", "created"], + ["ledgerEntryUpdated", "updated"], + ["ledgerEntryRemoved", "removed"], + ["ledgerEntryState", "state"], + ], + arms: { + created: xdr.lookup("LedgerEntry"), + updated: xdr.lookup("LedgerEntry"), + removed: xdr.lookup("LedgerKey"), + state: xdr.lookup("LedgerEntry"), + }, + }); + + // === xdr source ============================================================ + // + // typedef LedgerEntryChange LedgerEntryChanges<>; + // + // =========================================================================== + xdr.typedef( + "LedgerEntryChanges", + xdr.varArray(xdr.lookup("LedgerEntryChange"), 2147483647) + ); + + // === xdr source ============================================================ + // + // struct OperationMeta + // { + // LedgerEntryChanges changes; + // }; + // + // =========================================================================== + xdr.struct("OperationMeta", [["changes", xdr.lookup("LedgerEntryChanges")]]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV1 + // { + // LedgerEntryChanges txChanges; // tx level changes if any + // OperationMeta operations<>; // meta for each operation + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV1", [ + ["txChanges", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV2 + // { + // LedgerEntryChanges txChangesBefore; // tx level changes before operations + // // are applied if any + // OperationMeta operations<>; // meta for each operation + // LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // // applied if any + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV2", [ + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ]); + + // === xdr source ============================================================ + // + // enum ContractEventType + // { + // SYSTEM = 0, + // CONTRACT = 1, + // DIAGNOSTIC = 2 + // }; + // + // =========================================================================== + xdr.enum("ContractEventType", { + system: 0, + contract: 1, + diagnostic: 2, + }); + + // === xdr source ============================================================ + // + // struct + // { + // SCVal topics<>; + // SCVal data; + // } + // + // =========================================================================== + xdr.struct("ContractEventV0", [ + ["topics", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], + ["data", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // struct + // { + // SCVal topics<>; + // SCVal data; + // } v0; + // } + // + // =========================================================================== + xdr.union("ContractEventBody", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("ContractEventV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct ContractEvent + // { + // // We can use this to add more fields, or because it + // // is first, to change ContractEvent into a union. + // ExtensionPoint ext; + // + // Hash* contractID; + // ContractEventType type; + // + // union switch (int v) + // { + // case 0: + // struct + // { + // SCVal topics<>; + // SCVal data; + // } v0; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("ContractEvent", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["contractId", xdr.option(xdr.lookup("Hash"))], + ["type", xdr.lookup("ContractEventType")], + ["body", xdr.lookup("ContractEventBody")], + ]); + + // === xdr source ============================================================ + // + // struct DiagnosticEvent + // { + // bool inSuccessfulContractCall; + // ContractEvent event; + // }; + // + // =========================================================================== + xdr.struct("DiagnosticEvent", [ + ["inSuccessfulContractCall", xdr.bool()], + ["event", xdr.lookup("ContractEvent")], + ]); + + // === xdr source ============================================================ + // + // struct SorobanTransactionMeta + // { + // ExtensionPoint ext; + // + // ContractEvent events<>; // custom events populated by the + // // contracts themselves. + // SCVal returnValue; // return value of the host fn invocation + // + // // Diagnostics events that are not hashed. + // // This will contain all contract and diagnostic events. Even ones + // // that were emitted in a failed contract call. + // DiagnosticEvent diagnosticEvents<>; + // }; + // + // =========================================================================== + xdr.struct("SorobanTransactionMeta", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], + ["returnValue", xdr.lookup("ScVal")], + [ + "diagnosticEvents", + xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV3 + // { + // ExtensionPoint ext; + // + // LedgerEntryChanges txChangesBefore; // tx level changes before operations + // // are applied if any + // OperationMeta operations<>; // meta for each operation + // LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // // applied if any + // SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for + // // Soroban transactions). + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV3", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMeta"))], + ]); + + // === xdr source ============================================================ + // + // struct InvokeHostFunctionSuccessPreImage + // { + // SCVal returnValue; + // ContractEvent events<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeHostFunctionSuccessPreImage", [ + ["returnValue", xdr.lookup("ScVal")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union TransactionMeta switch (int v) + // { + // case 0: + // OperationMeta operations<>; + // case 1: + // TransactionMetaV1 v1; + // case 2: + // TransactionMetaV2 v2; + // case 3: + // TransactionMetaV3 v3; + // }; + // + // =========================================================================== + xdr.union("TransactionMeta", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, "operations"], + [1, "v1"], + [2, "v2"], + [3, "v3"], + ], + arms: { + operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), + v1: xdr.lookup("TransactionMetaV1"), + v2: xdr.lookup("TransactionMetaV2"), + v3: xdr.lookup("TransactionMetaV3"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionResultMeta + // { + // TransactionResultPair result; + // LedgerEntryChanges feeProcessing; + // TransactionMeta txApplyProcessing; + // }; + // + // =========================================================================== + xdr.struct("TransactionResultMeta", [ + ["result", xdr.lookup("TransactionResultPair")], + ["feeProcessing", xdr.lookup("LedgerEntryChanges")], + ["txApplyProcessing", xdr.lookup("TransactionMeta")], + ]); + + // === xdr source ============================================================ + // + // struct UpgradeEntryMeta + // { + // LedgerUpgrade upgrade; + // LedgerEntryChanges changes; + // }; + // + // =========================================================================== + xdr.struct("UpgradeEntryMeta", [ + ["upgrade", xdr.lookup("LedgerUpgrade")], + ["changes", xdr.lookup("LedgerEntryChanges")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV0 + // { + // LedgerHeaderHistoryEntry ledgerHeader; + // // NB: txSet is sorted in "Hash order" + // TransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV0", [ + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("TransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV1 + // { + // LedgerHeaderHistoryEntry ledgerHeader; + // + // GeneralizedTransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV1", [ + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV2 + // { + // // We forgot to add an ExtensionPoint in v1 but at least + // // we can add one now in v2. + // ExtensionPoint ext; + // + // LedgerHeaderHistoryEntry ledgerHeader; + // + // GeneralizedTransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // + // // Size in bytes of BucketList, to support downstream + // // systems calculating storage fees correctly. + // uint64 totalByteSizeOfBucketList; + // + // // Expired temp keys that are being evicted at this ledger. + // LedgerKey evictedTemporaryLedgerKeys<>; + // + // // Expired restorable ledger entries that are being + // // evicted at this ledger. + // LedgerEntry evictedPersistentLedgerEntries<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV2", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ["totalByteSizeOfBucketList", xdr.lookup("Uint64")], + [ + "evictedTemporaryLedgerKeys", + xdr.varArray(xdr.lookup("LedgerKey"), 2147483647), + ], + [ + "evictedPersistentLedgerEntries", + xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // union LedgerCloseMeta switch (int v) + // { + // case 0: + // LedgerCloseMetaV0 v0; + // case 1: + // LedgerCloseMetaV1 v1; + // case 2: + // LedgerCloseMetaV2 v2; + // }; + // + // =========================================================================== + xdr.union("LedgerCloseMeta", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, "v0"], + [1, "v1"], + [2, "v2"], + ], + arms: { + v0: xdr.lookup("LedgerCloseMetaV0"), + v1: xdr.lookup("LedgerCloseMetaV1"), + v2: xdr.lookup("LedgerCloseMetaV2"), + }, + }); + + // === xdr source ============================================================ + // + // enum ErrorCode + // { + // ERR_MISC = 0, // Unspecific error + // ERR_DATA = 1, // Malformed data + // ERR_CONF = 2, // Misconfiguration error + // ERR_AUTH = 3, // Authentication failure + // ERR_LOAD = 4 // System overloaded + // }; + // + // =========================================================================== + xdr.enum("ErrorCode", { + errMisc: 0, + errData: 1, + errConf: 2, + errAuth: 3, + errLoad: 4, + }); + + // === xdr source ============================================================ + // + // struct Error + // { + // ErrorCode code; + // string msg<100>; + // }; + // + // =========================================================================== + xdr.struct("Error", [ + ["code", xdr.lookup("ErrorCode")], + ["msg", xdr.string(100)], + ]); + + // === xdr source ============================================================ + // + // struct SendMore + // { + // uint32 numMessages; + // }; + // + // =========================================================================== + xdr.struct("SendMore", [["numMessages", xdr.lookup("Uint32")]]); + + // === xdr source ============================================================ + // + // struct SendMoreExtended + // { + // uint32 numMessages; + // uint32 numBytes; + // }; + // + // =========================================================================== + xdr.struct("SendMoreExtended", [ + ["numMessages", xdr.lookup("Uint32")], + ["numBytes", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct AuthCert + // { + // Curve25519Public pubkey; + // uint64 expiration; + // Signature sig; + // }; + // + // =========================================================================== + xdr.struct("AuthCert", [ + ["pubkey", xdr.lookup("Curve25519Public")], + ["expiration", xdr.lookup("Uint64")], + ["sig", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // struct Hello + // { + // uint32 ledgerVersion; + // uint32 overlayVersion; + // uint32 overlayMinVersion; + // Hash networkID; + // string versionStr<100>; + // int listeningPort; + // NodeID peerID; + // AuthCert cert; + // uint256 nonce; + // }; + // + // =========================================================================== + xdr.struct("Hello", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["overlayVersion", xdr.lookup("Uint32")], + ["overlayMinVersion", xdr.lookup("Uint32")], + ["networkId", xdr.lookup("Hash")], + ["versionStr", xdr.string(100)], + ["listeningPort", xdr.int()], + ["peerId", xdr.lookup("NodeId")], + ["cert", xdr.lookup("AuthCert")], + ["nonce", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200; + // + // =========================================================================== + xdr.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED", 200); + + // === xdr source ============================================================ + // + // struct Auth + // { + // int flags; + // }; + // + // =========================================================================== + xdr.struct("Auth", [["flags", xdr.int()]]); + + // === xdr source ============================================================ + // + // enum IPAddrType + // { + // IPv4 = 0, + // IPv6 = 1 + // }; + // + // =========================================================================== + xdr.enum("IpAddrType", { + iPv4: 0, + iPv6: 1, + }); + + // === xdr source ============================================================ + // + // union switch (IPAddrType type) + // { + // case IPv4: + // opaque ipv4[4]; + // case IPv6: + // opaque ipv6[16]; + // } + // + // =========================================================================== + xdr.union("PeerAddressIp", { + switchOn: xdr.lookup("IpAddrType"), + switchName: "type", + switches: [ + ["iPv4", "ipv4"], + ["iPv6", "ipv6"], + ], + arms: { + ipv4: xdr.opaque(4), + ipv6: xdr.opaque(16), + }, + }); + + // === xdr source ============================================================ + // + // struct PeerAddress + // { + // union switch (IPAddrType type) + // { + // case IPv4: + // opaque ipv4[4]; + // case IPv6: + // opaque ipv6[16]; + // } + // ip; + // uint32 port; + // uint32 numFailures; + // }; + // + // =========================================================================== + xdr.struct("PeerAddress", [ + ["ip", xdr.lookup("PeerAddressIp")], + ["port", xdr.lookup("Uint32")], + ["numFailures", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // enum MessageType + // { + // ERROR_MSG = 0, + // AUTH = 2, + // DONT_HAVE = 3, + // + // GET_PEERS = 4, // gets a list of peers this guy knows about + // PEERS = 5, + // + // GET_TX_SET = 6, // gets a particular txset by hash + // TX_SET = 7, + // GENERALIZED_TX_SET = 17, + // + // TRANSACTION = 8, // pass on a tx you have heard about + // + // // SCP + // GET_SCP_QUORUMSET = 9, + // SCP_QUORUMSET = 10, + // SCP_MESSAGE = 11, + // GET_SCP_STATE = 12, + // + // // new messages + // HELLO = 13, + // + // SURVEY_REQUEST = 14, + // SURVEY_RESPONSE = 15, + // + // SEND_MORE = 16, + // SEND_MORE_EXTENDED = 20, + // + // FLOOD_ADVERT = 18, + // FLOOD_DEMAND = 19 + // }; + // + // =========================================================================== + xdr.enum("MessageType", { + errorMsg: 0, + auth: 2, + dontHave: 3, + getPeers: 4, + peers: 5, + getTxSet: 6, + txSet: 7, + generalizedTxSet: 17, + transaction: 8, + getScpQuorumset: 9, + scpQuorumset: 10, + scpMessage: 11, + getScpState: 12, + hello: 13, + surveyRequest: 14, + surveyResponse: 15, + sendMore: 16, + sendMoreExtended: 20, + floodAdvert: 18, + floodDemand: 19, + }); + + // === xdr source ============================================================ + // + // struct DontHave + // { + // MessageType type; + // uint256 reqHash; + // }; + // + // =========================================================================== + xdr.struct("DontHave", [ + ["type", xdr.lookup("MessageType")], + ["reqHash", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // enum SurveyMessageCommandType + // { + // SURVEY_TOPOLOGY = 0 + // }; + // + // =========================================================================== + xdr.enum("SurveyMessageCommandType", { + surveyTopology: 0, + }); + + // === xdr source ============================================================ + // + // enum SurveyMessageResponseType + // { + // SURVEY_TOPOLOGY_RESPONSE_V0 = 0, + // SURVEY_TOPOLOGY_RESPONSE_V1 = 1 + // }; + // + // =========================================================================== + xdr.enum("SurveyMessageResponseType", { + surveyTopologyResponseV0: 0, + surveyTopologyResponseV1: 1, + }); + + // === xdr source ============================================================ + // + // struct SurveyRequestMessage + // { + // NodeID surveyorPeerID; + // NodeID surveyedPeerID; + // uint32 ledgerNum; + // Curve25519Public encryptionKey; + // SurveyMessageCommandType commandType; + // }; + // + // =========================================================================== + xdr.struct("SurveyRequestMessage", [ + ["surveyorPeerId", xdr.lookup("NodeId")], + ["surveyedPeerId", xdr.lookup("NodeId")], + ["ledgerNum", xdr.lookup("Uint32")], + ["encryptionKey", xdr.lookup("Curve25519Public")], + ["commandType", xdr.lookup("SurveyMessageCommandType")], + ]); + + // === xdr source ============================================================ + // + // struct SignedSurveyRequestMessage + // { + // Signature requestSignature; + // SurveyRequestMessage request; + // }; + // + // =========================================================================== + xdr.struct("SignedSurveyRequestMessage", [ + ["requestSignature", xdr.lookup("Signature")], + ["request", xdr.lookup("SurveyRequestMessage")], + ]); + + // === xdr source ============================================================ + // + // typedef opaque EncryptedBody<64000>; + // + // =========================================================================== + xdr.typedef("EncryptedBody", xdr.varOpaque(64000)); + + // === xdr source ============================================================ + // + // struct SurveyResponseMessage + // { + // NodeID surveyorPeerID; + // NodeID surveyedPeerID; + // uint32 ledgerNum; + // SurveyMessageCommandType commandType; + // EncryptedBody encryptedBody; + // }; + // + // =========================================================================== + xdr.struct("SurveyResponseMessage", [ + ["surveyorPeerId", xdr.lookup("NodeId")], + ["surveyedPeerId", xdr.lookup("NodeId")], + ["ledgerNum", xdr.lookup("Uint32")], + ["commandType", xdr.lookup("SurveyMessageCommandType")], + ["encryptedBody", xdr.lookup("EncryptedBody")], + ]); + + // === xdr source ============================================================ + // + // struct SignedSurveyResponseMessage + // { + // Signature responseSignature; + // SurveyResponseMessage response; + // }; + // + // =========================================================================== + xdr.struct("SignedSurveyResponseMessage", [ + ["responseSignature", xdr.lookup("Signature")], + ["response", xdr.lookup("SurveyResponseMessage")], + ]); + + // === xdr source ============================================================ + // + // struct PeerStats + // { + // NodeID id; + // string versionStr<100>; + // uint64 messagesRead; + // uint64 messagesWritten; + // uint64 bytesRead; + // uint64 bytesWritten; + // uint64 secondsConnected; + // + // uint64 uniqueFloodBytesRecv; + // uint64 duplicateFloodBytesRecv; + // uint64 uniqueFetchBytesRecv; + // uint64 duplicateFetchBytesRecv; + // + // uint64 uniqueFloodMessageRecv; + // uint64 duplicateFloodMessageRecv; + // uint64 uniqueFetchMessageRecv; + // uint64 duplicateFetchMessageRecv; + // }; + // + // =========================================================================== + xdr.struct("PeerStats", [ + ["id", xdr.lookup("NodeId")], + ["versionStr", xdr.string(100)], + ["messagesRead", xdr.lookup("Uint64")], + ["messagesWritten", xdr.lookup("Uint64")], + ["bytesRead", xdr.lookup("Uint64")], + ["bytesWritten", xdr.lookup("Uint64")], + ["secondsConnected", xdr.lookup("Uint64")], + ["uniqueFloodBytesRecv", xdr.lookup("Uint64")], + ["duplicateFloodBytesRecv", xdr.lookup("Uint64")], + ["uniqueFetchBytesRecv", xdr.lookup("Uint64")], + ["duplicateFetchBytesRecv", xdr.lookup("Uint64")], + ["uniqueFloodMessageRecv", xdr.lookup("Uint64")], + ["duplicateFloodMessageRecv", xdr.lookup("Uint64")], + ["uniqueFetchMessageRecv", xdr.lookup("Uint64")], + ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // typedef PeerStats PeerStatList<25>; + // + // =========================================================================== + xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); + + // === xdr source ============================================================ + // + // struct TopologyResponseBodyV0 + // { + // PeerStatList inboundPeers; + // PeerStatList outboundPeers; + // + // uint32 totalInboundPeerCount; + // uint32 totalOutboundPeerCount; + // }; + // + // =========================================================================== + xdr.struct("TopologyResponseBodyV0", [ + ["inboundPeers", xdr.lookup("PeerStatList")], + ["outboundPeers", xdr.lookup("PeerStatList")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct TopologyResponseBodyV1 + // { + // PeerStatList inboundPeers; + // PeerStatList outboundPeers; + // + // uint32 totalInboundPeerCount; + // uint32 totalOutboundPeerCount; + // + // uint32 maxInboundPeerCount; + // uint32 maxOutboundPeerCount; + // }; + // + // =========================================================================== + xdr.struct("TopologyResponseBodyV1", [ + ["inboundPeers", xdr.lookup("PeerStatList")], + ["outboundPeers", xdr.lookup("PeerStatList")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ["maxInboundPeerCount", xdr.lookup("Uint32")], + ["maxOutboundPeerCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union SurveyResponseBody switch (SurveyMessageResponseType type) + // { + // case SURVEY_TOPOLOGY_RESPONSE_V0: + // TopologyResponseBodyV0 topologyResponseBodyV0; + // case SURVEY_TOPOLOGY_RESPONSE_V1: + // TopologyResponseBodyV1 topologyResponseBodyV1; + // }; + // + // =========================================================================== + xdr.union("SurveyResponseBody", { + switchOn: xdr.lookup("SurveyMessageResponseType"), + switchName: "type", + switches: [ + ["surveyTopologyResponseV0", "topologyResponseBodyV0"], + ["surveyTopologyResponseV1", "topologyResponseBodyV1"], + ], + arms: { + topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), + topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), + }, + }); + + // === xdr source ============================================================ + // + // const TX_ADVERT_VECTOR_MAX_SIZE = 1000; + // + // =========================================================================== + xdr.const("TX_ADVERT_VECTOR_MAX_SIZE", 1000); + + // === xdr source ============================================================ + // + // typedef Hash TxAdvertVector; + // + // =========================================================================== + xdr.typedef( + "TxAdvertVector", + xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_ADVERT_VECTOR_MAX_SIZE")) + ); + + // === xdr source ============================================================ + // + // struct FloodAdvert + // { + // TxAdvertVector txHashes; + // }; + // + // =========================================================================== + xdr.struct("FloodAdvert", [["txHashes", xdr.lookup("TxAdvertVector")]]); + + // === xdr source ============================================================ + // + // const TX_DEMAND_VECTOR_MAX_SIZE = 1000; + // + // =========================================================================== + xdr.const("TX_DEMAND_VECTOR_MAX_SIZE", 1000); + + // === xdr source ============================================================ + // + // typedef Hash TxDemandVector; + // + // =========================================================================== + xdr.typedef( + "TxDemandVector", + xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_DEMAND_VECTOR_MAX_SIZE")) + ); + + // === xdr source ============================================================ + // + // struct FloodDemand + // { + // TxDemandVector txHashes; + // }; + // + // =========================================================================== + xdr.struct("FloodDemand", [["txHashes", xdr.lookup("TxDemandVector")]]); + + // === xdr source ============================================================ + // + // union StellarMessage switch (MessageType type) + // { + // case ERROR_MSG: + // Error error; + // case HELLO: + // Hello hello; + // case AUTH: + // Auth auth; + // case DONT_HAVE: + // DontHave dontHave; + // case GET_PEERS: + // void; + // case PEERS: + // PeerAddress peers<100>; + // + // case GET_TX_SET: + // uint256 txSetHash; + // case TX_SET: + // TransactionSet txSet; + // case GENERALIZED_TX_SET: + // GeneralizedTransactionSet generalizedTxSet; + // + // case TRANSACTION: + // TransactionEnvelope transaction; + // + // case SURVEY_REQUEST: + // SignedSurveyRequestMessage signedSurveyRequestMessage; + // + // case SURVEY_RESPONSE: + // SignedSurveyResponseMessage signedSurveyResponseMessage; + // + // // SCP + // case GET_SCP_QUORUMSET: + // uint256 qSetHash; + // case SCP_QUORUMSET: + // SCPQuorumSet qSet; + // case SCP_MESSAGE: + // SCPEnvelope envelope; + // case GET_SCP_STATE: + // uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest + // case SEND_MORE: + // SendMore sendMoreMessage; + // case SEND_MORE_EXTENDED: + // SendMoreExtended sendMoreExtendedMessage; + // // Pull mode + // case FLOOD_ADVERT: + // FloodAdvert floodAdvert; + // case FLOOD_DEMAND: + // FloodDemand floodDemand; + // }; + // + // =========================================================================== + xdr.union("StellarMessage", { + switchOn: xdr.lookup("MessageType"), + switchName: "type", + switches: [ + ["errorMsg", "error"], + ["hello", "hello"], + ["auth", "auth"], + ["dontHave", "dontHave"], + ["getPeers", xdr.void()], + ["peers", "peers"], + ["getTxSet", "txSetHash"], + ["txSet", "txSet"], + ["generalizedTxSet", "generalizedTxSet"], + ["transaction", "transaction"], + ["surveyRequest", "signedSurveyRequestMessage"], + ["surveyResponse", "signedSurveyResponseMessage"], + ["getScpQuorumset", "qSetHash"], + ["scpQuorumset", "qSet"], + ["scpMessage", "envelope"], + ["getScpState", "getScpLedgerSeq"], + ["sendMore", "sendMoreMessage"], + ["sendMoreExtended", "sendMoreExtendedMessage"], + ["floodAdvert", "floodAdvert"], + ["floodDemand", "floodDemand"], + ], + arms: { + error: xdr.lookup("Error"), + hello: xdr.lookup("Hello"), + auth: xdr.lookup("Auth"), + dontHave: xdr.lookup("DontHave"), + peers: xdr.varArray(xdr.lookup("PeerAddress"), 100), + txSetHash: xdr.lookup("Uint256"), + txSet: xdr.lookup("TransactionSet"), + generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), + transaction: xdr.lookup("TransactionEnvelope"), + signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), + signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), + qSetHash: xdr.lookup("Uint256"), + qSet: xdr.lookup("ScpQuorumSet"), + envelope: xdr.lookup("ScpEnvelope"), + getScpLedgerSeq: xdr.lookup("Uint32"), + sendMoreMessage: xdr.lookup("SendMore"), + sendMoreExtendedMessage: xdr.lookup("SendMoreExtended"), + floodAdvert: xdr.lookup("FloodAdvert"), + floodDemand: xdr.lookup("FloodDemand"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // uint64 sequence; + // StellarMessage message; + // HmacSha256Mac mac; + // } + // + // =========================================================================== + xdr.struct("AuthenticatedMessageV0", [ + ["sequence", xdr.lookup("Uint64")], + ["message", xdr.lookup("StellarMessage")], + ["mac", xdr.lookup("HmacSha256Mac")], + ]); + + // === xdr source ============================================================ + // + // union AuthenticatedMessage switch (uint32 v) + // { + // case 0: + // struct + // { + // uint64 sequence; + // StellarMessage message; + // HmacSha256Mac mac; + // } v0; + // }; + // + // =========================================================================== + xdr.union("AuthenticatedMessage", { + switchOn: xdr.lookup("Uint32"), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("AuthenticatedMessageV0"), + }, + }); + + // === xdr source ============================================================ + // + // const MAX_OPS_PER_TX = 100; + // + // =========================================================================== + xdr.const("MAX_OPS_PER_TX", 100); + + // === xdr source ============================================================ + // + // union LiquidityPoolParameters switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // LiquidityPoolConstantProductParameters constantProduct; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolParameters", { + switchOn: xdr.lookup("LiquidityPoolType"), + switchName: "type", + switches: [["liquidityPoolConstantProduct", "constantProduct"]], + arms: { + constantProduct: xdr.lookup("LiquidityPoolConstantProductParameters"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // uint64 id; + // uint256 ed25519; + // } + // + // =========================================================================== + xdr.struct("MuxedAccountMed25519", [ + ["id", xdr.lookup("Uint64")], + ["ed25519", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // union MuxedAccount switch (CryptoKeyType type) + // { + // case KEY_TYPE_ED25519: + // uint256 ed25519; + // case KEY_TYPE_MUXED_ED25519: + // struct + // { + // uint64 id; + // uint256 ed25519; + // } med25519; + // }; + // + // =========================================================================== + xdr.union("MuxedAccount", { + switchOn: xdr.lookup("CryptoKeyType"), + switchName: "type", + switches: [ + ["keyTypeEd25519", "ed25519"], + ["keyTypeMuxedEd25519", "med25519"], + ], + arms: { + ed25519: xdr.lookup("Uint256"), + med25519: xdr.lookup("MuxedAccountMed25519"), + }, + }); + + // === xdr source ============================================================ + // + // struct DecoratedSignature + // { + // SignatureHint hint; // last 4 bytes of the public key, used as a hint + // Signature signature; // actual signature + // }; + // + // =========================================================================== + xdr.struct("DecoratedSignature", [ + ["hint", xdr.lookup("SignatureHint")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // enum OperationType + // { + // CREATE_ACCOUNT = 0, + // PAYMENT = 1, + // PATH_PAYMENT_STRICT_RECEIVE = 2, + // MANAGE_SELL_OFFER = 3, + // CREATE_PASSIVE_SELL_OFFER = 4, + // SET_OPTIONS = 5, + // CHANGE_TRUST = 6, + // ALLOW_TRUST = 7, + // ACCOUNT_MERGE = 8, + // INFLATION = 9, + // MANAGE_DATA = 10, + // BUMP_SEQUENCE = 11, + // MANAGE_BUY_OFFER = 12, + // PATH_PAYMENT_STRICT_SEND = 13, + // CREATE_CLAIMABLE_BALANCE = 14, + // CLAIM_CLAIMABLE_BALANCE = 15, + // BEGIN_SPONSORING_FUTURE_RESERVES = 16, + // END_SPONSORING_FUTURE_RESERVES = 17, + // REVOKE_SPONSORSHIP = 18, + // CLAWBACK = 19, + // CLAWBACK_CLAIMABLE_BALANCE = 20, + // SET_TRUST_LINE_FLAGS = 21, + // LIQUIDITY_POOL_DEPOSIT = 22, + // LIQUIDITY_POOL_WITHDRAW = 23, + // INVOKE_HOST_FUNCTION = 24, + // BUMP_FOOTPRINT_EXPIRATION = 25, + // RESTORE_FOOTPRINT = 26 + // }; + // + // =========================================================================== + xdr.enum("OperationType", { + createAccount: 0, + payment: 1, + pathPaymentStrictReceive: 2, + manageSellOffer: 3, + createPassiveSellOffer: 4, + setOptions: 5, + changeTrust: 6, + allowTrust: 7, + accountMerge: 8, + inflation: 9, + manageData: 10, + bumpSequence: 11, + manageBuyOffer: 12, + pathPaymentStrictSend: 13, + createClaimableBalance: 14, + claimClaimableBalance: 15, + beginSponsoringFutureReserves: 16, + endSponsoringFutureReserves: 17, + revokeSponsorship: 18, + clawback: 19, + clawbackClaimableBalance: 20, + setTrustLineFlags: 21, + liquidityPoolDeposit: 22, + liquidityPoolWithdraw: 23, + invokeHostFunction: 24, + bumpFootprintExpiration: 25, + restoreFootprint: 26, + }); + + // === xdr source ============================================================ + // + // struct CreateAccountOp + // { + // AccountID destination; // account to create + // int64 startingBalance; // amount they end up with + // }; + // + // =========================================================================== + xdr.struct("CreateAccountOp", [ + ["destination", xdr.lookup("AccountId")], + ["startingBalance", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct PaymentOp + // { + // MuxedAccount destination; // recipient of the payment + // Asset asset; // what they end up with + // int64 amount; // amount they end up with + // }; + // + // =========================================================================== + xdr.struct("PaymentOp", [ + ["destination", xdr.lookup("MuxedAccount")], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct PathPaymentStrictReceiveOp + // { + // Asset sendAsset; // asset we pay with + // int64 sendMax; // the maximum amount of sendAsset to + // // send (excluding fees). + // // The operation will fail if can't be met + // + // MuxedAccount destination; // recipient of the payment + // Asset destAsset; // what they end up with + // int64 destAmount; // amount they end up with + // + // Asset path<5>; // additional hops it must go through to get there + // }; + // + // =========================================================================== + xdr.struct("PathPaymentStrictReceiveOp", [ + ["sendAsset", xdr.lookup("Asset")], + ["sendMax", xdr.lookup("Int64")], + ["destination", xdr.lookup("MuxedAccount")], + ["destAsset", xdr.lookup("Asset")], + ["destAmount", xdr.lookup("Int64")], + ["path", xdr.varArray(xdr.lookup("Asset"), 5)], + ]); + + // === xdr source ============================================================ + // + // struct PathPaymentStrictSendOp + // { + // Asset sendAsset; // asset we pay with + // int64 sendAmount; // amount of sendAsset to send (excluding fees) + // + // MuxedAccount destination; // recipient of the payment + // Asset destAsset; // what they end up with + // int64 destMin; // the minimum amount of dest asset to + // // be received + // // The operation will fail if it can't be met + // + // Asset path<5>; // additional hops it must go through to get there + // }; + // + // =========================================================================== + xdr.struct("PathPaymentStrictSendOp", [ + ["sendAsset", xdr.lookup("Asset")], + ["sendAmount", xdr.lookup("Int64")], + ["destination", xdr.lookup("MuxedAccount")], + ["destAsset", xdr.lookup("Asset")], + ["destMin", xdr.lookup("Int64")], + ["path", xdr.varArray(xdr.lookup("Asset"), 5)], + ]); + + // === xdr source ============================================================ + // + // struct ManageSellOfferOp + // { + // Asset selling; + // Asset buying; + // int64 amount; // amount being sold. if set to 0, delete the offer + // Price price; // price of thing being sold in terms of what you are buying + // + // // 0=create a new offer, otherwise edit an existing offer + // int64 offerID; + // }; + // + // =========================================================================== + xdr.struct("ManageSellOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ManageBuyOfferOp + // { + // Asset selling; + // Asset buying; + // int64 buyAmount; // amount being bought. if set to 0, delete the offer + // Price price; // price of thing being bought in terms of what you are + // // selling + // + // // 0=create a new offer, otherwise edit an existing offer + // int64 offerID; + // }; + // + // =========================================================================== + xdr.struct("ManageBuyOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["buyAmount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct CreatePassiveSellOfferOp + // { + // Asset selling; // A + // Asset buying; // B + // int64 amount; // amount taker gets + // Price price; // cost of A in terms of B + // }; + // + // =========================================================================== + xdr.struct("CreatePassiveSellOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ]); + + // === xdr source ============================================================ + // + // struct SetOptionsOp + // { + // AccountID* inflationDest; // sets the inflation destination + // + // uint32* clearFlags; // which flags to clear + // uint32* setFlags; // which flags to set + // + // // account threshold manipulation + // uint32* masterWeight; // weight of the master account + // uint32* lowThreshold; + // uint32* medThreshold; + // uint32* highThreshold; + // + // string32* homeDomain; // sets the home domain + // + // // Add, update or remove a signer for the account + // // signer is deleted if the weight is 0 + // Signer* signer; + // }; + // + // =========================================================================== + xdr.struct("SetOptionsOp", [ + ["inflationDest", xdr.option(xdr.lookup("AccountId"))], + ["clearFlags", xdr.option(xdr.lookup("Uint32"))], + ["setFlags", xdr.option(xdr.lookup("Uint32"))], + ["masterWeight", xdr.option(xdr.lookup("Uint32"))], + ["lowThreshold", xdr.option(xdr.lookup("Uint32"))], + ["medThreshold", xdr.option(xdr.lookup("Uint32"))], + ["highThreshold", xdr.option(xdr.lookup("Uint32"))], + ["homeDomain", xdr.option(xdr.lookup("String32"))], + ["signer", xdr.option(xdr.lookup("Signer"))], + ]); + + // === xdr source ============================================================ + // + // union ChangeTrustAsset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // case ASSET_TYPE_POOL_SHARE: + // LiquidityPoolParameters liquidityPool; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("ChangeTrustAsset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ["assetTypePoolShare", "liquidityPool"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + liquidityPool: xdr.lookup("LiquidityPoolParameters"), + }, + }); + + // === xdr source ============================================================ + // + // struct ChangeTrustOp + // { + // ChangeTrustAsset line; + // + // // if limit is set to 0, deletes the trust line + // int64 limit; + // }; + // + // =========================================================================== + xdr.struct("ChangeTrustOp", [ + ["line", xdr.lookup("ChangeTrustAsset")], + ["limit", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct AllowTrustOp + // { + // AccountID trustor; + // AssetCode asset; + // + // // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG + // uint32 authorize; + // }; + // + // =========================================================================== + xdr.struct("AllowTrustOp", [ + ["trustor", xdr.lookup("AccountId")], + ["asset", xdr.lookup("AssetCode")], + ["authorize", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ManageDataOp + // { + // string64 dataName; + // DataValue* dataValue; // set to null to clear + // }; + // + // =========================================================================== + xdr.struct("ManageDataOp", [ + ["dataName", xdr.lookup("String64")], + ["dataValue", xdr.option(xdr.lookup("DataValue"))], + ]); + + // === xdr source ============================================================ + // + // struct BumpSequenceOp + // { + // SequenceNumber bumpTo; + // }; + // + // =========================================================================== + xdr.struct("BumpSequenceOp", [["bumpTo", xdr.lookup("SequenceNumber")]]); + + // === xdr source ============================================================ + // + // struct CreateClaimableBalanceOp + // { + // Asset asset; + // int64 amount; + // Claimant claimants<10>; + // }; + // + // =========================================================================== + xdr.struct("CreateClaimableBalanceOp", [ + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], + ]); + + // === xdr source ============================================================ + // + // struct ClaimClaimableBalanceOp + // { + // ClaimableBalanceID balanceID; + // }; + // + // =========================================================================== + xdr.struct("ClaimClaimableBalanceOp", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct BeginSponsoringFutureReservesOp + // { + // AccountID sponsoredID; + // }; + // + // =========================================================================== + xdr.struct("BeginSponsoringFutureReservesOp", [ + ["sponsoredId", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // enum RevokeSponsorshipType + // { + // REVOKE_SPONSORSHIP_LEDGER_ENTRY = 0, + // REVOKE_SPONSORSHIP_SIGNER = 1 + // }; + // + // =========================================================================== + xdr.enum("RevokeSponsorshipType", { + revokeSponsorshipLedgerEntry: 0, + revokeSponsorshipSigner: 1, + }); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // SignerKey signerKey; + // } + // + // =========================================================================== + xdr.struct("RevokeSponsorshipOpSigner", [ + ["accountId", xdr.lookup("AccountId")], + ["signerKey", xdr.lookup("SignerKey")], + ]); + + // === xdr source ============================================================ + // + // union RevokeSponsorshipOp switch (RevokeSponsorshipType type) + // { + // case REVOKE_SPONSORSHIP_LEDGER_ENTRY: + // LedgerKey ledgerKey; + // case REVOKE_SPONSORSHIP_SIGNER: + // struct + // { + // AccountID accountID; + // SignerKey signerKey; + // } signer; + // }; + // + // =========================================================================== + xdr.union("RevokeSponsorshipOp", { + switchOn: xdr.lookup("RevokeSponsorshipType"), + switchName: "type", + switches: [ + ["revokeSponsorshipLedgerEntry", "ledgerKey"], + ["revokeSponsorshipSigner", "signer"], + ], + arms: { + ledgerKey: xdr.lookup("LedgerKey"), + signer: xdr.lookup("RevokeSponsorshipOpSigner"), + }, + }); + + // === xdr source ============================================================ + // + // struct ClawbackOp + // { + // Asset asset; + // MuxedAccount from; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("ClawbackOp", [ + ["asset", xdr.lookup("Asset")], + ["from", xdr.lookup("MuxedAccount")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClawbackClaimableBalanceOp + // { + // ClaimableBalanceID balanceID; + // }; + // + // =========================================================================== + xdr.struct("ClawbackClaimableBalanceOp", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct SetTrustLineFlagsOp + // { + // AccountID trustor; + // Asset asset; + // + // uint32 clearFlags; // which flags to clear + // uint32 setFlags; // which flags to set + // }; + // + // =========================================================================== + xdr.struct("SetTrustLineFlagsOp", [ + ["trustor", xdr.lookup("AccountId")], + ["asset", xdr.lookup("Asset")], + ["clearFlags", xdr.lookup("Uint32")], + ["setFlags", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // const LIQUIDITY_POOL_FEE_V18 = 30; + // + // =========================================================================== + xdr.const("LIQUIDITY_POOL_FEE_V18", 30); + + // === xdr source ============================================================ + // + // struct LiquidityPoolDepositOp + // { + // PoolID liquidityPoolID; + // int64 maxAmountA; // maximum amount of first asset to deposit + // int64 maxAmountB; // maximum amount of second asset to deposit + // Price minPrice; // minimum depositA/depositB + // Price maxPrice; // maximum depositA/depositB + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolDepositOp", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["maxAmountA", xdr.lookup("Int64")], + ["maxAmountB", xdr.lookup("Int64")], + ["minPrice", xdr.lookup("Price")], + ["maxPrice", xdr.lookup("Price")], + ]); + + // === xdr source ============================================================ + // + // struct LiquidityPoolWithdrawOp + // { + // PoolID liquidityPoolID; + // int64 amount; // amount of pool shares to withdraw + // int64 minAmountA; // minimum amount of first asset to withdraw + // int64 minAmountB; // minimum amount of second asset to withdraw + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolWithdrawOp", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["amount", xdr.lookup("Int64")], + ["minAmountA", xdr.lookup("Int64")], + ["minAmountB", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum HostFunctionType + // { + // HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, + // HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, + // HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 + // }; + // + // =========================================================================== + xdr.enum("HostFunctionType", { + hostFunctionTypeInvokeContract: 0, + hostFunctionTypeCreateContract: 1, + hostFunctionTypeUploadContractWasm: 2, + }); + + // === xdr source ============================================================ + // + // enum ContractIDPreimageType + // { + // CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0, + // CONTRACT_ID_PREIMAGE_FROM_ASSET = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractIdPreimageType", { + contractIdPreimageFromAddress: 0, + contractIdPreimageFromAsset: 1, + }); + + // === xdr source ============================================================ + // + // struct + // { + // SCAddress address; + // uint256 salt; + // } + // + // =========================================================================== + xdr.struct("ContractIdPreimageFromAddress", [ + ["address", xdr.lookup("ScAddress")], + ["salt", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // union ContractIDPreimage switch (ContractIDPreimageType type) + // { + // case CONTRACT_ID_PREIMAGE_FROM_ADDRESS: + // struct + // { + // SCAddress address; + // uint256 salt; + // } fromAddress; + // case CONTRACT_ID_PREIMAGE_FROM_ASSET: + // Asset fromAsset; + // }; + // + // =========================================================================== + xdr.union("ContractIdPreimage", { + switchOn: xdr.lookup("ContractIdPreimageType"), + switchName: "type", + switches: [ + ["contractIdPreimageFromAddress", "fromAddress"], + ["contractIdPreimageFromAsset", "fromAsset"], + ], + arms: { + fromAddress: xdr.lookup("ContractIdPreimageFromAddress"), + fromAsset: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // struct CreateContractArgs + // { + // ContractIDPreimage contractIDPreimage; + // ContractExecutable executable; + // }; + // + // =========================================================================== + xdr.struct("CreateContractArgs", [ + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ["executable", xdr.lookup("ContractExecutable")], + ]); + + // === xdr source ============================================================ + // + // struct InvokeContractArgs { + // SCAddress contractAddress; + // SCSymbol functionName; + // SCVal args<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeContractArgs", [ + ["contractAddress", xdr.lookup("ScAddress")], + ["functionName", xdr.lookup("ScSymbol")], + ["args", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union HostFunction switch (HostFunctionType type) + // { + // case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: + // InvokeContractArgs invokeContract; + // case HOST_FUNCTION_TYPE_CREATE_CONTRACT: + // CreateContractArgs createContract; + // case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: + // opaque wasm<>; + // }; + // + // =========================================================================== + xdr.union("HostFunction", { + switchOn: xdr.lookup("HostFunctionType"), + switchName: "type", + switches: [ + ["hostFunctionTypeInvokeContract", "invokeContract"], + ["hostFunctionTypeCreateContract", "createContract"], + ["hostFunctionTypeUploadContractWasm", "wasm"], + ], + arms: { + invokeContract: xdr.lookup("InvokeContractArgs"), + createContract: xdr.lookup("CreateContractArgs"), + wasm: xdr.varOpaque(), + }, + }); + + // === xdr source ============================================================ + // + // enum SorobanAuthorizedFunctionType + // { + // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, + // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 + // }; + // + // =========================================================================== + xdr.enum("SorobanAuthorizedFunctionType", { + sorobanAuthorizedFunctionTypeContractFn: 0, + sorobanAuthorizedFunctionTypeCreateContractHostFn: 1, + }); + + // === xdr source ============================================================ + // + // union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) + // { + // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: + // InvokeContractArgs contractFn; + // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: + // CreateContractArgs createContractHostFn; + // }; + // + // =========================================================================== + xdr.union("SorobanAuthorizedFunction", { + switchOn: xdr.lookup("SorobanAuthorizedFunctionType"), + switchName: "type", + switches: [ + ["sorobanAuthorizedFunctionTypeContractFn", "contractFn"], + [ + "sorobanAuthorizedFunctionTypeCreateContractHostFn", + "createContractHostFn", + ], + ], + arms: { + contractFn: xdr.lookup("InvokeContractArgs"), + createContractHostFn: xdr.lookup("CreateContractArgs"), + }, + }); + + // === xdr source ============================================================ + // + // struct SorobanAuthorizedInvocation + // { + // SorobanAuthorizedFunction function; + // SorobanAuthorizedInvocation subInvocations<>; + // }; + // + // =========================================================================== + xdr.struct("SorobanAuthorizedInvocation", [ + ["function", xdr.lookup("SorobanAuthorizedFunction")], + [ + "subInvocations", + xdr.varArray(xdr.lookup("SorobanAuthorizedInvocation"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // struct SorobanAddressCredentials + // { + // SCAddress address; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SCVal signature; + // }; + // + // =========================================================================== + xdr.struct("SorobanAddressCredentials", [ + ["address", xdr.lookup("ScAddress")], + ["nonce", xdr.lookup("Int64")], + ["signatureExpirationLedger", xdr.lookup("Uint32")], + ["signature", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // enum SorobanCredentialsType + // { + // SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0, + // SOROBAN_CREDENTIALS_ADDRESS = 1 + // }; + // + // =========================================================================== + xdr.enum("SorobanCredentialsType", { + sorobanCredentialsSourceAccount: 0, + sorobanCredentialsAddress: 1, + }); + + // === xdr source ============================================================ + // + // union SorobanCredentials switch (SorobanCredentialsType type) + // { + // case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT: + // void; + // case SOROBAN_CREDENTIALS_ADDRESS: + // SorobanAddressCredentials address; + // }; + // + // =========================================================================== + xdr.union("SorobanCredentials", { + switchOn: xdr.lookup("SorobanCredentialsType"), + switchName: "type", + switches: [ + ["sorobanCredentialsSourceAccount", xdr.void()], + ["sorobanCredentialsAddress", "address"], + ], + arms: { + address: xdr.lookup("SorobanAddressCredentials"), + }, + }); + + // === xdr source ============================================================ + // + // struct SorobanAuthorizationEntry + // { + // SorobanCredentials credentials; + // SorobanAuthorizedInvocation rootInvocation; + // }; + // + // =========================================================================== + xdr.struct("SorobanAuthorizationEntry", [ + ["credentials", xdr.lookup("SorobanCredentials")], + ["rootInvocation", xdr.lookup("SorobanAuthorizedInvocation")], + ]); + + // === xdr source ============================================================ + // + // struct InvokeHostFunctionOp + // { + // // Host function to invoke. + // HostFunction hostFunction; + // // Per-address authorizations for this host function. + // SorobanAuthorizationEntry auth<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeHostFunctionOp", [ + ["hostFunction", xdr.lookup("HostFunction")], + ["auth", xdr.varArray(xdr.lookup("SorobanAuthorizationEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct BumpFootprintExpirationOp + // { + // ExtensionPoint ext; + // uint32 ledgersToExpire; + // }; + // + // =========================================================================== + xdr.struct("BumpFootprintExpirationOp", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["ledgersToExpire", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct RestoreFootprintOp + // { + // ExtensionPoint ext; + // }; + // + // =========================================================================== + xdr.struct("RestoreFootprintOp", [["ext", xdr.lookup("ExtensionPoint")]]); + + // === xdr source ============================================================ + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountOp createAccountOp; + // case PAYMENT: + // PaymentOp paymentOp; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; + // case MANAGE_SELL_OFFER: + // ManageSellOfferOp manageSellOfferOp; + // case CREATE_PASSIVE_SELL_OFFER: + // CreatePassiveSellOfferOp createPassiveSellOfferOp; + // case SET_OPTIONS: + // SetOptionsOp setOptionsOp; + // case CHANGE_TRUST: + // ChangeTrustOp changeTrustOp; + // case ALLOW_TRUST: + // AllowTrustOp allowTrustOp; + // case ACCOUNT_MERGE: + // MuxedAccount destination; + // case INFLATION: + // void; + // case MANAGE_DATA: + // ManageDataOp manageDataOp; + // case BUMP_SEQUENCE: + // BumpSequenceOp bumpSequenceOp; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferOp manageBuyOfferOp; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendOp pathPaymentStrictSendOp; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceOp createClaimableBalanceOp; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceOp claimClaimableBalanceOp; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; + // case END_SPONSORING_FUTURE_RESERVES: + // void; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipOp revokeSponsorshipOp; + // case CLAWBACK: + // ClawbackOp clawbackOp; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsOp setTrustLineFlagsOp; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositOp liquidityPoolDepositOp; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionOp invokeHostFunctionOp; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case RESTORE_FOOTPRINT: + // RestoreFootprintOp restoreFootprintOp; + // } + // + // =========================================================================== + xdr.union("OperationBody", { + switchOn: xdr.lookup("OperationType"), + switchName: "type", + switches: [ + ["createAccount", "createAccountOp"], + ["payment", "paymentOp"], + ["pathPaymentStrictReceive", "pathPaymentStrictReceiveOp"], + ["manageSellOffer", "manageSellOfferOp"], + ["createPassiveSellOffer", "createPassiveSellOfferOp"], + ["setOptions", "setOptionsOp"], + ["changeTrust", "changeTrustOp"], + ["allowTrust", "allowTrustOp"], + ["accountMerge", "destination"], + ["inflation", xdr.void()], + ["manageData", "manageDataOp"], + ["bumpSequence", "bumpSequenceOp"], + ["manageBuyOffer", "manageBuyOfferOp"], + ["pathPaymentStrictSend", "pathPaymentStrictSendOp"], + ["createClaimableBalance", "createClaimableBalanceOp"], + ["claimClaimableBalance", "claimClaimableBalanceOp"], + ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesOp"], + ["endSponsoringFutureReserves", xdr.void()], + ["revokeSponsorship", "revokeSponsorshipOp"], + ["clawback", "clawbackOp"], + ["clawbackClaimableBalance", "clawbackClaimableBalanceOp"], + ["setTrustLineFlags", "setTrustLineFlagsOp"], + ["liquidityPoolDeposit", "liquidityPoolDepositOp"], + ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], + ["invokeHostFunction", "invokeHostFunctionOp"], + ["bumpFootprintExpiration", "bumpFootprintExpirationOp"], + ["restoreFootprint", "restoreFootprintOp"], + ], + arms: { + createAccountOp: xdr.lookup("CreateAccountOp"), + paymentOp: xdr.lookup("PaymentOp"), + pathPaymentStrictReceiveOp: xdr.lookup("PathPaymentStrictReceiveOp"), + manageSellOfferOp: xdr.lookup("ManageSellOfferOp"), + createPassiveSellOfferOp: xdr.lookup("CreatePassiveSellOfferOp"), + setOptionsOp: xdr.lookup("SetOptionsOp"), + changeTrustOp: xdr.lookup("ChangeTrustOp"), + allowTrustOp: xdr.lookup("AllowTrustOp"), + destination: xdr.lookup("MuxedAccount"), + manageDataOp: xdr.lookup("ManageDataOp"), + bumpSequenceOp: xdr.lookup("BumpSequenceOp"), + manageBuyOfferOp: xdr.lookup("ManageBuyOfferOp"), + pathPaymentStrictSendOp: xdr.lookup("PathPaymentStrictSendOp"), + createClaimableBalanceOp: xdr.lookup("CreateClaimableBalanceOp"), + claimClaimableBalanceOp: xdr.lookup("ClaimClaimableBalanceOp"), + beginSponsoringFutureReservesOp: xdr.lookup( + "BeginSponsoringFutureReservesOp" + ), + revokeSponsorshipOp: xdr.lookup("RevokeSponsorshipOp"), + clawbackOp: xdr.lookup("ClawbackOp"), + clawbackClaimableBalanceOp: xdr.lookup("ClawbackClaimableBalanceOp"), + setTrustLineFlagsOp: xdr.lookup("SetTrustLineFlagsOp"), + liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), + liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), + invokeHostFunctionOp: xdr.lookup("InvokeHostFunctionOp"), + bumpFootprintExpirationOp: xdr.lookup("BumpFootprintExpirationOp"), + restoreFootprintOp: xdr.lookup("RestoreFootprintOp"), + }, + }); + + // === xdr source ============================================================ + // + // struct Operation + // { + // // sourceAccount is the account used to run the operation + // // if not set, the runtime defaults to "sourceAccount" specified at + // // the transaction level + // MuxedAccount* sourceAccount; + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountOp createAccountOp; + // case PAYMENT: + // PaymentOp paymentOp; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; + // case MANAGE_SELL_OFFER: + // ManageSellOfferOp manageSellOfferOp; + // case CREATE_PASSIVE_SELL_OFFER: + // CreatePassiveSellOfferOp createPassiveSellOfferOp; + // case SET_OPTIONS: + // SetOptionsOp setOptionsOp; + // case CHANGE_TRUST: + // ChangeTrustOp changeTrustOp; + // case ALLOW_TRUST: + // AllowTrustOp allowTrustOp; + // case ACCOUNT_MERGE: + // MuxedAccount destination; + // case INFLATION: + // void; + // case MANAGE_DATA: + // ManageDataOp manageDataOp; + // case BUMP_SEQUENCE: + // BumpSequenceOp bumpSequenceOp; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferOp manageBuyOfferOp; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendOp pathPaymentStrictSendOp; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceOp createClaimableBalanceOp; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceOp claimClaimableBalanceOp; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; + // case END_SPONSORING_FUTURE_RESERVES: + // void; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipOp revokeSponsorshipOp; + // case CLAWBACK: + // ClawbackOp clawbackOp; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsOp setTrustLineFlagsOp; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositOp liquidityPoolDepositOp; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionOp invokeHostFunctionOp; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case RESTORE_FOOTPRINT: + // RestoreFootprintOp restoreFootprintOp; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("Operation", [ + ["sourceAccount", xdr.option(xdr.lookup("MuxedAccount"))], + ["body", xdr.lookup("OperationBody")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageOperationId", [ + ["sourceAccount", xdr.lookup("AccountId")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["opNum", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // PoolID liquidityPoolID; + // Asset asset; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageRevokeId", [ + ["sourceAccount", xdr.lookup("AccountId")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["opNum", xdr.lookup("Uint32")], + ["liquidityPoolId", xdr.lookup("PoolId")], + ["asset", xdr.lookup("Asset")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash networkID; + // ContractIDPreimage contractIDPreimage; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageContractId", [ + ["networkId", xdr.lookup("Hash")], + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash networkID; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SorobanAuthorizedInvocation invocation; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageSorobanAuthorization", [ + ["networkId", xdr.lookup("Hash")], + ["nonce", xdr.lookup("Int64")], + ["signatureExpirationLedger", xdr.lookup("Uint32")], + ["invocation", xdr.lookup("SorobanAuthorizedInvocation")], + ]); + + // === xdr source ============================================================ + // + // union HashIDPreimage switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_OP_ID: + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // } operationID; + // case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // PoolID liquidityPoolID; + // Asset asset; + // } revokeID; + // case ENVELOPE_TYPE_CONTRACT_ID: + // struct + // { + // Hash networkID; + // ContractIDPreimage contractIDPreimage; + // } contractID; + // case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: + // struct + // { + // Hash networkID; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SorobanAuthorizedInvocation invocation; + // } sorobanAuthorization; + // }; + // + // =========================================================================== + xdr.union("HashIdPreimage", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeOpId", "operationId"], + ["envelopeTypePoolRevokeOpId", "revokeId"], + ["envelopeTypeContractId", "contractId"], + ["envelopeTypeSorobanAuthorization", "sorobanAuthorization"], + ], + arms: { + operationId: xdr.lookup("HashIdPreimageOperationId"), + revokeId: xdr.lookup("HashIdPreimageRevokeId"), + contractId: xdr.lookup("HashIdPreimageContractId"), + sorobanAuthorization: xdr.lookup("HashIdPreimageSorobanAuthorization"), + }, + }); + + // === xdr source ============================================================ + // + // enum MemoType + // { + // MEMO_NONE = 0, + // MEMO_TEXT = 1, + // MEMO_ID = 2, + // MEMO_HASH = 3, + // MEMO_RETURN = 4 + // }; + // + // =========================================================================== + xdr.enum("MemoType", { + memoNone: 0, + memoText: 1, + memoId: 2, + memoHash: 3, + memoReturn: 4, + }); + + // === xdr source ============================================================ + // + // union Memo switch (MemoType type) + // { + // case MEMO_NONE: + // void; + // case MEMO_TEXT: + // string text<28>; + // case MEMO_ID: + // uint64 id; + // case MEMO_HASH: + // Hash hash; // the hash of what to pull from the content server + // case MEMO_RETURN: + // Hash retHash; // the hash of the tx you are rejecting + // }; + // + // =========================================================================== + xdr.union("Memo", { + switchOn: xdr.lookup("MemoType"), + switchName: "type", + switches: [ + ["memoNone", xdr.void()], + ["memoText", "text"], + ["memoId", "id"], + ["memoHash", "hash"], + ["memoReturn", "retHash"], + ], + arms: { + text: xdr.string(28), + id: xdr.lookup("Uint64"), + hash: xdr.lookup("Hash"), + retHash: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // struct TimeBounds + // { + // TimePoint minTime; + // TimePoint maxTime; // 0 here means no maxTime + // }; + // + // =========================================================================== + xdr.struct("TimeBounds", [ + ["minTime", xdr.lookup("TimePoint")], + ["maxTime", xdr.lookup("TimePoint")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerBounds + // { + // uint32 minLedger; + // uint32 maxLedger; // 0 here means no maxLedger + // }; + // + // =========================================================================== + xdr.struct("LedgerBounds", [ + ["minLedger", xdr.lookup("Uint32")], + ["maxLedger", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct PreconditionsV2 + // { + // TimeBounds* timeBounds; + // + // // Transaction only valid for ledger numbers n such that + // // minLedger <= n < maxLedger (if maxLedger == 0, then + // // only minLedger is checked) + // LedgerBounds* ledgerBounds; + // + // // If NULL, only valid when sourceAccount's sequence number + // // is seqNum - 1. Otherwise, valid when sourceAccount's + // // sequence number n satisfies minSeqNum <= n < tx.seqNum. + // // Note that after execution the account's sequence number + // // is always raised to tx.seqNum, and a transaction is not + // // valid if tx.seqNum is too high to ensure replay protection. + // SequenceNumber* minSeqNum; + // + // // For the transaction to be valid, the current ledger time must + // // be at least minSeqAge greater than sourceAccount's seqTime. + // Duration minSeqAge; + // + // // For the transaction to be valid, the current ledger number + // // must be at least minSeqLedgerGap greater than sourceAccount's + // // seqLedger. + // uint32 minSeqLedgerGap; + // + // // 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. + // SignerKey extraSigners<2>; + // }; + // + // =========================================================================== + xdr.struct("PreconditionsV2", [ + ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], + ["ledgerBounds", xdr.option(xdr.lookup("LedgerBounds"))], + ["minSeqNum", xdr.option(xdr.lookup("SequenceNumber"))], + ["minSeqAge", xdr.lookup("Duration")], + ["minSeqLedgerGap", xdr.lookup("Uint32")], + ["extraSigners", xdr.varArray(xdr.lookup("SignerKey"), 2)], + ]); + + // === xdr source ============================================================ + // + // enum PreconditionType + // { + // PRECOND_NONE = 0, + // PRECOND_TIME = 1, + // PRECOND_V2 = 2 + // }; + // + // =========================================================================== + xdr.enum("PreconditionType", { + precondNone: 0, + precondTime: 1, + precondV2: 2, + }); + + // === xdr source ============================================================ + // + // union Preconditions switch (PreconditionType type) + // { + // case PRECOND_NONE: + // void; + // case PRECOND_TIME: + // TimeBounds timeBounds; + // case PRECOND_V2: + // PreconditionsV2 v2; + // }; + // + // =========================================================================== + xdr.union("Preconditions", { + switchOn: xdr.lookup("PreconditionType"), + switchName: "type", + switches: [ + ["precondNone", xdr.void()], + ["precondTime", "timeBounds"], + ["precondV2", "v2"], + ], + arms: { + timeBounds: xdr.lookup("TimeBounds"), + v2: xdr.lookup("PreconditionsV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerFootprint + // { + // LedgerKey readOnly<>; + // LedgerKey readWrite<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerFootprint", [ + ["readOnly", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ["readWrite", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct SorobanResources + // { + // // The ledger footprint of the transaction. + // LedgerFootprint footprint; + // // The maximum number of instructions this transaction can use + // uint32 instructions; + // + // // The maximum number of bytes this transaction can read from ledger + // uint32 readBytes; + // // The maximum number of bytes this transaction can write to ledger + // uint32 writeBytes; + // }; + // + // =========================================================================== + xdr.struct("SorobanResources", [ + ["footprint", xdr.lookup("LedgerFootprint")], + ["instructions", xdr.lookup("Uint32")], + ["readBytes", xdr.lookup("Uint32")], + ["writeBytes", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SorobanTransactionData + // { + // ExtensionPoint ext; + // SorobanResources resources; + // // Portion of transaction `fee` allocated to refundable fees. + // int64 refundableFee; + // }; + // + // =========================================================================== + xdr.struct("SorobanTransactionData", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["resources", xdr.lookup("SorobanResources")], + ["refundableFee", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionV0Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionV0 + // { + // uint256 sourceAccountEd25519; + // uint32 fee; + // SequenceNumber seqNum; + // TimeBounds* timeBounds; + // Memo memo; + // Operation operations; + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionV0", [ + ["sourceAccountEd25519", xdr.lookup("Uint256")], + ["fee", xdr.lookup("Uint32")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], + ["memo", xdr.lookup("Memo")], + [ + "operations", + xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX")), + ], + ["ext", xdr.lookup("TransactionV0Ext")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionV0Envelope + // { + // TransactionV0 tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("TransactionV0Envelope", [ + ["tx", xdr.lookup("TransactionV0")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // SorobanTransactionData sorobanData; + // } + // + // =========================================================================== + xdr.union("TransactionExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "sorobanData"], + ], + arms: { + sorobanData: xdr.lookup("SorobanTransactionData"), + }, + }); + + // === xdr source ============================================================ + // + // struct Transaction + // { + // // account used to run the transaction + // MuxedAccount sourceAccount; + // + // // the fee the sourceAccount will pay + // uint32 fee; + // + // // sequence number to consume in the account + // SequenceNumber seqNum; + // + // // validity conditions + // Preconditions cond; + // + // Memo memo; + // + // Operation operations; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // SorobanTransactionData sorobanData; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("Transaction", [ + ["sourceAccount", xdr.lookup("MuxedAccount")], + ["fee", xdr.lookup("Uint32")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["cond", xdr.lookup("Preconditions")], + ["memo", xdr.lookup("Memo")], + [ + "operations", + xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX")), + ], + ["ext", xdr.lookup("TransactionExt")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionV1Envelope + // { + // Transaction tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("TransactionV1Envelope", [ + ["tx", xdr.lookup("Transaction")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // } + // + // =========================================================================== + xdr.union("FeeBumpTransactionInnerTx", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [["envelopeTypeTx", "v1"]], + arms: { + v1: xdr.lookup("TransactionV1Envelope"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("FeeBumpTransactionExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct FeeBumpTransaction + // { + // MuxedAccount feeSource; + // int64 fee; + // union switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // } + // innerTx; + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("FeeBumpTransaction", [ + ["feeSource", xdr.lookup("MuxedAccount")], + ["fee", xdr.lookup("Int64")], + ["innerTx", xdr.lookup("FeeBumpTransactionInnerTx")], + ["ext", xdr.lookup("FeeBumpTransactionExt")], + ]); + + // === xdr source ============================================================ + // + // struct FeeBumpTransactionEnvelope + // { + // FeeBumpTransaction tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("FeeBumpTransactionEnvelope", [ + ["tx", xdr.lookup("FeeBumpTransaction")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union TransactionEnvelope switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX_V0: + // TransactionV0Envelope v0; + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransactionEnvelope feeBump; + // }; + // + // =========================================================================== + xdr.union("TransactionEnvelope", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeTxV0", "v0"], + ["envelopeTypeTx", "v1"], + ["envelopeTypeTxFeeBump", "feeBump"], + ], + arms: { + v0: xdr.lookup("TransactionV0Envelope"), + v1: xdr.lookup("TransactionV1Envelope"), + feeBump: xdr.lookup("FeeBumpTransactionEnvelope"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (EnvelopeType type) + // { + // // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 + // case ENVELOPE_TYPE_TX: + // Transaction tx; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransaction feeBump; + // } + // + // =========================================================================== + xdr.union("TransactionSignaturePayloadTaggedTransaction", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeTx", "tx"], + ["envelopeTypeTxFeeBump", "feeBump"], + ], + arms: { + tx: xdr.lookup("Transaction"), + feeBump: xdr.lookup("FeeBumpTransaction"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionSignaturePayload + // { + // Hash networkId; + // union switch (EnvelopeType type) + // { + // // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 + // case ENVELOPE_TYPE_TX: + // Transaction tx; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransaction feeBump; + // } + // taggedTransaction; + // }; + // + // =========================================================================== + xdr.struct("TransactionSignaturePayload", [ + ["networkId", xdr.lookup("Hash")], + [ + "taggedTransaction", + xdr.lookup("TransactionSignaturePayloadTaggedTransaction"), + ], + ]); + + // === xdr source ============================================================ + // + // enum ClaimAtomType + // { + // CLAIM_ATOM_TYPE_V0 = 0, + // CLAIM_ATOM_TYPE_ORDER_BOOK = 1, + // CLAIM_ATOM_TYPE_LIQUIDITY_POOL = 2 + // }; + // + // =========================================================================== + xdr.enum("ClaimAtomType", { + claimAtomTypeV0: 0, + claimAtomTypeOrderBook: 1, + claimAtomTypeLiquidityPool: 2, + }); + + // === xdr source ============================================================ + // + // struct ClaimOfferAtomV0 + // { + // // emitted to identify the offer + // uint256 sellerEd25519; // Account that owns the offer + // int64 offerID; + // + // // amount and asset taken from the owner + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the owner + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimOfferAtomV0", [ + ["sellerEd25519", xdr.lookup("Uint256")], + ["offerId", xdr.lookup("Int64")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClaimOfferAtom + // { + // // emitted to identify the offer + // AccountID sellerID; // Account that owns the offer + // int64 offerID; + // + // // amount and asset taken from the owner + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the owner + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimOfferAtom", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClaimLiquidityAtom + // { + // PoolID liquidityPoolID; + // + // // amount and asset taken from the pool + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the pool + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimLiquidityAtom", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union ClaimAtom switch (ClaimAtomType type) + // { + // case CLAIM_ATOM_TYPE_V0: + // ClaimOfferAtomV0 v0; + // case CLAIM_ATOM_TYPE_ORDER_BOOK: + // ClaimOfferAtom orderBook; + // case CLAIM_ATOM_TYPE_LIQUIDITY_POOL: + // ClaimLiquidityAtom liquidityPool; + // }; + // + // =========================================================================== + xdr.union("ClaimAtom", { + switchOn: xdr.lookup("ClaimAtomType"), + switchName: "type", + switches: [ + ["claimAtomTypeV0", "v0"], + ["claimAtomTypeOrderBook", "orderBook"], + ["claimAtomTypeLiquidityPool", "liquidityPool"], + ], + arms: { + v0: xdr.lookup("ClaimOfferAtomV0"), + orderBook: xdr.lookup("ClaimOfferAtom"), + liquidityPool: xdr.lookup("ClaimLiquidityAtom"), + }, + }); + + // === xdr source ============================================================ + // + // enum CreateAccountResultCode + // { + // // codes considered as "success" for the operation + // CREATE_ACCOUNT_SUCCESS = 0, // account was created + // + // // codes considered as "failure" for the operation + // CREATE_ACCOUNT_MALFORMED = -1, // invalid destination + // CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account + // CREATE_ACCOUNT_LOW_RESERVE = + // -3, // would create an account below the min reserve + // CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists + // }; + // + // =========================================================================== + xdr.enum("CreateAccountResultCode", { + createAccountSuccess: 0, + createAccountMalformed: -1, + createAccountUnderfunded: -2, + createAccountLowReserve: -3, + createAccountAlreadyExist: -4, + }); + + // === xdr source ============================================================ + // + // union CreateAccountResult switch (CreateAccountResultCode code) + // { + // case CREATE_ACCOUNT_SUCCESS: + // void; + // case CREATE_ACCOUNT_MALFORMED: + // case CREATE_ACCOUNT_UNDERFUNDED: + // case CREATE_ACCOUNT_LOW_RESERVE: + // case CREATE_ACCOUNT_ALREADY_EXIST: + // void; + // }; + // + // =========================================================================== + xdr.union("CreateAccountResult", { + switchOn: xdr.lookup("CreateAccountResultCode"), + switchName: "code", + switches: [ + ["createAccountSuccess", xdr.void()], + ["createAccountMalformed", xdr.void()], + ["createAccountUnderfunded", xdr.void()], + ["createAccountLowReserve", xdr.void()], + ["createAccountAlreadyExist", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum PaymentResultCode + // { + // // codes considered as "success" for the operation + // PAYMENT_SUCCESS = 0, // payment successfully completed + // + // // codes considered as "failure" for the operation + // PAYMENT_MALFORMED = -1, // bad input + // PAYMENT_UNDERFUNDED = -2, // not enough funds in source account + // PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account + // PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer + // PAYMENT_NO_DESTINATION = -5, // destination account does not exist + // PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset + // PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset + // PAYMENT_LINE_FULL = -8, // destination would go above their limit + // PAYMENT_NO_ISSUER = -9 // missing issuer on asset + // }; + // + // =========================================================================== + xdr.enum("PaymentResultCode", { + paymentSuccess: 0, + paymentMalformed: -1, + paymentUnderfunded: -2, + paymentSrcNoTrust: -3, + paymentSrcNotAuthorized: -4, + paymentNoDestination: -5, + paymentNoTrust: -6, + paymentNotAuthorized: -7, + paymentLineFull: -8, + paymentNoIssuer: -9, + }); + + // === xdr source ============================================================ + // + // union PaymentResult switch (PaymentResultCode code) + // { + // case PAYMENT_SUCCESS: + // void; + // case PAYMENT_MALFORMED: + // case PAYMENT_UNDERFUNDED: + // case PAYMENT_SRC_NO_TRUST: + // case PAYMENT_SRC_NOT_AUTHORIZED: + // case PAYMENT_NO_DESTINATION: + // case PAYMENT_NO_TRUST: + // case PAYMENT_NOT_AUTHORIZED: + // case PAYMENT_LINE_FULL: + // case PAYMENT_NO_ISSUER: + // void; + // }; + // + // =========================================================================== + xdr.union("PaymentResult", { + switchOn: xdr.lookup("PaymentResultCode"), + switchName: "code", + switches: [ + ["paymentSuccess", xdr.void()], + ["paymentMalformed", xdr.void()], + ["paymentUnderfunded", xdr.void()], + ["paymentSrcNoTrust", xdr.void()], + ["paymentSrcNotAuthorized", xdr.void()], + ["paymentNoDestination", xdr.void()], + ["paymentNoTrust", xdr.void()], + ["paymentNotAuthorized", xdr.void()], + ["paymentLineFull", xdr.void()], + ["paymentNoIssuer", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum PathPaymentStrictReceiveResultCode + // { + // // codes considered as "success" for the operation + // PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success + // + // // codes considered as "failure" for the operation + // PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input + // PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = + // -2, // not enough funds in source account + // PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = + // -3, // no trust line on source account + // PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = + // -4, // source not authorized to transfer + // PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = + // -5, // destination account does not exist + // PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = + // -6, // dest missing a trust line for asset + // PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = + // -7, // dest not authorized to hold asset + // PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = + // -8, // dest would go above their limit + // PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset + // PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = + // -10, // not enough offers to satisfy path + // PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = + // -11, // would cross one of its own offers + // PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax + // }; + // + // =========================================================================== + xdr.enum("PathPaymentStrictReceiveResultCode", { + pathPaymentStrictReceiveSuccess: 0, + pathPaymentStrictReceiveMalformed: -1, + pathPaymentStrictReceiveUnderfunded: -2, + pathPaymentStrictReceiveSrcNoTrust: -3, + pathPaymentStrictReceiveSrcNotAuthorized: -4, + pathPaymentStrictReceiveNoDestination: -5, + pathPaymentStrictReceiveNoTrust: -6, + pathPaymentStrictReceiveNotAuthorized: -7, + pathPaymentStrictReceiveLineFull: -8, + pathPaymentStrictReceiveNoIssuer: -9, + pathPaymentStrictReceiveTooFewOffers: -10, + pathPaymentStrictReceiveOfferCrossSelf: -11, + pathPaymentStrictReceiveOverSendmax: -12, + }); + + // === xdr source ============================================================ + // + // struct SimplePaymentResult + // { + // AccountID destination; + // Asset asset; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("SimplePaymentResult", [ + ["destination", xdr.lookup("AccountId")], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } + // + // =========================================================================== + xdr.struct("PathPaymentStrictReceiveResultSuccess", [ + ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["last", xdr.lookup("SimplePaymentResult")], + ]); + + // === xdr source ============================================================ + // + // union PathPaymentStrictReceiveResult switch ( + // PathPaymentStrictReceiveResultCode code) + // { + // case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS: + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } success; + // case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED: + // case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED: + // case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST: + // case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION: + // case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST: + // case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL: + // void; + // case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER: + // Asset noIssuer; // the asset that caused the error + // case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS: + // case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF: + // case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX: + // void; + // }; + // + // =========================================================================== + xdr.union("PathPaymentStrictReceiveResult", { + switchOn: xdr.lookup("PathPaymentStrictReceiveResultCode"), + switchName: "code", + switches: [ + ["pathPaymentStrictReceiveSuccess", "success"], + ["pathPaymentStrictReceiveMalformed", xdr.void()], + ["pathPaymentStrictReceiveUnderfunded", xdr.void()], + ["pathPaymentStrictReceiveSrcNoTrust", xdr.void()], + ["pathPaymentStrictReceiveSrcNotAuthorized", xdr.void()], + ["pathPaymentStrictReceiveNoDestination", xdr.void()], + ["pathPaymentStrictReceiveNoTrust", xdr.void()], + ["pathPaymentStrictReceiveNotAuthorized", xdr.void()], + ["pathPaymentStrictReceiveLineFull", xdr.void()], + ["pathPaymentStrictReceiveNoIssuer", "noIssuer"], + ["pathPaymentStrictReceiveTooFewOffers", xdr.void()], + ["pathPaymentStrictReceiveOfferCrossSelf", xdr.void()], + ["pathPaymentStrictReceiveOverSendmax", xdr.void()], + ], + arms: { + success: xdr.lookup("PathPaymentStrictReceiveResultSuccess"), + noIssuer: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // enum PathPaymentStrictSendResultCode + // { + // // codes considered as "success" for the operation + // PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success + // + // // codes considered as "failure" for the operation + // PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input + // PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = + // -2, // not enough funds in source account + // PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = + // -3, // no trust line on source account + // PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = + // -4, // source not authorized to transfer + // PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = + // -5, // destination account does not exist + // PATH_PAYMENT_STRICT_SEND_NO_TRUST = + // -6, // dest missing a trust line for asset + // PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = + // -7, // dest not authorized to hold asset + // PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit + // PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset + // PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = + // -10, // not enough offers to satisfy path + // PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = + // -11, // would cross one of its own offers + // PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin + // }; + // + // =========================================================================== + xdr.enum("PathPaymentStrictSendResultCode", { + pathPaymentStrictSendSuccess: 0, + pathPaymentStrictSendMalformed: -1, + pathPaymentStrictSendUnderfunded: -2, + pathPaymentStrictSendSrcNoTrust: -3, + pathPaymentStrictSendSrcNotAuthorized: -4, + pathPaymentStrictSendNoDestination: -5, + pathPaymentStrictSendNoTrust: -6, + pathPaymentStrictSendNotAuthorized: -7, + pathPaymentStrictSendLineFull: -8, + pathPaymentStrictSendNoIssuer: -9, + pathPaymentStrictSendTooFewOffers: -10, + pathPaymentStrictSendOfferCrossSelf: -11, + pathPaymentStrictSendUnderDestmin: -12, + }); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } + // + // =========================================================================== + xdr.struct("PathPaymentStrictSendResultSuccess", [ + ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["last", xdr.lookup("SimplePaymentResult")], + ]); + + // === xdr source ============================================================ + // + // union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code) + // { + // case PATH_PAYMENT_STRICT_SEND_SUCCESS: + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } success; + // case PATH_PAYMENT_STRICT_SEND_MALFORMED: + // case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED: + // case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST: + // case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION: + // case PATH_PAYMENT_STRICT_SEND_NO_TRUST: + // case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_SEND_LINE_FULL: + // void; + // case PATH_PAYMENT_STRICT_SEND_NO_ISSUER: + // Asset noIssuer; // the asset that caused the error + // case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS: + // case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF: + // case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN: + // void; + // }; + // + // =========================================================================== + xdr.union("PathPaymentStrictSendResult", { + switchOn: xdr.lookup("PathPaymentStrictSendResultCode"), + switchName: "code", + switches: [ + ["pathPaymentStrictSendSuccess", "success"], + ["pathPaymentStrictSendMalformed", xdr.void()], + ["pathPaymentStrictSendUnderfunded", xdr.void()], + ["pathPaymentStrictSendSrcNoTrust", xdr.void()], + ["pathPaymentStrictSendSrcNotAuthorized", xdr.void()], + ["pathPaymentStrictSendNoDestination", xdr.void()], + ["pathPaymentStrictSendNoTrust", xdr.void()], + ["pathPaymentStrictSendNotAuthorized", xdr.void()], + ["pathPaymentStrictSendLineFull", xdr.void()], + ["pathPaymentStrictSendNoIssuer", "noIssuer"], + ["pathPaymentStrictSendTooFewOffers", xdr.void()], + ["pathPaymentStrictSendOfferCrossSelf", xdr.void()], + ["pathPaymentStrictSendUnderDestmin", xdr.void()], + ], + arms: { + success: xdr.lookup("PathPaymentStrictSendResultSuccess"), + noIssuer: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageSellOfferResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_SELL_OFFER_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid + // MANAGE_SELL_OFFER_SELL_NO_TRUST = + // -2, // no trust line for what we're selling + // MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying + // MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell + // MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy + // MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying + // MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell + // MANAGE_SELL_OFFER_CROSS_SELF = + // -8, // would cross an offer from the same user + // MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling + // MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying + // + // // update errors + // MANAGE_SELL_OFFER_NOT_FOUND = + // -11, // offerID does not match an existing offer + // + // MANAGE_SELL_OFFER_LOW_RESERVE = + // -12 // not enough funds to create a new Offer + // }; + // + // =========================================================================== + xdr.enum("ManageSellOfferResultCode", { + manageSellOfferSuccess: 0, + manageSellOfferMalformed: -1, + manageSellOfferSellNoTrust: -2, + manageSellOfferBuyNoTrust: -3, + manageSellOfferSellNotAuthorized: -4, + manageSellOfferBuyNotAuthorized: -5, + manageSellOfferLineFull: -6, + manageSellOfferUnderfunded: -7, + manageSellOfferCrossSelf: -8, + manageSellOfferSellNoIssuer: -9, + manageSellOfferBuyNoIssuer: -10, + manageSellOfferNotFound: -11, + manageSellOfferLowReserve: -12, + }); + + // === xdr source ============================================================ + // + // enum ManageOfferEffect + // { + // MANAGE_OFFER_CREATED = 0, + // MANAGE_OFFER_UPDATED = 1, + // MANAGE_OFFER_DELETED = 2 + // }; + // + // =========================================================================== + xdr.enum("ManageOfferEffect", { + manageOfferCreated: 0, + manageOfferUpdated: 1, + manageOfferDeleted: 2, + }); + + // === xdr source ============================================================ + // + // union switch (ManageOfferEffect effect) + // { + // case MANAGE_OFFER_CREATED: + // case MANAGE_OFFER_UPDATED: + // OfferEntry offer; + // case MANAGE_OFFER_DELETED: + // void; + // } + // + // =========================================================================== + xdr.union("ManageOfferSuccessResultOffer", { + switchOn: xdr.lookup("ManageOfferEffect"), + switchName: "effect", + switches: [ + ["manageOfferCreated", "offer"], + ["manageOfferUpdated", "offer"], + ["manageOfferDeleted", xdr.void()], + ], + arms: { + offer: xdr.lookup("OfferEntry"), + }, + }); + + // === xdr source ============================================================ + // + // struct ManageOfferSuccessResult + // { + // // offers that got claimed while creating this offer + // ClaimAtom offersClaimed<>; + // + // union switch (ManageOfferEffect effect) + // { + // case MANAGE_OFFER_CREATED: + // case MANAGE_OFFER_UPDATED: + // OfferEntry offer; + // case MANAGE_OFFER_DELETED: + // void; + // } + // offer; + // }; + // + // =========================================================================== + xdr.struct("ManageOfferSuccessResult", [ + ["offersClaimed", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["offer", xdr.lookup("ManageOfferSuccessResultOffer")], + ]); + + // === xdr source ============================================================ + // + // union ManageSellOfferResult switch (ManageSellOfferResultCode code) + // { + // case MANAGE_SELL_OFFER_SUCCESS: + // ManageOfferSuccessResult success; + // case MANAGE_SELL_OFFER_MALFORMED: + // case MANAGE_SELL_OFFER_SELL_NO_TRUST: + // case MANAGE_SELL_OFFER_BUY_NO_TRUST: + // case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED: + // case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED: + // case MANAGE_SELL_OFFER_LINE_FULL: + // case MANAGE_SELL_OFFER_UNDERFUNDED: + // case MANAGE_SELL_OFFER_CROSS_SELF: + // case MANAGE_SELL_OFFER_SELL_NO_ISSUER: + // case MANAGE_SELL_OFFER_BUY_NO_ISSUER: + // case MANAGE_SELL_OFFER_NOT_FOUND: + // case MANAGE_SELL_OFFER_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageSellOfferResult", { + switchOn: xdr.lookup("ManageSellOfferResultCode"), + switchName: "code", + switches: [ + ["manageSellOfferSuccess", "success"], + ["manageSellOfferMalformed", xdr.void()], + ["manageSellOfferSellNoTrust", xdr.void()], + ["manageSellOfferBuyNoTrust", xdr.void()], + ["manageSellOfferSellNotAuthorized", xdr.void()], + ["manageSellOfferBuyNotAuthorized", xdr.void()], + ["manageSellOfferLineFull", xdr.void()], + ["manageSellOfferUnderfunded", xdr.void()], + ["manageSellOfferCrossSelf", xdr.void()], + ["manageSellOfferSellNoIssuer", xdr.void()], + ["manageSellOfferBuyNoIssuer", xdr.void()], + ["manageSellOfferNotFound", xdr.void()], + ["manageSellOfferLowReserve", xdr.void()], + ], + arms: { + success: xdr.lookup("ManageOfferSuccessResult"), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageBuyOfferResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_BUY_OFFER_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // MANAGE_BUY_OFFER_MALFORMED = -1, // generated offer would be invalid + // MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling + // MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying + // MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell + // MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy + // MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying + // MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell + // MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user + // MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling + // MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying + // + // // update errors + // MANAGE_BUY_OFFER_NOT_FOUND = + // -11, // offerID does not match an existing offer + // + // MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer + // }; + // + // =========================================================================== + xdr.enum("ManageBuyOfferResultCode", { + manageBuyOfferSuccess: 0, + manageBuyOfferMalformed: -1, + manageBuyOfferSellNoTrust: -2, + manageBuyOfferBuyNoTrust: -3, + manageBuyOfferSellNotAuthorized: -4, + manageBuyOfferBuyNotAuthorized: -5, + manageBuyOfferLineFull: -6, + manageBuyOfferUnderfunded: -7, + manageBuyOfferCrossSelf: -8, + manageBuyOfferSellNoIssuer: -9, + manageBuyOfferBuyNoIssuer: -10, + manageBuyOfferNotFound: -11, + manageBuyOfferLowReserve: -12, + }); + + // === xdr source ============================================================ + // + // union ManageBuyOfferResult switch (ManageBuyOfferResultCode code) + // { + // case MANAGE_BUY_OFFER_SUCCESS: + // ManageOfferSuccessResult success; + // case MANAGE_BUY_OFFER_MALFORMED: + // case MANAGE_BUY_OFFER_SELL_NO_TRUST: + // case MANAGE_BUY_OFFER_BUY_NO_TRUST: + // case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED: + // case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED: + // case MANAGE_BUY_OFFER_LINE_FULL: + // case MANAGE_BUY_OFFER_UNDERFUNDED: + // case MANAGE_BUY_OFFER_CROSS_SELF: + // case MANAGE_BUY_OFFER_SELL_NO_ISSUER: + // case MANAGE_BUY_OFFER_BUY_NO_ISSUER: + // case MANAGE_BUY_OFFER_NOT_FOUND: + // case MANAGE_BUY_OFFER_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageBuyOfferResult", { + switchOn: xdr.lookup("ManageBuyOfferResultCode"), + switchName: "code", + switches: [ + ["manageBuyOfferSuccess", "success"], + ["manageBuyOfferMalformed", xdr.void()], + ["manageBuyOfferSellNoTrust", xdr.void()], + ["manageBuyOfferBuyNoTrust", xdr.void()], + ["manageBuyOfferSellNotAuthorized", xdr.void()], + ["manageBuyOfferBuyNotAuthorized", xdr.void()], + ["manageBuyOfferLineFull", xdr.void()], + ["manageBuyOfferUnderfunded", xdr.void()], + ["manageBuyOfferCrossSelf", xdr.void()], + ["manageBuyOfferSellNoIssuer", xdr.void()], + ["manageBuyOfferBuyNoIssuer", xdr.void()], + ["manageBuyOfferNotFound", xdr.void()], + ["manageBuyOfferLowReserve", xdr.void()], + ], + arms: { + success: xdr.lookup("ManageOfferSuccessResult"), + }, + }); + + // === xdr source ============================================================ + // + // enum SetOptionsResultCode + // { + // // codes considered as "success" for the operation + // SET_OPTIONS_SUCCESS = 0, + // // codes considered as "failure" for the operation + // SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer + // SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached + // SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags + // SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist + // SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option + // SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag + // SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold + // SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey + // SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain + // SET_OPTIONS_AUTH_REVOCABLE_REQUIRED = + // -10 // auth revocable is required for clawback + // }; + // + // =========================================================================== + xdr.enum("SetOptionsResultCode", { + setOptionsSuccess: 0, + setOptionsLowReserve: -1, + setOptionsTooManySigners: -2, + setOptionsBadFlags: -3, + setOptionsInvalidInflation: -4, + setOptionsCantChange: -5, + setOptionsUnknownFlag: -6, + setOptionsThresholdOutOfRange: -7, + setOptionsBadSigner: -8, + setOptionsInvalidHomeDomain: -9, + setOptionsAuthRevocableRequired: -10, + }); + + // === xdr source ============================================================ + // + // union SetOptionsResult switch (SetOptionsResultCode code) + // { + // case SET_OPTIONS_SUCCESS: + // void; + // case SET_OPTIONS_LOW_RESERVE: + // case SET_OPTIONS_TOO_MANY_SIGNERS: + // case SET_OPTIONS_BAD_FLAGS: + // case SET_OPTIONS_INVALID_INFLATION: + // case SET_OPTIONS_CANT_CHANGE: + // case SET_OPTIONS_UNKNOWN_FLAG: + // case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE: + // case SET_OPTIONS_BAD_SIGNER: + // case SET_OPTIONS_INVALID_HOME_DOMAIN: + // case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED: + // void; + // }; + // + // =========================================================================== + xdr.union("SetOptionsResult", { + switchOn: xdr.lookup("SetOptionsResultCode"), + switchName: "code", + switches: [ + ["setOptionsSuccess", xdr.void()], + ["setOptionsLowReserve", xdr.void()], + ["setOptionsTooManySigners", xdr.void()], + ["setOptionsBadFlags", xdr.void()], + ["setOptionsInvalidInflation", xdr.void()], + ["setOptionsCantChange", xdr.void()], + ["setOptionsUnknownFlag", xdr.void()], + ["setOptionsThresholdOutOfRange", xdr.void()], + ["setOptionsBadSigner", xdr.void()], + ["setOptionsInvalidHomeDomain", xdr.void()], + ["setOptionsAuthRevocableRequired", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ChangeTrustResultCode + // { + // // codes considered as "success" for the operation + // CHANGE_TRUST_SUCCESS = 0, + // // codes considered as "failure" for the operation + // CHANGE_TRUST_MALFORMED = -1, // bad input + // CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer + // CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance + // // cannot create with a limit of 0 + // CHANGE_TRUST_LOW_RESERVE = + // -4, // not enough funds to create a new trust line, + // CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed + // CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool + // CHANGE_TRUST_CANNOT_DELETE = + // -7, // Asset trustline is still referenced in a pool + // CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = + // -8 // Asset trustline is deauthorized + // }; + // + // =========================================================================== + xdr.enum("ChangeTrustResultCode", { + changeTrustSuccess: 0, + changeTrustMalformed: -1, + changeTrustNoIssuer: -2, + changeTrustInvalidLimit: -3, + changeTrustLowReserve: -4, + changeTrustSelfNotAllowed: -5, + changeTrustTrustLineMissing: -6, + changeTrustCannotDelete: -7, + changeTrustNotAuthMaintainLiabilities: -8, + }); + + // === xdr source ============================================================ + // + // union ChangeTrustResult switch (ChangeTrustResultCode code) + // { + // case CHANGE_TRUST_SUCCESS: + // void; + // case CHANGE_TRUST_MALFORMED: + // case CHANGE_TRUST_NO_ISSUER: + // case CHANGE_TRUST_INVALID_LIMIT: + // case CHANGE_TRUST_LOW_RESERVE: + // case CHANGE_TRUST_SELF_NOT_ALLOWED: + // case CHANGE_TRUST_TRUST_LINE_MISSING: + // case CHANGE_TRUST_CANNOT_DELETE: + // case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES: + // void; + // }; + // + // =========================================================================== + xdr.union("ChangeTrustResult", { + switchOn: xdr.lookup("ChangeTrustResultCode"), + switchName: "code", + switches: [ + ["changeTrustSuccess", xdr.void()], + ["changeTrustMalformed", xdr.void()], + ["changeTrustNoIssuer", xdr.void()], + ["changeTrustInvalidLimit", xdr.void()], + ["changeTrustLowReserve", xdr.void()], + ["changeTrustSelfNotAllowed", xdr.void()], + ["changeTrustTrustLineMissing", xdr.void()], + ["changeTrustCannotDelete", xdr.void()], + ["changeTrustNotAuthMaintainLiabilities", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum AllowTrustResultCode + // { + // // codes considered as "success" for the operation + // ALLOW_TRUST_SUCCESS = 0, + // // codes considered as "failure" for the operation + // ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM + // ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline + // // source account does not require trust + // ALLOW_TRUST_TRUST_NOT_REQUIRED = -3, + // ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust, + // ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed + // ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created + // // on revoke due to low reserves + // }; + // + // =========================================================================== + xdr.enum("AllowTrustResultCode", { + allowTrustSuccess: 0, + allowTrustMalformed: -1, + allowTrustNoTrustLine: -2, + allowTrustTrustNotRequired: -3, + allowTrustCantRevoke: -4, + allowTrustSelfNotAllowed: -5, + allowTrustLowReserve: -6, + }); + + // === xdr source ============================================================ + // + // union AllowTrustResult switch (AllowTrustResultCode code) + // { + // case ALLOW_TRUST_SUCCESS: + // void; + // case ALLOW_TRUST_MALFORMED: + // case ALLOW_TRUST_NO_TRUST_LINE: + // case ALLOW_TRUST_TRUST_NOT_REQUIRED: + // case ALLOW_TRUST_CANT_REVOKE: + // case ALLOW_TRUST_SELF_NOT_ALLOWED: + // case ALLOW_TRUST_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("AllowTrustResult", { + switchOn: xdr.lookup("AllowTrustResultCode"), + switchName: "code", + switches: [ + ["allowTrustSuccess", xdr.void()], + ["allowTrustMalformed", xdr.void()], + ["allowTrustNoTrustLine", xdr.void()], + ["allowTrustTrustNotRequired", xdr.void()], + ["allowTrustCantRevoke", xdr.void()], + ["allowTrustSelfNotAllowed", xdr.void()], + ["allowTrustLowReserve", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum AccountMergeResultCode + // { + // // codes considered as "success" for the operation + // ACCOUNT_MERGE_SUCCESS = 0, + // // codes considered as "failure" for the operation + // ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself + // ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist + // ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set + // ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers + // ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed + // ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to + // // destination balance + // ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor + // }; + // + // =========================================================================== + xdr.enum("AccountMergeResultCode", { + accountMergeSuccess: 0, + accountMergeMalformed: -1, + accountMergeNoAccount: -2, + accountMergeImmutableSet: -3, + accountMergeHasSubEntries: -4, + accountMergeSeqnumTooFar: -5, + accountMergeDestFull: -6, + accountMergeIsSponsor: -7, + }); + + // === xdr source ============================================================ + // + // union AccountMergeResult switch (AccountMergeResultCode code) + // { + // case ACCOUNT_MERGE_SUCCESS: + // int64 sourceAccountBalance; // how much got transferred from source account + // case ACCOUNT_MERGE_MALFORMED: + // case ACCOUNT_MERGE_NO_ACCOUNT: + // case ACCOUNT_MERGE_IMMUTABLE_SET: + // case ACCOUNT_MERGE_HAS_SUB_ENTRIES: + // case ACCOUNT_MERGE_SEQNUM_TOO_FAR: + // case ACCOUNT_MERGE_DEST_FULL: + // case ACCOUNT_MERGE_IS_SPONSOR: + // void; + // }; + // + // =========================================================================== + xdr.union("AccountMergeResult", { + switchOn: xdr.lookup("AccountMergeResultCode"), + switchName: "code", + switches: [ + ["accountMergeSuccess", "sourceAccountBalance"], + ["accountMergeMalformed", xdr.void()], + ["accountMergeNoAccount", xdr.void()], + ["accountMergeImmutableSet", xdr.void()], + ["accountMergeHasSubEntries", xdr.void()], + ["accountMergeSeqnumTooFar", xdr.void()], + ["accountMergeDestFull", xdr.void()], + ["accountMergeIsSponsor", xdr.void()], + ], + arms: { + sourceAccountBalance: xdr.lookup("Int64"), + }, + }); + + // === xdr source ============================================================ + // + // enum InflationResultCode + // { + // // codes considered as "success" for the operation + // INFLATION_SUCCESS = 0, + // // codes considered as "failure" for the operation + // INFLATION_NOT_TIME = -1 + // }; + // + // =========================================================================== + xdr.enum("InflationResultCode", { + inflationSuccess: 0, + inflationNotTime: -1, + }); + + // === xdr source ============================================================ + // + // struct InflationPayout // or use PaymentResultAtom to limit types? + // { + // AccountID destination; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("InflationPayout", [ + ["destination", xdr.lookup("AccountId")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union InflationResult switch (InflationResultCode code) + // { + // case INFLATION_SUCCESS: + // InflationPayout payouts<>; + // case INFLATION_NOT_TIME: + // void; + // }; + // + // =========================================================================== + xdr.union("InflationResult", { + switchOn: xdr.lookup("InflationResultCode"), + switchName: "code", + switches: [ + ["inflationSuccess", "payouts"], + ["inflationNotTime", xdr.void()], + ], + arms: { + payouts: xdr.varArray(xdr.lookup("InflationPayout"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageDataResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_DATA_SUCCESS = 0, + // // codes considered as "failure" for the operation + // MANAGE_DATA_NOT_SUPPORTED_YET = + // -1, // The network hasn't moved to this protocol change yet + // MANAGE_DATA_NAME_NOT_FOUND = + // -2, // Trying to remove a Data Entry that isn't there + // MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry + // MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string + // }; + // + // =========================================================================== + xdr.enum("ManageDataResultCode", { + manageDataSuccess: 0, + manageDataNotSupportedYet: -1, + manageDataNameNotFound: -2, + manageDataLowReserve: -3, + manageDataInvalidName: -4, + }); + + // === xdr source ============================================================ + // + // union ManageDataResult switch (ManageDataResultCode code) + // { + // case MANAGE_DATA_SUCCESS: + // void; + // case MANAGE_DATA_NOT_SUPPORTED_YET: + // case MANAGE_DATA_NAME_NOT_FOUND: + // case MANAGE_DATA_LOW_RESERVE: + // case MANAGE_DATA_INVALID_NAME: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageDataResult", { + switchOn: xdr.lookup("ManageDataResultCode"), + switchName: "code", + switches: [ + ["manageDataSuccess", xdr.void()], + ["manageDataNotSupportedYet", xdr.void()], + ["manageDataNameNotFound", xdr.void()], + ["manageDataLowReserve", xdr.void()], + ["manageDataInvalidName", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum BumpSequenceResultCode + // { + // // codes considered as "success" for the operation + // BUMP_SEQUENCE_SUCCESS = 0, + // // codes considered as "failure" for the operation + // BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds + // }; + // + // =========================================================================== + xdr.enum("BumpSequenceResultCode", { + bumpSequenceSuccess: 0, + bumpSequenceBadSeq: -1, + }); + + // === xdr source ============================================================ + // + // union BumpSequenceResult switch (BumpSequenceResultCode code) + // { + // case BUMP_SEQUENCE_SUCCESS: + // void; + // case BUMP_SEQUENCE_BAD_SEQ: + // void; + // }; + // + // =========================================================================== + xdr.union("BumpSequenceResult", { + switchOn: xdr.lookup("BumpSequenceResultCode"), + switchName: "code", + switches: [ + ["bumpSequenceSuccess", xdr.void()], + ["bumpSequenceBadSeq", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum CreateClaimableBalanceResultCode + // { + // CREATE_CLAIMABLE_BALANCE_SUCCESS = 0, + // CREATE_CLAIMABLE_BALANCE_MALFORMED = -1, + // CREATE_CLAIMABLE_BALANCE_LOW_RESERVE = -2, + // CREATE_CLAIMABLE_BALANCE_NO_TRUST = -3, + // CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -4, + // CREATE_CLAIMABLE_BALANCE_UNDERFUNDED = -5 + // }; + // + // =========================================================================== + xdr.enum("CreateClaimableBalanceResultCode", { + createClaimableBalanceSuccess: 0, + createClaimableBalanceMalformed: -1, + createClaimableBalanceLowReserve: -2, + createClaimableBalanceNoTrust: -3, + createClaimableBalanceNotAuthorized: -4, + createClaimableBalanceUnderfunded: -5, + }); + + // === xdr source ============================================================ + // + // union CreateClaimableBalanceResult switch ( + // CreateClaimableBalanceResultCode code) + // { + // case CREATE_CLAIMABLE_BALANCE_SUCCESS: + // ClaimableBalanceID balanceID; + // case CREATE_CLAIMABLE_BALANCE_MALFORMED: + // case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE: + // case CREATE_CLAIMABLE_BALANCE_NO_TRUST: + // case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED: + // case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED: + // void; + // }; + // + // =========================================================================== + xdr.union("CreateClaimableBalanceResult", { + switchOn: xdr.lookup("CreateClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["createClaimableBalanceSuccess", "balanceId"], + ["createClaimableBalanceMalformed", xdr.void()], + ["createClaimableBalanceLowReserve", xdr.void()], + ["createClaimableBalanceNoTrust", xdr.void()], + ["createClaimableBalanceNotAuthorized", xdr.void()], + ["createClaimableBalanceUnderfunded", xdr.void()], + ], + arms: { + balanceId: xdr.lookup("ClaimableBalanceId"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimClaimableBalanceResultCode + // { + // CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0, + // CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, + // CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2, + // CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3, + // CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4, + // CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5 + // }; + // + // =========================================================================== + xdr.enum("ClaimClaimableBalanceResultCode", { + claimClaimableBalanceSuccess: 0, + claimClaimableBalanceDoesNotExist: -1, + claimClaimableBalanceCannotClaim: -2, + claimClaimableBalanceLineFull: -3, + claimClaimableBalanceNoTrust: -4, + claimClaimableBalanceNotAuthorized: -5, + }); + + // === xdr source ============================================================ + // + // union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code) + // { + // case CLAIM_CLAIMABLE_BALANCE_SUCCESS: + // void; + // case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST: + // case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM: + // case CLAIM_CLAIMABLE_BALANCE_LINE_FULL: + // case CLAIM_CLAIMABLE_BALANCE_NO_TRUST: + // case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClaimClaimableBalanceResult", { + switchOn: xdr.lookup("ClaimClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["claimClaimableBalanceSuccess", xdr.void()], + ["claimClaimableBalanceDoesNotExist", xdr.void()], + ["claimClaimableBalanceCannotClaim", xdr.void()], + ["claimClaimableBalanceLineFull", xdr.void()], + ["claimClaimableBalanceNoTrust", xdr.void()], + ["claimClaimableBalanceNotAuthorized", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum BeginSponsoringFutureReservesResultCode + // { + // // codes considered as "success" for the operation + // BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1, + // BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2, + // BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3 + // }; + // + // =========================================================================== + xdr.enum("BeginSponsoringFutureReservesResultCode", { + beginSponsoringFutureReservesSuccess: 0, + beginSponsoringFutureReservesMalformed: -1, + beginSponsoringFutureReservesAlreadySponsored: -2, + beginSponsoringFutureReservesRecursive: -3, + }); + + // === xdr source ============================================================ + // + // union BeginSponsoringFutureReservesResult switch ( + // BeginSponsoringFutureReservesResultCode code) + // { + // case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS: + // void; + // case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED: + // case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED: + // case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE: + // void; + // }; + // + // =========================================================================== + xdr.union("BeginSponsoringFutureReservesResult", { + switchOn: xdr.lookup("BeginSponsoringFutureReservesResultCode"), + switchName: "code", + switches: [ + ["beginSponsoringFutureReservesSuccess", xdr.void()], + ["beginSponsoringFutureReservesMalformed", xdr.void()], + ["beginSponsoringFutureReservesAlreadySponsored", xdr.void()], + ["beginSponsoringFutureReservesRecursive", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum EndSponsoringFutureReservesResultCode + // { + // // codes considered as "success" for the operation + // END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1 + // }; + // + // =========================================================================== + xdr.enum("EndSponsoringFutureReservesResultCode", { + endSponsoringFutureReservesSuccess: 0, + endSponsoringFutureReservesNotSponsored: -1, + }); + + // === xdr source ============================================================ + // + // union EndSponsoringFutureReservesResult switch ( + // EndSponsoringFutureReservesResultCode code) + // { + // case END_SPONSORING_FUTURE_RESERVES_SUCCESS: + // void; + // case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED: + // void; + // }; + // + // =========================================================================== + xdr.union("EndSponsoringFutureReservesResult", { + switchOn: xdr.lookup("EndSponsoringFutureReservesResultCode"), + switchName: "code", + switches: [ + ["endSponsoringFutureReservesSuccess", xdr.void()], + ["endSponsoringFutureReservesNotSponsored", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum RevokeSponsorshipResultCode + // { + // // codes considered as "success" for the operation + // REVOKE_SPONSORSHIP_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1, + // REVOKE_SPONSORSHIP_NOT_SPONSOR = -2, + // REVOKE_SPONSORSHIP_LOW_RESERVE = -3, + // REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4, + // REVOKE_SPONSORSHIP_MALFORMED = -5 + // }; + // + // =========================================================================== + xdr.enum("RevokeSponsorshipResultCode", { + revokeSponsorshipSuccess: 0, + revokeSponsorshipDoesNotExist: -1, + revokeSponsorshipNotSponsor: -2, + revokeSponsorshipLowReserve: -3, + revokeSponsorshipOnlyTransferable: -4, + revokeSponsorshipMalformed: -5, + }); + + // === xdr source ============================================================ + // + // union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code) + // { + // case REVOKE_SPONSORSHIP_SUCCESS: + // void; + // case REVOKE_SPONSORSHIP_DOES_NOT_EXIST: + // case REVOKE_SPONSORSHIP_NOT_SPONSOR: + // case REVOKE_SPONSORSHIP_LOW_RESERVE: + // case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE: + // case REVOKE_SPONSORSHIP_MALFORMED: + // void; + // }; + // + // =========================================================================== + xdr.union("RevokeSponsorshipResult", { + switchOn: xdr.lookup("RevokeSponsorshipResultCode"), + switchName: "code", + switches: [ + ["revokeSponsorshipSuccess", xdr.void()], + ["revokeSponsorshipDoesNotExist", xdr.void()], + ["revokeSponsorshipNotSponsor", xdr.void()], + ["revokeSponsorshipLowReserve", xdr.void()], + ["revokeSponsorshipOnlyTransferable", xdr.void()], + ["revokeSponsorshipMalformed", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ClawbackResultCode + // { + // // codes considered as "success" for the operation + // CLAWBACK_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // CLAWBACK_MALFORMED = -1, + // CLAWBACK_NOT_CLAWBACK_ENABLED = -2, + // CLAWBACK_NO_TRUST = -3, + // CLAWBACK_UNDERFUNDED = -4 + // }; + // + // =========================================================================== + xdr.enum("ClawbackResultCode", { + clawbackSuccess: 0, + clawbackMalformed: -1, + clawbackNotClawbackEnabled: -2, + clawbackNoTrust: -3, + clawbackUnderfunded: -4, + }); + + // === xdr source ============================================================ + // + // union ClawbackResult switch (ClawbackResultCode code) + // { + // case CLAWBACK_SUCCESS: + // void; + // case CLAWBACK_MALFORMED: + // case CLAWBACK_NOT_CLAWBACK_ENABLED: + // case CLAWBACK_NO_TRUST: + // case CLAWBACK_UNDERFUNDED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClawbackResult", { + switchOn: xdr.lookup("ClawbackResultCode"), + switchName: "code", + switches: [ + ["clawbackSuccess", xdr.void()], + ["clawbackMalformed", xdr.void()], + ["clawbackNotClawbackEnabled", xdr.void()], + ["clawbackNoTrust", xdr.void()], + ["clawbackUnderfunded", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ClawbackClaimableBalanceResultCode + // { + // // codes considered as "success" for the operation + // CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, + // CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2, + // CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3 + // }; + // + // =========================================================================== + xdr.enum("ClawbackClaimableBalanceResultCode", { + clawbackClaimableBalanceSuccess: 0, + clawbackClaimableBalanceDoesNotExist: -1, + clawbackClaimableBalanceNotIssuer: -2, + clawbackClaimableBalanceNotClawbackEnabled: -3, + }); + + // === xdr source ============================================================ + // + // union ClawbackClaimableBalanceResult switch ( + // ClawbackClaimableBalanceResultCode code) + // { + // case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS: + // void; + // case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST: + // case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER: + // case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClawbackClaimableBalanceResult", { + switchOn: xdr.lookup("ClawbackClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["clawbackClaimableBalanceSuccess", xdr.void()], + ["clawbackClaimableBalanceDoesNotExist", xdr.void()], + ["clawbackClaimableBalanceNotIssuer", xdr.void()], + ["clawbackClaimableBalanceNotClawbackEnabled", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum SetTrustLineFlagsResultCode + // { + // // codes considered as "success" for the operation + // SET_TRUST_LINE_FLAGS_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // SET_TRUST_LINE_FLAGS_MALFORMED = -1, + // SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2, + // SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3, + // SET_TRUST_LINE_FLAGS_INVALID_STATE = -4, + // SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created + // // on revoke due to low reserves + // }; + // + // =========================================================================== + xdr.enum("SetTrustLineFlagsResultCode", { + setTrustLineFlagsSuccess: 0, + setTrustLineFlagsMalformed: -1, + setTrustLineFlagsNoTrustLine: -2, + setTrustLineFlagsCantRevoke: -3, + setTrustLineFlagsInvalidState: -4, + setTrustLineFlagsLowReserve: -5, + }); + + // === xdr source ============================================================ + // + // union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code) + // { + // case SET_TRUST_LINE_FLAGS_SUCCESS: + // void; + // case SET_TRUST_LINE_FLAGS_MALFORMED: + // case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE: + // case SET_TRUST_LINE_FLAGS_CANT_REVOKE: + // case SET_TRUST_LINE_FLAGS_INVALID_STATE: + // case SET_TRUST_LINE_FLAGS_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("SetTrustLineFlagsResult", { + switchOn: xdr.lookup("SetTrustLineFlagsResultCode"), + switchName: "code", + switches: [ + ["setTrustLineFlagsSuccess", xdr.void()], + ["setTrustLineFlagsMalformed", xdr.void()], + ["setTrustLineFlagsNoTrustLine", xdr.void()], + ["setTrustLineFlagsCantRevoke", xdr.void()], + ["setTrustLineFlagsInvalidState", xdr.void()], + ["setTrustLineFlagsLowReserve", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum LiquidityPoolDepositResultCode + // { + // // codes considered as "success" for the operation + // LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input + // LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the + // // assets + // LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the + // // assets + // LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of + // // the assets + // LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't + // // have sufficient limit + // LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds + // LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolDepositResultCode", { + liquidityPoolDepositSuccess: 0, + liquidityPoolDepositMalformed: -1, + liquidityPoolDepositNoTrust: -2, + liquidityPoolDepositNotAuthorized: -3, + liquidityPoolDepositUnderfunded: -4, + liquidityPoolDepositLineFull: -5, + liquidityPoolDepositBadPrice: -6, + liquidityPoolDepositPoolFull: -7, + }); + + // === xdr source ============================================================ + // + // union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code) + // { + // case LIQUIDITY_POOL_DEPOSIT_SUCCESS: + // void; + // case LIQUIDITY_POOL_DEPOSIT_MALFORMED: + // case LIQUIDITY_POOL_DEPOSIT_NO_TRUST: + // case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED: + // case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED: + // case LIQUIDITY_POOL_DEPOSIT_LINE_FULL: + // case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE: + // case LIQUIDITY_POOL_DEPOSIT_POOL_FULL: + // void; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolDepositResult", { + switchOn: xdr.lookup("LiquidityPoolDepositResultCode"), + switchName: "code", + switches: [ + ["liquidityPoolDepositSuccess", xdr.void()], + ["liquidityPoolDepositMalformed", xdr.void()], + ["liquidityPoolDepositNoTrust", xdr.void()], + ["liquidityPoolDepositNotAuthorized", xdr.void()], + ["liquidityPoolDepositUnderfunded", xdr.void()], + ["liquidityPoolDepositLineFull", xdr.void()], + ["liquidityPoolDepositBadPrice", xdr.void()], + ["liquidityPoolDepositPoolFull", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum LiquidityPoolWithdrawResultCode + // { + // // codes considered as "success" for the operation + // LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input + // LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the + // // assets + // LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the + // // pool share + // LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one + // // of the assets + // LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolWithdrawResultCode", { + liquidityPoolWithdrawSuccess: 0, + liquidityPoolWithdrawMalformed: -1, + liquidityPoolWithdrawNoTrust: -2, + liquidityPoolWithdrawUnderfunded: -3, + liquidityPoolWithdrawLineFull: -4, + liquidityPoolWithdrawUnderMinimum: -5, + }); + + // === xdr source ============================================================ + // + // union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code) + // { + // case LIQUIDITY_POOL_WITHDRAW_SUCCESS: + // void; + // case LIQUIDITY_POOL_WITHDRAW_MALFORMED: + // case LIQUIDITY_POOL_WITHDRAW_NO_TRUST: + // case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED: + // case LIQUIDITY_POOL_WITHDRAW_LINE_FULL: + // case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: + // void; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolWithdrawResult", { + switchOn: xdr.lookup("LiquidityPoolWithdrawResultCode"), + switchName: "code", + switches: [ + ["liquidityPoolWithdrawSuccess", xdr.void()], + ["liquidityPoolWithdrawMalformed", xdr.void()], + ["liquidityPoolWithdrawNoTrust", xdr.void()], + ["liquidityPoolWithdrawUnderfunded", xdr.void()], + ["liquidityPoolWithdrawLineFull", xdr.void()], + ["liquidityPoolWithdrawUnderMinimum", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum InvokeHostFunctionResultCode + // { + // // codes considered as "success" for the operation + // INVOKE_HOST_FUNCTION_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // INVOKE_HOST_FUNCTION_MALFORMED = -1, + // INVOKE_HOST_FUNCTION_TRAPPED = -2, + // INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, + // INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + // INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 + // }; + // + // =========================================================================== + xdr.enum("InvokeHostFunctionResultCode", { + invokeHostFunctionSuccess: 0, + invokeHostFunctionMalformed: -1, + invokeHostFunctionTrapped: -2, + invokeHostFunctionResourceLimitExceeded: -3, + invokeHostFunctionEntryExpired: -4, + invokeHostFunctionInsufficientRefundableFee: -5, + }); + + // === xdr source ============================================================ + // + // union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) + // { + // case INVOKE_HOST_FUNCTION_SUCCESS: + // Hash success; // sha256(InvokeHostFunctionSuccessPreImage) + // case INVOKE_HOST_FUNCTION_MALFORMED: + // case INVOKE_HOST_FUNCTION_TRAPPED: + // case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: + // case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: + // case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("InvokeHostFunctionResult", { + switchOn: xdr.lookup("InvokeHostFunctionResultCode"), + switchName: "code", + switches: [ + ["invokeHostFunctionSuccess", "success"], + ["invokeHostFunctionMalformed", xdr.void()], + ["invokeHostFunctionTrapped", xdr.void()], + ["invokeHostFunctionResourceLimitExceeded", xdr.void()], + ["invokeHostFunctionEntryExpired", xdr.void()], + ["invokeHostFunctionInsufficientRefundableFee", xdr.void()], + ], + arms: { + success: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum BumpFootprintExpirationResultCode + // { + // // codes considered as "success" for the operation + // BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, + // BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, + // BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + // }; + // + // =========================================================================== + xdr.enum("BumpFootprintExpirationResultCode", { + bumpFootprintExpirationSuccess: 0, + bumpFootprintExpirationMalformed: -1, + bumpFootprintExpirationResourceLimitExceeded: -2, + bumpFootprintExpirationInsufficientRefundableFee: -3, + }); + + // === xdr source ============================================================ + // + // union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) + // { + // case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + // void; + // case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: + // case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: + // case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("BumpFootprintExpirationResult", { + switchOn: xdr.lookup("BumpFootprintExpirationResultCode"), + switchName: "code", + switches: [ + ["bumpFootprintExpirationSuccess", xdr.void()], + ["bumpFootprintExpirationMalformed", xdr.void()], + ["bumpFootprintExpirationResourceLimitExceeded", xdr.void()], + ["bumpFootprintExpirationInsufficientRefundableFee", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum RestoreFootprintResultCode + // { + // // codes considered as "success" for the operation + // RESTORE_FOOTPRINT_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // RESTORE_FOOTPRINT_MALFORMED = -1, + // RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, + // RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 + // }; + // + // =========================================================================== + xdr.enum("RestoreFootprintResultCode", { + restoreFootprintSuccess: 0, + restoreFootprintMalformed: -1, + restoreFootprintResourceLimitExceeded: -2, + restoreFootprintInsufficientRefundableFee: -3, + }); + + // === xdr source ============================================================ + // + // union RestoreFootprintResult switch (RestoreFootprintResultCode code) + // { + // case RESTORE_FOOTPRINT_SUCCESS: + // void; + // case RESTORE_FOOTPRINT_MALFORMED: + // case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED: + // case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("RestoreFootprintResult", { + switchOn: xdr.lookup("RestoreFootprintResultCode"), + switchName: "code", + switches: [ + ["restoreFootprintSuccess", xdr.void()], + ["restoreFootprintMalformed", xdr.void()], + ["restoreFootprintResourceLimitExceeded", xdr.void()], + ["restoreFootprintInsufficientRefundableFee", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum OperationResultCode + // { + // opINNER = 0, // inner object result is valid + // + // opBAD_AUTH = -1, // too few valid signatures / wrong network + // opNO_ACCOUNT = -2, // source account was not found + // opNOT_SUPPORTED = -3, // operation not supported at this time + // opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached + // opEXCEEDED_WORK_LIMIT = -5, // operation did too much work + // opTOO_MANY_SPONSORING = -6 // account is sponsoring too many entries + // }; + // + // =========================================================================== + xdr.enum("OperationResultCode", { + opInner: 0, + opBadAuth: -1, + opNoAccount: -2, + opNotSupported: -3, + opTooManySubentries: -4, + opExceededWorkLimit: -5, + opTooManySponsoring: -6, + }); + + // === xdr source ============================================================ + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountResult createAccountResult; + // case PAYMENT: + // PaymentResult paymentResult; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; + // case MANAGE_SELL_OFFER: + // ManageSellOfferResult manageSellOfferResult; + // case CREATE_PASSIVE_SELL_OFFER: + // ManageSellOfferResult createPassiveSellOfferResult; + // case SET_OPTIONS: + // SetOptionsResult setOptionsResult; + // case CHANGE_TRUST: + // ChangeTrustResult changeTrustResult; + // case ALLOW_TRUST: + // AllowTrustResult allowTrustResult; + // case ACCOUNT_MERGE: + // AccountMergeResult accountMergeResult; + // case INFLATION: + // InflationResult inflationResult; + // case MANAGE_DATA: + // ManageDataResult manageDataResult; + // case BUMP_SEQUENCE: + // BumpSequenceResult bumpSeqResult; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferResult manageBuyOfferResult; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendResult pathPaymentStrictSendResult; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceResult createClaimableBalanceResult; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceResult claimClaimableBalanceResult; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; + // case END_SPONSORING_FUTURE_RESERVES: + // EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipResult revokeSponsorshipResult; + // case CLAWBACK: + // ClawbackResult clawbackResult; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsResult setTrustLineFlagsResult; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositResult liquidityPoolDepositResult; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionResult invokeHostFunctionResult; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case RESTORE_FOOTPRINT: + // RestoreFootprintResult restoreFootprintResult; + // } + // + // =========================================================================== + xdr.union("OperationResultTr", { + switchOn: xdr.lookup("OperationType"), + switchName: "type", + switches: [ + ["createAccount", "createAccountResult"], + ["payment", "paymentResult"], + ["pathPaymentStrictReceive", "pathPaymentStrictReceiveResult"], + ["manageSellOffer", "manageSellOfferResult"], + ["createPassiveSellOffer", "createPassiveSellOfferResult"], + ["setOptions", "setOptionsResult"], + ["changeTrust", "changeTrustResult"], + ["allowTrust", "allowTrustResult"], + ["accountMerge", "accountMergeResult"], + ["inflation", "inflationResult"], + ["manageData", "manageDataResult"], + ["bumpSequence", "bumpSeqResult"], + ["manageBuyOffer", "manageBuyOfferResult"], + ["pathPaymentStrictSend", "pathPaymentStrictSendResult"], + ["createClaimableBalance", "createClaimableBalanceResult"], + ["claimClaimableBalance", "claimClaimableBalanceResult"], + ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesResult"], + ["endSponsoringFutureReserves", "endSponsoringFutureReservesResult"], + ["revokeSponsorship", "revokeSponsorshipResult"], + ["clawback", "clawbackResult"], + ["clawbackClaimableBalance", "clawbackClaimableBalanceResult"], + ["setTrustLineFlags", "setTrustLineFlagsResult"], + ["liquidityPoolDeposit", "liquidityPoolDepositResult"], + ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], + ["invokeHostFunction", "invokeHostFunctionResult"], + ["bumpFootprintExpiration", "bumpFootprintExpirationResult"], + ["restoreFootprint", "restoreFootprintResult"], + ], + arms: { + createAccountResult: xdr.lookup("CreateAccountResult"), + paymentResult: xdr.lookup("PaymentResult"), + pathPaymentStrictReceiveResult: xdr.lookup( + "PathPaymentStrictReceiveResult" + ), + manageSellOfferResult: xdr.lookup("ManageSellOfferResult"), + createPassiveSellOfferResult: xdr.lookup("ManageSellOfferResult"), + setOptionsResult: xdr.lookup("SetOptionsResult"), + changeTrustResult: xdr.lookup("ChangeTrustResult"), + allowTrustResult: xdr.lookup("AllowTrustResult"), + accountMergeResult: xdr.lookup("AccountMergeResult"), + inflationResult: xdr.lookup("InflationResult"), + manageDataResult: xdr.lookup("ManageDataResult"), + bumpSeqResult: xdr.lookup("BumpSequenceResult"), + manageBuyOfferResult: xdr.lookup("ManageBuyOfferResult"), + pathPaymentStrictSendResult: xdr.lookup("PathPaymentStrictSendResult"), + createClaimableBalanceResult: xdr.lookup("CreateClaimableBalanceResult"), + claimClaimableBalanceResult: xdr.lookup("ClaimClaimableBalanceResult"), + beginSponsoringFutureReservesResult: xdr.lookup( + "BeginSponsoringFutureReservesResult" + ), + endSponsoringFutureReservesResult: xdr.lookup( + "EndSponsoringFutureReservesResult" + ), + revokeSponsorshipResult: xdr.lookup("RevokeSponsorshipResult"), + clawbackResult: xdr.lookup("ClawbackResult"), + clawbackClaimableBalanceResult: xdr.lookup( + "ClawbackClaimableBalanceResult" + ), + setTrustLineFlagsResult: xdr.lookup("SetTrustLineFlagsResult"), + liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), + liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), + invokeHostFunctionResult: xdr.lookup("InvokeHostFunctionResult"), + bumpFootprintExpirationResult: xdr.lookup( + "BumpFootprintExpirationResult" + ), + restoreFootprintResult: xdr.lookup("RestoreFootprintResult"), + }, + }); + + // === xdr source ============================================================ + // + // union OperationResult switch (OperationResultCode code) + // { + // case opINNER: + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountResult createAccountResult; + // case PAYMENT: + // PaymentResult paymentResult; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; + // case MANAGE_SELL_OFFER: + // ManageSellOfferResult manageSellOfferResult; + // case CREATE_PASSIVE_SELL_OFFER: + // ManageSellOfferResult createPassiveSellOfferResult; + // case SET_OPTIONS: + // SetOptionsResult setOptionsResult; + // case CHANGE_TRUST: + // ChangeTrustResult changeTrustResult; + // case ALLOW_TRUST: + // AllowTrustResult allowTrustResult; + // case ACCOUNT_MERGE: + // AccountMergeResult accountMergeResult; + // case INFLATION: + // InflationResult inflationResult; + // case MANAGE_DATA: + // ManageDataResult manageDataResult; + // case BUMP_SEQUENCE: + // BumpSequenceResult bumpSeqResult; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferResult manageBuyOfferResult; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendResult pathPaymentStrictSendResult; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceResult createClaimableBalanceResult; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceResult claimClaimableBalanceResult; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; + // case END_SPONSORING_FUTURE_RESERVES: + // EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipResult revokeSponsorshipResult; + // case CLAWBACK: + // ClawbackResult clawbackResult; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsResult setTrustLineFlagsResult; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositResult liquidityPoolDepositResult; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionResult invokeHostFunctionResult; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case RESTORE_FOOTPRINT: + // RestoreFootprintResult restoreFootprintResult; + // } + // tr; + // case opBAD_AUTH: + // case opNO_ACCOUNT: + // case opNOT_SUPPORTED: + // case opTOO_MANY_SUBENTRIES: + // case opEXCEEDED_WORK_LIMIT: + // case opTOO_MANY_SPONSORING: + // void; + // }; + // + // =========================================================================== + xdr.union("OperationResult", { + switchOn: xdr.lookup("OperationResultCode"), + switchName: "code", + switches: [ + ["opInner", "tr"], + ["opBadAuth", xdr.void()], + ["opNoAccount", xdr.void()], + ["opNotSupported", xdr.void()], + ["opTooManySubentries", xdr.void()], + ["opExceededWorkLimit", xdr.void()], + ["opTooManySponsoring", xdr.void()], + ], + arms: { + tr: xdr.lookup("OperationResultTr"), + }, + }); + + // === xdr source ============================================================ + // + // enum TransactionResultCode + // { + // txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded + // txSUCCESS = 0, // all operations succeeded + // + // txFAILED = -1, // one of the operations failed (none were applied) + // + // txTOO_EARLY = -2, // ledger closeTime before minTime + // txTOO_LATE = -3, // ledger closeTime after maxTime + // txMISSING_OPERATION = -4, // no operation was specified + // txBAD_SEQ = -5, // sequence number does not match source account + // + // txBAD_AUTH = -6, // too few valid signatures / wrong network + // txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve + // txNO_ACCOUNT = -8, // source account not found + // txINSUFFICIENT_FEE = -9, // fee is too small + // txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction + // txINTERNAL_ERROR = -11, // an unknown error occurred + // + // txNOT_SUPPORTED = -12, // transaction type not supported + // txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed + // txBAD_SPONSORSHIP = -14, // sponsorship not confirmed + // txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met + // txMALFORMED = -16, // precondition is invalid + // txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met + // }; + // + // =========================================================================== + xdr.enum("TransactionResultCode", { + txFeeBumpInnerSuccess: 1, + txSuccess: 0, + txFailed: -1, + txTooEarly: -2, + txTooLate: -3, + txMissingOperation: -4, + txBadSeq: -5, + txBadAuth: -6, + txInsufficientBalance: -7, + txNoAccount: -8, + txInsufficientFee: -9, + txBadAuthExtra: -10, + txInternalError: -11, + txNotSupported: -12, + txFeeBumpInnerFailed: -13, + txBadSponsorship: -14, + txBadMinSeqAgeOrGap: -15, + txMalformed: -16, + txSorobanInvalid: -17, + }); + + // === xdr source ============================================================ + // + // union switch (TransactionResultCode code) + // { + // // txFEE_BUMP_INNER_SUCCESS is not included + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // txFEE_BUMP_INNER_FAILED is not included + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // + // =========================================================================== + xdr.union("InnerTransactionResultResult", { + switchOn: xdr.lookup("TransactionResultCode"), + switchName: "code", + switches: [ + ["txSuccess", "results"], + ["txFailed", "results"], + ["txTooEarly", xdr.void()], + ["txTooLate", xdr.void()], + ["txMissingOperation", xdr.void()], + ["txBadSeq", xdr.void()], + ["txBadAuth", xdr.void()], + ["txInsufficientBalance", xdr.void()], + ["txNoAccount", xdr.void()], + ["txInsufficientFee", xdr.void()], + ["txBadAuthExtra", xdr.void()], + ["txInternalError", xdr.void()], + ["txNotSupported", xdr.void()], + ["txBadSponsorship", xdr.void()], + ["txBadMinSeqAgeOrGap", xdr.void()], + ["txMalformed", xdr.void()], + ["txSorobanInvalid", xdr.void()], + ], + arms: { + results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("InnerTransactionResultExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct InnerTransactionResult + // { + // // Always 0. Here for binary compatibility. + // int64 feeCharged; + // + // union switch (TransactionResultCode code) + // { + // // txFEE_BUMP_INNER_SUCCESS is not included + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // txFEE_BUMP_INNER_FAILED is not included + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // result; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("InnerTransactionResult", [ + ["feeCharged", xdr.lookup("Int64")], + ["result", xdr.lookup("InnerTransactionResultResult")], + ["ext", xdr.lookup("InnerTransactionResultExt")], + ]); + + // === xdr source ============================================================ + // + // struct InnerTransactionResultPair + // { + // Hash transactionHash; // hash of the inner transaction + // InnerTransactionResult result; // result for the inner transaction + // }; + // + // =========================================================================== + xdr.struct("InnerTransactionResultPair", [ + ["transactionHash", xdr.lookup("Hash")], + ["result", xdr.lookup("InnerTransactionResult")], + ]); + + // === xdr source ============================================================ + // + // union switch (TransactionResultCode code) + // { + // case txFEE_BUMP_INNER_SUCCESS: + // case txFEE_BUMP_INNER_FAILED: + // InnerTransactionResultPair innerResultPair; + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // case txFEE_BUMP_INNER_FAILED: handled above + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionResultResult", { + switchOn: xdr.lookup("TransactionResultCode"), + switchName: "code", + switches: [ + ["txFeeBumpInnerSuccess", "innerResultPair"], + ["txFeeBumpInnerFailed", "innerResultPair"], + ["txSuccess", "results"], + ["txFailed", "results"], + ["txTooEarly", xdr.void()], + ["txTooLate", xdr.void()], + ["txMissingOperation", xdr.void()], + ["txBadSeq", xdr.void()], + ["txBadAuth", xdr.void()], + ["txInsufficientBalance", xdr.void()], + ["txNoAccount", xdr.void()], + ["txInsufficientFee", xdr.void()], + ["txBadAuthExtra", xdr.void()], + ["txInternalError", xdr.void()], + ["txNotSupported", xdr.void()], + ["txBadSponsorship", xdr.void()], + ["txBadMinSeqAgeOrGap", xdr.void()], + ["txMalformed", xdr.void()], + ["txSorobanInvalid", xdr.void()], + ], + arms: { + innerResultPair: xdr.lookup("InnerTransactionResultPair"), + results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionResultExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionResult + // { + // int64 feeCharged; // actual fee charged for the transaction + // + // union switch (TransactionResultCode code) + // { + // case txFEE_BUMP_INNER_SUCCESS: + // case txFEE_BUMP_INNER_FAILED: + // InnerTransactionResultPair innerResultPair; + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // case txFEE_BUMP_INNER_FAILED: handled above + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // result; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionResult", [ + ["feeCharged", xdr.lookup("Int64")], + ["result", xdr.lookup("TransactionResultResult")], + ["ext", xdr.lookup("TransactionResultExt")], + ]); + + // === xdr source ============================================================ + // + // typedef opaque Hash[32]; + // + // =========================================================================== + xdr.typedef("Hash", xdr.opaque(32)); + + // === xdr source ============================================================ + // + // typedef opaque uint256[32]; + // + // =========================================================================== + xdr.typedef("Uint256", xdr.opaque(32)); + + // === xdr source ============================================================ + // + // typedef unsigned int uint32; + // + // =========================================================================== + xdr.typedef("Uint32", xdr.uint()); + + // === xdr source ============================================================ + // + // typedef int int32; + // + // =========================================================================== + xdr.typedef("Int32", xdr.int()); + + // === xdr source ============================================================ + // + // typedef unsigned hyper uint64; + // + // =========================================================================== + xdr.typedef("Uint64", xdr.uhyper()); + + // === xdr source ============================================================ + // + // typedef hyper int64; + // + // =========================================================================== + xdr.typedef("Int64", xdr.hyper()); + + // === xdr source ============================================================ + // + // typedef uint64 TimePoint; + // + // =========================================================================== + xdr.typedef("TimePoint", xdr.lookup("Uint64")); + + // === xdr source ============================================================ + // + // typedef uint64 Duration; + // + // =========================================================================== + xdr.typedef("Duration", xdr.lookup("Uint64")); + + // === xdr source ============================================================ + // + // union ExtensionPoint switch (int v) + // { + // case 0: + // void; + // }; + // + // =========================================================================== + xdr.union("ExtensionPoint", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum CryptoKeyType + // { + // KEY_TYPE_ED25519 = 0, + // KEY_TYPE_PRE_AUTH_TX = 1, + // KEY_TYPE_HASH_X = 2, + // KEY_TYPE_ED25519_SIGNED_PAYLOAD = 3, + // // MUXED enum values for supported type are derived from the enum values + // // above by ORing them with 0x100 + // KEY_TYPE_MUXED_ED25519 = 0x100 + // }; + // + // =========================================================================== + xdr.enum("CryptoKeyType", { + keyTypeEd25519: 0, + keyTypePreAuthTx: 1, + keyTypeHashX: 2, + keyTypeEd25519SignedPayload: 3, + keyTypeMuxedEd25519: 256, + }); + + // === xdr source ============================================================ + // + // enum PublicKeyType + // { + // PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519 + // }; + // + // =========================================================================== + xdr.enum("PublicKeyType", { + publicKeyTypeEd25519: 0, + }); + + // === xdr source ============================================================ + // + // enum SignerKeyType + // { + // SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, + // SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, + // SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X, + // SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD + // }; + // + // =========================================================================== + xdr.enum("SignerKeyType", { + signerKeyTypeEd25519: 0, + signerKeyTypePreAuthTx: 1, + signerKeyTypeHashX: 2, + signerKeyTypeEd25519SignedPayload: 3, + }); + + // === xdr source ============================================================ + // + // union PublicKey switch (PublicKeyType type) + // { + // case PUBLIC_KEY_TYPE_ED25519: + // uint256 ed25519; + // }; + // + // =========================================================================== + xdr.union("PublicKey", { + switchOn: xdr.lookup("PublicKeyType"), + switchName: "type", + switches: [["publicKeyTypeEd25519", "ed25519"]], + arms: { + ed25519: xdr.lookup("Uint256"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // /* Public key that must sign the payload. */ + // uint256 ed25519; + // /* Payload to be raw signed by ed25519. */ + // opaque payload<64>; + // } + // + // =========================================================================== + xdr.struct("SignerKeyEd25519SignedPayload", [ + ["ed25519", xdr.lookup("Uint256")], + ["payload", xdr.varOpaque(64)], + ]); + + // === xdr source ============================================================ + // + // union SignerKey switch (SignerKeyType type) + // { + // case SIGNER_KEY_TYPE_ED25519: + // uint256 ed25519; + // case SIGNER_KEY_TYPE_PRE_AUTH_TX: + // /* SHA-256 Hash of TransactionSignaturePayload structure */ + // uint256 preAuthTx; + // case SIGNER_KEY_TYPE_HASH_X: + // /* Hash of random 256 bit preimage X */ + // uint256 hashX; + // case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD: + // struct + // { + // /* Public key that must sign the payload. */ + // uint256 ed25519; + // /* Payload to be raw signed by ed25519. */ + // opaque payload<64>; + // } ed25519SignedPayload; + // }; + // + // =========================================================================== + xdr.union("SignerKey", { + switchOn: xdr.lookup("SignerKeyType"), + switchName: "type", + switches: [ + ["signerKeyTypeEd25519", "ed25519"], + ["signerKeyTypePreAuthTx", "preAuthTx"], + ["signerKeyTypeHashX", "hashX"], + ["signerKeyTypeEd25519SignedPayload", "ed25519SignedPayload"], + ], + arms: { + ed25519: xdr.lookup("Uint256"), + preAuthTx: xdr.lookup("Uint256"), + hashX: xdr.lookup("Uint256"), + ed25519SignedPayload: xdr.lookup("SignerKeyEd25519SignedPayload"), + }, + }); + + // === xdr source ============================================================ + // + // typedef opaque Signature<64>; + // + // =========================================================================== + xdr.typedef("Signature", xdr.varOpaque(64)); + + // === xdr source ============================================================ + // + // typedef opaque SignatureHint[4]; + // + // =========================================================================== + xdr.typedef("SignatureHint", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef PublicKey NodeID; + // + // =========================================================================== + xdr.typedef("NodeId", xdr.lookup("PublicKey")); + + // === xdr source ============================================================ + // + // typedef PublicKey AccountID; + // + // =========================================================================== + xdr.typedef("AccountId", xdr.lookup("PublicKey")); + + // === xdr source ============================================================ + // + // struct Curve25519Secret + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("Curve25519Secret", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct Curve25519Public + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("Curve25519Public", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct HmacSha256Key + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("HmacSha256Key", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct HmacSha256Mac + // { + // opaque mac[32]; + // }; + // + // =========================================================================== + xdr.struct("HmacSha256Mac", [["mac", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // enum SCValType + // { + // SCV_BOOL = 0, + // SCV_VOID = 1, + // SCV_ERROR = 2, + // + // // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. + // SCV_U32 = 3, + // SCV_I32 = 4, + // + // // 64 bits is naturally supported by both WASM and XDR also. + // SCV_U64 = 5, + // SCV_I64 = 6, + // + // // Time-related u64 subtypes with their own functions and formatting. + // SCV_TIMEPOINT = 7, + // SCV_DURATION = 8, + // + // // 128 bits is naturally supported by Rust and we use it for Soroban + // // fixed-point arithmetic prices / balances / similar "quantities". These + // // are represented in XDR as a pair of 2 u64s. + // SCV_U128 = 9, + // SCV_I128 = 10, + // + // // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine + // // word, so for interop use we include this even though it requires a small + // // amount of Rust guest and/or host library code. + // SCV_U256 = 11, + // SCV_I256 = 12, + // + // // Bytes come in 3 flavors, 2 of which have meaningfully different + // // formatting and validity-checking / domain-restriction. + // SCV_BYTES = 13, + // SCV_STRING = 14, + // SCV_SYMBOL = 15, + // + // // Vecs and maps are just polymorphic containers of other ScVals. + // SCV_VEC = 16, + // SCV_MAP = 17, + // + // // Address is the universal identifier for contracts and classic + // // accounts. + // SCV_ADDRESS = 18, + // + // // The following are the internal SCVal variants that are not + // // exposed to the contracts. + // SCV_CONTRACT_INSTANCE = 19, + // + // // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique + // // symbolic SCVals used as the key for ledger entries for a contract's + // // instance and an address' nonce, respectively. + // SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20, + // SCV_LEDGER_KEY_NONCE = 21 + // }; + // + // =========================================================================== + xdr.enum("ScValType", { + scvBool: 0, + scvVoid: 1, + scvError: 2, + scvU32: 3, + scvI32: 4, + scvU64: 5, + scvI64: 6, + scvTimepoint: 7, + scvDuration: 8, + scvU128: 9, + scvI128: 10, + scvU256: 11, + scvI256: 12, + scvBytes: 13, + scvString: 14, + scvSymbol: 15, + scvVec: 16, + scvMap: 17, + scvAddress: 18, + scvContractInstance: 19, + scvLedgerKeyContractInstance: 20, + scvLedgerKeyNonce: 21, + }); + + // === xdr source ============================================================ + // + // enum SCErrorType + // { + // SCE_CONTRACT = 0, // Contract-specific, user-defined codes. + // SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode. + // SCE_CONTEXT = 2, // Errors in the contract's host context. + // SCE_STORAGE = 3, // Errors accessing host storage. + // SCE_OBJECT = 4, // Errors working with host objects. + // SCE_CRYPTO = 5, // Errors in cryptographic operations. + // SCE_EVENTS = 6, // Errors while emitting events. + // SCE_BUDGET = 7, // Errors relating to budget limits. + // SCE_VALUE = 8, // Errors working with host values or SCVals. + // SCE_AUTH = 9 // Errors from the authentication subsystem. + // }; + // + // =========================================================================== + xdr.enum("ScErrorType", { + sceContract: 0, + sceWasmVm: 1, + sceContext: 2, + sceStorage: 3, + sceObject: 4, + sceCrypto: 5, + sceEvents: 6, + sceBudget: 7, + sceValue: 8, + sceAuth: 9, + }); + + // === xdr source ============================================================ + // + // enum SCErrorCode + // { + // SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero). + // SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds. + // SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data. + // SCEC_MISSING_VALUE = 3, // Some value was required but not provided. + // SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed. + // SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit. + // SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not. + // SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic. + // SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected. + // SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected. + // }; + // + // =========================================================================== + xdr.enum("ScErrorCode", { + scecArithDomain: 0, + scecIndexBounds: 1, + scecInvalidInput: 2, + scecMissingValue: 3, + scecExistingValue: 4, + scecExceededLimit: 5, + scecInvalidAction: 6, + scecInternalError: 7, + scecUnexpectedType: 8, + scecUnexpectedSize: 9, + }); + + // === xdr source ============================================================ + // + // union SCError switch (SCErrorType type) + // { + // case SCE_CONTRACT: + // uint32 contractCode; + // case SCE_WASM_VM: + // case SCE_CONTEXT: + // case SCE_STORAGE: + // case SCE_OBJECT: + // case SCE_CRYPTO: + // case SCE_EVENTS: + // case SCE_BUDGET: + // case SCE_VALUE: + // case SCE_AUTH: + // SCErrorCode code; + // }; + // + // =========================================================================== + xdr.union("ScError", { + switchOn: xdr.lookup("ScErrorType"), + switchName: "type", + switches: [ + ["sceContract", "contractCode"], + ["sceWasmVm", "code"], + ["sceContext", "code"], + ["sceStorage", "code"], + ["sceObject", "code"], + ["sceCrypto", "code"], + ["sceEvents", "code"], + ["sceBudget", "code"], + ["sceValue", "code"], + ["sceAuth", "code"], + ], + arms: { + contractCode: xdr.lookup("Uint32"), + code: xdr.lookup("ScErrorCode"), + }, + }); + + // === xdr source ============================================================ + // + // struct UInt128Parts { + // uint64 hi; + // uint64 lo; + // }; + // + // =========================================================================== + xdr.struct("UInt128Parts", [ + ["hi", xdr.lookup("Uint64")], + ["lo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct Int128Parts { + // int64 hi; + // uint64 lo; + // }; + // + // =========================================================================== + xdr.struct("Int128Parts", [ + ["hi", xdr.lookup("Int64")], + ["lo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct UInt256Parts { + // uint64 hi_hi; + // uint64 hi_lo; + // uint64 lo_hi; + // uint64 lo_lo; + // }; + // + // =========================================================================== + xdr.struct("UInt256Parts", [ + ["hiHi", xdr.lookup("Uint64")], + ["hiLo", xdr.lookup("Uint64")], + ["loHi", xdr.lookup("Uint64")], + ["loLo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct Int256Parts { + // int64 hi_hi; + // uint64 hi_lo; + // uint64 lo_hi; + // uint64 lo_lo; + // }; + // + // =========================================================================== + xdr.struct("Int256Parts", [ + ["hiHi", xdr.lookup("Int64")], + ["hiLo", xdr.lookup("Uint64")], + ["loHi", xdr.lookup("Uint64")], + ["loLo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // enum ContractExecutableType + // { + // CONTRACT_EXECUTABLE_WASM = 0, + // CONTRACT_EXECUTABLE_TOKEN = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractExecutableType", { + contractExecutableWasm: 0, + contractExecutableToken: 1, + }); + + // === xdr source ============================================================ + // + // union ContractExecutable switch (ContractExecutableType type) + // { + // case CONTRACT_EXECUTABLE_WASM: + // Hash wasm_hash; + // case CONTRACT_EXECUTABLE_TOKEN: + // void; + // }; + // + // =========================================================================== + xdr.union("ContractExecutable", { + switchOn: xdr.lookup("ContractExecutableType"), + switchName: "type", + switches: [ + ["contractExecutableWasm", "wasmHash"], + ["contractExecutableToken", xdr.void()], + ], + arms: { + wasmHash: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum SCAddressType + // { + // SC_ADDRESS_TYPE_ACCOUNT = 0, + // SC_ADDRESS_TYPE_CONTRACT = 1 + // }; + // + // =========================================================================== + xdr.enum("ScAddressType", { + scAddressTypeAccount: 0, + scAddressTypeContract: 1, + }); + + // === xdr source ============================================================ + // + // union SCAddress switch (SCAddressType type) + // { + // case SC_ADDRESS_TYPE_ACCOUNT: + // AccountID accountId; + // case SC_ADDRESS_TYPE_CONTRACT: + // Hash contractId; + // }; + // + // =========================================================================== + xdr.union("ScAddress", { + switchOn: xdr.lookup("ScAddressType"), + switchName: "type", + switches: [ + ["scAddressTypeAccount", "accountId"], + ["scAddressTypeContract", "contractId"], + ], + arms: { + accountId: xdr.lookup("AccountId"), + contractId: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // const SCSYMBOL_LIMIT = 32; + // + // =========================================================================== + xdr.const("SCSYMBOL_LIMIT", 32); + + // === xdr source ============================================================ + // + // typedef SCVal SCVec<>; + // + // =========================================================================== + xdr.typedef("ScVec", xdr.varArray(xdr.lookup("ScVal"), 2147483647)); + + // === xdr source ============================================================ + // + // typedef SCMapEntry SCMap<>; + // + // =========================================================================== + xdr.typedef("ScMap", xdr.varArray(xdr.lookup("ScMapEntry"), 2147483647)); + + // === xdr source ============================================================ + // + // typedef opaque SCBytes<>; + // + // =========================================================================== + xdr.typedef("ScBytes", xdr.varOpaque()); + + // === xdr source ============================================================ + // + // typedef string SCString<>; + // + // =========================================================================== + xdr.typedef("ScString", xdr.string()); + + // === xdr source ============================================================ + // + // typedef string SCSymbol; + // + // =========================================================================== + xdr.typedef("ScSymbol", xdr.string(SCSYMBOL_LIMIT)); + + // === xdr source ============================================================ + // + // struct SCNonceKey { + // int64 nonce; + // }; + // + // =========================================================================== + xdr.struct("ScNonceKey", [["nonce", xdr.lookup("Int64")]]); + + // === xdr source ============================================================ + // + // struct SCContractInstance { + // ContractExecutable executable; + // SCMap* storage; + // }; + // + // =========================================================================== + xdr.struct("ScContractInstance", [ + ["executable", xdr.lookup("ContractExecutable")], + ["storage", xdr.option(xdr.lookup("ScMap"))], + ]); + + // === xdr source ============================================================ + // + // union SCVal switch (SCValType type) + // { + // + // case SCV_BOOL: + // bool b; + // case SCV_VOID: + // void; + // case SCV_ERROR: + // SCError error; + // + // case SCV_U32: + // uint32 u32; + // case SCV_I32: + // int32 i32; + // + // case SCV_U64: + // uint64 u64; + // case SCV_I64: + // int64 i64; + // case SCV_TIMEPOINT: + // TimePoint timepoint; + // case SCV_DURATION: + // Duration duration; + // + // case SCV_U128: + // UInt128Parts u128; + // case SCV_I128: + // Int128Parts i128; + // + // case SCV_U256: + // UInt256Parts u256; + // case SCV_I256: + // Int256Parts i256; + // + // case SCV_BYTES: + // SCBytes bytes; + // case SCV_STRING: + // SCString str; + // case SCV_SYMBOL: + // SCSymbol sym; + // + // // Vec and Map are recursive so need to live + // // behind an option, due to xdrpp limitations. + // case SCV_VEC: + // SCVec *vec; + // case SCV_MAP: + // SCMap *map; + // + // case SCV_ADDRESS: + // SCAddress address; + // + // // Special SCVals reserved for system-constructed contract-data + // // ledger keys, not generally usable elsewhere. + // case SCV_LEDGER_KEY_CONTRACT_INSTANCE: + // void; + // case SCV_LEDGER_KEY_NONCE: + // SCNonceKey nonce_key; + // + // case SCV_CONTRACT_INSTANCE: + // SCContractInstance instance; + // }; + // + // =========================================================================== + xdr.union("ScVal", { + switchOn: xdr.lookup("ScValType"), + switchName: "type", + switches: [ + ["scvBool", "b"], + ["scvVoid", xdr.void()], + ["scvError", "error"], + ["scvU32", "u32"], + ["scvI32", "i32"], + ["scvU64", "u64"], + ["scvI64", "i64"], + ["scvTimepoint", "timepoint"], + ["scvDuration", "duration"], + ["scvU128", "u128"], + ["scvI128", "i128"], + ["scvU256", "u256"], + ["scvI256", "i256"], + ["scvBytes", "bytes"], + ["scvString", "str"], + ["scvSymbol", "sym"], + ["scvVec", "vec"], + ["scvMap", "map"], + ["scvAddress", "address"], + ["scvLedgerKeyContractInstance", xdr.void()], + ["scvLedgerKeyNonce", "nonceKey"], + ["scvContractInstance", "instance"], + ], + arms: { + b: xdr.bool(), + error: xdr.lookup("ScError"), + u32: xdr.lookup("Uint32"), + i32: xdr.lookup("Int32"), + u64: xdr.lookup("Uint64"), + i64: xdr.lookup("Int64"), + timepoint: xdr.lookup("TimePoint"), + duration: xdr.lookup("Duration"), + u128: xdr.lookup("UInt128Parts"), + i128: xdr.lookup("Int128Parts"), + u256: xdr.lookup("UInt256Parts"), + i256: xdr.lookup("Int256Parts"), + bytes: xdr.lookup("ScBytes"), + str: xdr.lookup("ScString"), + sym: xdr.lookup("ScSymbol"), + vec: xdr.option(xdr.lookup("ScVec")), + map: xdr.option(xdr.lookup("ScMap")), + address: xdr.lookup("ScAddress"), + nonceKey: xdr.lookup("ScNonceKey"), + instance: xdr.lookup("ScContractInstance"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCMapEntry + // { + // SCVal key; + // SCVal val; + // }; + // + // =========================================================================== + xdr.struct("ScMapEntry", [ + ["key", xdr.lookup("ScVal")], + ["val", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // enum SCEnvMetaKind + // { + // SC_ENV_META_KIND_INTERFACE_VERSION = 0 + // }; + // + // =========================================================================== + xdr.enum("ScEnvMetaKind", { + scEnvMetaKindInterfaceVersion: 0, + }); + + // === xdr source ============================================================ + // + // union SCEnvMetaEntry switch (SCEnvMetaKind kind) + // { + // case SC_ENV_META_KIND_INTERFACE_VERSION: + // uint64 interfaceVersion; + // }; + // + // =========================================================================== + xdr.union("ScEnvMetaEntry", { + switchOn: xdr.lookup("ScEnvMetaKind"), + switchName: "kind", + switches: [["scEnvMetaKindInterfaceVersion", "interfaceVersion"]], + arms: { + interfaceVersion: xdr.lookup("Uint64"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCMetaV0 + // { + // string key<>; + // string val<>; + // }; + // + // =========================================================================== + xdr.struct("ScMetaV0", [ + ["key", xdr.string()], + ["val", xdr.string()], + ]); + + // === xdr source ============================================================ + // + // enum SCMetaKind + // { + // SC_META_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ScMetaKind", { + scMetaV0: 0, + }); + + // === xdr source ============================================================ + // + // union SCMetaEntry switch (SCMetaKind kind) + // { + // case SC_META_V0: + // SCMetaV0 v0; + // }; + // + // =========================================================================== + xdr.union("ScMetaEntry", { + switchOn: xdr.lookup("ScMetaKind"), + switchName: "kind", + switches: [["scMetaV0", "v0"]], + arms: { + v0: xdr.lookup("ScMetaV0"), + }, + }); + + // === xdr source ============================================================ + // + // const SC_SPEC_DOC_LIMIT = 1024; + // + // =========================================================================== + xdr.const("SC_SPEC_DOC_LIMIT", 1024); + + // === xdr source ============================================================ + // + // enum SCSpecType + // { + // SC_SPEC_TYPE_VAL = 0, + // + // // Types with no parameters. + // SC_SPEC_TYPE_BOOL = 1, + // SC_SPEC_TYPE_VOID = 2, + // SC_SPEC_TYPE_ERROR = 3, + // SC_SPEC_TYPE_U32 = 4, + // SC_SPEC_TYPE_I32 = 5, + // SC_SPEC_TYPE_U64 = 6, + // SC_SPEC_TYPE_I64 = 7, + // SC_SPEC_TYPE_TIMEPOINT = 8, + // SC_SPEC_TYPE_DURATION = 9, + // SC_SPEC_TYPE_U128 = 10, + // SC_SPEC_TYPE_I128 = 11, + // SC_SPEC_TYPE_U256 = 12, + // SC_SPEC_TYPE_I256 = 13, + // SC_SPEC_TYPE_BYTES = 14, + // SC_SPEC_TYPE_STRING = 16, + // SC_SPEC_TYPE_SYMBOL = 17, + // SC_SPEC_TYPE_ADDRESS = 19, + // + // // Types with parameters. + // SC_SPEC_TYPE_OPTION = 1000, + // SC_SPEC_TYPE_RESULT = 1001, + // SC_SPEC_TYPE_VEC = 1002, + // SC_SPEC_TYPE_MAP = 1004, + // SC_SPEC_TYPE_TUPLE = 1005, + // SC_SPEC_TYPE_BYTES_N = 1006, + // + // // User defined types. + // SC_SPEC_TYPE_UDT = 2000 + // }; + // + // =========================================================================== + xdr.enum("ScSpecType", { + scSpecTypeVal: 0, + scSpecTypeBool: 1, + scSpecTypeVoid: 2, + scSpecTypeError: 3, + scSpecTypeU32: 4, + scSpecTypeI32: 5, + scSpecTypeU64: 6, + scSpecTypeI64: 7, + scSpecTypeTimepoint: 8, + scSpecTypeDuration: 9, + scSpecTypeU128: 10, + scSpecTypeI128: 11, + scSpecTypeU256: 12, + scSpecTypeI256: 13, + scSpecTypeBytes: 14, + scSpecTypeString: 16, + scSpecTypeSymbol: 17, + scSpecTypeAddress: 19, + scSpecTypeOption: 1000, + scSpecTypeResult: 1001, + scSpecTypeVec: 1002, + scSpecTypeMap: 1004, + scSpecTypeTuple: 1005, + scSpecTypeBytesN: 1006, + scSpecTypeUdt: 2000, + }); + + // === xdr source ============================================================ + // + // struct SCSpecTypeOption + // { + // SCSpecTypeDef valueType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeOption", [["valueType", xdr.lookup("ScSpecTypeDef")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeResult + // { + // SCSpecTypeDef okType; + // SCSpecTypeDef errorType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeResult", [ + ["okType", xdr.lookup("ScSpecTypeDef")], + ["errorType", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeVec + // { + // SCSpecTypeDef elementType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeVec", [["elementType", xdr.lookup("ScSpecTypeDef")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeMap + // { + // SCSpecTypeDef keyType; + // SCSpecTypeDef valueType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeMap", [ + ["keyType", xdr.lookup("ScSpecTypeDef")], + ["valueType", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeTuple + // { + // SCSpecTypeDef valueTypes<12>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeTuple", [ + ["valueTypes", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeBytesN + // { + // uint32 n; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeBytesN", [["n", xdr.lookup("Uint32")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeUDT + // { + // string name<60>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeUdt", [["name", xdr.string(60)]]); + + // === xdr source ============================================================ + // + // union SCSpecTypeDef switch (SCSpecType type) + // { + // case SC_SPEC_TYPE_VAL: + // case SC_SPEC_TYPE_BOOL: + // case SC_SPEC_TYPE_VOID: + // case SC_SPEC_TYPE_ERROR: + // case SC_SPEC_TYPE_U32: + // case SC_SPEC_TYPE_I32: + // case SC_SPEC_TYPE_U64: + // case SC_SPEC_TYPE_I64: + // case SC_SPEC_TYPE_TIMEPOINT: + // case SC_SPEC_TYPE_DURATION: + // case SC_SPEC_TYPE_U128: + // case SC_SPEC_TYPE_I128: + // case SC_SPEC_TYPE_U256: + // case SC_SPEC_TYPE_I256: + // case SC_SPEC_TYPE_BYTES: + // case SC_SPEC_TYPE_STRING: + // case SC_SPEC_TYPE_SYMBOL: + // case SC_SPEC_TYPE_ADDRESS: + // void; + // case SC_SPEC_TYPE_OPTION: + // SCSpecTypeOption option; + // case SC_SPEC_TYPE_RESULT: + // SCSpecTypeResult result; + // case SC_SPEC_TYPE_VEC: + // SCSpecTypeVec vec; + // case SC_SPEC_TYPE_MAP: + // SCSpecTypeMap map; + // case SC_SPEC_TYPE_TUPLE: + // SCSpecTypeTuple tuple; + // case SC_SPEC_TYPE_BYTES_N: + // SCSpecTypeBytesN bytesN; + // case SC_SPEC_TYPE_UDT: + // SCSpecTypeUDT udt; + // }; + // + // =========================================================================== + xdr.union("ScSpecTypeDef", { + switchOn: xdr.lookup("ScSpecType"), + switchName: "type", + switches: [ + ["scSpecTypeVal", xdr.void()], + ["scSpecTypeBool", xdr.void()], + ["scSpecTypeVoid", xdr.void()], + ["scSpecTypeError", xdr.void()], + ["scSpecTypeU32", xdr.void()], + ["scSpecTypeI32", xdr.void()], + ["scSpecTypeU64", xdr.void()], + ["scSpecTypeI64", xdr.void()], + ["scSpecTypeTimepoint", xdr.void()], + ["scSpecTypeDuration", xdr.void()], + ["scSpecTypeU128", xdr.void()], + ["scSpecTypeI128", xdr.void()], + ["scSpecTypeU256", xdr.void()], + ["scSpecTypeI256", xdr.void()], + ["scSpecTypeBytes", xdr.void()], + ["scSpecTypeString", xdr.void()], + ["scSpecTypeSymbol", xdr.void()], + ["scSpecTypeAddress", xdr.void()], + ["scSpecTypeOption", "option"], + ["scSpecTypeResult", "result"], + ["scSpecTypeVec", "vec"], + ["scSpecTypeMap", "map"], + ["scSpecTypeTuple", "tuple"], + ["scSpecTypeBytesN", "bytesN"], + ["scSpecTypeUdt", "udt"], + ], + arms: { + option: xdr.lookup("ScSpecTypeOption"), + result: xdr.lookup("ScSpecTypeResult"), + vec: xdr.lookup("ScSpecTypeVec"), + map: xdr.lookup("ScSpecTypeMap"), + tuple: xdr.lookup("ScSpecTypeTuple"), + bytesN: xdr.lookup("ScSpecTypeBytesN"), + udt: xdr.lookup("ScSpecTypeUdt"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructFieldV0 + // { + // string doc; + // string name<30>; + // SCSpecTypeDef type; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtStructFieldV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTStructFieldV0 fields<40>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtStructV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["fields", xdr.varArray(xdr.lookup("ScSpecUdtStructFieldV0"), 40)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionCaseVoidV0 + // { + // string doc; + // string name<60>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionCaseVoidV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionCaseTupleV0 + // { + // string doc; + // string name<60>; + // SCSpecTypeDef type<12>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionCaseTupleV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["type", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], + ]); + + // === xdr source ============================================================ + // + // enum SCSpecUDTUnionCaseV0Kind + // { + // SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0, + // SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1 + // }; + // + // =========================================================================== + xdr.enum("ScSpecUdtUnionCaseV0Kind", { + scSpecUdtUnionCaseVoidV0: 0, + scSpecUdtUnionCaseTupleV0: 1, + }); + + // === xdr source ============================================================ + // + // union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind) + // { + // case SC_SPEC_UDT_UNION_CASE_VOID_V0: + // SCSpecUDTUnionCaseVoidV0 voidCase; + // case SC_SPEC_UDT_UNION_CASE_TUPLE_V0: + // SCSpecUDTUnionCaseTupleV0 tupleCase; + // }; + // + // =========================================================================== + xdr.union("ScSpecUdtUnionCaseV0", { + switchOn: xdr.lookup("ScSpecUdtUnionCaseV0Kind"), + switchName: "kind", + switches: [ + ["scSpecUdtUnionCaseVoidV0", "voidCase"], + ["scSpecUdtUnionCaseTupleV0", "tupleCase"], + ], + arms: { + voidCase: xdr.lookup("ScSpecUdtUnionCaseVoidV0"), + tupleCase: xdr.lookup("ScSpecUdtUnionCaseTupleV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTUnionCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtUnionCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTEnumCaseV0 + // { + // string doc; + // string name<60>; + // uint32 value; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtEnumCaseV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["value", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTEnumV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTEnumCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtEnumV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtEnumCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTErrorEnumCaseV0 + // { + // string doc; + // string name<60>; + // uint32 value; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtErrorEnumCaseV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["value", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTErrorEnumV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTErrorEnumCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtErrorEnumV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtErrorEnumCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecFunctionInputV0 + // { + // string doc; + // string name<30>; + // SCSpecTypeDef type; + // }; + // + // =========================================================================== + xdr.struct("ScSpecFunctionInputV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecFunctionV0 + // { + // string doc; + // SCSymbol name; + // SCSpecFunctionInputV0 inputs<10>; + // SCSpecTypeDef outputs<1>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecFunctionV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.lookup("ScSymbol")], + ["inputs", xdr.varArray(xdr.lookup("ScSpecFunctionInputV0"), 10)], + ["outputs", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 1)], + ]); + + // === xdr source ============================================================ + // + // enum SCSpecEntryKind + // { + // SC_SPEC_ENTRY_FUNCTION_V0 = 0, + // SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, + // SC_SPEC_ENTRY_UDT_UNION_V0 = 2, + // SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, + // SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 + // }; + // + // =========================================================================== + xdr.enum("ScSpecEntryKind", { + scSpecEntryFunctionV0: 0, + scSpecEntryUdtStructV0: 1, + scSpecEntryUdtUnionV0: 2, + scSpecEntryUdtEnumV0: 3, + scSpecEntryUdtErrorEnumV0: 4, + }); + + // === xdr source ============================================================ + // + // union SCSpecEntry switch (SCSpecEntryKind kind) + // { + // case SC_SPEC_ENTRY_FUNCTION_V0: + // SCSpecFunctionV0 functionV0; + // case SC_SPEC_ENTRY_UDT_STRUCT_V0: + // SCSpecUDTStructV0 udtStructV0; + // case SC_SPEC_ENTRY_UDT_UNION_V0: + // SCSpecUDTUnionV0 udtUnionV0; + // case SC_SPEC_ENTRY_UDT_ENUM_V0: + // SCSpecUDTEnumV0 udtEnumV0; + // case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: + // SCSpecUDTErrorEnumV0 udtErrorEnumV0; + // }; + // + // =========================================================================== + xdr.union("ScSpecEntry", { + switchOn: xdr.lookup("ScSpecEntryKind"), + switchName: "kind", + switches: [ + ["scSpecEntryFunctionV0", "functionV0"], + ["scSpecEntryUdtStructV0", "udtStructV0"], + ["scSpecEntryUdtUnionV0", "udtUnionV0"], + ["scSpecEntryUdtEnumV0", "udtEnumV0"], + ["scSpecEntryUdtErrorEnumV0", "udtErrorEnumV0"], + ], + arms: { + functionV0: xdr.lookup("ScSpecFunctionV0"), + udtStructV0: xdr.lookup("ScSpecUdtStructV0"), + udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), + udtEnumV0: xdr.lookup("ScSpecUdtEnumV0"), + udtErrorEnumV0: xdr.lookup("ScSpecUdtErrorEnumV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractExecutionLanesV0 + // { + // // maximum number of Soroban transactions per ledger + // uint32 ledgerMaxTxCount; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractExecutionLanesV0", [ + ["ledgerMaxTxCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractComputeV0 + // { + // // Maximum instructions per ledger + // int64 ledgerMaxInstructions; + // // Maximum instructions per transaction + // int64 txMaxInstructions; + // // Cost of 10000 instructions + // int64 feeRatePerInstructionsIncrement; + // + // // Memory limit per transaction. Unlike instructions, there is no fee + // // for memory, just the limit. + // uint32 txMemoryLimit; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractComputeV0", [ + ["ledgerMaxInstructions", xdr.lookup("Int64")], + ["txMaxInstructions", xdr.lookup("Int64")], + ["feeRatePerInstructionsIncrement", xdr.lookup("Int64")], + ["txMemoryLimit", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractLedgerCostV0 + // { + // // Maximum number of ledger entry read operations per ledger + // uint32 ledgerMaxReadLedgerEntries; + // // Maximum number of bytes that can be read per ledger + // uint32 ledgerMaxReadBytes; + // // Maximum number of ledger entry write operations per ledger + // uint32 ledgerMaxWriteLedgerEntries; + // // Maximum number of bytes that can be written per ledger + // uint32 ledgerMaxWriteBytes; + // + // // Maximum number of ledger entry read operations per transaction + // uint32 txMaxReadLedgerEntries; + // // Maximum number of bytes that can be read per transaction + // uint32 txMaxReadBytes; + // // Maximum number of ledger entry write operations per transaction + // uint32 txMaxWriteLedgerEntries; + // // Maximum number of bytes that can be written per transaction + // uint32 txMaxWriteBytes; + // + // int64 feeReadLedgerEntry; // Fee per ledger entry read + // int64 feeWriteLedgerEntry; // Fee per ledger entry write + // + // int64 feeRead1KB; // Fee for reading 1KB + // + // // The following parameters determine the write fee per 1KB. + // // Write fee grows linearly until bucket list reaches this size + // int64 bucketListTargetSizeBytes; + // // Fee per 1KB write when the bucket list is empty + // int64 writeFee1KBBucketListLow; + // // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` + // int64 writeFee1KBBucketListHigh; + // // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` + // uint32 bucketListWriteFeeGrowthFactor; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractLedgerCostV0", [ + ["ledgerMaxReadLedgerEntries", xdr.lookup("Uint32")], + ["ledgerMaxReadBytes", xdr.lookup("Uint32")], + ["ledgerMaxWriteLedgerEntries", xdr.lookup("Uint32")], + ["ledgerMaxWriteBytes", xdr.lookup("Uint32")], + ["txMaxReadLedgerEntries", xdr.lookup("Uint32")], + ["txMaxReadBytes", xdr.lookup("Uint32")], + ["txMaxWriteLedgerEntries", xdr.lookup("Uint32")], + ["txMaxWriteBytes", xdr.lookup("Uint32")], + ["feeReadLedgerEntry", xdr.lookup("Int64")], + ["feeWriteLedgerEntry", xdr.lookup("Int64")], + ["feeRead1Kb", xdr.lookup("Int64")], + ["bucketListTargetSizeBytes", xdr.lookup("Int64")], + ["writeFee1KbBucketListLow", xdr.lookup("Int64")], + ["writeFee1KbBucketListHigh", xdr.lookup("Int64")], + ["bucketListWriteFeeGrowthFactor", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractHistoricalDataV0 + // { + // int64 feeHistorical1KB; // Fee for storing 1KB in archives + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractHistoricalDataV0", [ + ["feeHistorical1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractEventsV0 + // { + // // Maximum size of events that a contract call can emit. + // uint32 txMaxContractEventsSizeBytes; + // // Fee for generating 1KB of contract events. + // int64 feeContractEvents1KB; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractEventsV0", [ + ["txMaxContractEventsSizeBytes", xdr.lookup("Uint32")], + ["feeContractEvents1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractBandwidthV0 + // { + // // Maximum sum of all transaction sizes in the ledger in bytes + // uint32 ledgerMaxTxsSizeBytes; + // // Maximum size in bytes for a transaction + // uint32 txMaxSizeBytes; + // + // // Fee for 1 KB of transaction size + // int64 feeTxSize1KB; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractBandwidthV0", [ + ["ledgerMaxTxsSizeBytes", xdr.lookup("Uint32")], + ["txMaxSizeBytes", xdr.lookup("Uint32")], + ["feeTxSize1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum ContractCostType { + // // Cost of running 1 wasm instruction + // WasmInsnExec = 0, + // // Cost of growing wasm linear memory by 1 page + // WasmMemAlloc = 1, + // // Cost of allocating a chuck of host memory (in bytes) + // HostMemAlloc = 2, + // // Cost of copying a chuck of bytes into a pre-allocated host memory + // HostMemCpy = 3, + // // Cost of comparing two slices of host memory + // HostMemCmp = 4, + // // Cost of a host function dispatch, not including the actual work done by + // // the function nor the cost of VM invocation machinary + // DispatchHostFunction = 5, + // // Cost of visiting a host object from the host object storage. Exists to + // // make sure some baseline cost coverage, i.e. repeatly visiting objects + // // by the guest will always incur some charges. + // VisitObject = 6, + // // Cost of serializing an xdr object to bytes + // ValSer = 7, + // // Cost of deserializing an xdr object from bytes + // ValDeser = 8, + // // Cost of computing the sha256 hash from bytes + // ComputeSha256Hash = 9, + // // Cost of computing the ed25519 pubkey from bytes + // ComputeEd25519PubKey = 10, + // // Cost of accessing an entry in a Map. + // MapEntry = 11, + // // Cost of accessing an entry in a Vec + // VecEntry = 12, + // // Cost of verifying ed25519 signature of a payload. + // VerifyEd25519Sig = 13, + // // Cost of reading a slice of vm linear memory + // VmMemRead = 14, + // // Cost of writing to a slice of vm linear memory + // VmMemWrite = 15, + // // Cost of instantiation a VM from wasm bytes code. + // VmInstantiation = 16, + // // Cost of instantiation a VM from a cached state. + // VmCachedInstantiation = 17, + // // Cost of invoking a function on the VM. If the function is a host function, + // // additional cost will be covered by `DispatchHostFunction`. + // InvokeVmFunction = 18, + // // Cost of computing a keccak256 hash from bytes. + // ComputeKeccak256Hash = 19, + // // Cost of computing an ECDSA secp256k1 pubkey from bytes. + // ComputeEcdsaSecp256k1Key = 20, + // // Cost of computing an ECDSA secp256k1 signature from bytes. + // ComputeEcdsaSecp256k1Sig = 21, + // // Cost of recovering an ECDSA secp256k1 key from a signature. + // RecoverEcdsaSecp256k1Key = 22, + // // Cost of int256 addition (`+`) and subtraction (`-`) operations + // Int256AddSub = 23, + // // Cost of int256 multiplication (`*`) operation + // Int256Mul = 24, + // // Cost of int256 division (`/`) operation + // Int256Div = 25, + // // Cost of int256 power (`exp`) operation + // Int256Pow = 26, + // // Cost of int256 shift (`shl`, `shr`) operation + // Int256Shift = 27 + // }; + // + // =========================================================================== + xdr.enum("ContractCostType", { + wasmInsnExec: 0, + wasmMemAlloc: 1, + hostMemAlloc: 2, + hostMemCpy: 3, + hostMemCmp: 4, + dispatchHostFunction: 5, + visitObject: 6, + valSer: 7, + valDeser: 8, + computeSha256Hash: 9, + computeEd25519PubKey: 10, + mapEntry: 11, + vecEntry: 12, + verifyEd25519Sig: 13, + vmMemRead: 14, + vmMemWrite: 15, + vmInstantiation: 16, + vmCachedInstantiation: 17, + invokeVmFunction: 18, + computeKeccak256Hash: 19, + computeEcdsaSecp256k1Key: 20, + computeEcdsaSecp256k1Sig: 21, + recoverEcdsaSecp256k1Key: 22, + int256AddSub: 23, + int256Mul: 24, + int256Div: 25, + int256Pow: 26, + int256Shift: 27, + }); + + // === xdr source ============================================================ + // + // struct ContractCostParamEntry { + // // use `ext` to add more terms (e.g. higher order polynomials) in the future + // ExtensionPoint ext; + // + // int64 constTerm; + // int64 linearTerm; + // }; + // + // =========================================================================== + xdr.struct("ContractCostParamEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["constTerm", xdr.lookup("Int64")], + ["linearTerm", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct StateExpirationSettings { + // uint32 maxEntryExpiration; + // uint32 minTempEntryExpiration; + // uint32 minPersistentEntryExpiration; + // + // // rent_fee = wfee_rate_average / rent_rate_denominator_for_type + // int64 persistentRentRateDenominator; + // int64 tempRentRateDenominator; + // + // // max number of entries that emit expiration meta in a single ledger + // uint32 maxEntriesToExpire; + // + // // Number of snapshots to use when calculating average BucketList size + // uint32 bucketListSizeWindowSampleSize; + // + // // Maximum number of bytes that we scan for eviction per ledger + // uint64 evictionScanSize; + // + // // Lowest BucketList level to be scanned to evict entries + // uint32 startingEvictionScanLevel; + // }; + // + // =========================================================================== + xdr.struct("StateExpirationSettings", [ + ["maxEntryExpiration", xdr.lookup("Uint32")], + ["minTempEntryExpiration", xdr.lookup("Uint32")], + ["minPersistentEntryExpiration", xdr.lookup("Uint32")], + ["persistentRentRateDenominator", xdr.lookup("Int64")], + ["tempRentRateDenominator", xdr.lookup("Int64")], + ["maxEntriesToExpire", xdr.lookup("Uint32")], + ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], + ["evictionScanSize", xdr.lookup("Uint64")], + ["startingEvictionScanLevel", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct EvictionIterator { + // uint32 bucketListLevel; + // bool isCurrBucket; + // uint64 bucketFileOffset; + // }; + // + // =========================================================================== + xdr.struct("EvictionIterator", [ + ["bucketListLevel", xdr.lookup("Uint32")], + ["isCurrBucket", xdr.bool()], + ["bucketFileOffset", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // const CONTRACT_COST_COUNT_LIMIT = 1024; + // + // =========================================================================== + xdr.const("CONTRACT_COST_COUNT_LIMIT", 1024); + + // === xdr source ============================================================ + // + // typedef ContractCostParamEntry ContractCostParams; + // + // =========================================================================== + xdr.typedef( + "ContractCostParams", + xdr.varArray( + xdr.lookup("ContractCostParamEntry"), + xdr.lookup("CONTRACT_COST_COUNT_LIMIT") + ) + ); + + // === xdr source ============================================================ + // + // enum ConfigSettingID + // { + // CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, + // CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, + // CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, + // CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, + // CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4, + // CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, + // CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6, + // CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, + // CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, + // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, + // CONFIG_SETTING_STATE_EXPIRATION = 10, + // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, + // CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, + // CONFIG_SETTING_EVICTION_ITERATOR = 13 + // }; + // + // =========================================================================== + xdr.enum("ConfigSettingId", { + configSettingContractMaxSizeBytes: 0, + configSettingContractComputeV0: 1, + configSettingContractLedgerCostV0: 2, + configSettingContractHistoricalDataV0: 3, + configSettingContractEventsV0: 4, + configSettingContractBandwidthV0: 5, + configSettingContractCostParamsCpuInstructions: 6, + configSettingContractCostParamsMemoryBytes: 7, + configSettingContractDataKeySizeBytes: 8, + configSettingContractDataEntrySizeBytes: 9, + configSettingStateExpiration: 10, + configSettingContractExecutionLanes: 11, + configSettingBucketlistSizeWindow: 12, + configSettingEvictionIterator: 13, + }); + + // === xdr source ============================================================ + // + // union ConfigSettingEntry switch (ConfigSettingID configSettingID) + // { + // case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: + // uint32 contractMaxSizeBytes; + // case CONFIG_SETTING_CONTRACT_COMPUTE_V0: + // ConfigSettingContractComputeV0 contractCompute; + // case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: + // ConfigSettingContractLedgerCostV0 contractLedgerCost; + // case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: + // ConfigSettingContractHistoricalDataV0 contractHistoricalData; + // case CONFIG_SETTING_CONTRACT_EVENTS_V0: + // ConfigSettingContractEventsV0 contractEvents; + // case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: + // ConfigSettingContractBandwidthV0 contractBandwidth; + // case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: + // ContractCostParams contractCostParamsCpuInsns; + // case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: + // ContractCostParams contractCostParamsMemBytes; + // case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: + // uint32 contractDataKeySizeBytes; + // case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: + // uint32 contractDataEntrySizeBytes; + // case CONFIG_SETTING_STATE_EXPIRATION: + // StateExpirationSettings stateExpirationSettings; + // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: + // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; + // case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: + // uint64 bucketListSizeWindow<>; + // case CONFIG_SETTING_EVICTION_ITERATOR: + // EvictionIterator evictionIterator; + // }; + // + // =========================================================================== + xdr.union("ConfigSettingEntry", { + switchOn: xdr.lookup("ConfigSettingId"), + switchName: "configSettingId", + switches: [ + ["configSettingContractMaxSizeBytes", "contractMaxSizeBytes"], + ["configSettingContractComputeV0", "contractCompute"], + ["configSettingContractLedgerCostV0", "contractLedgerCost"], + ["configSettingContractHistoricalDataV0", "contractHistoricalData"], + ["configSettingContractEventsV0", "contractEvents"], + ["configSettingContractBandwidthV0", "contractBandwidth"], + [ + "configSettingContractCostParamsCpuInstructions", + "contractCostParamsCpuInsns", + ], + [ + "configSettingContractCostParamsMemoryBytes", + "contractCostParamsMemBytes", + ], + ["configSettingContractDataKeySizeBytes", "contractDataKeySizeBytes"], + ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], + ["configSettingStateExpiration", "stateExpirationSettings"], + ["configSettingContractExecutionLanes", "contractExecutionLanes"], + ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], + ["configSettingEvictionIterator", "evictionIterator"], + ], + arms: { + contractMaxSizeBytes: xdr.lookup("Uint32"), + contractCompute: xdr.lookup("ConfigSettingContractComputeV0"), + contractLedgerCost: xdr.lookup("ConfigSettingContractLedgerCostV0"), + contractHistoricalData: xdr.lookup( + "ConfigSettingContractHistoricalDataV0" + ), + contractEvents: xdr.lookup("ConfigSettingContractEventsV0"), + contractBandwidth: xdr.lookup("ConfigSettingContractBandwidthV0"), + contractCostParamsCpuInsns: xdr.lookup("ContractCostParams"), + contractCostParamsMemBytes: xdr.lookup("ContractCostParams"), + contractDataKeySizeBytes: xdr.lookup("Uint32"), + contractDataEntrySizeBytes: xdr.lookup("Uint32"), + stateExpirationSettings: xdr.lookup("StateExpirationSettings"), + contractExecutionLanes: xdr.lookup( + "ConfigSettingContractExecutionLanesV0" + ), + bucketListSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), + evictionIterator: xdr.lookup("EvictionIterator"), + }, + }); }); export default types; diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index 25b8de063..713a09356 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -4,9532 +4,9766 @@ /* jshint maxstatements:2147483647 */ /* jshint esnext:true */ -import * as XDR from 'js-xdr'; - - -var types = XDR.config(xdr => { - -// === xdr source ============================================================ -// -// typedef opaque Value<>; -// -// =========================================================================== -xdr.typedef("Value", xdr.varOpaque()); - -// === xdr source ============================================================ -// -// struct SCPBallot -// { -// uint32 counter; // n -// Value value; // x -// }; -// -// =========================================================================== -xdr.struct("ScpBallot", [ - ["counter", xdr.lookup("Uint32")], - ["value", xdr.lookup("Value")], -]); - -// === xdr source ============================================================ -// -// enum SCPStatementType -// { -// SCP_ST_PREPARE = 0, -// SCP_ST_CONFIRM = 1, -// SCP_ST_EXTERNALIZE = 2, -// SCP_ST_NOMINATE = 3 -// }; -// -// =========================================================================== -xdr.enum("ScpStatementType", { - scpStPrepare: 0, - scpStConfirm: 1, - scpStExternalize: 2, - scpStNominate: 3, -}); - -// === xdr source ============================================================ -// -// struct SCPNomination -// { -// Hash quorumSetHash; // D -// Value votes<>; // X -// Value accepted<>; // Y -// }; -// -// =========================================================================== -xdr.struct("ScpNomination", [ - ["quorumSetHash", xdr.lookup("Hash")], - ["votes", xdr.varArray(xdr.lookup("Value"), 2147483647)], - ["accepted", xdr.varArray(xdr.lookup("Value"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } -// -// =========================================================================== -xdr.struct("ScpStatementPrepare", [ - ["quorumSetHash", xdr.lookup("Hash")], - ["ballot", xdr.lookup("ScpBallot")], - ["prepared", xdr.option(xdr.lookup("ScpBallot"))], - ["preparedPrime", xdr.option(xdr.lookup("ScpBallot"))], - ["nC", xdr.lookup("Uint32")], - ["nH", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } -// -// =========================================================================== -xdr.struct("ScpStatementConfirm", [ - ["ballot", xdr.lookup("ScpBallot")], - ["nPrepared", xdr.lookup("Uint32")], - ["nCommit", xdr.lookup("Uint32")], - ["nH", xdr.lookup("Uint32")], - ["quorumSetHash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } -// -// =========================================================================== -xdr.struct("ScpStatementExternalize", [ - ["commit", xdr.lookup("ScpBallot")], - ["nH", xdr.lookup("Uint32")], - ["commitQuorumSetHash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// union switch (SCPStatementType type) -// { -// case SCP_ST_PREPARE: -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } prepare; -// case SCP_ST_CONFIRM: -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } confirm; -// case SCP_ST_EXTERNALIZE: -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } externalize; -// case SCP_ST_NOMINATE: -// SCPNomination nominate; -// } -// -// =========================================================================== -xdr.union("ScpStatementPledges", { - switchOn: xdr.lookup("ScpStatementType"), - switchName: "type", - switches: [ - ["scpStPrepare", "prepare"], - ["scpStConfirm", "confirm"], - ["scpStExternalize", "externalize"], - ["scpStNominate", "nominate"], - ], - arms: { - prepare: xdr.lookup("ScpStatementPrepare"), - confirm: xdr.lookup("ScpStatementConfirm"), - externalize: xdr.lookup("ScpStatementExternalize"), - nominate: xdr.lookup("ScpNomination"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCPStatement -// { -// NodeID nodeID; // v -// uint64 slotIndex; // i -// -// union switch (SCPStatementType type) -// { -// case SCP_ST_PREPARE: -// struct -// { -// Hash quorumSetHash; // D -// SCPBallot ballot; // b -// SCPBallot* prepared; // p -// SCPBallot* preparedPrime; // p' -// uint32 nC; // c.n -// uint32 nH; // h.n -// } prepare; -// case SCP_ST_CONFIRM: -// struct -// { -// SCPBallot ballot; // b -// uint32 nPrepared; // p.n -// uint32 nCommit; // c.n -// uint32 nH; // h.n -// Hash quorumSetHash; // D -// } confirm; -// case SCP_ST_EXTERNALIZE: -// struct -// { -// SCPBallot commit; // c -// uint32 nH; // h.n -// Hash commitQuorumSetHash; // D used before EXTERNALIZE -// } externalize; -// case SCP_ST_NOMINATE: -// SCPNomination nominate; -// } -// pledges; -// }; -// -// =========================================================================== -xdr.struct("ScpStatement", [ - ["nodeId", xdr.lookup("NodeId")], - ["slotIndex", xdr.lookup("Uint64")], - ["pledges", xdr.lookup("ScpStatementPledges")], -]); - -// === xdr source ============================================================ -// -// struct SCPEnvelope -// { -// SCPStatement statement; -// Signature signature; -// }; -// -// =========================================================================== -xdr.struct("ScpEnvelope", [ - ["statement", xdr.lookup("ScpStatement")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// struct SCPQuorumSet -// { -// uint32 threshold; -// NodeID validators<>; -// SCPQuorumSet innerSets<>; -// }; -// -// =========================================================================== -xdr.struct("ScpQuorumSet", [ - ["threshold", xdr.lookup("Uint32")], - ["validators", xdr.varArray(xdr.lookup("NodeId"), 2147483647)], - ["innerSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// typedef opaque Thresholds[4]; -// -// =========================================================================== -xdr.typedef("Thresholds", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef string string32<32>; -// -// =========================================================================== -xdr.typedef("String32", xdr.string(32)); - -// === xdr source ============================================================ -// -// typedef string string64<64>; -// -// =========================================================================== -xdr.typedef("String64", xdr.string(64)); - -// === xdr source ============================================================ -// -// typedef int64 SequenceNumber; -// -// =========================================================================== -xdr.typedef("SequenceNumber", xdr.lookup("Int64")); - -// === xdr source ============================================================ -// -// typedef opaque DataValue<64>; -// -// =========================================================================== -xdr.typedef("DataValue", xdr.varOpaque(64)); - -// === xdr source ============================================================ -// -// typedef Hash PoolID; -// -// =========================================================================== -xdr.typedef("PoolId", xdr.lookup("Hash")); - -// === xdr source ============================================================ -// -// typedef opaque AssetCode4[4]; -// -// =========================================================================== -xdr.typedef("AssetCode4", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef opaque AssetCode12[12]; -// -// =========================================================================== -xdr.typedef("AssetCode12", xdr.opaque(12)); - -// === xdr source ============================================================ -// -// enum AssetType -// { -// ASSET_TYPE_NATIVE = 0, -// ASSET_TYPE_CREDIT_ALPHANUM4 = 1, -// ASSET_TYPE_CREDIT_ALPHANUM12 = 2, -// ASSET_TYPE_POOL_SHARE = 3 -// }; -// -// =========================================================================== -xdr.enum("AssetType", { - assetTypeNative: 0, - assetTypeCreditAlphanum4: 1, - assetTypeCreditAlphanum12: 2, - assetTypePoolShare: 3, -}); - -// === xdr source ============================================================ -// -// union AssetCode switch (AssetType type) -// { -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AssetCode4 assetCode4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AssetCode12 assetCode12; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("AssetCode", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeCreditAlphanum4", "assetCode4"], - ["assetTypeCreditAlphanum12", "assetCode12"], - ], - arms: { - assetCode4: xdr.lookup("AssetCode4"), - assetCode12: xdr.lookup("AssetCode12"), - }, -}); - -// === xdr source ============================================================ -// -// struct AlphaNum4 -// { -// AssetCode4 assetCode; -// AccountID issuer; -// }; -// -// =========================================================================== -xdr.struct("AlphaNum4", [ - ["assetCode", xdr.lookup("AssetCode4")], - ["issuer", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// struct AlphaNum12 -// { -// AssetCode12 assetCode; -// AccountID issuer; -// }; -// -// =========================================================================== -xdr.struct("AlphaNum12", [ - ["assetCode", xdr.lookup("AssetCode12")], - ["issuer", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// union Asset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("Asset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - }, -}); - -// === xdr source ============================================================ -// -// struct Price -// { -// int32 n; // numerator -// int32 d; // denominator -// }; -// -// =========================================================================== -xdr.struct("Price", [ - ["n", xdr.lookup("Int32")], - ["d", xdr.lookup("Int32")], -]); - -// === xdr source ============================================================ -// -// struct Liabilities -// { -// int64 buying; -// int64 selling; -// }; -// -// =========================================================================== -xdr.struct("Liabilities", [ - ["buying", xdr.lookup("Int64")], - ["selling", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// enum ThresholdIndexes -// { -// THRESHOLD_MASTER_WEIGHT = 0, -// THRESHOLD_LOW = 1, -// THRESHOLD_MED = 2, -// THRESHOLD_HIGH = 3 -// }; -// -// =========================================================================== -xdr.enum("ThresholdIndices", { - thresholdMasterWeight: 0, - thresholdLow: 1, - thresholdMed: 2, - thresholdHigh: 3, -}); - -// === xdr source ============================================================ -// -// enum LedgerEntryType -// { -// ACCOUNT = 0, -// TRUSTLINE = 1, -// OFFER = 2, -// DATA = 3, -// CLAIMABLE_BALANCE = 4, -// LIQUIDITY_POOL = 5, -// CONTRACT_DATA = 6, -// CONTRACT_CODE = 7, -// CONFIG_SETTING = 8 -// }; -// -// =========================================================================== -xdr.enum("LedgerEntryType", { - account: 0, - trustline: 1, - offer: 2, - data: 3, - claimableBalance: 4, - liquidityPool: 5, - contractData: 6, - contractCode: 7, - configSetting: 8, -}); - -// === xdr source ============================================================ -// -// struct Signer -// { -// SignerKey key; -// uint32 weight; // really only need 1 byte -// }; -// -// =========================================================================== -xdr.struct("Signer", [ - ["key", xdr.lookup("SignerKey")], - ["weight", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// enum AccountFlags -// { // masks for each flag -// -// // Flags set on issuer accounts -// // TrustLines are created with authorized set to "false" requiring -// // the issuer to set it for each TrustLine -// AUTH_REQUIRED_FLAG = 0x1, -// // If set, the authorized flag in TrustLines can be cleared -// // otherwise, authorization cannot be revoked -// AUTH_REVOCABLE_FLAG = 0x2, -// // Once set, causes all AUTH_* flags to be read-only -// AUTH_IMMUTABLE_FLAG = 0x4, -// // Trustlines are created with clawback enabled set to "true", -// // and claimable balances created from those trustlines are created -// // with clawback enabled set to "true" -// AUTH_CLAWBACK_ENABLED_FLAG = 0x8 -// }; -// -// =========================================================================== -xdr.enum("AccountFlags", { - authRequiredFlag: 1, - authRevocableFlag: 2, - authImmutableFlag: 4, - authClawbackEnabledFlag: 8, -}); - -// === xdr source ============================================================ -// -// const MASK_ACCOUNT_FLAGS = 0x7; -// -// =========================================================================== -xdr.const("MASK_ACCOUNT_FLAGS", 0x7); - -// === xdr source ============================================================ -// -// const MASK_ACCOUNT_FLAGS_V17 = 0xF; -// -// =========================================================================== -xdr.const("MASK_ACCOUNT_FLAGS_V17", 0xF); - -// === xdr source ============================================================ -// -// const MAX_SIGNERS = 20; -// -// =========================================================================== -xdr.const("MAX_SIGNERS", 20); - -// === xdr source ============================================================ -// -// typedef AccountID* SponsorshipDescriptor; -// -// =========================================================================== -xdr.typedef("SponsorshipDescriptor", xdr.option(xdr.lookup("AccountId"))); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV3 -// { -// // We can use this to add more fields, or because it is first, to -// // change AccountEntryExtensionV3 into a union. -// ExtensionPoint ext; -// -// // Ledger number at which `seqNum` took on its present value. -// uint32 seqLedger; -// -// // Time at which `seqNum` took on its present value. -// TimePoint seqTime; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV3", [ - ["ext", xdr.lookup("ExtensionPoint")], - ["seqLedger", xdr.lookup("Uint32")], - ["seqTime", xdr.lookup("TimePoint")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 3: -// AccountEntryExtensionV3 v3; -// } -// -// =========================================================================== -xdr.union("AccountEntryExtensionV2Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [3, "v3"], - ], - arms: { - v3: xdr.lookup("AccountEntryExtensionV3"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV2 -// { -// uint32 numSponsored; -// uint32 numSponsoring; -// SponsorshipDescriptor signerSponsoringIDs; -// -// union switch (int v) -// { -// case 0: -// void; -// case 3: -// AccountEntryExtensionV3 v3; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV2", [ - ["numSponsored", xdr.lookup("Uint32")], - ["numSponsoring", xdr.lookup("Uint32")], - ["signerSponsoringIDs", xdr.varArray(xdr.lookup("SponsorshipDescriptor"), xdr.lookup("MAX_SIGNERS"))], - ["ext", xdr.lookup("AccountEntryExtensionV2Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// AccountEntryExtensionV2 v2; -// } -// -// =========================================================================== -xdr.union("AccountEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [2, "v2"], - ], - arms: { - v2: xdr.lookup("AccountEntryExtensionV2"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntryExtensionV1 -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// AccountEntryExtensionV2 v2; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntryExtensionV1", [ - ["liabilities", xdr.lookup("Liabilities")], - ["ext", xdr.lookup("AccountEntryExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// AccountEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("AccountEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("AccountEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct AccountEntry -// { -// AccountID accountID; // master public key for this account -// int64 balance; // in stroops -// SequenceNumber seqNum; // last sequence number used for this account -// uint32 numSubEntries; // number of sub-entries this account has -// // drives the reserve -// AccountID* inflationDest; // Account to vote for during inflation -// uint32 flags; // see AccountFlags -// -// string32 homeDomain; // can be used for reverse federation and memo lookup -// -// // fields used for signatures -// // thresholds stores unsigned bytes: [weight of master|low|medium|high] -// Thresholds thresholds; -// -// Signer signers; // possible signers for this account -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// AccountEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("AccountEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["balance", xdr.lookup("Int64")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["numSubEntries", xdr.lookup("Uint32")], - ["inflationDest", xdr.option(xdr.lookup("AccountId"))], - ["flags", xdr.lookup("Uint32")], - ["homeDomain", xdr.lookup("String32")], - ["thresholds", xdr.lookup("Thresholds")], - ["signers", xdr.varArray(xdr.lookup("Signer"), xdr.lookup("MAX_SIGNERS"))], - ["ext", xdr.lookup("AccountEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum TrustLineFlags -// { -// // issuer has authorized account to perform transactions with its credit -// AUTHORIZED_FLAG = 1, -// // issuer has authorized account to maintain and reduce liabilities for its -// // credit -// AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, -// // issuer has specified that it may clawback its credit, and that claimable -// // balances created with its credit may also be clawed back -// TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 -// }; -// -// =========================================================================== -xdr.enum("TrustLineFlags", { - authorizedFlag: 1, - authorizedToMaintainLiabilitiesFlag: 2, - trustlineClawbackEnabledFlag: 4, -}); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS = 1; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS", 1); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS_V13 = 3; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS_V13", 3); - -// === xdr source ============================================================ -// -// const MASK_TRUSTLINE_FLAGS_V17 = 7; -// -// =========================================================================== -xdr.const("MASK_TRUSTLINE_FLAGS_V17", 7); - -// === xdr source ============================================================ -// -// enum LiquidityPoolType -// { -// LIQUIDITY_POOL_CONSTANT_PRODUCT = 0 -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolType", { - liquidityPoolConstantProduct: 0, -}); - -// === xdr source ============================================================ -// -// union TrustLineAsset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// case ASSET_TYPE_POOL_SHARE: -// PoolID liquidityPoolID; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("TrustLineAsset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ["assetTypePoolShare", "liquidityPoolId"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - liquidityPoolId: xdr.lookup("PoolId"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryExtensionV2Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TrustLineEntryExtensionV2 -// { -// int32 liquidityPoolUseCount; -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TrustLineEntryExtensionV2", [ - ["liquidityPoolUseCount", xdr.lookup("Int32")], - ["ext", xdr.lookup("TrustLineEntryExtensionV2Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [2, "v2"], - ], - arms: { - v2: xdr.lookup("TrustLineEntryExtensionV2"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } -// -// =========================================================================== -xdr.struct("TrustLineEntryV1", [ - ["liabilities", xdr.lookup("Liabilities")], - ["ext", xdr.lookup("TrustLineEntryV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } v1; -// } -// -// =========================================================================== -xdr.union("TrustLineEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("TrustLineEntryV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct TrustLineEntry -// { -// AccountID accountID; // account this trustline belongs to -// TrustLineAsset asset; // type of asset (with issuer) -// int64 balance; // how much of this asset the user has. -// // Asset defines the unit for this; -// -// int64 limit; // balance cannot be above this -// uint32 flags; // see TrustLineFlags -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// struct -// { -// Liabilities liabilities; -// -// union switch (int v) -// { -// case 0: -// void; -// case 2: -// TrustLineEntryExtensionV2 v2; -// } -// ext; -// } v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TrustLineEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["asset", xdr.lookup("TrustLineAsset")], - ["balance", xdr.lookup("Int64")], - ["limit", xdr.lookup("Int64")], - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("TrustLineEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum OfferEntryFlags -// { -// // an offer with this flag will not act on and take a reverse offer of equal -// // price -// PASSIVE_FLAG = 1 -// }; -// -// =========================================================================== -xdr.enum("OfferEntryFlags", { - passiveFlag: 1, -}); - -// === xdr source ============================================================ -// -// const MASK_OFFERENTRY_FLAGS = 1; -// -// =========================================================================== -xdr.const("MASK_OFFERENTRY_FLAGS", 1); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("OfferEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct OfferEntry -// { -// AccountID sellerID; -// int64 offerID; -// Asset selling; // A -// Asset buying; // B -// int64 amount; // amount of A -// -// /* price for this offer: -// price of A in terms of B -// price=AmountB/AmountA=priceNumerator/priceDenominator -// price is after fees -// */ -// Price price; -// uint32 flags; // see OfferEntryFlags -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("OfferEntry", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("OfferEntryExt")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("DataEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct DataEntry -// { -// AccountID accountID; // account this data belongs to -// string64 dataName; -// DataValue dataValue; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("DataEntry", [ - ["accountId", xdr.lookup("AccountId")], - ["dataName", xdr.lookup("String64")], - ["dataValue", xdr.lookup("DataValue")], - ["ext", xdr.lookup("DataEntryExt")], -]); - -// === xdr source ============================================================ -// -// enum ClaimPredicateType -// { -// CLAIM_PREDICATE_UNCONDITIONAL = 0, -// CLAIM_PREDICATE_AND = 1, -// CLAIM_PREDICATE_OR = 2, -// CLAIM_PREDICATE_NOT = 3, -// CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, -// CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 -// }; -// -// =========================================================================== -xdr.enum("ClaimPredicateType", { - claimPredicateUnconditional: 0, - claimPredicateAnd: 1, - claimPredicateOr: 2, - claimPredicateNot: 3, - claimPredicateBeforeAbsoluteTime: 4, - claimPredicateBeforeRelativeTime: 5, -}); - -// === xdr source ============================================================ -// -// union ClaimPredicate switch (ClaimPredicateType type) -// { -// case CLAIM_PREDICATE_UNCONDITIONAL: -// void; -// case CLAIM_PREDICATE_AND: -// ClaimPredicate andPredicates<2>; -// case CLAIM_PREDICATE_OR: -// ClaimPredicate orPredicates<2>; -// case CLAIM_PREDICATE_NOT: -// ClaimPredicate* notPredicate; -// case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: -// int64 absBefore; // Predicate will be true if closeTime < absBefore -// case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: -// int64 relBefore; // Seconds since closeTime of the ledger in which the -// // ClaimableBalanceEntry was created -// }; -// -// =========================================================================== -xdr.union("ClaimPredicate", { - switchOn: xdr.lookup("ClaimPredicateType"), - switchName: "type", - switches: [ - ["claimPredicateUnconditional", xdr.void()], - ["claimPredicateAnd", "andPredicates"], - ["claimPredicateOr", "orPredicates"], - ["claimPredicateNot", "notPredicate"], - ["claimPredicateBeforeAbsoluteTime", "absBefore"], - ["claimPredicateBeforeRelativeTime", "relBefore"], - ], - arms: { - andPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), - orPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), - notPredicate: xdr.option(xdr.lookup("ClaimPredicate")), - absBefore: xdr.lookup("Int64"), - relBefore: xdr.lookup("Int64"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimantType -// { -// CLAIMANT_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimantType", { - claimantTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID destination; // The account that can use this condition -// ClaimPredicate predicate; // Claimable if predicate is true -// } -// -// =========================================================================== -xdr.struct("ClaimantV0", [ - ["destination", xdr.lookup("AccountId")], - ["predicate", xdr.lookup("ClaimPredicate")], -]); - -// === xdr source ============================================================ -// -// union Claimant switch (ClaimantType type) -// { -// case CLAIMANT_TYPE_V0: -// struct -// { -// AccountID destination; // The account that can use this condition -// ClaimPredicate predicate; // Claimable if predicate is true -// } v0; -// }; -// -// =========================================================================== -xdr.union("Claimant", { - switchOn: xdr.lookup("ClaimantType"), - switchName: "type", - switches: [ - ["claimantTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("ClaimantV0"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimableBalanceIDType -// { -// CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceIdType", { - claimableBalanceIdTypeV0: 0, -}); - -// === xdr source ============================================================ -// -// union ClaimableBalanceID switch (ClaimableBalanceIDType type) -// { -// case CLAIMABLE_BALANCE_ID_TYPE_V0: -// Hash v0; -// }; -// -// =========================================================================== -xdr.union("ClaimableBalanceId", { - switchOn: xdr.lookup("ClaimableBalanceIdType"), - switchName: "type", - switches: [ - ["claimableBalanceIdTypeV0", "v0"], - ], - arms: { - v0: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimableBalanceFlags -// { -// // If set, the issuer account of the asset held by the claimable balance may -// // clawback the claimable balance -// CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1 -// }; -// -// =========================================================================== -xdr.enum("ClaimableBalanceFlags", { - claimableBalanceClawbackEnabledFlag: 1, -}); - -// === xdr source ============================================================ -// -// const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1; -// -// =========================================================================== -xdr.const("MASK_CLAIMABLE_BALANCE_FLAGS", 0x1); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("ClaimableBalanceEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct ClaimableBalanceEntryExtensionV1 -// { -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// -// uint32 flags; // see ClaimableBalanceFlags -// }; -// -// =========================================================================== -xdr.struct("ClaimableBalanceEntryExtensionV1", [ - ["ext", xdr.lookup("ClaimableBalanceEntryExtensionV1Ext")], - ["flags", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// ClaimableBalanceEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("ClaimableBalanceEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("ClaimableBalanceEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct ClaimableBalanceEntry -// { -// // Unique identifier for this ClaimableBalanceEntry -// ClaimableBalanceID balanceID; -// -// // List of claimants with associated predicate -// Claimant claimants<10>; -// -// // Any asset including native -// Asset asset; -// -// // Amount of asset -// int64 amount; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// ClaimableBalanceEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("ClaimableBalanceEntry", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], - ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["ext", xdr.lookup("ClaimableBalanceEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct LiquidityPoolConstantProductParameters -// { -// Asset assetA; // assetA < assetB -// Asset assetB; -// int32 fee; // Fee is in basis points, so the actual rate is (fee/100)% -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolConstantProductParameters", [ - ["assetA", xdr.lookup("Asset")], - ["assetB", xdr.lookup("Asset")], - ["fee", xdr.lookup("Int32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } -// -// =========================================================================== -xdr.struct("LiquidityPoolEntryConstantProduct", [ - ["params", xdr.lookup("LiquidityPoolConstantProductParameters")], - ["reserveA", xdr.lookup("Int64")], - ["reserveB", xdr.lookup("Int64")], - ["totalPoolShares", xdr.lookup("Int64")], - ["poolSharesTrustLineCount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } constantProduct; -// } -// -// =========================================================================== -xdr.union("LiquidityPoolEntryBody", { - switchOn: xdr.lookup("LiquidityPoolType"), - switchName: "type", - switches: [ - ["liquidityPoolConstantProduct", "constantProduct"], - ], - arms: { - constantProduct: xdr.lookup("LiquidityPoolEntryConstantProduct"), - }, -}); - -// === xdr source ============================================================ -// -// struct LiquidityPoolEntry -// { -// PoolID liquidityPoolID; -// -// union switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// struct -// { -// LiquidityPoolConstantProductParameters params; -// -// int64 reserveA; // amount of A in the pool -// int64 reserveB; // amount of B in the pool -// int64 totalPoolShares; // total number of pool shares issued -// int64 poolSharesTrustLineCount; // number of trust lines for the -// // associated pool shares -// } constantProduct; -// } -// body; -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolEntry", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["body", xdr.lookup("LiquidityPoolEntryBody")], -]); - -// === xdr source ============================================================ -// -// struct ContractDataEntry { -// Hash contractID; -// SCVal key; -// SCVal val; -// }; -// -// =========================================================================== -xdr.struct("ContractDataEntry", [ - ["contractId", xdr.lookup("Hash")], - ["key", xdr.lookup("ScVal")], - ["val", xdr.lookup("ScVal")], -]); - -// === xdr source ============================================================ -// -// struct ContractCodeEntry { -// ExtensionPoint ext; -// -// Hash hash; -// opaque code; -// }; -// -// =========================================================================== -xdr.struct("ContractCodeEntry", [ - ["ext", xdr.lookup("ExtensionPoint")], - ["hash", xdr.lookup("Hash")], - ["code", xdr.varOpaque(SCVAL_LIMIT)], -]); - -// === xdr source ============================================================ -// -// enum ConfigSettingID -// { -// CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, -// CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, -// CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, -// CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, -// CONFIG_SETTING_CONTRACT_META_DATA_V0 = 4, -// CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, -// CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION = 6 -// }; -// -// =========================================================================== -xdr.enum("ConfigSettingId", { - configSettingContractMaxSizeBytes: 0, - configSettingContractComputeV0: 1, - configSettingContractLedgerCostV0: 2, - configSettingContractHistoricalDataV0: 3, - configSettingContractMetaDataV0: 4, - configSettingContractBandwidthV0: 5, - configSettingContractHostLogicVersion: 6, -}); - -// === xdr source ============================================================ -// -// struct ConfigSettingContractComputeV0 -// { -// // Maximum instructions per ledger -// int64 ledgerMaxInstructions; -// // Maximum instructions per transaction -// int64 txMaxInstructions; -// // Cost of 10000 instructions -// int64 feeRatePerInstructionsIncrement; -// -// // Memory limit per contract/host function invocation. Unlike -// // instructions, there is no fee for memory and it's not -// // accumulated between operations - the same limit is applied -// // to every operation. -// uint32 memoryLimit; -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingContractComputeV0", [ - ["ledgerMaxInstructions", xdr.lookup("Int64")], - ["txMaxInstructions", xdr.lookup("Int64")], - ["feeRatePerInstructionsIncrement", xdr.lookup("Int64")], - ["memoryLimit", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct ConfigSettingContractLedgerCostV0 -// { -// // Maximum number of ledger entry read operations per ledger -// uint32 ledgerMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per ledger -// uint32 ledgerMaxReadBytes; -// // Maximum number of ledger entry write operations per ledger -// uint32 ledgerMaxWriteLedgerEntries; -// // Maximum number of bytes that can be written per ledger -// uint32 ledgerMaxWriteBytes; -// -// // Maximum number of ledger entry read operations per transaction -// uint32 txMaxReadLedgerEntries; -// // Maximum number of bytes that can be read per transaction -// uint32 txMaxReadBytes; -// // Maximum number of ledger entry write operations per transaction -// uint32 txMaxWriteLedgerEntries; -// // Maximum number of bytes that can be written per transaction -// uint32 txMaxWriteBytes; -// -// int64 feeReadLedgerEntry; // Fee per ledger entry read -// int64 feeWriteLedgerEntry; // Fee per ledger entry write -// -// int64 feeRead1KB; // Fee for reading 1KB -// int64 feeWrite1KB; // Fee for writing 1KB -// -// // Bucket list fees grow slowly up to that size -// int64 bucketListSizeBytes; -// // Fee rate in stroops when the bucket list is empty -// int64 bucketListFeeRateLow; -// // Fee rate in stroops when the bucket list reached bucketListSizeBytes -// int64 bucketListFeeRateHigh; -// // Rate multiplier for any additional data past the first bucketListSizeBytes -// uint32 bucketListGrowthFactor; -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingContractLedgerCostV0", [ - ["ledgerMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["ledgerMaxReadBytes", xdr.lookup("Uint32")], - ["ledgerMaxWriteLedgerEntries", xdr.lookup("Uint32")], - ["ledgerMaxWriteBytes", xdr.lookup("Uint32")], - ["txMaxReadLedgerEntries", xdr.lookup("Uint32")], - ["txMaxReadBytes", xdr.lookup("Uint32")], - ["txMaxWriteLedgerEntries", xdr.lookup("Uint32")], - ["txMaxWriteBytes", xdr.lookup("Uint32")], - ["feeReadLedgerEntry", xdr.lookup("Int64")], - ["feeWriteLedgerEntry", xdr.lookup("Int64")], - ["feeRead1Kb", xdr.lookup("Int64")], - ["feeWrite1Kb", xdr.lookup("Int64")], - ["bucketListSizeBytes", xdr.lookup("Int64")], - ["bucketListFeeRateLow", xdr.lookup("Int64")], - ["bucketListFeeRateHigh", xdr.lookup("Int64")], - ["bucketListGrowthFactor", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct ConfigSettingContractHistoricalDataV0 -// { -// int64 feeHistorical1KB; // Fee for storing 1KB in archives -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingContractHistoricalDataV0", [ - ["feeHistorical1Kb", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ConfigSettingContractMetaDataV0 -// { -// // Maximum size of extended meta data produced by a transaction -// uint32 txMaxExtendedMetaDataSizeBytes; -// // Fee for generating 1KB of extended meta data -// int64 feeExtendedMetaData1KB; -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingContractMetaDataV0", [ - ["txMaxExtendedMetaDataSizeBytes", xdr.lookup("Uint32")], - ["feeExtendedMetaData1Kb", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ConfigSettingContractBandwidthV0 -// { -// // Maximum size in bytes to propagate per ledger -// uint32 ledgerMaxPropagateSizeBytes; -// // Maximum size in bytes for a transaction -// uint32 txMaxSizeBytes; -// -// // Fee for propagating 1KB of data -// int64 feePropagateData1KB; -// }; -// -// =========================================================================== -xdr.struct("ConfigSettingContractBandwidthV0", [ - ["ledgerMaxPropagateSizeBytes", xdr.lookup("Uint32")], - ["txMaxSizeBytes", xdr.lookup("Uint32")], - ["feePropagateData1Kb", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union ConfigSettingEntry switch (ConfigSettingID configSettingID) -// { -// case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: -// uint32 contractMaxSizeBytes; -// case CONFIG_SETTING_CONTRACT_COMPUTE_V0: -// ConfigSettingContractComputeV0 contractCompute; -// case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: -// ConfigSettingContractLedgerCostV0 contractLedgerCost; -// case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: -// ConfigSettingContractHistoricalDataV0 contractHistoricalData; -// case CONFIG_SETTING_CONTRACT_META_DATA_V0: -// ConfigSettingContractMetaDataV0 contractMetaData; -// case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: -// ConfigSettingContractBandwidthV0 contractBandwidth; -// case CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION: -// uint32 contractHostLogicVersion; -// }; -// -// =========================================================================== -xdr.union("ConfigSettingEntry", { - switchOn: xdr.lookup("ConfigSettingId"), - switchName: "configSettingId", - switches: [ - ["configSettingContractMaxSizeBytes", "contractMaxSizeBytes"], - ["configSettingContractComputeV0", "contractCompute"], - ["configSettingContractLedgerCostV0", "contractLedgerCost"], - ["configSettingContractHistoricalDataV0", "contractHistoricalData"], - ["configSettingContractMetaDataV0", "contractMetaData"], - ["configSettingContractBandwidthV0", "contractBandwidth"], - ["configSettingContractHostLogicVersion", "contractHostLogicVersion"], - ], - arms: { - contractMaxSizeBytes: xdr.lookup("Uint32"), - contractCompute: xdr.lookup("ConfigSettingContractComputeV0"), - contractLedgerCost: xdr.lookup("ConfigSettingContractLedgerCostV0"), - contractHistoricalData: xdr.lookup("ConfigSettingContractHistoricalDataV0"), - contractMetaData: xdr.lookup("ConfigSettingContractMetaDataV0"), - contractBandwidth: xdr.lookup("ConfigSettingContractBandwidthV0"), - contractHostLogicVersion: xdr.lookup("Uint32"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerEntryExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerEntryExtensionV1 -// { -// SponsorshipDescriptor sponsoringID; -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerEntryExtensionV1", [ - ["sponsoringId", xdr.lookup("SponsorshipDescriptor")], - ["ext", xdr.lookup("LedgerEntryExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (LedgerEntryType type) -// { -// case ACCOUNT: -// AccountEntry account; -// case TRUSTLINE: -// TrustLineEntry trustLine; -// case OFFER: -// OfferEntry offer; -// case DATA: -// DataEntry data; -// case CLAIMABLE_BALANCE: -// ClaimableBalanceEntry claimableBalance; -// case LIQUIDITY_POOL: -// LiquidityPoolEntry liquidityPool; -// case CONTRACT_DATA: -// ContractDataEntry contractData; -// case CONTRACT_CODE: -// ContractCodeEntry contractCode; -// case CONFIG_SETTING: -// ConfigSettingEntry configSetting; -// } -// -// =========================================================================== -xdr.union("LedgerEntryData", { - switchOn: xdr.lookup("LedgerEntryType"), - switchName: "type", - switches: [ - ["account", "account"], - ["trustline", "trustLine"], - ["offer", "offer"], - ["data", "data"], - ["claimableBalance", "claimableBalance"], - ["liquidityPool", "liquidityPool"], - ["contractData", "contractData"], - ["contractCode", "contractCode"], - ["configSetting", "configSetting"], - ], - arms: { - account: xdr.lookup("AccountEntry"), - trustLine: xdr.lookup("TrustLineEntry"), - offer: xdr.lookup("OfferEntry"), - data: xdr.lookup("DataEntry"), - claimableBalance: xdr.lookup("ClaimableBalanceEntry"), - liquidityPool: xdr.lookup("LiquidityPoolEntry"), - contractData: xdr.lookup("ContractDataEntry"), - contractCode: xdr.lookup("ContractCodeEntry"), - configSetting: xdr.lookup("ConfigSettingEntry"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerEntryExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("LedgerEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("LedgerEntryExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerEntry -// { -// uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed -// -// union switch (LedgerEntryType type) -// { -// case ACCOUNT: -// AccountEntry account; -// case TRUSTLINE: -// TrustLineEntry trustLine; -// case OFFER: -// OfferEntry offer; -// case DATA: -// DataEntry data; -// case CLAIMABLE_BALANCE: -// ClaimableBalanceEntry claimableBalance; -// case LIQUIDITY_POOL: -// LiquidityPoolEntry liquidityPool; -// case CONTRACT_DATA: -// ContractDataEntry contractData; -// case CONTRACT_CODE: -// ContractCodeEntry contractCode; -// case CONFIG_SETTING: -// ConfigSettingEntry configSetting; -// } -// data; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerEntryExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerEntry", [ - ["lastModifiedLedgerSeq", xdr.lookup("Uint32")], - ["data", xdr.lookup("LedgerEntryData")], - ["ext", xdr.lookup("LedgerEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyAccount", [ - ["accountId", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// TrustLineAsset asset; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyTrustLine", [ - ["accountId", xdr.lookup("AccountId")], - ["asset", xdr.lookup("TrustLineAsset")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sellerID; -// int64 offerID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyOffer", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// string64 dataName; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyData", [ - ["accountId", xdr.lookup("AccountId")], - ["dataName", xdr.lookup("String64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimableBalanceID balanceID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyClaimableBalance", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// PoolID liquidityPoolID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyLiquidityPool", [ - ["liquidityPoolId", xdr.lookup("PoolId")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash contractID; -// SCVal key; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyContractData", [ - ["contractId", xdr.lookup("Hash")], - ["key", xdr.lookup("ScVal")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash hash; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyContractCode", [ - ["hash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// ConfigSettingID configSettingID; -// } -// -// =========================================================================== -xdr.struct("LedgerKeyConfigSetting", [ - ["configSettingId", xdr.lookup("ConfigSettingId")], -]); - -// === xdr source ============================================================ -// -// union LedgerKey switch (LedgerEntryType type) -// { -// case ACCOUNT: -// struct -// { -// AccountID accountID; -// } account; -// -// case TRUSTLINE: -// struct -// { -// AccountID accountID; -// TrustLineAsset asset; -// } trustLine; -// -// case OFFER: -// struct -// { -// AccountID sellerID; -// int64 offerID; -// } offer; -// -// case DATA: -// struct -// { -// AccountID accountID; -// string64 dataName; -// } data; -// -// case CLAIMABLE_BALANCE: -// struct -// { -// ClaimableBalanceID balanceID; -// } claimableBalance; -// -// case LIQUIDITY_POOL: -// struct -// { -// PoolID liquidityPoolID; -// } liquidityPool; -// case CONTRACT_DATA: -// struct -// { -// Hash contractID; -// SCVal key; -// } contractData; -// case CONTRACT_CODE: -// struct -// { -// Hash hash; -// } contractCode; -// case CONFIG_SETTING: -// struct -// { -// ConfigSettingID configSettingID; -// } configSetting; -// }; -// -// =========================================================================== -xdr.union("LedgerKey", { - switchOn: xdr.lookup("LedgerEntryType"), - switchName: "type", - switches: [ - ["account", "account"], - ["trustline", "trustLine"], - ["offer", "offer"], - ["data", "data"], - ["claimableBalance", "claimableBalance"], - ["liquidityPool", "liquidityPool"], - ["contractData", "contractData"], - ["contractCode", "contractCode"], - ["configSetting", "configSetting"], - ], - arms: { - account: xdr.lookup("LedgerKeyAccount"), - trustLine: xdr.lookup("LedgerKeyTrustLine"), - offer: xdr.lookup("LedgerKeyOffer"), - data: xdr.lookup("LedgerKeyData"), - claimableBalance: xdr.lookup("LedgerKeyClaimableBalance"), - liquidityPool: xdr.lookup("LedgerKeyLiquidityPool"), - contractData: xdr.lookup("LedgerKeyContractData"), - contractCode: xdr.lookup("LedgerKeyContractCode"), - configSetting: xdr.lookup("LedgerKeyConfigSetting"), - }, -}); - -// === xdr source ============================================================ -// -// enum EnvelopeType -// { -// ENVELOPE_TYPE_TX_V0 = 0, -// ENVELOPE_TYPE_SCP = 1, -// ENVELOPE_TYPE_TX = 2, -// ENVELOPE_TYPE_AUTH = 3, -// ENVELOPE_TYPE_SCPVALUE = 4, -// ENVELOPE_TYPE_TX_FEE_BUMP = 5, -// ENVELOPE_TYPE_OP_ID = 6, -// ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, -// ENVELOPE_TYPE_CONTRACT_ID_FROM_ED25519 = 8, -// ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT = 9, -// ENVELOPE_TYPE_CONTRACT_ID_FROM_ASSET = 10, -// ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE_ACCOUNT = 11, -// ENVELOPE_TYPE_CREATE_CONTRACT_ARGS = 12, -// ENVELOPE_TYPE_CONTRACT_AUTH = 13 -// }; -// -// =========================================================================== -xdr.enum("EnvelopeType", { - envelopeTypeTxV0: 0, - envelopeTypeScp: 1, - envelopeTypeTx: 2, - envelopeTypeAuth: 3, - envelopeTypeScpvalue: 4, - envelopeTypeTxFeeBump: 5, - envelopeTypeOpId: 6, - envelopeTypePoolRevokeOpId: 7, - envelopeTypeContractIdFromEd25519: 8, - envelopeTypeContractIdFromContract: 9, - envelopeTypeContractIdFromAsset: 10, - envelopeTypeContractIdFromSourceAccount: 11, - envelopeTypeCreateContractArgs: 12, - envelopeTypeContractAuth: 13, -}); - -// === xdr source ============================================================ -// -// typedef opaque UpgradeType<128>; -// -// =========================================================================== -xdr.typedef("UpgradeType", xdr.varOpaque(128)); - -// === xdr source ============================================================ -// -// enum StellarValueType -// { -// STELLAR_VALUE_BASIC = 0, -// STELLAR_VALUE_SIGNED = 1 -// }; -// -// =========================================================================== -xdr.enum("StellarValueType", { - stellarValueBasic: 0, - stellarValueSigned: 1, -}); - -// === xdr source ============================================================ -// -// struct LedgerCloseValueSignature -// { -// NodeID nodeID; // which node introduced the value -// Signature signature; // nodeID's signature -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseValueSignature", [ - ["nodeId", xdr.lookup("NodeId")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// union switch (StellarValueType v) -// { -// case STELLAR_VALUE_BASIC: -// void; -// case STELLAR_VALUE_SIGNED: -// LedgerCloseValueSignature lcValueSignature; -// } -// -// =========================================================================== -xdr.union("StellarValueExt", { - switchOn: xdr.lookup("StellarValueType"), - switchName: "v", - switches: [ - ["stellarValueBasic", xdr.void()], - ["stellarValueSigned", "lcValueSignature"], - ], - arms: { - lcValueSignature: xdr.lookup("LedgerCloseValueSignature"), - }, -}); - -// === xdr source ============================================================ -// -// struct StellarValue -// { -// Hash txSetHash; // transaction set to apply to previous ledger -// TimePoint closeTime; // network close time -// -// // upgrades to apply to the previous ledger (usually empty) -// // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop -// // unknown steps during consensus if needed. -// // see notes below on 'LedgerUpgrade' for more detail -// // max size is dictated by number of upgrade types (+ room for future) -// UpgradeType upgrades<6>; -// -// // reserved for future use -// union switch (StellarValueType v) -// { -// case STELLAR_VALUE_BASIC: -// void; -// case STELLAR_VALUE_SIGNED: -// LedgerCloseValueSignature lcValueSignature; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("StellarValue", [ - ["txSetHash", xdr.lookup("Hash")], - ["closeTime", xdr.lookup("TimePoint")], - ["upgrades", xdr.varArray(xdr.lookup("UpgradeType"), 6)], - ["ext", xdr.lookup("StellarValueExt")], -]); - -// === xdr source ============================================================ -// -// const MASK_LEDGER_HEADER_FLAGS = 0x7F; -// -// =========================================================================== -xdr.const("MASK_LEDGER_HEADER_FLAGS", 0x7F); - -// === xdr source ============================================================ -// -// enum LedgerHeaderFlags -// { -// DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, -// DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, -// DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4, -// DISABLE_CONTRACT_CREATE = 0x8, -// DISABLE_CONTRACT_UPDATE = 0x10, -// DISABLE_CONTRACT_REMOVE = 0x20, -// DISABLE_CONTRACT_INVOKE = 0x40 -// }; -// -// =========================================================================== -xdr.enum("LedgerHeaderFlags", { - disableLiquidityPoolTradingFlag: 1, - disableLiquidityPoolDepositFlag: 2, - disableLiquidityPoolWithdrawalFlag: 4, - disableContractCreate: 8, - disableContractUpdate: 16, - disableContractRemove: 32, - disableContractInvoke: 64, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderExtensionV1Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeaderExtensionV1 -// { -// uint32 flags; // LedgerHeaderFlags -// -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeaderExtensionV1", [ - ["flags", xdr.lookup("Uint32")], - ["ext", xdr.lookup("LedgerHeaderExtensionV1Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerHeaderExtensionV1 v1; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "v1"], - ], - arms: { - v1: xdr.lookup("LedgerHeaderExtensionV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeader -// { -// uint32 ledgerVersion; // the protocol version of the ledger -// Hash previousLedgerHash; // hash of the previous ledger header -// StellarValue scpValue; // what consensus agreed to -// Hash txSetResultHash; // the TransactionResultSet that led to this ledger -// Hash bucketListHash; // hash of the ledger state -// -// uint32 ledgerSeq; // sequence number of this ledger -// -// int64 totalCoins; // total number of stroops in existence. -// // 10,000,000 stroops in 1 XLM -// -// int64 feePool; // fees burned since last inflation run -// uint32 inflationSeq; // inflation sequence number -// -// uint64 idPool; // last used global ID, used for generating objects -// -// uint32 baseFee; // base fee per operation in stroops -// uint32 baseReserve; // account base reserve in stroops -// -// uint32 maxTxSetSize; // maximum size a transaction set can be -// -// Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back -// // in time without walking the chain back ledger by ledger -// // each slot contains the oldest ledger that is mod of -// // either 50 5000 50000 or 500000 depending on index -// // skipList[0] mod(50), skipList[1] mod(5000), etc -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// LedgerHeaderExtensionV1 v1; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeader", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["previousLedgerHash", xdr.lookup("Hash")], - ["scpValue", xdr.lookup("StellarValue")], - ["txSetResultHash", xdr.lookup("Hash")], - ["bucketListHash", xdr.lookup("Hash")], - ["ledgerSeq", xdr.lookup("Uint32")], - ["totalCoins", xdr.lookup("Int64")], - ["feePool", xdr.lookup("Int64")], - ["inflationSeq", xdr.lookup("Uint32")], - ["idPool", xdr.lookup("Uint64")], - ["baseFee", xdr.lookup("Uint32")], - ["baseReserve", xdr.lookup("Uint32")], - ["maxTxSetSize", xdr.lookup("Uint32")], - ["skipList", xdr.array(xdr.lookup("Hash"), 4)], - ["ext", xdr.lookup("LedgerHeaderExt")], -]); - -// === xdr source ============================================================ -// -// enum LedgerUpgradeType -// { -// LEDGER_UPGRADE_VERSION = 1, -// LEDGER_UPGRADE_BASE_FEE = 2, -// LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, -// LEDGER_UPGRADE_BASE_RESERVE = 4, -// LEDGER_UPGRADE_FLAGS = 5, -// LEDGER_UPGRADE_CONFIG = 6 -// }; -// -// =========================================================================== -xdr.enum("LedgerUpgradeType", { - ledgerUpgradeVersion: 1, - ledgerUpgradeBaseFee: 2, - ledgerUpgradeMaxTxSetSize: 3, - ledgerUpgradeBaseReserve: 4, - ledgerUpgradeFlags: 5, - ledgerUpgradeConfig: 6, -}); - -// === xdr source ============================================================ -// -// struct ConfigUpgradeSetKey { -// Hash contractID; -// Hash contentHash; -// }; -// -// =========================================================================== -xdr.struct("ConfigUpgradeSetKey", [ - ["contractId", xdr.lookup("Hash")], - ["contentHash", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// union LedgerUpgrade switch (LedgerUpgradeType type) -// { -// case LEDGER_UPGRADE_VERSION: -// uint32 newLedgerVersion; // update ledgerVersion -// case LEDGER_UPGRADE_BASE_FEE: -// uint32 newBaseFee; // update baseFee -// case LEDGER_UPGRADE_MAX_TX_SET_SIZE: -// uint32 newMaxTxSetSize; // update maxTxSetSize -// case LEDGER_UPGRADE_BASE_RESERVE: -// uint32 newBaseReserve; // update baseReserve -// case LEDGER_UPGRADE_FLAGS: -// uint32 newFlags; // update flags -// case LEDGER_UPGRADE_CONFIG: -// ConfigUpgradeSetKey newConfig; -// }; -// -// =========================================================================== -xdr.union("LedgerUpgrade", { - switchOn: xdr.lookup("LedgerUpgradeType"), - switchName: "type", - switches: [ - ["ledgerUpgradeVersion", "newLedgerVersion"], - ["ledgerUpgradeBaseFee", "newBaseFee"], - ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], - ["ledgerUpgradeBaseReserve", "newBaseReserve"], - ["ledgerUpgradeFlags", "newFlags"], - ["ledgerUpgradeConfig", "newConfig"], - ], - arms: { - newLedgerVersion: xdr.lookup("Uint32"), - newBaseFee: xdr.lookup("Uint32"), - newMaxTxSetSize: xdr.lookup("Uint32"), - newBaseReserve: xdr.lookup("Uint32"), - newFlags: xdr.lookup("Uint32"), - newConfig: xdr.lookup("ConfigUpgradeSetKey"), - }, -}); - -// === xdr source ============================================================ -// -// struct ConfigUpgradeSet { -// ConfigSettingEntry updatedEntry<>; -// }; -// -// =========================================================================== -xdr.struct("ConfigUpgradeSet", [ - ["updatedEntry", xdr.varArray(xdr.lookup("ConfigSettingEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// enum BucketEntryType -// { -// METAENTRY = -// -1, // At-and-after protocol 11: bucket metadata, should come first. -// LIVEENTRY = 0, // Before protocol 11: created-or-updated; -// // At-and-after protocol 11: only updated. -// DEADENTRY = 1, -// INITENTRY = 2 // At-and-after protocol 11: only created. -// }; -// -// =========================================================================== -xdr.enum("BucketEntryType", { - metaentry: -1, - liveentry: 0, - deadentry: 1, - initentry: 2, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("BucketMetadataExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct BucketMetadata -// { -// // Indicates the protocol version used to create / merge this bucket. -// uint32 ledgerVersion; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("BucketMetadata", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["ext", xdr.lookup("BucketMetadataExt")], -]); - -// === xdr source ============================================================ -// -// union BucketEntry switch (BucketEntryType type) -// { -// case LIVEENTRY: -// case INITENTRY: -// LedgerEntry liveEntry; -// -// case DEADENTRY: -// LedgerKey deadEntry; -// case METAENTRY: -// BucketMetadata metaEntry; -// }; -// -// =========================================================================== -xdr.union("BucketEntry", { - switchOn: xdr.lookup("BucketEntryType"), - switchName: "type", - switches: [ - ["liveentry", "liveEntry"], - ["initentry", "liveEntry"], - ["deadentry", "deadEntry"], - ["metaentry", "metaEntry"], - ], - arms: { - liveEntry: xdr.lookup("LedgerEntry"), - deadEntry: xdr.lookup("LedgerKey"), - metaEntry: xdr.lookup("BucketMetadata"), - }, -}); - -// === xdr source ============================================================ -// -// enum TxSetComponentType -// { -// // txs with effective fee <= bid derived from a base fee (if any). -// // If base fee is not specified, no discount is applied. -// TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 -// }; -// -// =========================================================================== -xdr.enum("TxSetComponentType", { - txsetCompTxsMaybeDiscountedFee: 0, -}); - -// === xdr source ============================================================ -// -// struct -// { -// int64* baseFee; -// TransactionEnvelope txs<>; -// } -// -// =========================================================================== -xdr.struct("TxSetComponentTxsMaybeDiscountedFee", [ - ["baseFee", xdr.option(xdr.lookup("Int64"))], - ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union TxSetComponent switch (TxSetComponentType type) -// { -// case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: -// struct -// { -// int64* baseFee; -// TransactionEnvelope txs<>; -// } txsMaybeDiscountedFee; -// }; -// -// =========================================================================== -xdr.union("TxSetComponent", { - switchOn: xdr.lookup("TxSetComponentType"), - switchName: "type", - switches: [ - ["txsetCompTxsMaybeDiscountedFee", "txsMaybeDiscountedFee"], - ], - arms: { - txsMaybeDiscountedFee: xdr.lookup("TxSetComponentTxsMaybeDiscountedFee"), - }, -}); - -// === xdr source ============================================================ -// -// union TransactionPhase switch (int v) -// { -// case 0: -// TxSetComponent v0Components<>; -// }; -// -// =========================================================================== -xdr.union("TransactionPhase", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0Components"], - ], - arms: { - v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionSet -// { -// Hash previousLedgerHash; -// TransactionEnvelope txs<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionSet", [ - ["previousLedgerHash", xdr.lookup("Hash")], - ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct TransactionSetV1 -// { -// Hash previousLedgerHash; -// TransactionPhase phases<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionSetV1", [ - ["previousLedgerHash", xdr.lookup("Hash")], - ["phases", xdr.varArray(xdr.lookup("TransactionPhase"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union GeneralizedTransactionSet switch (int v) -// { -// // We consider the legacy TransactionSet to be v0. -// case 1: -// TransactionSetV1 v1TxSet; -// }; -// -// =========================================================================== -xdr.union("GeneralizedTransactionSet", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [1, "v1TxSet"], - ], - arms: { - v1TxSet: xdr.lookup("TransactionSetV1"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResultPair -// { -// Hash transactionHash; -// TransactionResult result; // result for the transaction -// }; -// -// =========================================================================== -xdr.struct("TransactionResultPair", [ - ["transactionHash", xdr.lookup("Hash")], - ["result", xdr.lookup("TransactionResult")], -]); - -// === xdr source ============================================================ -// -// struct TransactionResultSet -// { -// TransactionResultPair results<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultSet", [ - ["results", xdr.varArray(xdr.lookup("TransactionResultPair"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// GeneralizedTransactionSet generalizedTxSet; -// } -// -// =========================================================================== -xdr.union("TransactionHistoryEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - [1, "generalizedTxSet"], - ], - arms: { - generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionHistoryEntry -// { -// uint32 ledgerSeq; -// TransactionSet txSet; -// -// // when v != 0, txSet must be empty -// union switch (int v) -// { -// case 0: -// void; -// case 1: -// GeneralizedTransactionSet generalizedTxSet; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionHistoryEntry", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["txSet", xdr.lookup("TransactionSet")], - ["ext", xdr.lookup("TransactionHistoryEntryExt")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionHistoryResultEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionHistoryResultEntry -// { -// uint32 ledgerSeq; -// TransactionResultSet txResultSet; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionHistoryResultEntry", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["txResultSet", xdr.lookup("TransactionResultSet")], - ["ext", xdr.lookup("TransactionHistoryResultEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct TransactionResultPairV2 -// { -// Hash transactionHash; -// Hash hashOfMetaHashes; // hash of hashes in TransactionMetaV3 -// // TransactionResult is in the meta -// }; -// -// =========================================================================== -xdr.struct("TransactionResultPairV2", [ - ["transactionHash", xdr.lookup("Hash")], - ["hashOfMetaHashes", xdr.lookup("Hash")], -]); - -// === xdr source ============================================================ -// -// struct TransactionResultSetV2 -// { -// TransactionResultPairV2 results<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultSetV2", [ - ["results", xdr.varArray(xdr.lookup("TransactionResultPairV2"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionHistoryResultEntryV2Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionHistoryResultEntryV2 -// { -// uint32 ledgerSeq; -// TransactionResultSetV2 txResultSet; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionHistoryResultEntryV2", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["txResultSet", xdr.lookup("TransactionResultSetV2")], - ["ext", xdr.lookup("TransactionHistoryResultEntryV2Ext")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("LedgerHeaderHistoryEntryExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct LedgerHeaderHistoryEntry -// { -// Hash hash; -// LedgerHeader header; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("LedgerHeaderHistoryEntry", [ - ["hash", xdr.lookup("Hash")], - ["header", xdr.lookup("LedgerHeader")], - ["ext", xdr.lookup("LedgerHeaderHistoryEntryExt")], -]); - -// === xdr source ============================================================ -// -// struct LedgerSCPMessages -// { -// uint32 ledgerSeq; -// SCPEnvelope messages<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerScpMessages", [ - ["ledgerSeq", xdr.lookup("Uint32")], - ["messages", xdr.varArray(xdr.lookup("ScpEnvelope"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct SCPHistoryEntryV0 -// { -// SCPQuorumSet quorumSets<>; // additional quorum sets used by ledgerMessages -// LedgerSCPMessages ledgerMessages; -// }; -// -// =========================================================================== -xdr.struct("ScpHistoryEntryV0", [ - ["quorumSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], - ["ledgerMessages", xdr.lookup("LedgerScpMessages")], -]); - -// === xdr source ============================================================ -// -// union SCPHistoryEntry switch (int v) -// { -// case 0: -// SCPHistoryEntryV0 v0; -// }; -// -// =========================================================================== -xdr.union("ScpHistoryEntry", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0"], - ], - arms: { - v0: xdr.lookup("ScpHistoryEntryV0"), - }, -}); - -// === xdr source ============================================================ -// -// enum LedgerEntryChangeType -// { -// LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger -// LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger -// LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger -// LEDGER_ENTRY_STATE = 3 // value of the entry -// }; -// -// =========================================================================== -xdr.enum("LedgerEntryChangeType", { - ledgerEntryCreated: 0, - ledgerEntryUpdated: 1, - ledgerEntryRemoved: 2, - ledgerEntryState: 3, -}); - -// === xdr source ============================================================ -// -// union LedgerEntryChange switch (LedgerEntryChangeType type) -// { -// case LEDGER_ENTRY_CREATED: -// LedgerEntry created; -// case LEDGER_ENTRY_UPDATED: -// LedgerEntry updated; -// case LEDGER_ENTRY_REMOVED: -// LedgerKey removed; -// case LEDGER_ENTRY_STATE: -// LedgerEntry state; -// }; -// -// =========================================================================== -xdr.union("LedgerEntryChange", { - switchOn: xdr.lookup("LedgerEntryChangeType"), - switchName: "type", - switches: [ - ["ledgerEntryCreated", "created"], - ["ledgerEntryUpdated", "updated"], - ["ledgerEntryRemoved", "removed"], - ["ledgerEntryState", "state"], - ], - arms: { - created: xdr.lookup("LedgerEntry"), - updated: xdr.lookup("LedgerEntry"), - removed: xdr.lookup("LedgerKey"), - state: xdr.lookup("LedgerEntry"), - }, -}); - -// === xdr source ============================================================ -// -// typedef LedgerEntryChange LedgerEntryChanges<>; -// -// =========================================================================== -xdr.typedef("LedgerEntryChanges", xdr.varArray(xdr.lookup("LedgerEntryChange"), 2147483647)); - -// === xdr source ============================================================ -// -// struct OperationMeta -// { -// LedgerEntryChanges changes; -// }; -// -// =========================================================================== -xdr.struct("OperationMeta", [ - ["changes", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// struct TransactionMetaV1 -// { -// LedgerEntryChanges txChanges; // tx level changes if any -// OperationMeta operations<>; // meta for each operation -// }; -// -// =========================================================================== -xdr.struct("TransactionMetaV1", [ - ["txChanges", xdr.lookup("LedgerEntryChanges")], - ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct TransactionMetaV2 -// { -// LedgerEntryChanges txChangesBefore; // tx level changes before operations -// // are applied if any -// OperationMeta operations<>; // meta for each operation -// LedgerEntryChanges txChangesAfter; // tx level changes after operations are -// // applied if any -// }; -// -// =========================================================================== -xdr.struct("TransactionMetaV2", [ - ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], - ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], - ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// enum ContractEventType -// { -// SYSTEM = 0, -// CONTRACT = 1, -// DIAGNOSTIC = 2 -// }; -// -// =========================================================================== -xdr.enum("ContractEventType", { - system: 0, - contract: 1, - diagnostic: 2, -}); - -// === xdr source ============================================================ -// -// struct -// { -// SCVec topics; -// SCVal data; -// } -// -// =========================================================================== -xdr.struct("ContractEventV0", [ - ["topics", xdr.lookup("ScVec")], - ["data", xdr.lookup("ScVal")], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// struct -// { -// SCVec topics; -// SCVal data; -// } v0; -// } -// -// =========================================================================== -xdr.union("ContractEventBody", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0"], - ], - arms: { - v0: xdr.lookup("ContractEventV0"), - }, -}); - -// === xdr source ============================================================ -// -// struct ContractEvent -// { -// // We can use this to add more fields, or because it -// // is first, to change ContractEvent into a union. -// ExtensionPoint ext; -// -// Hash* contractID; -// ContractEventType type; -// -// union switch (int v) -// { -// case 0: -// struct -// { -// SCVec topics; -// SCVal data; -// } v0; -// } -// body; -// }; -// -// =========================================================================== -xdr.struct("ContractEvent", [ - ["ext", xdr.lookup("ExtensionPoint")], - ["contractId", xdr.option(xdr.lookup("Hash"))], - ["type", xdr.lookup("ContractEventType")], - ["body", xdr.lookup("ContractEventBody")], -]); - -// === xdr source ============================================================ -// -// struct DiagnosticEvent -// { -// bool inSuccessfulContractCall; -// ContractEvent event; -// }; -// -// =========================================================================== -xdr.struct("DiagnosticEvent", [ - ["inSuccessfulContractCall", xdr.bool()], - ["event", xdr.lookup("ContractEvent")], -]); - -// === xdr source ============================================================ -// -// struct OperationDiagnosticEvents -// { -// DiagnosticEvent events<>; -// }; -// -// =========================================================================== -xdr.struct("OperationDiagnosticEvents", [ - ["events", xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct OperationEvents -// { -// ContractEvent events<>; -// }; -// -// =========================================================================== -xdr.struct("OperationEvents", [ - ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct TransactionMetaV3 -// { -// LedgerEntryChanges txChangesBefore; // tx level changes before operations -// // are applied if any -// OperationMeta operations<>; // meta for each operation -// LedgerEntryChanges txChangesAfter; // tx level changes after operations are -// // applied if any -// OperationEvents events<>; // custom events populated by the -// // contracts themselves. One list per operation. -// TransactionResult txResult; -// -// Hash hashes[3]; // stores sha256(txChangesBefore, operations, txChangesAfter), -// // sha256(events), and sha256(txResult) -// -// // Diagnostics events that are not hashed. One list per operation. -// // This will contain all contract and diagnostic events. Even ones -// // that were emitted in a failed contract call. -// OperationDiagnosticEvents diagnosticEvents<>; -// }; -// -// =========================================================================== -xdr.struct("TransactionMetaV3", [ - ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], - ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], - ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], - ["events", xdr.varArray(xdr.lookup("OperationEvents"), 2147483647)], - ["txResult", xdr.lookup("TransactionResult")], - ["hashes", xdr.array(xdr.lookup("Hash"), 3)], - ["diagnosticEvents", xdr.varArray(xdr.lookup("OperationDiagnosticEvents"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union TransactionMeta switch (int v) -// { -// case 0: -// OperationMeta operations<>; -// case 1: -// TransactionMetaV1 v1; -// case 2: -// TransactionMetaV2 v2; -// case 3: -// TransactionMetaV3 v3; -// }; -// -// =========================================================================== -xdr.union("TransactionMeta", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "operations"], - [1, "v1"], - [2, "v2"], - [3, "v3"], - ], - arms: { - operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), - v1: xdr.lookup("TransactionMetaV1"), - v2: xdr.lookup("TransactionMetaV2"), - v3: xdr.lookup("TransactionMetaV3"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResultMeta -// { -// TransactionResultPair result; -// LedgerEntryChanges feeProcessing; -// TransactionMeta txApplyProcessing; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultMeta", [ - ["result", xdr.lookup("TransactionResultPair")], - ["feeProcessing", xdr.lookup("LedgerEntryChanges")], - ["txApplyProcessing", xdr.lookup("TransactionMeta")], -]); - -// === xdr source ============================================================ -// -// struct TransactionResultMetaV2 -// { -// TransactionResultPairV2 result; -// LedgerEntryChanges feeProcessing; -// TransactionMeta txApplyProcessing; -// }; -// -// =========================================================================== -xdr.struct("TransactionResultMetaV2", [ - ["result", xdr.lookup("TransactionResultPairV2")], - ["feeProcessing", xdr.lookup("LedgerEntryChanges")], - ["txApplyProcessing", xdr.lookup("TransactionMeta")], -]); - -// === xdr source ============================================================ -// -// struct UpgradeEntryMeta -// { -// LedgerUpgrade upgrade; -// LedgerEntryChanges changes; -// }; -// -// =========================================================================== -xdr.struct("UpgradeEntryMeta", [ - ["upgrade", xdr.lookup("LedgerUpgrade")], - ["changes", xdr.lookup("LedgerEntryChanges")], -]); - -// === xdr source ============================================================ -// -// struct LedgerCloseMetaV0 -// { -// LedgerHeaderHistoryEntry ledgerHeader; -// // NB: txSet is sorted in "Hash order" -// TransactionSet txSet; -// -// // NB: transactions are sorted in apply order here -// // fees for all transactions are processed first -// // followed by applying transactions -// TransactionResultMeta txProcessing<>; -// -// // upgrades are applied last -// UpgradeEntryMeta upgradesProcessing<>; -// -// // other misc information attached to the ledger close -// SCPHistoryEntry scpInfo<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseMetaV0", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("TransactionSet")], - ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], - ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct LedgerCloseMetaV1 -// { -// LedgerHeaderHistoryEntry ledgerHeader; -// -// GeneralizedTransactionSet txSet; -// -// // NB: transactions are sorted in apply order here -// // fees for all transactions are processed first -// // followed by applying transactions -// TransactionResultMeta txProcessing<>; -// -// // upgrades are applied last -// UpgradeEntryMeta upgradesProcessing<>; -// -// // other misc information attached to the ledger close -// SCPHistoryEntry scpInfo<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseMetaV1", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("GeneralizedTransactionSet")], - ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647)], - ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct LedgerCloseMetaV2 -// { -// LedgerHeaderHistoryEntry ledgerHeader; -// -// GeneralizedTransactionSet txSet; -// -// // NB: transactions are sorted in apply order here -// // fees for all transactions are processed first -// // followed by applying transactions -// TransactionResultMetaV2 txProcessing<>; -// -// // upgrades are applied last -// UpgradeEntryMeta upgradesProcessing<>; -// -// // other misc information attached to the ledger close -// SCPHistoryEntry scpInfo<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerCloseMetaV2", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("GeneralizedTransactionSet")], - ["txProcessing", xdr.varArray(xdr.lookup("TransactionResultMetaV2"), 2147483647)], - ["upgradesProcessing", xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647)], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union LedgerCloseMeta switch (int v) -// { -// case 0: -// LedgerCloseMetaV0 v0; -// case 1: -// LedgerCloseMetaV1 v1; -// case 2: -// LedgerCloseMetaV2 v2; -// }; -// -// =========================================================================== -xdr.union("LedgerCloseMeta", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, "v0"], - [1, "v1"], - [2, "v2"], - ], - arms: { - v0: xdr.lookup("LedgerCloseMetaV0"), - v1: xdr.lookup("LedgerCloseMetaV1"), - v2: xdr.lookup("LedgerCloseMetaV2"), - }, -}); - -// === xdr source ============================================================ -// -// enum ErrorCode -// { -// ERR_MISC = 0, // Unspecific error -// ERR_DATA = 1, // Malformed data -// ERR_CONF = 2, // Misconfiguration error -// ERR_AUTH = 3, // Authentication failure -// ERR_LOAD = 4 // System overloaded -// }; -// -// =========================================================================== -xdr.enum("ErrorCode", { - errMisc: 0, - errData: 1, - errConf: 2, - errAuth: 3, - errLoad: 4, -}); - -// === xdr source ============================================================ -// -// struct Error -// { -// ErrorCode code; -// string msg<100>; -// }; -// -// =========================================================================== -xdr.struct("Error", [ - ["code", xdr.lookup("ErrorCode")], - ["msg", xdr.string(100)], -]); - -// === xdr source ============================================================ -// -// struct SendMore -// { -// uint32 numMessages; -// }; -// -// =========================================================================== -xdr.struct("SendMore", [ - ["numMessages", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct AuthCert -// { -// Curve25519Public pubkey; -// uint64 expiration; -// Signature sig; -// }; -// -// =========================================================================== -xdr.struct("AuthCert", [ - ["pubkey", xdr.lookup("Curve25519Public")], - ["expiration", xdr.lookup("Uint64")], - ["sig", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// struct Hello -// { -// uint32 ledgerVersion; -// uint32 overlayVersion; -// uint32 overlayMinVersion; -// Hash networkID; -// string versionStr<100>; -// int listeningPort; -// NodeID peerID; -// AuthCert cert; -// uint256 nonce; -// }; -// -// =========================================================================== -xdr.struct("Hello", [ - ["ledgerVersion", xdr.lookup("Uint32")], - ["overlayVersion", xdr.lookup("Uint32")], - ["overlayMinVersion", xdr.lookup("Uint32")], - ["networkId", xdr.lookup("Hash")], - ["versionStr", xdr.string(100)], - ["listeningPort", xdr.int()], - ["peerId", xdr.lookup("NodeId")], - ["cert", xdr.lookup("AuthCert")], - ["nonce", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// const AUTH_MSG_FLAG_PULL_MODE_REQUESTED = 100; -// -// =========================================================================== -xdr.const("AUTH_MSG_FLAG_PULL_MODE_REQUESTED", 100); - -// === xdr source ============================================================ -// -// struct Auth -// { -// int flags; -// }; -// -// =========================================================================== -xdr.struct("Auth", [ - ["flags", xdr.int()], -]); - -// === xdr source ============================================================ -// -// enum IPAddrType -// { -// IPv4 = 0, -// IPv6 = 1 -// }; -// -// =========================================================================== -xdr.enum("IpAddrType", { - iPv4: 0, - iPv6: 1, -}); - -// === xdr source ============================================================ -// -// union switch (IPAddrType type) -// { -// case IPv4: -// opaque ipv4[4]; -// case IPv6: -// opaque ipv6[16]; -// } -// -// =========================================================================== -xdr.union("PeerAddressIp", { - switchOn: xdr.lookup("IpAddrType"), - switchName: "type", - switches: [ - ["iPv4", "ipv4"], - ["iPv6", "ipv6"], - ], - arms: { - ipv4: xdr.opaque(4), - ipv6: xdr.opaque(16), - }, -}); - -// === xdr source ============================================================ -// -// struct PeerAddress -// { -// union switch (IPAddrType type) -// { -// case IPv4: -// opaque ipv4[4]; -// case IPv6: -// opaque ipv6[16]; -// } -// ip; -// uint32 port; -// uint32 numFailures; -// }; -// -// =========================================================================== -xdr.struct("PeerAddress", [ - ["ip", xdr.lookup("PeerAddressIp")], - ["port", xdr.lookup("Uint32")], - ["numFailures", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// enum MessageType -// { -// ERROR_MSG = 0, -// AUTH = 2, -// DONT_HAVE = 3, -// -// GET_PEERS = 4, // gets a list of peers this guy knows about -// PEERS = 5, -// -// GET_TX_SET = 6, // gets a particular txset by hash -// TX_SET = 7, -// GENERALIZED_TX_SET = 17, -// -// TRANSACTION = 8, // pass on a tx you have heard about -// -// // SCP -// GET_SCP_QUORUMSET = 9, -// SCP_QUORUMSET = 10, -// SCP_MESSAGE = 11, -// GET_SCP_STATE = 12, -// -// // new messages -// HELLO = 13, -// -// SURVEY_REQUEST = 14, -// SURVEY_RESPONSE = 15, -// -// SEND_MORE = 16, -// FLOOD_ADVERT = 18, -// FLOOD_DEMAND = 19 -// }; -// -// =========================================================================== -xdr.enum("MessageType", { - errorMsg: 0, - auth: 2, - dontHave: 3, - getPeers: 4, - peers: 5, - getTxSet: 6, - txSet: 7, - generalizedTxSet: 17, - transaction: 8, - getScpQuorumset: 9, - scpQuorumset: 10, - scpMessage: 11, - getScpState: 12, - hello: 13, - surveyRequest: 14, - surveyResponse: 15, - sendMore: 16, - floodAdvert: 18, - floodDemand: 19, -}); - -// === xdr source ============================================================ -// -// struct DontHave -// { -// MessageType type; -// uint256 reqHash; -// }; -// -// =========================================================================== -xdr.struct("DontHave", [ - ["type", xdr.lookup("MessageType")], - ["reqHash", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// enum SurveyMessageCommandType -// { -// SURVEY_TOPOLOGY = 0 -// }; -// -// =========================================================================== -xdr.enum("SurveyMessageCommandType", { - surveyTopology: 0, -}); - -// === xdr source ============================================================ -// -// enum SurveyMessageResponseType -// { -// SURVEY_TOPOLOGY_RESPONSE_V0 = 0, -// SURVEY_TOPOLOGY_RESPONSE_V1 = 1 -// }; -// -// =========================================================================== -xdr.enum("SurveyMessageResponseType", { - surveyTopologyResponseV0: 0, - surveyTopologyResponseV1: 1, -}); - -// === xdr source ============================================================ -// -// struct SurveyRequestMessage -// { -// NodeID surveyorPeerID; -// NodeID surveyedPeerID; -// uint32 ledgerNum; -// Curve25519Public encryptionKey; -// SurveyMessageCommandType commandType; -// }; -// -// =========================================================================== -xdr.struct("SurveyRequestMessage", [ - ["surveyorPeerId", xdr.lookup("NodeId")], - ["surveyedPeerId", xdr.lookup("NodeId")], - ["ledgerNum", xdr.lookup("Uint32")], - ["encryptionKey", xdr.lookup("Curve25519Public")], - ["commandType", xdr.lookup("SurveyMessageCommandType")], -]); - -// === xdr source ============================================================ -// -// struct SignedSurveyRequestMessage -// { -// Signature requestSignature; -// SurveyRequestMessage request; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyRequestMessage", [ - ["requestSignature", xdr.lookup("Signature")], - ["request", xdr.lookup("SurveyRequestMessage")], -]); - -// === xdr source ============================================================ -// -// typedef opaque EncryptedBody<64000>; -// -// =========================================================================== -xdr.typedef("EncryptedBody", xdr.varOpaque(64000)); - -// === xdr source ============================================================ -// -// struct SurveyResponseMessage -// { -// NodeID surveyorPeerID; -// NodeID surveyedPeerID; -// uint32 ledgerNum; -// SurveyMessageCommandType commandType; -// EncryptedBody encryptedBody; -// }; -// -// =========================================================================== -xdr.struct("SurveyResponseMessage", [ - ["surveyorPeerId", xdr.lookup("NodeId")], - ["surveyedPeerId", xdr.lookup("NodeId")], - ["ledgerNum", xdr.lookup("Uint32")], - ["commandType", xdr.lookup("SurveyMessageCommandType")], - ["encryptedBody", xdr.lookup("EncryptedBody")], -]); - -// === xdr source ============================================================ -// -// struct SignedSurveyResponseMessage -// { -// Signature responseSignature; -// SurveyResponseMessage response; -// }; -// -// =========================================================================== -xdr.struct("SignedSurveyResponseMessage", [ - ["responseSignature", xdr.lookup("Signature")], - ["response", xdr.lookup("SurveyResponseMessage")], -]); - -// === xdr source ============================================================ -// -// struct PeerStats -// { -// NodeID id; -// string versionStr<100>; -// uint64 messagesRead; -// uint64 messagesWritten; -// uint64 bytesRead; -// uint64 bytesWritten; -// uint64 secondsConnected; -// -// uint64 uniqueFloodBytesRecv; -// uint64 duplicateFloodBytesRecv; -// uint64 uniqueFetchBytesRecv; -// uint64 duplicateFetchBytesRecv; -// -// uint64 uniqueFloodMessageRecv; -// uint64 duplicateFloodMessageRecv; -// uint64 uniqueFetchMessageRecv; -// uint64 duplicateFetchMessageRecv; -// }; -// -// =========================================================================== -xdr.struct("PeerStats", [ - ["id", xdr.lookup("NodeId")], - ["versionStr", xdr.string(100)], - ["messagesRead", xdr.lookup("Uint64")], - ["messagesWritten", xdr.lookup("Uint64")], - ["bytesRead", xdr.lookup("Uint64")], - ["bytesWritten", xdr.lookup("Uint64")], - ["secondsConnected", xdr.lookup("Uint64")], - ["uniqueFloodBytesRecv", xdr.lookup("Uint64")], - ["duplicateFloodBytesRecv", xdr.lookup("Uint64")], - ["uniqueFetchBytesRecv", xdr.lookup("Uint64")], - ["duplicateFetchBytesRecv", xdr.lookup("Uint64")], - ["uniqueFloodMessageRecv", xdr.lookup("Uint64")], - ["duplicateFloodMessageRecv", xdr.lookup("Uint64")], - ["uniqueFetchMessageRecv", xdr.lookup("Uint64")], - ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// typedef PeerStats PeerStatList<25>; -// -// =========================================================================== -xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); - -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV0 -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBodyV0", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct TopologyResponseBodyV1 -// { -// PeerStatList inboundPeers; -// PeerStatList outboundPeers; -// -// uint32 totalInboundPeerCount; -// uint32 totalOutboundPeerCount; -// -// uint32 maxInboundPeerCount; -// uint32 maxOutboundPeerCount; -// }; -// -// =========================================================================== -xdr.struct("TopologyResponseBodyV1", [ - ["inboundPeers", xdr.lookup("PeerStatList")], - ["outboundPeers", xdr.lookup("PeerStatList")], - ["totalInboundPeerCount", xdr.lookup("Uint32")], - ["totalOutboundPeerCount", xdr.lookup("Uint32")], - ["maxInboundPeerCount", xdr.lookup("Uint32")], - ["maxOutboundPeerCount", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// union SurveyResponseBody switch (SurveyMessageResponseType type) -// { -// case SURVEY_TOPOLOGY_RESPONSE_V0: -// TopologyResponseBodyV0 topologyResponseBodyV0; -// case SURVEY_TOPOLOGY_RESPONSE_V1: -// TopologyResponseBodyV1 topologyResponseBodyV1; -// }; -// -// =========================================================================== -xdr.union("SurveyResponseBody", { - switchOn: xdr.lookup("SurveyMessageResponseType"), - switchName: "type", - switches: [ - ["surveyTopologyResponseV0", "topologyResponseBodyV0"], - ["surveyTopologyResponseV1", "topologyResponseBodyV1"], - ], - arms: { - topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), - topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), - }, -}); - -// === xdr source ============================================================ -// -// const TX_ADVERT_VECTOR_MAX_SIZE = 1000; -// -// =========================================================================== -xdr.const("TX_ADVERT_VECTOR_MAX_SIZE", 1000); - -// === xdr source ============================================================ -// -// typedef Hash TxAdvertVector; -// -// =========================================================================== -xdr.typedef("TxAdvertVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))); - -// === xdr source ============================================================ -// -// struct FloodAdvert -// { -// TxAdvertVector txHashes; -// }; -// -// =========================================================================== -xdr.struct("FloodAdvert", [ - ["txHashes", xdr.lookup("TxAdvertVector")], -]); - -// === xdr source ============================================================ -// -// const TX_DEMAND_VECTOR_MAX_SIZE = 1000; -// -// =========================================================================== -xdr.const("TX_DEMAND_VECTOR_MAX_SIZE", 1000); - -// === xdr source ============================================================ -// -// typedef Hash TxDemandVector; -// -// =========================================================================== -xdr.typedef("TxDemandVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))); - -// === xdr source ============================================================ -// -// struct FloodDemand -// { -// TxDemandVector txHashes; -// }; -// -// =========================================================================== -xdr.struct("FloodDemand", [ - ["txHashes", xdr.lookup("TxDemandVector")], -]); - -// === xdr source ============================================================ -// -// union StellarMessage switch (MessageType type) -// { -// case ERROR_MSG: -// Error error; -// case HELLO: -// Hello hello; -// case AUTH: -// Auth auth; -// case DONT_HAVE: -// DontHave dontHave; -// case GET_PEERS: -// void; -// case PEERS: -// PeerAddress peers<100>; -// -// case GET_TX_SET: -// uint256 txSetHash; -// case TX_SET: -// TransactionSet txSet; -// case GENERALIZED_TX_SET: -// GeneralizedTransactionSet generalizedTxSet; -// -// case TRANSACTION: -// TransactionEnvelope transaction; -// -// case SURVEY_REQUEST: -// SignedSurveyRequestMessage signedSurveyRequestMessage; -// -// case SURVEY_RESPONSE: -// SignedSurveyResponseMessage signedSurveyResponseMessage; -// -// // SCP -// case GET_SCP_QUORUMSET: -// uint256 qSetHash; -// case SCP_QUORUMSET: -// SCPQuorumSet qSet; -// case SCP_MESSAGE: -// SCPEnvelope envelope; -// case GET_SCP_STATE: -// uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest -// case SEND_MORE: -// SendMore sendMoreMessage; -// -// // Pull mode -// case FLOOD_ADVERT: -// FloodAdvert floodAdvert; -// case FLOOD_DEMAND: -// FloodDemand floodDemand; -// }; -// -// =========================================================================== -xdr.union("StellarMessage", { - switchOn: xdr.lookup("MessageType"), - switchName: "type", - switches: [ - ["errorMsg", "error"], - ["hello", "hello"], - ["auth", "auth"], - ["dontHave", "dontHave"], - ["getPeers", xdr.void()], - ["peers", "peers"], - ["getTxSet", "txSetHash"], - ["txSet", "txSet"], - ["generalizedTxSet", "generalizedTxSet"], - ["transaction", "transaction"], - ["surveyRequest", "signedSurveyRequestMessage"], - ["surveyResponse", "signedSurveyResponseMessage"], - ["getScpQuorumset", "qSetHash"], - ["scpQuorumset", "qSet"], - ["scpMessage", "envelope"], - ["getScpState", "getScpLedgerSeq"], - ["sendMore", "sendMoreMessage"], - ["floodAdvert", "floodAdvert"], - ["floodDemand", "floodDemand"], - ], - arms: { - error: xdr.lookup("Error"), - hello: xdr.lookup("Hello"), - auth: xdr.lookup("Auth"), - dontHave: xdr.lookup("DontHave"), - peers: xdr.varArray(xdr.lookup("PeerAddress"), 100), - txSetHash: xdr.lookup("Uint256"), - txSet: xdr.lookup("TransactionSet"), - generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), - transaction: xdr.lookup("TransactionEnvelope"), - signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), - signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), - qSetHash: xdr.lookup("Uint256"), - qSet: xdr.lookup("ScpQuorumSet"), - envelope: xdr.lookup("ScpEnvelope"), - getScpLedgerSeq: xdr.lookup("Uint32"), - sendMoreMessage: xdr.lookup("SendMore"), - floodAdvert: xdr.lookup("FloodAdvert"), - floodDemand: xdr.lookup("FloodDemand"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// uint64 sequence; -// StellarMessage message; -// HmacSha256Mac mac; -// } -// -// =========================================================================== -xdr.struct("AuthenticatedMessageV0", [ - ["sequence", xdr.lookup("Uint64")], - ["message", xdr.lookup("StellarMessage")], - ["mac", xdr.lookup("HmacSha256Mac")], -]); - -// === xdr source ============================================================ -// -// union AuthenticatedMessage switch (uint32 v) -// { -// case 0: -// struct -// { -// uint64 sequence; -// StellarMessage message; -// HmacSha256Mac mac; -// } v0; -// }; -// -// =========================================================================== -xdr.union("AuthenticatedMessage", { - switchOn: xdr.lookup("Uint32"), - switchName: "v", - switches: [ - [0, "v0"], - ], - arms: { - v0: xdr.lookup("AuthenticatedMessageV0"), - }, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolParameters switch (LiquidityPoolType type) -// { -// case LIQUIDITY_POOL_CONSTANT_PRODUCT: -// LiquidityPoolConstantProductParameters constantProduct; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolParameters", { - switchOn: xdr.lookup("LiquidityPoolType"), - switchName: "type", - switches: [ - ["liquidityPoolConstantProduct", "constantProduct"], - ], - arms: { - constantProduct: xdr.lookup("LiquidityPoolConstantProductParameters"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// uint64 id; -// uint256 ed25519; -// } -// -// =========================================================================== -xdr.struct("MuxedAccountMed25519", [ - ["id", xdr.lookup("Uint64")], - ["ed25519", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// union MuxedAccount switch (CryptoKeyType type) -// { -// case KEY_TYPE_ED25519: -// uint256 ed25519; -// case KEY_TYPE_MUXED_ED25519: -// struct -// { -// uint64 id; -// uint256 ed25519; -// } med25519; -// }; -// -// =========================================================================== -xdr.union("MuxedAccount", { - switchOn: xdr.lookup("CryptoKeyType"), - switchName: "type", - switches: [ - ["keyTypeEd25519", "ed25519"], - ["keyTypeMuxedEd25519", "med25519"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - med25519: xdr.lookup("MuxedAccountMed25519"), - }, -}); - -// === xdr source ============================================================ -// -// struct DecoratedSignature -// { -// SignatureHint hint; // last 4 bytes of the public key, used as a hint -// Signature signature; // actual signature -// }; -// -// =========================================================================== -xdr.struct("DecoratedSignature", [ - ["hint", xdr.lookup("SignatureHint")], - ["signature", xdr.lookup("Signature")], -]); - -// === xdr source ============================================================ -// -// struct LedgerFootprint -// { -// LedgerKey readOnly<>; -// LedgerKey readWrite<>; -// }; -// -// =========================================================================== -xdr.struct("LedgerFootprint", [ - ["readOnly", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], - ["readWrite", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// enum OperationType -// { -// CREATE_ACCOUNT = 0, -// PAYMENT = 1, -// PATH_PAYMENT_STRICT_RECEIVE = 2, -// MANAGE_SELL_OFFER = 3, -// CREATE_PASSIVE_SELL_OFFER = 4, -// SET_OPTIONS = 5, -// CHANGE_TRUST = 6, -// ALLOW_TRUST = 7, -// ACCOUNT_MERGE = 8, -// INFLATION = 9, -// MANAGE_DATA = 10, -// BUMP_SEQUENCE = 11, -// MANAGE_BUY_OFFER = 12, -// PATH_PAYMENT_STRICT_SEND = 13, -// CREATE_CLAIMABLE_BALANCE = 14, -// CLAIM_CLAIMABLE_BALANCE = 15, -// BEGIN_SPONSORING_FUTURE_RESERVES = 16, -// END_SPONSORING_FUTURE_RESERVES = 17, -// REVOKE_SPONSORSHIP = 18, -// CLAWBACK = 19, -// CLAWBACK_CLAIMABLE_BALANCE = 20, -// SET_TRUST_LINE_FLAGS = 21, -// LIQUIDITY_POOL_DEPOSIT = 22, -// LIQUIDITY_POOL_WITHDRAW = 23, -// INVOKE_HOST_FUNCTION = 24 -// }; -// -// =========================================================================== -xdr.enum("OperationType", { - createAccount: 0, - payment: 1, - pathPaymentStrictReceive: 2, - manageSellOffer: 3, - createPassiveSellOffer: 4, - setOptions: 5, - changeTrust: 6, - allowTrust: 7, - accountMerge: 8, - inflation: 9, - manageData: 10, - bumpSequence: 11, - manageBuyOffer: 12, - pathPaymentStrictSend: 13, - createClaimableBalance: 14, - claimClaimableBalance: 15, - beginSponsoringFutureReserves: 16, - endSponsoringFutureReserves: 17, - revokeSponsorship: 18, - clawback: 19, - clawbackClaimableBalance: 20, - setTrustLineFlags: 21, - liquidityPoolDeposit: 22, - liquidityPoolWithdraw: 23, - invokeHostFunction: 24, -}); - -// === xdr source ============================================================ -// -// struct CreateAccountOp -// { -// AccountID destination; // account to create -// int64 startingBalance; // amount they end up with -// }; -// -// =========================================================================== -xdr.struct("CreateAccountOp", [ - ["destination", xdr.lookup("AccountId")], - ["startingBalance", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct PaymentOp -// { -// MuxedAccount destination; // recipient of the payment -// Asset asset; // what they end up with -// int64 amount; // amount they end up with -// }; -// -// =========================================================================== -xdr.struct("PaymentOp", [ - ["destination", xdr.lookup("MuxedAccount")], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct PathPaymentStrictReceiveOp -// { -// Asset sendAsset; // asset we pay with -// int64 sendMax; // the maximum amount of sendAsset to -// // send (excluding fees). -// // The operation will fail if can't be met -// -// MuxedAccount destination; // recipient of the payment -// Asset destAsset; // what they end up with -// int64 destAmount; // amount they end up with -// -// Asset path<5>; // additional hops it must go through to get there -// }; -// -// =========================================================================== -xdr.struct("PathPaymentStrictReceiveOp", [ - ["sendAsset", xdr.lookup("Asset")], - ["sendMax", xdr.lookup("Int64")], - ["destination", xdr.lookup("MuxedAccount")], - ["destAsset", xdr.lookup("Asset")], - ["destAmount", xdr.lookup("Int64")], - ["path", xdr.varArray(xdr.lookup("Asset"), 5)], -]); - -// === xdr source ============================================================ -// -// struct PathPaymentStrictSendOp -// { -// Asset sendAsset; // asset we pay with -// int64 sendAmount; // amount of sendAsset to send (excluding fees) -// -// MuxedAccount destination; // recipient of the payment -// Asset destAsset; // what they end up with -// int64 destMin; // the minimum amount of dest asset to -// // be received -// // The operation will fail if it can't be met -// -// Asset path<5>; // additional hops it must go through to get there -// }; -// -// =========================================================================== -xdr.struct("PathPaymentStrictSendOp", [ - ["sendAsset", xdr.lookup("Asset")], - ["sendAmount", xdr.lookup("Int64")], - ["destination", xdr.lookup("MuxedAccount")], - ["destAsset", xdr.lookup("Asset")], - ["destMin", xdr.lookup("Int64")], - ["path", xdr.varArray(xdr.lookup("Asset"), 5)], -]); - -// === xdr source ============================================================ -// -// struct ManageSellOfferOp -// { -// Asset selling; -// Asset buying; -// int64 amount; // amount being sold. if set to 0, delete the offer -// Price price; // price of thing being sold in terms of what you are buying -// -// // 0=create a new offer, otherwise edit an existing offer -// int64 offerID; -// }; -// -// =========================================================================== -xdr.struct("ManageSellOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ManageBuyOfferOp -// { -// Asset selling; -// Asset buying; -// int64 buyAmount; // amount being bought. if set to 0, delete the offer -// Price price; // price of thing being bought in terms of what you are -// // selling -// -// // 0=create a new offer, otherwise edit an existing offer -// int64 offerID; -// }; -// -// =========================================================================== -xdr.struct("ManageBuyOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["buyAmount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], - ["offerId", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct CreatePassiveSellOfferOp -// { -// Asset selling; // A -// Asset buying; // B -// int64 amount; // amount taker gets -// Price price; // cost of A in terms of B -// }; -// -// =========================================================================== -xdr.struct("CreatePassiveSellOfferOp", [ - ["selling", xdr.lookup("Asset")], - ["buying", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["price", xdr.lookup("Price")], -]); - -// === xdr source ============================================================ -// -// struct SetOptionsOp -// { -// AccountID* inflationDest; // sets the inflation destination -// -// uint32* clearFlags; // which flags to clear -// uint32* setFlags; // which flags to set -// -// // account threshold manipulation -// uint32* masterWeight; // weight of the master account -// uint32* lowThreshold; -// uint32* medThreshold; -// uint32* highThreshold; -// -// string32* homeDomain; // sets the home domain -// -// // Add, update or remove a signer for the account -// // signer is deleted if the weight is 0 -// Signer* signer; -// }; -// -// =========================================================================== -xdr.struct("SetOptionsOp", [ - ["inflationDest", xdr.option(xdr.lookup("AccountId"))], - ["clearFlags", xdr.option(xdr.lookup("Uint32"))], - ["setFlags", xdr.option(xdr.lookup("Uint32"))], - ["masterWeight", xdr.option(xdr.lookup("Uint32"))], - ["lowThreshold", xdr.option(xdr.lookup("Uint32"))], - ["medThreshold", xdr.option(xdr.lookup("Uint32"))], - ["highThreshold", xdr.option(xdr.lookup("Uint32"))], - ["homeDomain", xdr.option(xdr.lookup("String32"))], - ["signer", xdr.option(xdr.lookup("Signer"))], -]); - -// === xdr source ============================================================ -// -// union ChangeTrustAsset switch (AssetType type) -// { -// case ASSET_TYPE_NATIVE: // Not credit -// void; -// -// case ASSET_TYPE_CREDIT_ALPHANUM4: -// AlphaNum4 alphaNum4; -// -// case ASSET_TYPE_CREDIT_ALPHANUM12: -// AlphaNum12 alphaNum12; -// -// case ASSET_TYPE_POOL_SHARE: -// LiquidityPoolParameters liquidityPool; -// -// // add other asset types here in the future -// }; -// -// =========================================================================== -xdr.union("ChangeTrustAsset", { - switchOn: xdr.lookup("AssetType"), - switchName: "type", - switches: [ - ["assetTypeNative", xdr.void()], - ["assetTypeCreditAlphanum4", "alphaNum4"], - ["assetTypeCreditAlphanum12", "alphaNum12"], - ["assetTypePoolShare", "liquidityPool"], - ], - arms: { - alphaNum4: xdr.lookup("AlphaNum4"), - alphaNum12: xdr.lookup("AlphaNum12"), - liquidityPool: xdr.lookup("LiquidityPoolParameters"), - }, -}); - -// === xdr source ============================================================ -// -// struct ChangeTrustOp -// { -// ChangeTrustAsset line; -// -// // if limit is set to 0, deletes the trust line -// int64 limit; -// }; -// -// =========================================================================== -xdr.struct("ChangeTrustOp", [ - ["line", xdr.lookup("ChangeTrustAsset")], - ["limit", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct AllowTrustOp -// { -// AccountID trustor; -// AssetCode asset; -// -// // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG -// uint32 authorize; -// }; -// -// =========================================================================== -xdr.struct("AllowTrustOp", [ - ["trustor", xdr.lookup("AccountId")], - ["asset", xdr.lookup("AssetCode")], - ["authorize", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct ManageDataOp -// { -// string64 dataName; -// DataValue* dataValue; // set to null to clear -// }; -// -// =========================================================================== -xdr.struct("ManageDataOp", [ - ["dataName", xdr.lookup("String64")], - ["dataValue", xdr.option(xdr.lookup("DataValue"))], -]); - -// === xdr source ============================================================ -// -// struct BumpSequenceOp -// { -// SequenceNumber bumpTo; -// }; -// -// =========================================================================== -xdr.struct("BumpSequenceOp", [ - ["bumpTo", xdr.lookup("SequenceNumber")], -]); - -// === xdr source ============================================================ -// -// struct CreateClaimableBalanceOp -// { -// Asset asset; -// int64 amount; -// Claimant claimants<10>; -// }; -// -// =========================================================================== -xdr.struct("CreateClaimableBalanceOp", [ - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], - ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], -]); - -// === xdr source ============================================================ -// -// struct ClaimClaimableBalanceOp -// { -// ClaimableBalanceID balanceID; -// }; -// -// =========================================================================== -xdr.struct("ClaimClaimableBalanceOp", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct BeginSponsoringFutureReservesOp -// { -// AccountID sponsoredID; -// }; -// -// =========================================================================== -xdr.struct("BeginSponsoringFutureReservesOp", [ - ["sponsoredId", xdr.lookup("AccountId")], -]); - -// === xdr source ============================================================ -// -// enum RevokeSponsorshipType -// { -// REVOKE_SPONSORSHIP_LEDGER_ENTRY = 0, -// REVOKE_SPONSORSHIP_SIGNER = 1 -// }; -// -// =========================================================================== -xdr.enum("RevokeSponsorshipType", { - revokeSponsorshipLedgerEntry: 0, - revokeSponsorshipSigner: 1, -}); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID accountID; -// SignerKey signerKey; -// } -// -// =========================================================================== -xdr.struct("RevokeSponsorshipOpSigner", [ - ["accountId", xdr.lookup("AccountId")], - ["signerKey", xdr.lookup("SignerKey")], -]); - -// === xdr source ============================================================ -// -// union RevokeSponsorshipOp switch (RevokeSponsorshipType type) -// { -// case REVOKE_SPONSORSHIP_LEDGER_ENTRY: -// LedgerKey ledgerKey; -// case REVOKE_SPONSORSHIP_SIGNER: -// struct -// { -// AccountID accountID; -// SignerKey signerKey; -// } signer; -// }; -// -// =========================================================================== -xdr.union("RevokeSponsorshipOp", { - switchOn: xdr.lookup("RevokeSponsorshipType"), - switchName: "type", - switches: [ - ["revokeSponsorshipLedgerEntry", "ledgerKey"], - ["revokeSponsorshipSigner", "signer"], - ], - arms: { - ledgerKey: xdr.lookup("LedgerKey"), - signer: xdr.lookup("RevokeSponsorshipOpSigner"), - }, -}); - -// === xdr source ============================================================ -// -// struct ClawbackOp -// { -// Asset asset; -// MuxedAccount from; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("ClawbackOp", [ - ["asset", xdr.lookup("Asset")], - ["from", xdr.lookup("MuxedAccount")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClawbackClaimableBalanceOp -// { -// ClaimableBalanceID balanceID; -// }; -// -// =========================================================================== -xdr.struct("ClawbackClaimableBalanceOp", [ - ["balanceId", xdr.lookup("ClaimableBalanceId")], -]); - -// === xdr source ============================================================ -// -// struct SetTrustLineFlagsOp -// { -// AccountID trustor; -// Asset asset; -// -// uint32 clearFlags; // which flags to clear -// uint32 setFlags; // which flags to set -// }; -// -// =========================================================================== -xdr.struct("SetTrustLineFlagsOp", [ - ["trustor", xdr.lookup("AccountId")], - ["asset", xdr.lookup("Asset")], - ["clearFlags", xdr.lookup("Uint32")], - ["setFlags", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// const LIQUIDITY_POOL_FEE_V18 = 30; -// -// =========================================================================== -xdr.const("LIQUIDITY_POOL_FEE_V18", 30); - -// === xdr source ============================================================ -// -// struct LiquidityPoolDepositOp -// { -// PoolID liquidityPoolID; -// int64 maxAmountA; // maximum amount of first asset to deposit -// int64 maxAmountB; // maximum amount of second asset to deposit -// Price minPrice; // minimum depositA/depositB -// Price maxPrice; // maximum depositA/depositB -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolDepositOp", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["maxAmountA", xdr.lookup("Int64")], - ["maxAmountB", xdr.lookup("Int64")], - ["minPrice", xdr.lookup("Price")], - ["maxPrice", xdr.lookup("Price")], -]); - -// === xdr source ============================================================ -// -// struct LiquidityPoolWithdrawOp -// { -// PoolID liquidityPoolID; -// int64 amount; // amount of pool shares to withdraw -// int64 minAmountA; // minimum amount of first asset to withdraw -// int64 minAmountB; // minimum amount of second asset to withdraw -// }; -// -// =========================================================================== -xdr.struct("LiquidityPoolWithdrawOp", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["amount", xdr.lookup("Int64")], - ["minAmountA", xdr.lookup("Int64")], - ["minAmountB", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// enum HostFunctionType -// { -// HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, -// HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, -// HOST_FUNCTION_TYPE_INSTALL_CONTRACT_CODE = 2 -// }; -// -// =========================================================================== -xdr.enum("HostFunctionType", { - hostFunctionTypeInvokeContract: 0, - hostFunctionTypeCreateContract: 1, - hostFunctionTypeInstallContractCode: 2, -}); - -// === xdr source ============================================================ -// -// enum ContractIDType -// { -// CONTRACT_ID_FROM_SOURCE_ACCOUNT = 0, -// CONTRACT_ID_FROM_ED25519_PUBLIC_KEY = 1, -// CONTRACT_ID_FROM_ASSET = 2 -// }; -// -// =========================================================================== -xdr.enum("ContractIdType", { - contractIdFromSourceAccount: 0, - contractIdFromEd25519PublicKey: 1, - contractIdFromAsset: 2, -}); - -// === xdr source ============================================================ -// -// enum ContractIDPublicKeyType -// { -// CONTRACT_ID_PUBLIC_KEY_SOURCE_ACCOUNT = 0, -// CONTRACT_ID_PUBLIC_KEY_ED25519 = 1 -// }; -// -// =========================================================================== -xdr.enum("ContractIdPublicKeyType", { - contractIdPublicKeySourceAccount: 0, - contractIdPublicKeyEd25519: 1, -}); - -// === xdr source ============================================================ -// -// struct InstallContractCodeArgs -// { -// opaque code; -// }; -// -// =========================================================================== -xdr.struct("InstallContractCodeArgs", [ - ["code", xdr.varOpaque(SCVAL_LIMIT)], -]); - -// === xdr source ============================================================ -// -// struct -// { -// uint256 key; -// Signature signature; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("ContractIdFromEd25519PublicKey", [ - ["key", xdr.lookup("Uint256")], - ["signature", xdr.lookup("Signature")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// union ContractID switch (ContractIDType type) -// { -// case CONTRACT_ID_FROM_SOURCE_ACCOUNT: -// uint256 salt; -// case CONTRACT_ID_FROM_ED25519_PUBLIC_KEY: -// struct -// { -// uint256 key; -// Signature signature; -// uint256 salt; -// } fromEd25519PublicKey; -// case CONTRACT_ID_FROM_ASSET: -// Asset asset; -// }; -// -// =========================================================================== -xdr.union("ContractId", { - switchOn: xdr.lookup("ContractIdType"), - switchName: "type", - switches: [ - ["contractIdFromSourceAccount", "salt"], - ["contractIdFromEd25519PublicKey", "fromEd25519PublicKey"], - ["contractIdFromAsset", "asset"], - ], - arms: { - salt: xdr.lookup("Uint256"), - fromEd25519PublicKey: xdr.lookup("ContractIdFromEd25519PublicKey"), - asset: xdr.lookup("Asset"), - }, -}); - -// === xdr source ============================================================ -// -// struct CreateContractArgs -// { -// ContractID contractID; -// SCContractExecutable source; -// }; -// -// =========================================================================== -xdr.struct("CreateContractArgs", [ - ["contractId", xdr.lookup("ContractId")], - ["source", xdr.lookup("ScContractExecutable")], -]); - -// === xdr source ============================================================ -// -// union HostFunction switch (HostFunctionType type) -// { -// case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: -// SCVec invokeArgs; -// case HOST_FUNCTION_TYPE_CREATE_CONTRACT: -// CreateContractArgs createContractArgs; -// case HOST_FUNCTION_TYPE_INSTALL_CONTRACT_CODE: -// InstallContractCodeArgs installContractCodeArgs; -// }; -// -// =========================================================================== -xdr.union("HostFunction", { - switchOn: xdr.lookup("HostFunctionType"), - switchName: "type", - switches: [ - ["hostFunctionTypeInvokeContract", "invokeArgs"], - ["hostFunctionTypeCreateContract", "createContractArgs"], - ["hostFunctionTypeInstallContractCode", "installContractCodeArgs"], - ], - arms: { - invokeArgs: xdr.lookup("ScVec"), - createContractArgs: xdr.lookup("CreateContractArgs"), - installContractCodeArgs: xdr.lookup("InstallContractCodeArgs"), - }, -}); - -// === xdr source ============================================================ -// -// struct AuthorizedInvocation -// { -// Hash contractID; -// SCSymbol functionName; -// SCVec args; -// AuthorizedInvocation subInvocations<>; -// }; -// -// =========================================================================== -xdr.struct("AuthorizedInvocation", [ - ["contractId", xdr.lookup("Hash")], - ["functionName", xdr.lookup("ScSymbol")], - ["args", xdr.lookup("ScVec")], - ["subInvocations", xdr.varArray(xdr.lookup("AuthorizedInvocation"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// struct AddressWithNonce -// { -// SCAddress address; -// uint64 nonce; -// }; -// -// =========================================================================== -xdr.struct("AddressWithNonce", [ - ["address", xdr.lookup("ScAddress")], - ["nonce", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// struct ContractAuth -// { -// AddressWithNonce* addressWithNonce; // not present for invoker -// AuthorizedInvocation rootInvocation; -// SCVec signatureArgs; -// }; -// -// =========================================================================== -xdr.struct("ContractAuth", [ - ["addressWithNonce", xdr.option(xdr.lookup("AddressWithNonce"))], - ["rootInvocation", xdr.lookup("AuthorizedInvocation")], - ["signatureArgs", xdr.lookup("ScVec")], -]); - -// === xdr source ============================================================ -// -// struct InvokeHostFunctionOp -// { -// // The host function to invoke -// HostFunction function; -// // The footprint for this invocation -// LedgerFootprint footprint; -// // Per-address authorizations for this host fn -// // Currently only supported for INVOKE_CONTRACT function -// ContractAuth auth<>; -// }; -// -// =========================================================================== -xdr.struct("InvokeHostFunctionOp", [ - ["function", xdr.lookup("HostFunction")], - ["footprint", xdr.lookup("LedgerFootprint")], - ["auth", xdr.varArray(xdr.lookup("ContractAuth"), 2147483647)], -]); - -// === xdr source ============================================================ -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountOp createAccountOp; -// case PAYMENT: -// PaymentOp paymentOp; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; -// case MANAGE_SELL_OFFER: -// ManageSellOfferOp manageSellOfferOp; -// case CREATE_PASSIVE_SELL_OFFER: -// CreatePassiveSellOfferOp createPassiveSellOfferOp; -// case SET_OPTIONS: -// SetOptionsOp setOptionsOp; -// case CHANGE_TRUST: -// ChangeTrustOp changeTrustOp; -// case ALLOW_TRUST: -// AllowTrustOp allowTrustOp; -// case ACCOUNT_MERGE: -// MuxedAccount destination; -// case INFLATION: -// void; -// case MANAGE_DATA: -// ManageDataOp manageDataOp; -// case BUMP_SEQUENCE: -// BumpSequenceOp bumpSequenceOp; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferOp manageBuyOfferOp; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendOp pathPaymentStrictSendOp; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceOp createClaimableBalanceOp; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceOp claimClaimableBalanceOp; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; -// case END_SPONSORING_FUTURE_RESERVES: -// void; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipOp revokeSponsorshipOp; -// case CLAWBACK: -// ClawbackOp clawbackOp; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsOp setTrustLineFlagsOp; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositOp liquidityPoolDepositOp; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; -// case INVOKE_HOST_FUNCTION: -// InvokeHostFunctionOp invokeHostFunctionOp; -// } -// -// =========================================================================== -xdr.union("OperationBody", { - switchOn: xdr.lookup("OperationType"), - switchName: "type", - switches: [ - ["createAccount", "createAccountOp"], - ["payment", "paymentOp"], - ["pathPaymentStrictReceive", "pathPaymentStrictReceiveOp"], - ["manageSellOffer", "manageSellOfferOp"], - ["createPassiveSellOffer", "createPassiveSellOfferOp"], - ["setOptions", "setOptionsOp"], - ["changeTrust", "changeTrustOp"], - ["allowTrust", "allowTrustOp"], - ["accountMerge", "destination"], - ["inflation", xdr.void()], - ["manageData", "manageDataOp"], - ["bumpSequence", "bumpSequenceOp"], - ["manageBuyOffer", "manageBuyOfferOp"], - ["pathPaymentStrictSend", "pathPaymentStrictSendOp"], - ["createClaimableBalance", "createClaimableBalanceOp"], - ["claimClaimableBalance", "claimClaimableBalanceOp"], - ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesOp"], - ["endSponsoringFutureReserves", xdr.void()], - ["revokeSponsorship", "revokeSponsorshipOp"], - ["clawback", "clawbackOp"], - ["clawbackClaimableBalance", "clawbackClaimableBalanceOp"], - ["setTrustLineFlags", "setTrustLineFlagsOp"], - ["liquidityPoolDeposit", "liquidityPoolDepositOp"], - ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], - ["invokeHostFunction", "invokeHostFunctionOp"], - ], - arms: { - createAccountOp: xdr.lookup("CreateAccountOp"), - paymentOp: xdr.lookup("PaymentOp"), - pathPaymentStrictReceiveOp: xdr.lookup("PathPaymentStrictReceiveOp"), - manageSellOfferOp: xdr.lookup("ManageSellOfferOp"), - createPassiveSellOfferOp: xdr.lookup("CreatePassiveSellOfferOp"), - setOptionsOp: xdr.lookup("SetOptionsOp"), - changeTrustOp: xdr.lookup("ChangeTrustOp"), - allowTrustOp: xdr.lookup("AllowTrustOp"), - destination: xdr.lookup("MuxedAccount"), - manageDataOp: xdr.lookup("ManageDataOp"), - bumpSequenceOp: xdr.lookup("BumpSequenceOp"), - manageBuyOfferOp: xdr.lookup("ManageBuyOfferOp"), - pathPaymentStrictSendOp: xdr.lookup("PathPaymentStrictSendOp"), - createClaimableBalanceOp: xdr.lookup("CreateClaimableBalanceOp"), - claimClaimableBalanceOp: xdr.lookup("ClaimClaimableBalanceOp"), - beginSponsoringFutureReservesOp: xdr.lookup("BeginSponsoringFutureReservesOp"), - revokeSponsorshipOp: xdr.lookup("RevokeSponsorshipOp"), - clawbackOp: xdr.lookup("ClawbackOp"), - clawbackClaimableBalanceOp: xdr.lookup("ClawbackClaimableBalanceOp"), - setTrustLineFlagsOp: xdr.lookup("SetTrustLineFlagsOp"), - liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), - liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), - invokeHostFunctionOp: xdr.lookup("InvokeHostFunctionOp"), - }, -}); - -// === xdr source ============================================================ -// -// struct Operation -// { -// // sourceAccount is the account used to run the operation -// // if not set, the runtime defaults to "sourceAccount" specified at -// // the transaction level -// MuxedAccount* sourceAccount; -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountOp createAccountOp; -// case PAYMENT: -// PaymentOp paymentOp; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; -// case MANAGE_SELL_OFFER: -// ManageSellOfferOp manageSellOfferOp; -// case CREATE_PASSIVE_SELL_OFFER: -// CreatePassiveSellOfferOp createPassiveSellOfferOp; -// case SET_OPTIONS: -// SetOptionsOp setOptionsOp; -// case CHANGE_TRUST: -// ChangeTrustOp changeTrustOp; -// case ALLOW_TRUST: -// AllowTrustOp allowTrustOp; -// case ACCOUNT_MERGE: -// MuxedAccount destination; -// case INFLATION: -// void; -// case MANAGE_DATA: -// ManageDataOp manageDataOp; -// case BUMP_SEQUENCE: -// BumpSequenceOp bumpSequenceOp; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferOp manageBuyOfferOp; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendOp pathPaymentStrictSendOp; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceOp createClaimableBalanceOp; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceOp claimClaimableBalanceOp; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; -// case END_SPONSORING_FUTURE_RESERVES: -// void; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipOp revokeSponsorshipOp; -// case CLAWBACK: -// ClawbackOp clawbackOp; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsOp setTrustLineFlagsOp; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositOp liquidityPoolDepositOp; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; -// case INVOKE_HOST_FUNCTION: -// InvokeHostFunctionOp invokeHostFunctionOp; -// } -// body; -// }; -// -// =========================================================================== -xdr.struct("Operation", [ - ["sourceAccount", xdr.option(xdr.lookup("MuxedAccount"))], - ["body", xdr.lookup("OperationBody")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageOperationId", [ - ["sourceAccount", xdr.lookup("AccountId")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["opNum", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// PoolID liquidityPoolID; -// Asset asset; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageRevokeId", [ - ["sourceAccount", xdr.lookup("AccountId")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["opNum", xdr.lookup("Uint32")], - ["liquidityPoolId", xdr.lookup("PoolId")], - ["asset", xdr.lookup("Asset")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// uint256 ed25519; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageEd25519ContractId", [ - ["networkId", xdr.lookup("Hash")], - ["ed25519", xdr.lookup("Uint256")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// Hash contractID; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageContractId", [ - ["networkId", xdr.lookup("Hash")], - ["contractId", xdr.lookup("Hash")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// Asset asset; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageFromAsset", [ - ["networkId", xdr.lookup("Hash")], - ["asset", xdr.lookup("Asset")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// AccountID sourceAccount; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageSourceAccountContractId", [ - ["networkId", xdr.lookup("Hash")], - ["sourceAccount", xdr.lookup("AccountId")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// SCContractExecutable source; -// uint256 salt; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageCreateContractArgs", [ - ["networkId", xdr.lookup("Hash")], - ["source", xdr.lookup("ScContractExecutable")], - ["salt", xdr.lookup("Uint256")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// Hash networkID; -// uint64 nonce; -// AuthorizedInvocation invocation; -// } -// -// =========================================================================== -xdr.struct("HashIdPreimageContractAuth", [ - ["networkId", xdr.lookup("Hash")], - ["nonce", xdr.lookup("Uint64")], - ["invocation", xdr.lookup("AuthorizedInvocation")], -]); - -// === xdr source ============================================================ -// -// union HashIDPreimage switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_OP_ID: -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// } operationID; -// case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: -// struct -// { -// AccountID sourceAccount; -// SequenceNumber seqNum; -// uint32 opNum; -// PoolID liquidityPoolID; -// Asset asset; -// } revokeID; -// case ENVELOPE_TYPE_CONTRACT_ID_FROM_ED25519: -// struct -// { -// Hash networkID; -// uint256 ed25519; -// uint256 salt; -// } ed25519ContractID; -// case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: -// struct -// { -// Hash networkID; -// Hash contractID; -// uint256 salt; -// } contractID; -// case ENVELOPE_TYPE_CONTRACT_ID_FROM_ASSET: -// struct -// { -// Hash networkID; -// Asset asset; -// } fromAsset; -// case ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE_ACCOUNT: -// struct -// { -// Hash networkID; -// AccountID sourceAccount; -// uint256 salt; -// } sourceAccountContractID; -// case ENVELOPE_TYPE_CREATE_CONTRACT_ARGS: -// struct -// { -// Hash networkID; -// SCContractExecutable source; -// uint256 salt; -// } createContractArgs; -// case ENVELOPE_TYPE_CONTRACT_AUTH: -// struct -// { -// Hash networkID; -// uint64 nonce; -// AuthorizedInvocation invocation; -// } contractAuth; -// }; -// -// =========================================================================== -xdr.union("HashIdPreimage", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeOpId", "operationId"], - ["envelopeTypePoolRevokeOpId", "revokeId"], - ["envelopeTypeContractIdFromEd25519", "ed25519ContractId"], - ["envelopeTypeContractIdFromContract", "contractId"], - ["envelopeTypeContractIdFromAsset", "fromAsset"], - ["envelopeTypeContractIdFromSourceAccount", "sourceAccountContractId"], - ["envelopeTypeCreateContractArgs", "createContractArgs"], - ["envelopeTypeContractAuth", "contractAuth"], - ], - arms: { - operationId: xdr.lookup("HashIdPreimageOperationId"), - revokeId: xdr.lookup("HashIdPreimageRevokeId"), - ed25519ContractId: xdr.lookup("HashIdPreimageEd25519ContractId"), - contractId: xdr.lookup("HashIdPreimageContractId"), - fromAsset: xdr.lookup("HashIdPreimageFromAsset"), - sourceAccountContractId: xdr.lookup("HashIdPreimageSourceAccountContractId"), - createContractArgs: xdr.lookup("HashIdPreimageCreateContractArgs"), - contractAuth: xdr.lookup("HashIdPreimageContractAuth"), - }, -}); - -// === xdr source ============================================================ -// -// enum MemoType -// { -// MEMO_NONE = 0, -// MEMO_TEXT = 1, -// MEMO_ID = 2, -// MEMO_HASH = 3, -// MEMO_RETURN = 4 -// }; -// -// =========================================================================== -xdr.enum("MemoType", { - memoNone: 0, - memoText: 1, - memoId: 2, - memoHash: 3, - memoReturn: 4, -}); - -// === xdr source ============================================================ -// -// union Memo switch (MemoType type) -// { -// case MEMO_NONE: -// void; -// case MEMO_TEXT: -// string text<28>; -// case MEMO_ID: -// uint64 id; -// case MEMO_HASH: -// Hash hash; // the hash of what to pull from the content server -// case MEMO_RETURN: -// Hash retHash; // the hash of the tx you are rejecting -// }; -// -// =========================================================================== -xdr.union("Memo", { - switchOn: xdr.lookup("MemoType"), - switchName: "type", - switches: [ - ["memoNone", xdr.void()], - ["memoText", "text"], - ["memoId", "id"], - ["memoHash", "hash"], - ["memoReturn", "retHash"], - ], - arms: { - text: xdr.string(28), - id: xdr.lookup("Uint64"), - hash: xdr.lookup("Hash"), - retHash: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// struct TimeBounds -// { -// TimePoint minTime; -// TimePoint maxTime; // 0 here means no maxTime -// }; -// -// =========================================================================== -xdr.struct("TimeBounds", [ - ["minTime", xdr.lookup("TimePoint")], - ["maxTime", xdr.lookup("TimePoint")], -]); - -// === xdr source ============================================================ -// -// struct LedgerBounds -// { -// uint32 minLedger; -// uint32 maxLedger; // 0 here means no maxLedger -// }; -// -// =========================================================================== -xdr.struct("LedgerBounds", [ - ["minLedger", xdr.lookup("Uint32")], - ["maxLedger", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct PreconditionsV2 -// { -// TimeBounds* timeBounds; -// -// // Transaction only valid for ledger numbers n such that -// // minLedger <= n < maxLedger (if maxLedger == 0, then -// // only minLedger is checked) -// LedgerBounds* ledgerBounds; -// -// // If NULL, only valid when sourceAccount's sequence number -// // is seqNum - 1. Otherwise, valid when sourceAccount's -// // sequence number n satisfies minSeqNum <= n < tx.seqNum. -// // Note that after execution the account's sequence number -// // is always raised to tx.seqNum, and a transaction is not -// // valid if tx.seqNum is too high to ensure replay protection. -// SequenceNumber* minSeqNum; -// -// // For the transaction to be valid, the current ledger time must -// // be at least minSeqAge greater than sourceAccount's seqTime. -// Duration minSeqAge; -// -// // For the transaction to be valid, the current ledger number -// // must be at least minSeqLedgerGap greater than sourceAccount's -// // seqLedger. -// uint32 minSeqLedgerGap; -// -// // 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. -// SignerKey extraSigners<2>; -// }; -// -// =========================================================================== -xdr.struct("PreconditionsV2", [ - ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], - ["ledgerBounds", xdr.option(xdr.lookup("LedgerBounds"))], - ["minSeqNum", xdr.option(xdr.lookup("SequenceNumber"))], - ["minSeqAge", xdr.lookup("Duration")], - ["minSeqLedgerGap", xdr.lookup("Uint32")], - ["extraSigners", xdr.varArray(xdr.lookup("SignerKey"), 2)], -]); - -// === xdr source ============================================================ -// -// enum PreconditionType -// { -// PRECOND_NONE = 0, -// PRECOND_TIME = 1, -// PRECOND_V2 = 2 -// }; -// -// =========================================================================== -xdr.enum("PreconditionType", { - precondNone: 0, - precondTime: 1, - precondV2: 2, -}); - -// === xdr source ============================================================ -// -// union Preconditions switch (PreconditionType type) -// { -// case PRECOND_NONE: -// void; -// case PRECOND_TIME: -// TimeBounds timeBounds; -// case PRECOND_V2: -// PreconditionsV2 v2; -// }; -// -// =========================================================================== -xdr.union("Preconditions", { - switchOn: xdr.lookup("PreconditionType"), - switchName: "type", - switches: [ - ["precondNone", xdr.void()], - ["precondTime", "timeBounds"], - ["precondV2", "v2"], - ], - arms: { - timeBounds: xdr.lookup("TimeBounds"), - v2: xdr.lookup("PreconditionsV2"), - }, -}); - -// === xdr source ============================================================ -// -// const MAX_OPS_PER_TX = 100; -// -// =========================================================================== -xdr.const("MAX_OPS_PER_TX", 100); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionV0Ext", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionV0 -// { -// uint256 sourceAccountEd25519; -// uint32 fee; -// SequenceNumber seqNum; -// TimeBounds* timeBounds; -// Memo memo; -// Operation operations; -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionV0", [ - ["sourceAccountEd25519", xdr.lookup("Uint256")], - ["fee", xdr.lookup("Uint32")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], - ["memo", xdr.lookup("Memo")], - ["operations", xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX"))], - ["ext", xdr.lookup("TransactionV0Ext")], -]); - -// === xdr source ============================================================ -// -// struct TransactionV0Envelope -// { -// TransactionV0 tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("TransactionV0Envelope", [ - ["tx", xdr.lookup("TransactionV0")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct Transaction -// { -// // account used to run the transaction -// MuxedAccount sourceAccount; -// -// // the fee the sourceAccount will pay -// uint32 fee; -// -// // sequence number to consume in the account -// SequenceNumber seqNum; -// -// // validity conditions -// Preconditions cond; -// -// Memo memo; -// -// Operation operations; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("Transaction", [ - ["sourceAccount", xdr.lookup("MuxedAccount")], - ["fee", xdr.lookup("Uint32")], - ["seqNum", xdr.lookup("SequenceNumber")], - ["cond", xdr.lookup("Preconditions")], - ["memo", xdr.lookup("Memo")], - ["operations", xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX"))], - ["ext", xdr.lookup("TransactionExt")], -]); - -// === xdr source ============================================================ -// -// struct TransactionV1Envelope -// { -// Transaction tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("TransactionV1Envelope", [ - ["tx", xdr.lookup("Transaction")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// } -// -// =========================================================================== -xdr.union("FeeBumpTransactionInnerTx", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTx", "v1"], - ], - arms: { - v1: xdr.lookup("TransactionV1Envelope"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("FeeBumpTransactionExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct FeeBumpTransaction -// { -// MuxedAccount feeSource; -// int64 fee; -// union switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// } -// innerTx; -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("FeeBumpTransaction", [ - ["feeSource", xdr.lookup("MuxedAccount")], - ["fee", xdr.lookup("Int64")], - ["innerTx", xdr.lookup("FeeBumpTransactionInnerTx")], - ["ext", xdr.lookup("FeeBumpTransactionExt")], -]); - -// === xdr source ============================================================ -// -// struct FeeBumpTransactionEnvelope -// { -// FeeBumpTransaction tx; -// /* Each decorated signature is a signature over the SHA256 hash of -// * a TransactionSignaturePayload */ -// DecoratedSignature signatures<20>; -// }; -// -// =========================================================================== -xdr.struct("FeeBumpTransactionEnvelope", [ - ["tx", xdr.lookup("FeeBumpTransaction")], - ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], -]); - -// === xdr source ============================================================ -// -// union TransactionEnvelope switch (EnvelopeType type) -// { -// case ENVELOPE_TYPE_TX_V0: -// TransactionV0Envelope v0; -// case ENVELOPE_TYPE_TX: -// TransactionV1Envelope v1; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransactionEnvelope feeBump; -// }; -// -// =========================================================================== -xdr.union("TransactionEnvelope", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTxV0", "v0"], - ["envelopeTypeTx", "v1"], - ["envelopeTypeTxFeeBump", "feeBump"], - ], - arms: { - v0: xdr.lookup("TransactionV0Envelope"), - v1: xdr.lookup("TransactionV1Envelope"), - feeBump: xdr.lookup("FeeBumpTransactionEnvelope"), - }, -}); - -// === xdr source ============================================================ -// -// union switch (EnvelopeType type) -// { -// // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 -// case ENVELOPE_TYPE_TX: -// Transaction tx; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransaction feeBump; -// } -// -// =========================================================================== -xdr.union("TransactionSignaturePayloadTaggedTransaction", { - switchOn: xdr.lookup("EnvelopeType"), - switchName: "type", - switches: [ - ["envelopeTypeTx", "tx"], - ["envelopeTypeTxFeeBump", "feeBump"], - ], - arms: { - tx: xdr.lookup("Transaction"), - feeBump: xdr.lookup("FeeBumpTransaction"), - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionSignaturePayload -// { -// Hash networkId; -// union switch (EnvelopeType type) -// { -// // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 -// case ENVELOPE_TYPE_TX: -// Transaction tx; -// case ENVELOPE_TYPE_TX_FEE_BUMP: -// FeeBumpTransaction feeBump; -// } -// taggedTransaction; -// }; -// -// =========================================================================== -xdr.struct("TransactionSignaturePayload", [ - ["networkId", xdr.lookup("Hash")], - ["taggedTransaction", xdr.lookup("TransactionSignaturePayloadTaggedTransaction")], -]); - -// === xdr source ============================================================ -// -// enum ClaimAtomType -// { -// CLAIM_ATOM_TYPE_V0 = 0, -// CLAIM_ATOM_TYPE_ORDER_BOOK = 1, -// CLAIM_ATOM_TYPE_LIQUIDITY_POOL = 2 -// }; -// -// =========================================================================== -xdr.enum("ClaimAtomType", { - claimAtomTypeV0: 0, - claimAtomTypeOrderBook: 1, - claimAtomTypeLiquidityPool: 2, -}); - -// === xdr source ============================================================ -// -// struct ClaimOfferAtomV0 -// { -// // emitted to identify the offer -// uint256 sellerEd25519; // Account that owns the offer -// int64 offerID; -// -// // amount and asset taken from the owner -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the owner -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimOfferAtomV0", [ - ["sellerEd25519", xdr.lookup("Uint256")], - ["offerId", xdr.lookup("Int64")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClaimOfferAtom -// { -// // emitted to identify the offer -// AccountID sellerID; // Account that owns the offer -// int64 offerID; -// -// // amount and asset taken from the owner -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the owner -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimOfferAtom", [ - ["sellerId", xdr.lookup("AccountId")], - ["offerId", xdr.lookup("Int64")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct ClaimLiquidityAtom -// { -// PoolID liquidityPoolID; -// -// // amount and asset taken from the pool -// Asset assetSold; -// int64 amountSold; -// -// // amount and asset sent to the pool -// Asset assetBought; -// int64 amountBought; -// }; -// -// =========================================================================== -xdr.struct("ClaimLiquidityAtom", [ - ["liquidityPoolId", xdr.lookup("PoolId")], - ["assetSold", xdr.lookup("Asset")], - ["amountSold", xdr.lookup("Int64")], - ["assetBought", xdr.lookup("Asset")], - ["amountBought", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union ClaimAtom switch (ClaimAtomType type) -// { -// case CLAIM_ATOM_TYPE_V0: -// ClaimOfferAtomV0 v0; -// case CLAIM_ATOM_TYPE_ORDER_BOOK: -// ClaimOfferAtom orderBook; -// case CLAIM_ATOM_TYPE_LIQUIDITY_POOL: -// ClaimLiquidityAtom liquidityPool; -// }; -// -// =========================================================================== -xdr.union("ClaimAtom", { - switchOn: xdr.lookup("ClaimAtomType"), - switchName: "type", - switches: [ - ["claimAtomTypeV0", "v0"], - ["claimAtomTypeOrderBook", "orderBook"], - ["claimAtomTypeLiquidityPool", "liquidityPool"], - ], - arms: { - v0: xdr.lookup("ClaimOfferAtomV0"), - orderBook: xdr.lookup("ClaimOfferAtom"), - liquidityPool: xdr.lookup("ClaimLiquidityAtom"), - }, -}); - -// === xdr source ============================================================ -// -// enum CreateAccountResultCode -// { -// // codes considered as "success" for the operation -// CREATE_ACCOUNT_SUCCESS = 0, // account was created -// -// // codes considered as "failure" for the operation -// CREATE_ACCOUNT_MALFORMED = -1, // invalid destination -// CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account -// CREATE_ACCOUNT_LOW_RESERVE = -// -3, // would create an account below the min reserve -// CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists -// }; -// -// =========================================================================== -xdr.enum("CreateAccountResultCode", { - createAccountSuccess: 0, - createAccountMalformed: -1, - createAccountUnderfunded: -2, - createAccountLowReserve: -3, - createAccountAlreadyExist: -4, -}); - -// === xdr source ============================================================ -// -// union CreateAccountResult switch (CreateAccountResultCode code) -// { -// case CREATE_ACCOUNT_SUCCESS: -// void; -// case CREATE_ACCOUNT_MALFORMED: -// case CREATE_ACCOUNT_UNDERFUNDED: -// case CREATE_ACCOUNT_LOW_RESERVE: -// case CREATE_ACCOUNT_ALREADY_EXIST: -// void; -// }; -// -// =========================================================================== -xdr.union("CreateAccountResult", { - switchOn: xdr.lookup("CreateAccountResultCode"), - switchName: "code", - switches: [ - ["createAccountSuccess", xdr.void()], - ["createAccountMalformed", xdr.void()], - ["createAccountUnderfunded", xdr.void()], - ["createAccountLowReserve", xdr.void()], - ["createAccountAlreadyExist", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum PaymentResultCode -// { -// // codes considered as "success" for the operation -// PAYMENT_SUCCESS = 0, // payment successfully completed -// -// // codes considered as "failure" for the operation -// PAYMENT_MALFORMED = -1, // bad input -// PAYMENT_UNDERFUNDED = -2, // not enough funds in source account -// PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account -// PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer -// PAYMENT_NO_DESTINATION = -5, // destination account does not exist -// PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset -// PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset -// PAYMENT_LINE_FULL = -8, // destination would go above their limit -// PAYMENT_NO_ISSUER = -9 // missing issuer on asset -// }; -// -// =========================================================================== -xdr.enum("PaymentResultCode", { - paymentSuccess: 0, - paymentMalformed: -1, - paymentUnderfunded: -2, - paymentSrcNoTrust: -3, - paymentSrcNotAuthorized: -4, - paymentNoDestination: -5, - paymentNoTrust: -6, - paymentNotAuthorized: -7, - paymentLineFull: -8, - paymentNoIssuer: -9, -}); - -// === xdr source ============================================================ -// -// union PaymentResult switch (PaymentResultCode code) -// { -// case PAYMENT_SUCCESS: -// void; -// case PAYMENT_MALFORMED: -// case PAYMENT_UNDERFUNDED: -// case PAYMENT_SRC_NO_TRUST: -// case PAYMENT_SRC_NOT_AUTHORIZED: -// case PAYMENT_NO_DESTINATION: -// case PAYMENT_NO_TRUST: -// case PAYMENT_NOT_AUTHORIZED: -// case PAYMENT_LINE_FULL: -// case PAYMENT_NO_ISSUER: -// void; -// }; -// -// =========================================================================== -xdr.union("PaymentResult", { - switchOn: xdr.lookup("PaymentResultCode"), - switchName: "code", - switches: [ - ["paymentSuccess", xdr.void()], - ["paymentMalformed", xdr.void()], - ["paymentUnderfunded", xdr.void()], - ["paymentSrcNoTrust", xdr.void()], - ["paymentSrcNotAuthorized", xdr.void()], - ["paymentNoDestination", xdr.void()], - ["paymentNoTrust", xdr.void()], - ["paymentNotAuthorized", xdr.void()], - ["paymentLineFull", xdr.void()], - ["paymentNoIssuer", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum PathPaymentStrictReceiveResultCode -// { -// // codes considered as "success" for the operation -// PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success -// -// // codes considered as "failure" for the operation -// PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input -// PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = -// -2, // not enough funds in source account -// PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = -// -3, // no trust line on source account -// PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = -// -4, // source not authorized to transfer -// PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = -// -5, // destination account does not exist -// PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = -// -6, // dest missing a trust line for asset -// PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = -// -7, // dest not authorized to hold asset -// PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = -// -8, // dest would go above their limit -// PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset -// PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = -// -10, // not enough offers to satisfy path -// PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = -// -11, // would cross one of its own offers -// PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax -// }; -// -// =========================================================================== -xdr.enum("PathPaymentStrictReceiveResultCode", { - pathPaymentStrictReceiveSuccess: 0, - pathPaymentStrictReceiveMalformed: -1, - pathPaymentStrictReceiveUnderfunded: -2, - pathPaymentStrictReceiveSrcNoTrust: -3, - pathPaymentStrictReceiveSrcNotAuthorized: -4, - pathPaymentStrictReceiveNoDestination: -5, - pathPaymentStrictReceiveNoTrust: -6, - pathPaymentStrictReceiveNotAuthorized: -7, - pathPaymentStrictReceiveLineFull: -8, - pathPaymentStrictReceiveNoIssuer: -9, - pathPaymentStrictReceiveTooFewOffers: -10, - pathPaymentStrictReceiveOfferCrossSelf: -11, - pathPaymentStrictReceiveOverSendmax: -12, -}); - -// === xdr source ============================================================ -// -// struct SimplePaymentResult -// { -// AccountID destination; -// Asset asset; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("SimplePaymentResult", [ - ["destination", xdr.lookup("AccountId")], - ["asset", xdr.lookup("Asset")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } -// -// =========================================================================== -xdr.struct("PathPaymentStrictReceiveResultSuccess", [ - ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["last", xdr.lookup("SimplePaymentResult")], -]); - -// === xdr source ============================================================ -// -// union PathPaymentStrictReceiveResult switch ( -// PathPaymentStrictReceiveResultCode code) -// { -// case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS: -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } success; -// case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED: -// case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED: -// case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST: -// case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION: -// case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST: -// case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL: -// void; -// case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER: -// Asset noIssuer; // the asset that caused the error -// case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS: -// case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF: -// case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX: -// void; -// }; -// -// =========================================================================== -xdr.union("PathPaymentStrictReceiveResult", { - switchOn: xdr.lookup("PathPaymentStrictReceiveResultCode"), - switchName: "code", - switches: [ - ["pathPaymentStrictReceiveSuccess", "success"], - ["pathPaymentStrictReceiveMalformed", xdr.void()], - ["pathPaymentStrictReceiveUnderfunded", xdr.void()], - ["pathPaymentStrictReceiveSrcNoTrust", xdr.void()], - ["pathPaymentStrictReceiveSrcNotAuthorized", xdr.void()], - ["pathPaymentStrictReceiveNoDestination", xdr.void()], - ["pathPaymentStrictReceiveNoTrust", xdr.void()], - ["pathPaymentStrictReceiveNotAuthorized", xdr.void()], - ["pathPaymentStrictReceiveLineFull", xdr.void()], - ["pathPaymentStrictReceiveNoIssuer", "noIssuer"], - ["pathPaymentStrictReceiveTooFewOffers", xdr.void()], - ["pathPaymentStrictReceiveOfferCrossSelf", xdr.void()], - ["pathPaymentStrictReceiveOverSendmax", xdr.void()], - ], - arms: { - success: xdr.lookup("PathPaymentStrictReceiveResultSuccess"), - noIssuer: xdr.lookup("Asset"), - }, -}); - -// === xdr source ============================================================ -// -// enum PathPaymentStrictSendResultCode -// { -// // codes considered as "success" for the operation -// PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success -// -// // codes considered as "failure" for the operation -// PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input -// PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = -// -2, // not enough funds in source account -// PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = -// -3, // no trust line on source account -// PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = -// -4, // source not authorized to transfer -// PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = -// -5, // destination account does not exist -// PATH_PAYMENT_STRICT_SEND_NO_TRUST = -// -6, // dest missing a trust line for asset -// PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = -// -7, // dest not authorized to hold asset -// PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit -// PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset -// PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = -// -10, // not enough offers to satisfy path -// PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = -// -11, // would cross one of its own offers -// PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin -// }; -// -// =========================================================================== -xdr.enum("PathPaymentStrictSendResultCode", { - pathPaymentStrictSendSuccess: 0, - pathPaymentStrictSendMalformed: -1, - pathPaymentStrictSendUnderfunded: -2, - pathPaymentStrictSendSrcNoTrust: -3, - pathPaymentStrictSendSrcNotAuthorized: -4, - pathPaymentStrictSendNoDestination: -5, - pathPaymentStrictSendNoTrust: -6, - pathPaymentStrictSendNotAuthorized: -7, - pathPaymentStrictSendLineFull: -8, - pathPaymentStrictSendNoIssuer: -9, - pathPaymentStrictSendTooFewOffers: -10, - pathPaymentStrictSendOfferCrossSelf: -11, - pathPaymentStrictSendUnderDestmin: -12, -}); - -// === xdr source ============================================================ -// -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } -// -// =========================================================================== -xdr.struct("PathPaymentStrictSendResultSuccess", [ - ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["last", xdr.lookup("SimplePaymentResult")], -]); - -// === xdr source ============================================================ -// -// union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code) -// { -// case PATH_PAYMENT_STRICT_SEND_SUCCESS: -// struct -// { -// ClaimAtom offers<>; -// SimplePaymentResult last; -// } success; -// case PATH_PAYMENT_STRICT_SEND_MALFORMED: -// case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED: -// case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST: -// case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION: -// case PATH_PAYMENT_STRICT_SEND_NO_TRUST: -// case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED: -// case PATH_PAYMENT_STRICT_SEND_LINE_FULL: -// void; -// case PATH_PAYMENT_STRICT_SEND_NO_ISSUER: -// Asset noIssuer; // the asset that caused the error -// case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS: -// case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF: -// case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN: -// void; -// }; -// -// =========================================================================== -xdr.union("PathPaymentStrictSendResult", { - switchOn: xdr.lookup("PathPaymentStrictSendResultCode"), - switchName: "code", - switches: [ - ["pathPaymentStrictSendSuccess", "success"], - ["pathPaymentStrictSendMalformed", xdr.void()], - ["pathPaymentStrictSendUnderfunded", xdr.void()], - ["pathPaymentStrictSendSrcNoTrust", xdr.void()], - ["pathPaymentStrictSendSrcNotAuthorized", xdr.void()], - ["pathPaymentStrictSendNoDestination", xdr.void()], - ["pathPaymentStrictSendNoTrust", xdr.void()], - ["pathPaymentStrictSendNotAuthorized", xdr.void()], - ["pathPaymentStrictSendLineFull", xdr.void()], - ["pathPaymentStrictSendNoIssuer", "noIssuer"], - ["pathPaymentStrictSendTooFewOffers", xdr.void()], - ["pathPaymentStrictSendOfferCrossSelf", xdr.void()], - ["pathPaymentStrictSendUnderDestmin", xdr.void()], - ], - arms: { - success: xdr.lookup("PathPaymentStrictSendResultSuccess"), - noIssuer: xdr.lookup("Asset"), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageSellOfferResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_SELL_OFFER_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid -// MANAGE_SELL_OFFER_SELL_NO_TRUST = -// -2, // no trust line for what we're selling -// MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying -// MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell -// MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy -// MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying -// MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell -// MANAGE_SELL_OFFER_CROSS_SELF = -// -8, // would cross an offer from the same user -// MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling -// MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying -// -// // update errors -// MANAGE_SELL_OFFER_NOT_FOUND = -// -11, // offerID does not match an existing offer -// -// MANAGE_SELL_OFFER_LOW_RESERVE = -// -12 // not enough funds to create a new Offer -// }; -// -// =========================================================================== -xdr.enum("ManageSellOfferResultCode", { - manageSellOfferSuccess: 0, - manageSellOfferMalformed: -1, - manageSellOfferSellNoTrust: -2, - manageSellOfferBuyNoTrust: -3, - manageSellOfferSellNotAuthorized: -4, - manageSellOfferBuyNotAuthorized: -5, - manageSellOfferLineFull: -6, - manageSellOfferUnderfunded: -7, - manageSellOfferCrossSelf: -8, - manageSellOfferSellNoIssuer: -9, - manageSellOfferBuyNoIssuer: -10, - manageSellOfferNotFound: -11, - manageSellOfferLowReserve: -12, -}); - -// === xdr source ============================================================ -// -// enum ManageOfferEffect -// { -// MANAGE_OFFER_CREATED = 0, -// MANAGE_OFFER_UPDATED = 1, -// MANAGE_OFFER_DELETED = 2 -// }; -// -// =========================================================================== -xdr.enum("ManageOfferEffect", { - manageOfferCreated: 0, - manageOfferUpdated: 1, - manageOfferDeleted: 2, -}); - -// === xdr source ============================================================ -// -// union switch (ManageOfferEffect effect) -// { -// case MANAGE_OFFER_CREATED: -// case MANAGE_OFFER_UPDATED: -// OfferEntry offer; -// case MANAGE_OFFER_DELETED: -// void; -// } -// -// =========================================================================== -xdr.union("ManageOfferSuccessResultOffer", { - switchOn: xdr.lookup("ManageOfferEffect"), - switchName: "effect", - switches: [ - ["manageOfferCreated", "offer"], - ["manageOfferUpdated", "offer"], - ["manageOfferDeleted", xdr.void()], - ], - arms: { - offer: xdr.lookup("OfferEntry"), - }, -}); - -// === xdr source ============================================================ -// -// struct ManageOfferSuccessResult -// { -// // offers that got claimed while creating this offer -// ClaimAtom offersClaimed<>; -// -// union switch (ManageOfferEffect effect) -// { -// case MANAGE_OFFER_CREATED: -// case MANAGE_OFFER_UPDATED: -// OfferEntry offer; -// case MANAGE_OFFER_DELETED: -// void; -// } -// offer; -// }; -// -// =========================================================================== -xdr.struct("ManageOfferSuccessResult", [ - ["offersClaimed", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], - ["offer", xdr.lookup("ManageOfferSuccessResultOffer")], -]); - -// === xdr source ============================================================ -// -// union ManageSellOfferResult switch (ManageSellOfferResultCode code) -// { -// case MANAGE_SELL_OFFER_SUCCESS: -// ManageOfferSuccessResult success; -// case MANAGE_SELL_OFFER_MALFORMED: -// case MANAGE_SELL_OFFER_SELL_NO_TRUST: -// case MANAGE_SELL_OFFER_BUY_NO_TRUST: -// case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED: -// case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED: -// case MANAGE_SELL_OFFER_LINE_FULL: -// case MANAGE_SELL_OFFER_UNDERFUNDED: -// case MANAGE_SELL_OFFER_CROSS_SELF: -// case MANAGE_SELL_OFFER_SELL_NO_ISSUER: -// case MANAGE_SELL_OFFER_BUY_NO_ISSUER: -// case MANAGE_SELL_OFFER_NOT_FOUND: -// case MANAGE_SELL_OFFER_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageSellOfferResult", { - switchOn: xdr.lookup("ManageSellOfferResultCode"), - switchName: "code", - switches: [ - ["manageSellOfferSuccess", "success"], - ["manageSellOfferMalformed", xdr.void()], - ["manageSellOfferSellNoTrust", xdr.void()], - ["manageSellOfferBuyNoTrust", xdr.void()], - ["manageSellOfferSellNotAuthorized", xdr.void()], - ["manageSellOfferBuyNotAuthorized", xdr.void()], - ["manageSellOfferLineFull", xdr.void()], - ["manageSellOfferUnderfunded", xdr.void()], - ["manageSellOfferCrossSelf", xdr.void()], - ["manageSellOfferSellNoIssuer", xdr.void()], - ["manageSellOfferBuyNoIssuer", xdr.void()], - ["manageSellOfferNotFound", xdr.void()], - ["manageSellOfferLowReserve", xdr.void()], - ], - arms: { - success: xdr.lookup("ManageOfferSuccessResult"), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageBuyOfferResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_BUY_OFFER_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// MANAGE_BUY_OFFER_MALFORMED = -1, // generated offer would be invalid -// MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling -// MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying -// MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell -// MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy -// MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying -// MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell -// MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user -// MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling -// MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying -// -// // update errors -// MANAGE_BUY_OFFER_NOT_FOUND = -// -11, // offerID does not match an existing offer -// -// MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer -// }; -// -// =========================================================================== -xdr.enum("ManageBuyOfferResultCode", { - manageBuyOfferSuccess: 0, - manageBuyOfferMalformed: -1, - manageBuyOfferSellNoTrust: -2, - manageBuyOfferBuyNoTrust: -3, - manageBuyOfferSellNotAuthorized: -4, - manageBuyOfferBuyNotAuthorized: -5, - manageBuyOfferLineFull: -6, - manageBuyOfferUnderfunded: -7, - manageBuyOfferCrossSelf: -8, - manageBuyOfferSellNoIssuer: -9, - manageBuyOfferBuyNoIssuer: -10, - manageBuyOfferNotFound: -11, - manageBuyOfferLowReserve: -12, -}); - -// === xdr source ============================================================ -// -// union ManageBuyOfferResult switch (ManageBuyOfferResultCode code) -// { -// case MANAGE_BUY_OFFER_SUCCESS: -// ManageOfferSuccessResult success; -// case MANAGE_BUY_OFFER_MALFORMED: -// case MANAGE_BUY_OFFER_SELL_NO_TRUST: -// case MANAGE_BUY_OFFER_BUY_NO_TRUST: -// case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED: -// case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED: -// case MANAGE_BUY_OFFER_LINE_FULL: -// case MANAGE_BUY_OFFER_UNDERFUNDED: -// case MANAGE_BUY_OFFER_CROSS_SELF: -// case MANAGE_BUY_OFFER_SELL_NO_ISSUER: -// case MANAGE_BUY_OFFER_BUY_NO_ISSUER: -// case MANAGE_BUY_OFFER_NOT_FOUND: -// case MANAGE_BUY_OFFER_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageBuyOfferResult", { - switchOn: xdr.lookup("ManageBuyOfferResultCode"), - switchName: "code", - switches: [ - ["manageBuyOfferSuccess", "success"], - ["manageBuyOfferMalformed", xdr.void()], - ["manageBuyOfferSellNoTrust", xdr.void()], - ["manageBuyOfferBuyNoTrust", xdr.void()], - ["manageBuyOfferSellNotAuthorized", xdr.void()], - ["manageBuyOfferBuyNotAuthorized", xdr.void()], - ["manageBuyOfferLineFull", xdr.void()], - ["manageBuyOfferUnderfunded", xdr.void()], - ["manageBuyOfferCrossSelf", xdr.void()], - ["manageBuyOfferSellNoIssuer", xdr.void()], - ["manageBuyOfferBuyNoIssuer", xdr.void()], - ["manageBuyOfferNotFound", xdr.void()], - ["manageBuyOfferLowReserve", xdr.void()], - ], - arms: { - success: xdr.lookup("ManageOfferSuccessResult"), - }, -}); - -// === xdr source ============================================================ -// -// enum SetOptionsResultCode -// { -// // codes considered as "success" for the operation -// SET_OPTIONS_SUCCESS = 0, -// // codes considered as "failure" for the operation -// SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer -// SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached -// SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags -// SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist -// SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option -// SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag -// SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold -// SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey -// SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain -// SET_OPTIONS_AUTH_REVOCABLE_REQUIRED = -// -10 // auth revocable is required for clawback -// }; -// -// =========================================================================== -xdr.enum("SetOptionsResultCode", { - setOptionsSuccess: 0, - setOptionsLowReserve: -1, - setOptionsTooManySigners: -2, - setOptionsBadFlags: -3, - setOptionsInvalidInflation: -4, - setOptionsCantChange: -5, - setOptionsUnknownFlag: -6, - setOptionsThresholdOutOfRange: -7, - setOptionsBadSigner: -8, - setOptionsInvalidHomeDomain: -9, - setOptionsAuthRevocableRequired: -10, -}); - -// === xdr source ============================================================ -// -// union SetOptionsResult switch (SetOptionsResultCode code) -// { -// case SET_OPTIONS_SUCCESS: -// void; -// case SET_OPTIONS_LOW_RESERVE: -// case SET_OPTIONS_TOO_MANY_SIGNERS: -// case SET_OPTIONS_BAD_FLAGS: -// case SET_OPTIONS_INVALID_INFLATION: -// case SET_OPTIONS_CANT_CHANGE: -// case SET_OPTIONS_UNKNOWN_FLAG: -// case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE: -// case SET_OPTIONS_BAD_SIGNER: -// case SET_OPTIONS_INVALID_HOME_DOMAIN: -// case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED: -// void; -// }; -// -// =========================================================================== -xdr.union("SetOptionsResult", { - switchOn: xdr.lookup("SetOptionsResultCode"), - switchName: "code", - switches: [ - ["setOptionsSuccess", xdr.void()], - ["setOptionsLowReserve", xdr.void()], - ["setOptionsTooManySigners", xdr.void()], - ["setOptionsBadFlags", xdr.void()], - ["setOptionsInvalidInflation", xdr.void()], - ["setOptionsCantChange", xdr.void()], - ["setOptionsUnknownFlag", xdr.void()], - ["setOptionsThresholdOutOfRange", xdr.void()], - ["setOptionsBadSigner", xdr.void()], - ["setOptionsInvalidHomeDomain", xdr.void()], - ["setOptionsAuthRevocableRequired", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ChangeTrustResultCode -// { -// // codes considered as "success" for the operation -// CHANGE_TRUST_SUCCESS = 0, -// // codes considered as "failure" for the operation -// CHANGE_TRUST_MALFORMED = -1, // bad input -// CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer -// CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance -// // cannot create with a limit of 0 -// CHANGE_TRUST_LOW_RESERVE = -// -4, // not enough funds to create a new trust line, -// CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed -// CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool -// CHANGE_TRUST_CANNOT_DELETE = -// -7, // Asset trustline is still referenced in a pool -// CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -// -8 // Asset trustline is deauthorized -// }; -// -// =========================================================================== -xdr.enum("ChangeTrustResultCode", { - changeTrustSuccess: 0, - changeTrustMalformed: -1, - changeTrustNoIssuer: -2, - changeTrustInvalidLimit: -3, - changeTrustLowReserve: -4, - changeTrustSelfNotAllowed: -5, - changeTrustTrustLineMissing: -6, - changeTrustCannotDelete: -7, - changeTrustNotAuthMaintainLiabilities: -8, -}); - -// === xdr source ============================================================ -// -// union ChangeTrustResult switch (ChangeTrustResultCode code) -// { -// case CHANGE_TRUST_SUCCESS: -// void; -// case CHANGE_TRUST_MALFORMED: -// case CHANGE_TRUST_NO_ISSUER: -// case CHANGE_TRUST_INVALID_LIMIT: -// case CHANGE_TRUST_LOW_RESERVE: -// case CHANGE_TRUST_SELF_NOT_ALLOWED: -// case CHANGE_TRUST_TRUST_LINE_MISSING: -// case CHANGE_TRUST_CANNOT_DELETE: -// case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES: -// void; -// }; -// -// =========================================================================== -xdr.union("ChangeTrustResult", { - switchOn: xdr.lookup("ChangeTrustResultCode"), - switchName: "code", - switches: [ - ["changeTrustSuccess", xdr.void()], - ["changeTrustMalformed", xdr.void()], - ["changeTrustNoIssuer", xdr.void()], - ["changeTrustInvalidLimit", xdr.void()], - ["changeTrustLowReserve", xdr.void()], - ["changeTrustSelfNotAllowed", xdr.void()], - ["changeTrustTrustLineMissing", xdr.void()], - ["changeTrustCannotDelete", xdr.void()], - ["changeTrustNotAuthMaintainLiabilities", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum AllowTrustResultCode -// { -// // codes considered as "success" for the operation -// ALLOW_TRUST_SUCCESS = 0, -// // codes considered as "failure" for the operation -// ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM -// ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline -// // source account does not require trust -// ALLOW_TRUST_TRUST_NOT_REQUIRED = -3, -// ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust, -// ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed -// ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created -// // on revoke due to low reserves -// }; -// -// =========================================================================== -xdr.enum("AllowTrustResultCode", { - allowTrustSuccess: 0, - allowTrustMalformed: -1, - allowTrustNoTrustLine: -2, - allowTrustTrustNotRequired: -3, - allowTrustCantRevoke: -4, - allowTrustSelfNotAllowed: -5, - allowTrustLowReserve: -6, -}); - -// === xdr source ============================================================ -// -// union AllowTrustResult switch (AllowTrustResultCode code) -// { -// case ALLOW_TRUST_SUCCESS: -// void; -// case ALLOW_TRUST_MALFORMED: -// case ALLOW_TRUST_NO_TRUST_LINE: -// case ALLOW_TRUST_TRUST_NOT_REQUIRED: -// case ALLOW_TRUST_CANT_REVOKE: -// case ALLOW_TRUST_SELF_NOT_ALLOWED: -// case ALLOW_TRUST_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("AllowTrustResult", { - switchOn: xdr.lookup("AllowTrustResultCode"), - switchName: "code", - switches: [ - ["allowTrustSuccess", xdr.void()], - ["allowTrustMalformed", xdr.void()], - ["allowTrustNoTrustLine", xdr.void()], - ["allowTrustTrustNotRequired", xdr.void()], - ["allowTrustCantRevoke", xdr.void()], - ["allowTrustSelfNotAllowed", xdr.void()], - ["allowTrustLowReserve", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum AccountMergeResultCode -// { -// // codes considered as "success" for the operation -// ACCOUNT_MERGE_SUCCESS = 0, -// // codes considered as "failure" for the operation -// ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself -// ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist -// ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set -// ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers -// ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed -// ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to -// // destination balance -// ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor -// }; -// -// =========================================================================== -xdr.enum("AccountMergeResultCode", { - accountMergeSuccess: 0, - accountMergeMalformed: -1, - accountMergeNoAccount: -2, - accountMergeImmutableSet: -3, - accountMergeHasSubEntries: -4, - accountMergeSeqnumTooFar: -5, - accountMergeDestFull: -6, - accountMergeIsSponsor: -7, -}); - -// === xdr source ============================================================ -// -// union AccountMergeResult switch (AccountMergeResultCode code) -// { -// case ACCOUNT_MERGE_SUCCESS: -// int64 sourceAccountBalance; // how much got transferred from source account -// case ACCOUNT_MERGE_MALFORMED: -// case ACCOUNT_MERGE_NO_ACCOUNT: -// case ACCOUNT_MERGE_IMMUTABLE_SET: -// case ACCOUNT_MERGE_HAS_SUB_ENTRIES: -// case ACCOUNT_MERGE_SEQNUM_TOO_FAR: -// case ACCOUNT_MERGE_DEST_FULL: -// case ACCOUNT_MERGE_IS_SPONSOR: -// void; -// }; -// -// =========================================================================== -xdr.union("AccountMergeResult", { - switchOn: xdr.lookup("AccountMergeResultCode"), - switchName: "code", - switches: [ - ["accountMergeSuccess", "sourceAccountBalance"], - ["accountMergeMalformed", xdr.void()], - ["accountMergeNoAccount", xdr.void()], - ["accountMergeImmutableSet", xdr.void()], - ["accountMergeHasSubEntries", xdr.void()], - ["accountMergeSeqnumTooFar", xdr.void()], - ["accountMergeDestFull", xdr.void()], - ["accountMergeIsSponsor", xdr.void()], - ], - arms: { - sourceAccountBalance: xdr.lookup("Int64"), - }, -}); - -// === xdr source ============================================================ -// -// enum InflationResultCode -// { -// // codes considered as "success" for the operation -// INFLATION_SUCCESS = 0, -// // codes considered as "failure" for the operation -// INFLATION_NOT_TIME = -1 -// }; -// -// =========================================================================== -xdr.enum("InflationResultCode", { - inflationSuccess: 0, - inflationNotTime: -1, -}); - -// === xdr source ============================================================ -// -// struct InflationPayout // or use PaymentResultAtom to limit types? -// { -// AccountID destination; -// int64 amount; -// }; -// -// =========================================================================== -xdr.struct("InflationPayout", [ - ["destination", xdr.lookup("AccountId")], - ["amount", xdr.lookup("Int64")], -]); - -// === xdr source ============================================================ -// -// union InflationResult switch (InflationResultCode code) -// { -// case INFLATION_SUCCESS: -// InflationPayout payouts<>; -// case INFLATION_NOT_TIME: -// void; -// }; -// -// =========================================================================== -xdr.union("InflationResult", { - switchOn: xdr.lookup("InflationResultCode"), - switchName: "code", - switches: [ - ["inflationSuccess", "payouts"], - ["inflationNotTime", xdr.void()], - ], - arms: { - payouts: xdr.varArray(xdr.lookup("InflationPayout"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// enum ManageDataResultCode -// { -// // codes considered as "success" for the operation -// MANAGE_DATA_SUCCESS = 0, -// // codes considered as "failure" for the operation -// MANAGE_DATA_NOT_SUPPORTED_YET = -// -1, // The network hasn't moved to this protocol change yet -// MANAGE_DATA_NAME_NOT_FOUND = -// -2, // Trying to remove a Data Entry that isn't there -// MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry -// MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string -// }; -// -// =========================================================================== -xdr.enum("ManageDataResultCode", { - manageDataSuccess: 0, - manageDataNotSupportedYet: -1, - manageDataNameNotFound: -2, - manageDataLowReserve: -3, - manageDataInvalidName: -4, -}); - -// === xdr source ============================================================ -// -// union ManageDataResult switch (ManageDataResultCode code) -// { -// case MANAGE_DATA_SUCCESS: -// void; -// case MANAGE_DATA_NOT_SUPPORTED_YET: -// case MANAGE_DATA_NAME_NOT_FOUND: -// case MANAGE_DATA_LOW_RESERVE: -// case MANAGE_DATA_INVALID_NAME: -// void; -// }; -// -// =========================================================================== -xdr.union("ManageDataResult", { - switchOn: xdr.lookup("ManageDataResultCode"), - switchName: "code", - switches: [ - ["manageDataSuccess", xdr.void()], - ["manageDataNotSupportedYet", xdr.void()], - ["manageDataNameNotFound", xdr.void()], - ["manageDataLowReserve", xdr.void()], - ["manageDataInvalidName", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum BumpSequenceResultCode -// { -// // codes considered as "success" for the operation -// BUMP_SEQUENCE_SUCCESS = 0, -// // codes considered as "failure" for the operation -// BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds -// }; -// -// =========================================================================== -xdr.enum("BumpSequenceResultCode", { - bumpSequenceSuccess: 0, - bumpSequenceBadSeq: -1, -}); - -// === xdr source ============================================================ -// -// union BumpSequenceResult switch (BumpSequenceResultCode code) -// { -// case BUMP_SEQUENCE_SUCCESS: -// void; -// case BUMP_SEQUENCE_BAD_SEQ: -// void; -// }; -// -// =========================================================================== -xdr.union("BumpSequenceResult", { - switchOn: xdr.lookup("BumpSequenceResultCode"), - switchName: "code", - switches: [ - ["bumpSequenceSuccess", xdr.void()], - ["bumpSequenceBadSeq", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum CreateClaimableBalanceResultCode -// { -// CREATE_CLAIMABLE_BALANCE_SUCCESS = 0, -// CREATE_CLAIMABLE_BALANCE_MALFORMED = -1, -// CREATE_CLAIMABLE_BALANCE_LOW_RESERVE = -2, -// CREATE_CLAIMABLE_BALANCE_NO_TRUST = -3, -// CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -4, -// CREATE_CLAIMABLE_BALANCE_UNDERFUNDED = -5 -// }; -// -// =========================================================================== -xdr.enum("CreateClaimableBalanceResultCode", { - createClaimableBalanceSuccess: 0, - createClaimableBalanceMalformed: -1, - createClaimableBalanceLowReserve: -2, - createClaimableBalanceNoTrust: -3, - createClaimableBalanceNotAuthorized: -4, - createClaimableBalanceUnderfunded: -5, -}); - -// === xdr source ============================================================ -// -// union CreateClaimableBalanceResult switch ( -// CreateClaimableBalanceResultCode code) -// { -// case CREATE_CLAIMABLE_BALANCE_SUCCESS: -// ClaimableBalanceID balanceID; -// case CREATE_CLAIMABLE_BALANCE_MALFORMED: -// case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE: -// case CREATE_CLAIMABLE_BALANCE_NO_TRUST: -// case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED: -// case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED: -// void; -// }; -// -// =========================================================================== -xdr.union("CreateClaimableBalanceResult", { - switchOn: xdr.lookup("CreateClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["createClaimableBalanceSuccess", "balanceId"], - ["createClaimableBalanceMalformed", xdr.void()], - ["createClaimableBalanceLowReserve", xdr.void()], - ["createClaimableBalanceNoTrust", xdr.void()], - ["createClaimableBalanceNotAuthorized", xdr.void()], - ["createClaimableBalanceUnderfunded", xdr.void()], - ], - arms: { - balanceId: xdr.lookup("ClaimableBalanceId"), - }, -}); - -// === xdr source ============================================================ -// -// enum ClaimClaimableBalanceResultCode -// { -// CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0, -// CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, -// CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2, -// CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3, -// CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4, -// CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5 -// }; -// -// =========================================================================== -xdr.enum("ClaimClaimableBalanceResultCode", { - claimClaimableBalanceSuccess: 0, - claimClaimableBalanceDoesNotExist: -1, - claimClaimableBalanceCannotClaim: -2, - claimClaimableBalanceLineFull: -3, - claimClaimableBalanceNoTrust: -4, - claimClaimableBalanceNotAuthorized: -5, -}); - -// === xdr source ============================================================ -// -// union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code) -// { -// case CLAIM_CLAIMABLE_BALANCE_SUCCESS: -// void; -// case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST: -// case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM: -// case CLAIM_CLAIMABLE_BALANCE_LINE_FULL: -// case CLAIM_CLAIMABLE_BALANCE_NO_TRUST: -// case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClaimClaimableBalanceResult", { - switchOn: xdr.lookup("ClaimClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["claimClaimableBalanceSuccess", xdr.void()], - ["claimClaimableBalanceDoesNotExist", xdr.void()], - ["claimClaimableBalanceCannotClaim", xdr.void()], - ["claimClaimableBalanceLineFull", xdr.void()], - ["claimClaimableBalanceNoTrust", xdr.void()], - ["claimClaimableBalanceNotAuthorized", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum BeginSponsoringFutureReservesResultCode -// { -// // codes considered as "success" for the operation -// BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1, -// BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2, -// BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3 -// }; -// -// =========================================================================== -xdr.enum("BeginSponsoringFutureReservesResultCode", { - beginSponsoringFutureReservesSuccess: 0, - beginSponsoringFutureReservesMalformed: -1, - beginSponsoringFutureReservesAlreadySponsored: -2, - beginSponsoringFutureReservesRecursive: -3, -}); - -// === xdr source ============================================================ -// -// union BeginSponsoringFutureReservesResult switch ( -// BeginSponsoringFutureReservesResultCode code) -// { -// case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS: -// void; -// case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED: -// case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED: -// case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE: -// void; -// }; -// -// =========================================================================== -xdr.union("BeginSponsoringFutureReservesResult", { - switchOn: xdr.lookup("BeginSponsoringFutureReservesResultCode"), - switchName: "code", - switches: [ - ["beginSponsoringFutureReservesSuccess", xdr.void()], - ["beginSponsoringFutureReservesMalformed", xdr.void()], - ["beginSponsoringFutureReservesAlreadySponsored", xdr.void()], - ["beginSponsoringFutureReservesRecursive", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum EndSponsoringFutureReservesResultCode -// { -// // codes considered as "success" for the operation -// END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1 -// }; -// -// =========================================================================== -xdr.enum("EndSponsoringFutureReservesResultCode", { - endSponsoringFutureReservesSuccess: 0, - endSponsoringFutureReservesNotSponsored: -1, -}); - -// === xdr source ============================================================ -// -// union EndSponsoringFutureReservesResult switch ( -// EndSponsoringFutureReservesResultCode code) -// { -// case END_SPONSORING_FUTURE_RESERVES_SUCCESS: -// void; -// case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED: -// void; -// }; -// -// =========================================================================== -xdr.union("EndSponsoringFutureReservesResult", { - switchOn: xdr.lookup("EndSponsoringFutureReservesResultCode"), - switchName: "code", - switches: [ - ["endSponsoringFutureReservesSuccess", xdr.void()], - ["endSponsoringFutureReservesNotSponsored", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum RevokeSponsorshipResultCode -// { -// // codes considered as "success" for the operation -// REVOKE_SPONSORSHIP_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1, -// REVOKE_SPONSORSHIP_NOT_SPONSOR = -2, -// REVOKE_SPONSORSHIP_LOW_RESERVE = -3, -// REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4, -// REVOKE_SPONSORSHIP_MALFORMED = -5 -// }; -// -// =========================================================================== -xdr.enum("RevokeSponsorshipResultCode", { - revokeSponsorshipSuccess: 0, - revokeSponsorshipDoesNotExist: -1, - revokeSponsorshipNotSponsor: -2, - revokeSponsorshipLowReserve: -3, - revokeSponsorshipOnlyTransferable: -4, - revokeSponsorshipMalformed: -5, -}); - -// === xdr source ============================================================ -// -// union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code) -// { -// case REVOKE_SPONSORSHIP_SUCCESS: -// void; -// case REVOKE_SPONSORSHIP_DOES_NOT_EXIST: -// case REVOKE_SPONSORSHIP_NOT_SPONSOR: -// case REVOKE_SPONSORSHIP_LOW_RESERVE: -// case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE: -// case REVOKE_SPONSORSHIP_MALFORMED: -// void; -// }; -// -// =========================================================================== -xdr.union("RevokeSponsorshipResult", { - switchOn: xdr.lookup("RevokeSponsorshipResultCode"), - switchName: "code", - switches: [ - ["revokeSponsorshipSuccess", xdr.void()], - ["revokeSponsorshipDoesNotExist", xdr.void()], - ["revokeSponsorshipNotSponsor", xdr.void()], - ["revokeSponsorshipLowReserve", xdr.void()], - ["revokeSponsorshipOnlyTransferable", xdr.void()], - ["revokeSponsorshipMalformed", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ClawbackResultCode -// { -// // codes considered as "success" for the operation -// CLAWBACK_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// CLAWBACK_MALFORMED = -1, -// CLAWBACK_NOT_CLAWBACK_ENABLED = -2, -// CLAWBACK_NO_TRUST = -3, -// CLAWBACK_UNDERFUNDED = -4 -// }; -// -// =========================================================================== -xdr.enum("ClawbackResultCode", { - clawbackSuccess: 0, - clawbackMalformed: -1, - clawbackNotClawbackEnabled: -2, - clawbackNoTrust: -3, - clawbackUnderfunded: -4, -}); - -// === xdr source ============================================================ -// -// union ClawbackResult switch (ClawbackResultCode code) -// { -// case CLAWBACK_SUCCESS: -// void; -// case CLAWBACK_MALFORMED: -// case CLAWBACK_NOT_CLAWBACK_ENABLED: -// case CLAWBACK_NO_TRUST: -// case CLAWBACK_UNDERFUNDED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClawbackResult", { - switchOn: xdr.lookup("ClawbackResultCode"), - switchName: "code", - switches: [ - ["clawbackSuccess", xdr.void()], - ["clawbackMalformed", xdr.void()], - ["clawbackNotClawbackEnabled", xdr.void()], - ["clawbackNoTrust", xdr.void()], - ["clawbackUnderfunded", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum ClawbackClaimableBalanceResultCode -// { -// // codes considered as "success" for the operation -// CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, -// CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2, -// CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3 -// }; -// -// =========================================================================== -xdr.enum("ClawbackClaimableBalanceResultCode", { - clawbackClaimableBalanceSuccess: 0, - clawbackClaimableBalanceDoesNotExist: -1, - clawbackClaimableBalanceNotIssuer: -2, - clawbackClaimableBalanceNotClawbackEnabled: -3, -}); - -// === xdr source ============================================================ -// -// union ClawbackClaimableBalanceResult switch ( -// ClawbackClaimableBalanceResultCode code) -// { -// case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS: -// void; -// case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST: -// case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER: -// case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED: -// void; -// }; -// -// =========================================================================== -xdr.union("ClawbackClaimableBalanceResult", { - switchOn: xdr.lookup("ClawbackClaimableBalanceResultCode"), - switchName: "code", - switches: [ - ["clawbackClaimableBalanceSuccess", xdr.void()], - ["clawbackClaimableBalanceDoesNotExist", xdr.void()], - ["clawbackClaimableBalanceNotIssuer", xdr.void()], - ["clawbackClaimableBalanceNotClawbackEnabled", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum SetTrustLineFlagsResultCode -// { -// // codes considered as "success" for the operation -// SET_TRUST_LINE_FLAGS_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// SET_TRUST_LINE_FLAGS_MALFORMED = -1, -// SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2, -// SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3, -// SET_TRUST_LINE_FLAGS_INVALID_STATE = -4, -// SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created -// // on revoke due to low reserves -// }; -// -// =========================================================================== -xdr.enum("SetTrustLineFlagsResultCode", { - setTrustLineFlagsSuccess: 0, - setTrustLineFlagsMalformed: -1, - setTrustLineFlagsNoTrustLine: -2, - setTrustLineFlagsCantRevoke: -3, - setTrustLineFlagsInvalidState: -4, - setTrustLineFlagsLowReserve: -5, -}); - -// === xdr source ============================================================ -// -// union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code) -// { -// case SET_TRUST_LINE_FLAGS_SUCCESS: -// void; -// case SET_TRUST_LINE_FLAGS_MALFORMED: -// case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE: -// case SET_TRUST_LINE_FLAGS_CANT_REVOKE: -// case SET_TRUST_LINE_FLAGS_INVALID_STATE: -// case SET_TRUST_LINE_FLAGS_LOW_RESERVE: -// void; -// }; -// -// =========================================================================== -xdr.union("SetTrustLineFlagsResult", { - switchOn: xdr.lookup("SetTrustLineFlagsResultCode"), - switchName: "code", - switches: [ - ["setTrustLineFlagsSuccess", xdr.void()], - ["setTrustLineFlagsMalformed", xdr.void()], - ["setTrustLineFlagsNoTrustLine", xdr.void()], - ["setTrustLineFlagsCantRevoke", xdr.void()], - ["setTrustLineFlagsInvalidState", xdr.void()], - ["setTrustLineFlagsLowReserve", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum LiquidityPoolDepositResultCode -// { -// // codes considered as "success" for the operation -// LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input -// LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the -// // assets -// LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the -// // assets -// LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of -// // the assets -// LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't -// // have sufficient limit -// LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds -// LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolDepositResultCode", { - liquidityPoolDepositSuccess: 0, - liquidityPoolDepositMalformed: -1, - liquidityPoolDepositNoTrust: -2, - liquidityPoolDepositNotAuthorized: -3, - liquidityPoolDepositUnderfunded: -4, - liquidityPoolDepositLineFull: -5, - liquidityPoolDepositBadPrice: -6, - liquidityPoolDepositPoolFull: -7, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code) -// { -// case LIQUIDITY_POOL_DEPOSIT_SUCCESS: -// void; -// case LIQUIDITY_POOL_DEPOSIT_MALFORMED: -// case LIQUIDITY_POOL_DEPOSIT_NO_TRUST: -// case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED: -// case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED: -// case LIQUIDITY_POOL_DEPOSIT_LINE_FULL: -// case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE: -// case LIQUIDITY_POOL_DEPOSIT_POOL_FULL: -// void; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolDepositResult", { - switchOn: xdr.lookup("LiquidityPoolDepositResultCode"), - switchName: "code", - switches: [ - ["liquidityPoolDepositSuccess", xdr.void()], - ["liquidityPoolDepositMalformed", xdr.void()], - ["liquidityPoolDepositNoTrust", xdr.void()], - ["liquidityPoolDepositNotAuthorized", xdr.void()], - ["liquidityPoolDepositUnderfunded", xdr.void()], - ["liquidityPoolDepositLineFull", xdr.void()], - ["liquidityPoolDepositBadPrice", xdr.void()], - ["liquidityPoolDepositPoolFull", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum LiquidityPoolWithdrawResultCode -// { -// // codes considered as "success" for the operation -// LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input -// LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the -// // assets -// LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the -// // pool share -// LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one -// // of the assets -// LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough -// }; -// -// =========================================================================== -xdr.enum("LiquidityPoolWithdrawResultCode", { - liquidityPoolWithdrawSuccess: 0, - liquidityPoolWithdrawMalformed: -1, - liquidityPoolWithdrawNoTrust: -2, - liquidityPoolWithdrawUnderfunded: -3, - liquidityPoolWithdrawLineFull: -4, - liquidityPoolWithdrawUnderMinimum: -5, -}); - -// === xdr source ============================================================ -// -// union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code) -// { -// case LIQUIDITY_POOL_WITHDRAW_SUCCESS: -// void; -// case LIQUIDITY_POOL_WITHDRAW_MALFORMED: -// case LIQUIDITY_POOL_WITHDRAW_NO_TRUST: -// case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED: -// case LIQUIDITY_POOL_WITHDRAW_LINE_FULL: -// case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: -// void; -// }; -// -// =========================================================================== -xdr.union("LiquidityPoolWithdrawResult", { - switchOn: xdr.lookup("LiquidityPoolWithdrawResultCode"), - switchName: "code", - switches: [ - ["liquidityPoolWithdrawSuccess", xdr.void()], - ["liquidityPoolWithdrawMalformed", xdr.void()], - ["liquidityPoolWithdrawNoTrust", xdr.void()], - ["liquidityPoolWithdrawUnderfunded", xdr.void()], - ["liquidityPoolWithdrawLineFull", xdr.void()], - ["liquidityPoolWithdrawUnderMinimum", xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum InvokeHostFunctionResultCode -// { -// // codes considered as "success" for the operation -// INVOKE_HOST_FUNCTION_SUCCESS = 0, -// -// // codes considered as "failure" for the operation -// INVOKE_HOST_FUNCTION_MALFORMED = -1, -// INVOKE_HOST_FUNCTION_TRAPPED = -2 -// }; -// -// =========================================================================== -xdr.enum("InvokeHostFunctionResultCode", { - invokeHostFunctionSuccess: 0, - invokeHostFunctionMalformed: -1, - invokeHostFunctionTrapped: -2, -}); - -// === xdr source ============================================================ -// -// union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) -// { -// case INVOKE_HOST_FUNCTION_SUCCESS: -// SCVal success; -// case INVOKE_HOST_FUNCTION_MALFORMED: -// case INVOKE_HOST_FUNCTION_TRAPPED: -// void; -// }; -// -// =========================================================================== -xdr.union("InvokeHostFunctionResult", { - switchOn: xdr.lookup("InvokeHostFunctionResultCode"), - switchName: "code", - switches: [ - ["invokeHostFunctionSuccess", "success"], - ["invokeHostFunctionMalformed", xdr.void()], - ["invokeHostFunctionTrapped", xdr.void()], - ], - arms: { - success: xdr.lookup("ScVal"), - }, -}); - -// === xdr source ============================================================ -// -// enum OperationResultCode -// { -// opINNER = 0, // inner object result is valid -// -// opBAD_AUTH = -1, // too few valid signatures / wrong network -// opNO_ACCOUNT = -2, // source account was not found -// opNOT_SUPPORTED = -3, // operation not supported at this time -// opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached -// opEXCEEDED_WORK_LIMIT = -5, // operation did too much work -// opTOO_MANY_SPONSORING = -6 // account is sponsoring too many entries -// }; -// -// =========================================================================== -xdr.enum("OperationResultCode", { - opInner: 0, - opBadAuth: -1, - opNoAccount: -2, - opNotSupported: -3, - opTooManySubentries: -4, - opExceededWorkLimit: -5, - opTooManySponsoring: -6, -}); - -// === xdr source ============================================================ -// -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountResult createAccountResult; -// case PAYMENT: -// PaymentResult paymentResult; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; -// case MANAGE_SELL_OFFER: -// ManageSellOfferResult manageSellOfferResult; -// case CREATE_PASSIVE_SELL_OFFER: -// ManageSellOfferResult createPassiveSellOfferResult; -// case SET_OPTIONS: -// SetOptionsResult setOptionsResult; -// case CHANGE_TRUST: -// ChangeTrustResult changeTrustResult; -// case ALLOW_TRUST: -// AllowTrustResult allowTrustResult; -// case ACCOUNT_MERGE: -// AccountMergeResult accountMergeResult; -// case INFLATION: -// InflationResult inflationResult; -// case MANAGE_DATA: -// ManageDataResult manageDataResult; -// case BUMP_SEQUENCE: -// BumpSequenceResult bumpSeqResult; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferResult manageBuyOfferResult; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendResult pathPaymentStrictSendResult; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceResult createClaimableBalanceResult; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceResult claimClaimableBalanceResult; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; -// case END_SPONSORING_FUTURE_RESERVES: -// EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipResult revokeSponsorshipResult; -// case CLAWBACK: -// ClawbackResult clawbackResult; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsResult setTrustLineFlagsResult; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositResult liquidityPoolDepositResult; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; -// case INVOKE_HOST_FUNCTION: -// InvokeHostFunctionResult invokeHostFunctionResult; -// } -// -// =========================================================================== -xdr.union("OperationResultTr", { - switchOn: xdr.lookup("OperationType"), - switchName: "type", - switches: [ - ["createAccount", "createAccountResult"], - ["payment", "paymentResult"], - ["pathPaymentStrictReceive", "pathPaymentStrictReceiveResult"], - ["manageSellOffer", "manageSellOfferResult"], - ["createPassiveSellOffer", "createPassiveSellOfferResult"], - ["setOptions", "setOptionsResult"], - ["changeTrust", "changeTrustResult"], - ["allowTrust", "allowTrustResult"], - ["accountMerge", "accountMergeResult"], - ["inflation", "inflationResult"], - ["manageData", "manageDataResult"], - ["bumpSequence", "bumpSeqResult"], - ["manageBuyOffer", "manageBuyOfferResult"], - ["pathPaymentStrictSend", "pathPaymentStrictSendResult"], - ["createClaimableBalance", "createClaimableBalanceResult"], - ["claimClaimableBalance", "claimClaimableBalanceResult"], - ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesResult"], - ["endSponsoringFutureReserves", "endSponsoringFutureReservesResult"], - ["revokeSponsorship", "revokeSponsorshipResult"], - ["clawback", "clawbackResult"], - ["clawbackClaimableBalance", "clawbackClaimableBalanceResult"], - ["setTrustLineFlags", "setTrustLineFlagsResult"], - ["liquidityPoolDeposit", "liquidityPoolDepositResult"], - ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], - ["invokeHostFunction", "invokeHostFunctionResult"], - ], - arms: { - createAccountResult: xdr.lookup("CreateAccountResult"), - paymentResult: xdr.lookup("PaymentResult"), - pathPaymentStrictReceiveResult: xdr.lookup("PathPaymentStrictReceiveResult"), - manageSellOfferResult: xdr.lookup("ManageSellOfferResult"), - createPassiveSellOfferResult: xdr.lookup("ManageSellOfferResult"), - setOptionsResult: xdr.lookup("SetOptionsResult"), - changeTrustResult: xdr.lookup("ChangeTrustResult"), - allowTrustResult: xdr.lookup("AllowTrustResult"), - accountMergeResult: xdr.lookup("AccountMergeResult"), - inflationResult: xdr.lookup("InflationResult"), - manageDataResult: xdr.lookup("ManageDataResult"), - bumpSeqResult: xdr.lookup("BumpSequenceResult"), - manageBuyOfferResult: xdr.lookup("ManageBuyOfferResult"), - pathPaymentStrictSendResult: xdr.lookup("PathPaymentStrictSendResult"), - createClaimableBalanceResult: xdr.lookup("CreateClaimableBalanceResult"), - claimClaimableBalanceResult: xdr.lookup("ClaimClaimableBalanceResult"), - beginSponsoringFutureReservesResult: xdr.lookup("BeginSponsoringFutureReservesResult"), - endSponsoringFutureReservesResult: xdr.lookup("EndSponsoringFutureReservesResult"), - revokeSponsorshipResult: xdr.lookup("RevokeSponsorshipResult"), - clawbackResult: xdr.lookup("ClawbackResult"), - clawbackClaimableBalanceResult: xdr.lookup("ClawbackClaimableBalanceResult"), - setTrustLineFlagsResult: xdr.lookup("SetTrustLineFlagsResult"), - liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), - liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), - invokeHostFunctionResult: xdr.lookup("InvokeHostFunctionResult"), - }, -}); - -// === xdr source ============================================================ -// -// union OperationResult switch (OperationResultCode code) -// { -// case opINNER: -// union switch (OperationType type) -// { -// case CREATE_ACCOUNT: -// CreateAccountResult createAccountResult; -// case PAYMENT: -// PaymentResult paymentResult; -// case PATH_PAYMENT_STRICT_RECEIVE: -// PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; -// case MANAGE_SELL_OFFER: -// ManageSellOfferResult manageSellOfferResult; -// case CREATE_PASSIVE_SELL_OFFER: -// ManageSellOfferResult createPassiveSellOfferResult; -// case SET_OPTIONS: -// SetOptionsResult setOptionsResult; -// case CHANGE_TRUST: -// ChangeTrustResult changeTrustResult; -// case ALLOW_TRUST: -// AllowTrustResult allowTrustResult; -// case ACCOUNT_MERGE: -// AccountMergeResult accountMergeResult; -// case INFLATION: -// InflationResult inflationResult; -// case MANAGE_DATA: -// ManageDataResult manageDataResult; -// case BUMP_SEQUENCE: -// BumpSequenceResult bumpSeqResult; -// case MANAGE_BUY_OFFER: -// ManageBuyOfferResult manageBuyOfferResult; -// case PATH_PAYMENT_STRICT_SEND: -// PathPaymentStrictSendResult pathPaymentStrictSendResult; -// case CREATE_CLAIMABLE_BALANCE: -// CreateClaimableBalanceResult createClaimableBalanceResult; -// case CLAIM_CLAIMABLE_BALANCE: -// ClaimClaimableBalanceResult claimClaimableBalanceResult; -// case BEGIN_SPONSORING_FUTURE_RESERVES: -// BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; -// case END_SPONSORING_FUTURE_RESERVES: -// EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; -// case REVOKE_SPONSORSHIP: -// RevokeSponsorshipResult revokeSponsorshipResult; -// case CLAWBACK: -// ClawbackResult clawbackResult; -// case CLAWBACK_CLAIMABLE_BALANCE: -// ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; -// case SET_TRUST_LINE_FLAGS: -// SetTrustLineFlagsResult setTrustLineFlagsResult; -// case LIQUIDITY_POOL_DEPOSIT: -// LiquidityPoolDepositResult liquidityPoolDepositResult; -// case LIQUIDITY_POOL_WITHDRAW: -// LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; -// case INVOKE_HOST_FUNCTION: -// InvokeHostFunctionResult invokeHostFunctionResult; -// } -// tr; -// case opBAD_AUTH: -// case opNO_ACCOUNT: -// case opNOT_SUPPORTED: -// case opTOO_MANY_SUBENTRIES: -// case opEXCEEDED_WORK_LIMIT: -// case opTOO_MANY_SPONSORING: -// void; -// }; -// -// =========================================================================== -xdr.union("OperationResult", { - switchOn: xdr.lookup("OperationResultCode"), - switchName: "code", - switches: [ - ["opInner", "tr"], - ["opBadAuth", xdr.void()], - ["opNoAccount", xdr.void()], - ["opNotSupported", xdr.void()], - ["opTooManySubentries", xdr.void()], - ["opExceededWorkLimit", xdr.void()], - ["opTooManySponsoring", xdr.void()], - ], - arms: { - tr: xdr.lookup("OperationResultTr"), - }, -}); - -// === xdr source ============================================================ -// -// enum TransactionResultCode -// { -// txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded -// txSUCCESS = 0, // all operations succeeded -// -// txFAILED = -1, // one of the operations failed (none were applied) -// -// txTOO_EARLY = -2, // ledger closeTime before minTime -// txTOO_LATE = -3, // ledger closeTime after maxTime -// txMISSING_OPERATION = -4, // no operation was specified -// txBAD_SEQ = -5, // sequence number does not match source account -// -// txBAD_AUTH = -6, // too few valid signatures / wrong network -// txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve -// txNO_ACCOUNT = -8, // source account not found -// txINSUFFICIENT_FEE = -9, // fee is too small -// txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction -// txINTERNAL_ERROR = -11, // an unknown error occurred -// -// txNOT_SUPPORTED = -12, // transaction type not supported -// txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed -// txBAD_SPONSORSHIP = -14, // sponsorship not confirmed -// txBAD_MIN_SEQ_AGE_OR_GAP = -// -15, // minSeqAge or minSeqLedgerGap conditions not met -// txMALFORMED = -16 // precondition is invalid -// }; -// -// =========================================================================== -xdr.enum("TransactionResultCode", { - txFeeBumpInnerSuccess: 1, - txSuccess: 0, - txFailed: -1, - txTooEarly: -2, - txTooLate: -3, - txMissingOperation: -4, - txBadSeq: -5, - txBadAuth: -6, - txInsufficientBalance: -7, - txNoAccount: -8, - txInsufficientFee: -9, - txBadAuthExtra: -10, - txInternalError: -11, - txNotSupported: -12, - txFeeBumpInnerFailed: -13, - txBadSponsorship: -14, - txBadMinSeqAgeOrGap: -15, - txMalformed: -16, -}); - -// === xdr source ============================================================ -// -// union switch (TransactionResultCode code) -// { -// // txFEE_BUMP_INNER_SUCCESS is not included -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // txFEE_BUMP_INNER_FAILED is not included -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// -// =========================================================================== -xdr.union("InnerTransactionResultResult", { - switchOn: xdr.lookup("TransactionResultCode"), - switchName: "code", - switches: [ - ["txSuccess", "results"], - ["txFailed", "results"], - ["txTooEarly", xdr.void()], - ["txTooLate", xdr.void()], - ["txMissingOperation", xdr.void()], - ["txBadSeq", xdr.void()], - ["txBadAuth", xdr.void()], - ["txInsufficientBalance", xdr.void()], - ["txNoAccount", xdr.void()], - ["txInsufficientFee", xdr.void()], - ["txBadAuthExtra", xdr.void()], - ["txInternalError", xdr.void()], - ["txNotSupported", xdr.void()], - ["txBadSponsorship", xdr.void()], - ["txBadMinSeqAgeOrGap", xdr.void()], - ["txMalformed", xdr.void()], - ], - arms: { - results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("InnerTransactionResultExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct InnerTransactionResult -// { -// // Always 0. Here for binary compatibility. -// int64 feeCharged; -// -// union switch (TransactionResultCode code) -// { -// // txFEE_BUMP_INNER_SUCCESS is not included -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // txFEE_BUMP_INNER_FAILED is not included -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// result; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("InnerTransactionResult", [ - ["feeCharged", xdr.lookup("Int64")], - ["result", xdr.lookup("InnerTransactionResultResult")], - ["ext", xdr.lookup("InnerTransactionResultExt")], -]); - -// === xdr source ============================================================ -// -// struct InnerTransactionResultPair -// { -// Hash transactionHash; // hash of the inner transaction -// InnerTransactionResult result; // result for the inner transaction -// }; -// -// =========================================================================== -xdr.struct("InnerTransactionResultPair", [ - ["transactionHash", xdr.lookup("Hash")], - ["result", xdr.lookup("InnerTransactionResult")], -]); - -// === xdr source ============================================================ -// -// union switch (TransactionResultCode code) -// { -// case txFEE_BUMP_INNER_SUCCESS: -// case txFEE_BUMP_INNER_FAILED: -// InnerTransactionResultPair innerResultPair; -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // case txFEE_BUMP_INNER_FAILED: handled above -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionResultResult", { - switchOn: xdr.lookup("TransactionResultCode"), - switchName: "code", - switches: [ - ["txFeeBumpInnerSuccess", "innerResultPair"], - ["txFeeBumpInnerFailed", "innerResultPair"], - ["txSuccess", "results"], - ["txFailed", "results"], - ["txTooEarly", xdr.void()], - ["txTooLate", xdr.void()], - ["txMissingOperation", xdr.void()], - ["txBadSeq", xdr.void()], - ["txBadAuth", xdr.void()], - ["txInsufficientBalance", xdr.void()], - ["txNoAccount", xdr.void()], - ["txInsufficientFee", xdr.void()], - ["txBadAuthExtra", xdr.void()], - ["txInternalError", xdr.void()], - ["txNotSupported", xdr.void()], - ["txBadSponsorship", xdr.void()], - ["txBadMinSeqAgeOrGap", xdr.void()], - ["txMalformed", xdr.void()], - ], - arms: { - innerResultPair: xdr.lookup("InnerTransactionResultPair"), - results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), - }, -}); - -// === xdr source ============================================================ -// -// union switch (int v) -// { -// case 0: -// void; -// } -// -// =========================================================================== -xdr.union("TransactionResultExt", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// struct TransactionResult -// { -// int64 feeCharged; // actual fee charged for the transaction -// -// union switch (TransactionResultCode code) -// { -// case txFEE_BUMP_INNER_SUCCESS: -// case txFEE_BUMP_INNER_FAILED: -// InnerTransactionResultPair innerResultPair; -// case txSUCCESS: -// case txFAILED: -// OperationResult results<>; -// case txTOO_EARLY: -// case txTOO_LATE: -// case txMISSING_OPERATION: -// case txBAD_SEQ: -// case txBAD_AUTH: -// case txINSUFFICIENT_BALANCE: -// case txNO_ACCOUNT: -// case txINSUFFICIENT_FEE: -// case txBAD_AUTH_EXTRA: -// case txINTERNAL_ERROR: -// case txNOT_SUPPORTED: -// // case txFEE_BUMP_INNER_FAILED: handled above -// case txBAD_SPONSORSHIP: -// case txBAD_MIN_SEQ_AGE_OR_GAP: -// case txMALFORMED: -// void; -// } -// result; -// -// // reserved for future use -// union switch (int v) -// { -// case 0: -// void; -// } -// ext; -// }; -// -// =========================================================================== -xdr.struct("TransactionResult", [ - ["feeCharged", xdr.lookup("Int64")], - ["result", xdr.lookup("TransactionResultResult")], - ["ext", xdr.lookup("TransactionResultExt")], -]); - -// === xdr source ============================================================ -// -// typedef opaque Hash[32]; -// -// =========================================================================== -xdr.typedef("Hash", xdr.opaque(32)); - -// === xdr source ============================================================ -// -// typedef opaque uint256[32]; -// -// =========================================================================== -xdr.typedef("Uint256", xdr.opaque(32)); - -// === xdr source ============================================================ -// -// typedef unsigned int uint32; -// -// =========================================================================== -xdr.typedef("Uint32", xdr.uint()); - -// === xdr source ============================================================ -// -// typedef int int32; -// -// =========================================================================== -xdr.typedef("Int32", xdr.int()); - -// === xdr source ============================================================ -// -// typedef unsigned hyper uint64; -// -// =========================================================================== -xdr.typedef("Uint64", xdr.uhyper()); - -// === xdr source ============================================================ -// -// typedef hyper int64; -// -// =========================================================================== -xdr.typedef("Int64", xdr.hyper()); - -// === xdr source ============================================================ -// -// typedef uint64 TimePoint; -// -// =========================================================================== -xdr.typedef("TimePoint", xdr.lookup("Uint64")); - -// === xdr source ============================================================ -// -// typedef uint64 Duration; -// -// =========================================================================== -xdr.typedef("Duration", xdr.lookup("Uint64")); - -// === xdr source ============================================================ -// -// union ExtensionPoint switch (int v) -// { -// case 0: -// void; -// }; -// -// =========================================================================== -xdr.union("ExtensionPoint", { - switchOn: xdr.int(), - switchName: "v", - switches: [ - [0, xdr.void()], - ], - arms: { - }, -}); - -// === xdr source ============================================================ -// -// enum CryptoKeyType -// { -// KEY_TYPE_ED25519 = 0, -// KEY_TYPE_PRE_AUTH_TX = 1, -// KEY_TYPE_HASH_X = 2, -// KEY_TYPE_ED25519_SIGNED_PAYLOAD = 3, -// // MUXED enum values for supported type are derived from the enum values -// // above by ORing them with 0x100 -// KEY_TYPE_MUXED_ED25519 = 0x100 -// }; -// -// =========================================================================== -xdr.enum("CryptoKeyType", { - keyTypeEd25519: 0, - keyTypePreAuthTx: 1, - keyTypeHashX: 2, - keyTypeEd25519SignedPayload: 3, - keyTypeMuxedEd25519: 256, -}); - -// === xdr source ============================================================ -// -// enum PublicKeyType -// { -// PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519 -// }; -// -// =========================================================================== -xdr.enum("PublicKeyType", { - publicKeyTypeEd25519: 0, -}); - -// === xdr source ============================================================ -// -// enum SignerKeyType -// { -// SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, -// SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, -// SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X, -// SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD -// }; -// -// =========================================================================== -xdr.enum("SignerKeyType", { - signerKeyTypeEd25519: 0, - signerKeyTypePreAuthTx: 1, - signerKeyTypeHashX: 2, - signerKeyTypeEd25519SignedPayload: 3, -}); - -// === xdr source ============================================================ -// -// union PublicKey switch (PublicKeyType type) -// { -// case PUBLIC_KEY_TYPE_ED25519: -// uint256 ed25519; -// }; -// -// =========================================================================== -xdr.union("PublicKey", { - switchOn: xdr.lookup("PublicKeyType"), - switchName: "type", - switches: [ - ["publicKeyTypeEd25519", "ed25519"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - }, -}); - -// === xdr source ============================================================ -// -// struct -// { -// /* Public key that must sign the payload. */ -// uint256 ed25519; -// /* Payload to be raw signed by ed25519. */ -// opaque payload<64>; -// } -// -// =========================================================================== -xdr.struct("SignerKeyEd25519SignedPayload", [ - ["ed25519", xdr.lookup("Uint256")], - ["payload", xdr.varOpaque(64)], -]); - -// === xdr source ============================================================ -// -// union SignerKey switch (SignerKeyType type) -// { -// case SIGNER_KEY_TYPE_ED25519: -// uint256 ed25519; -// case SIGNER_KEY_TYPE_PRE_AUTH_TX: -// /* SHA-256 Hash of TransactionSignaturePayload structure */ -// uint256 preAuthTx; -// case SIGNER_KEY_TYPE_HASH_X: -// /* Hash of random 256 bit preimage X */ -// uint256 hashX; -// case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD: -// struct -// { -// /* Public key that must sign the payload. */ -// uint256 ed25519; -// /* Payload to be raw signed by ed25519. */ -// opaque payload<64>; -// } ed25519SignedPayload; -// }; -// -// =========================================================================== -xdr.union("SignerKey", { - switchOn: xdr.lookup("SignerKeyType"), - switchName: "type", - switches: [ - ["signerKeyTypeEd25519", "ed25519"], - ["signerKeyTypePreAuthTx", "preAuthTx"], - ["signerKeyTypeHashX", "hashX"], - ["signerKeyTypeEd25519SignedPayload", "ed25519SignedPayload"], - ], - arms: { - ed25519: xdr.lookup("Uint256"), - preAuthTx: xdr.lookup("Uint256"), - hashX: xdr.lookup("Uint256"), - ed25519SignedPayload: xdr.lookup("SignerKeyEd25519SignedPayload"), - }, -}); - -// === xdr source ============================================================ -// -// typedef opaque Signature<64>; -// -// =========================================================================== -xdr.typedef("Signature", xdr.varOpaque(64)); - -// === xdr source ============================================================ -// -// typedef opaque SignatureHint[4]; -// -// =========================================================================== -xdr.typedef("SignatureHint", xdr.opaque(4)); - -// === xdr source ============================================================ -// -// typedef PublicKey NodeID; -// -// =========================================================================== -xdr.typedef("NodeId", xdr.lookup("PublicKey")); - -// === xdr source ============================================================ -// -// typedef PublicKey AccountID; -// -// =========================================================================== -xdr.typedef("AccountId", xdr.lookup("PublicKey")); - -// === xdr source ============================================================ -// -// struct Curve25519Secret -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("Curve25519Secret", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct Curve25519Public -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("Curve25519Public", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct HmacSha256Key -// { -// opaque key[32]; -// }; -// -// =========================================================================== -xdr.struct("HmacSha256Key", [ - ["key", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// struct HmacSha256Mac -// { -// opaque mac[32]; -// }; -// -// =========================================================================== -xdr.struct("HmacSha256Mac", [ - ["mac", xdr.opaque(32)], -]); - -// === xdr source ============================================================ -// -// enum SCValType -// { -// SCV_BOOL = 0, -// SCV_VOID = 1, -// SCV_STATUS = 2, -// -// // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. -// SCV_U32 = 3, -// SCV_I32 = 4, -// -// // 64 bits is naturally supported by both WASM and XDR also. -// SCV_U64 = 5, -// SCV_I64 = 6, -// -// // Time-related u64 subtypes with their own functions and formatting. -// SCV_TIMEPOINT = 7, -// SCV_DURATION = 8, -// -// // 128 bits is naturally supported by Rust and we use it for Soroban -// // fixed-point arithmetic prices / balances / similar "quantities". These -// // are represented in XDR as a pair of 2 u64s, unlike {u,i}256 which is -// // represented as an array of 32 bytes. -// SCV_U128 = 9, -// SCV_I128 = 10, -// -// // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine -// // word, so for interop use we include this even though it requires a small -// // amount of Rust guest and/or host library code. -// SCV_U256 = 11, -// SCV_I256 = 12, -// -// // TODO: possibly allocate subtypes of i64, i128 and/or u256 for -// // fixed-precision with a specific number of decimals. -// -// // Bytes come in 3 flavors, 2 of which have meaningfully different -// // formatting and validity-checking / domain-restriction. -// SCV_BYTES = 13, -// SCV_STRING = 14, -// SCV_SYMBOL = 15, -// -// // Vecs and maps are just polymorphic containers of other ScVals. -// SCV_VEC = 16, -// SCV_MAP = 17, -// -// // SCContractExecutable and SCAddressType are types that gets used separately from -// // SCVal so we do not flatten their structures into separate SCVal cases. -// SCV_CONTRACT_EXECUTABLE = 18, -// SCV_ADDRESS = 19, -// -// // SCV_LEDGER_KEY_CONTRACT_EXECUTABLE and SCV_LEDGER_KEY_NONCE are unique -// // symbolic SCVals used as the key for ledger entries for a contract's code -// // and an address' nonce, respectively. -// SCV_LEDGER_KEY_CONTRACT_EXECUTABLE = 20, -// SCV_LEDGER_KEY_NONCE = 21 -// }; -// -// =========================================================================== -xdr.enum("ScValType", { - scvBool: 0, - scvVoid: 1, - scvStatus: 2, - scvU32: 3, - scvI32: 4, - scvU64: 5, - scvI64: 6, - scvTimepoint: 7, - scvDuration: 8, - scvU128: 9, - scvI128: 10, - scvU256: 11, - scvI256: 12, - scvBytes: 13, - scvString: 14, - scvSymbol: 15, - scvVec: 16, - scvMap: 17, - scvContractExecutable: 18, - scvAddress: 19, - scvLedgerKeyContractExecutable: 20, - scvLedgerKeyNonce: 21, -}); - -// === xdr source ============================================================ -// -// enum SCStatusType -// { -// SST_OK = 0, -// SST_UNKNOWN_ERROR = 1, -// SST_HOST_VALUE_ERROR = 2, -// SST_HOST_OBJECT_ERROR = 3, -// SST_HOST_FUNCTION_ERROR = 4, -// SST_HOST_STORAGE_ERROR = 5, -// SST_HOST_CONTEXT_ERROR = 6, -// SST_VM_ERROR = 7, -// SST_CONTRACT_ERROR = 8, -// SST_HOST_AUTH_ERROR = 9 -// // TODO: add more -// }; -// -// =========================================================================== -xdr.enum("ScStatusType", { - sstOk: 0, - sstUnknownError: 1, - sstHostValueError: 2, - sstHostObjectError: 3, - sstHostFunctionError: 4, - sstHostStorageError: 5, - sstHostContextError: 6, - sstVmError: 7, - sstContractError: 8, - sstHostAuthError: 9, -}); - -// === xdr source ============================================================ -// -// enum SCHostValErrorCode -// { -// HOST_VALUE_UNKNOWN_ERROR = 0, -// HOST_VALUE_RESERVED_TAG_VALUE = 1, -// HOST_VALUE_UNEXPECTED_VAL_TYPE = 2, -// HOST_VALUE_U63_OUT_OF_RANGE = 3, -// HOST_VALUE_U32_OUT_OF_RANGE = 4, -// HOST_VALUE_STATIC_UNKNOWN = 5, -// HOST_VALUE_MISSING_OBJECT = 6, -// HOST_VALUE_SYMBOL_TOO_LONG = 7, -// HOST_VALUE_SYMBOL_BAD_CHAR = 8, -// HOST_VALUE_SYMBOL_CONTAINS_NON_UTF8 = 9, -// HOST_VALUE_BITSET_TOO_MANY_BITS = 10, -// HOST_VALUE_STATUS_UNKNOWN = 11 -// }; -// -// =========================================================================== -xdr.enum("ScHostValErrorCode", { - hostValueUnknownError: 0, - hostValueReservedTagValue: 1, - hostValueUnexpectedValType: 2, - hostValueU63OutOfRange: 3, - hostValueU32OutOfRange: 4, - hostValueStaticUnknown: 5, - hostValueMissingObject: 6, - hostValueSymbolTooLong: 7, - hostValueSymbolBadChar: 8, - hostValueSymbolContainsNonUtf8: 9, - hostValueBitsetTooManyBits: 10, - hostValueStatusUnknown: 11, -}); - -// === xdr source ============================================================ -// -// enum SCHostObjErrorCode -// { -// HOST_OBJECT_UNKNOWN_ERROR = 0, -// HOST_OBJECT_UNKNOWN_REFERENCE = 1, -// HOST_OBJECT_UNEXPECTED_TYPE = 2, -// HOST_OBJECT_OBJECT_COUNT_EXCEEDS_U32_MAX = 3, -// HOST_OBJECT_OBJECT_NOT_EXIST = 4, -// HOST_OBJECT_VEC_INDEX_OUT_OF_BOUND = 5, -// HOST_OBJECT_CONTRACT_HASH_WRONG_LENGTH = 6 -// }; -// -// =========================================================================== -xdr.enum("ScHostObjErrorCode", { - hostObjectUnknownError: 0, - hostObjectUnknownReference: 1, - hostObjectUnexpectedType: 2, - hostObjectObjectCountExceedsU32Max: 3, - hostObjectObjectNotExist: 4, - hostObjectVecIndexOutOfBound: 5, - hostObjectContractHashWrongLength: 6, -}); - -// === xdr source ============================================================ -// -// enum SCHostFnErrorCode -// { -// HOST_FN_UNKNOWN_ERROR = 0, -// HOST_FN_UNEXPECTED_HOST_FUNCTION_ACTION = 1, -// HOST_FN_INPUT_ARGS_WRONG_LENGTH = 2, -// HOST_FN_INPUT_ARGS_WRONG_TYPE = 3, -// HOST_FN_INPUT_ARGS_INVALID = 4 -// }; -// -// =========================================================================== -xdr.enum("ScHostFnErrorCode", { - hostFnUnknownError: 0, - hostFnUnexpectedHostFunctionAction: 1, - hostFnInputArgsWrongLength: 2, - hostFnInputArgsWrongType: 3, - hostFnInputArgsInvalid: 4, -}); - -// === xdr source ============================================================ -// -// enum SCHostStorageErrorCode -// { -// HOST_STORAGE_UNKNOWN_ERROR = 0, -// HOST_STORAGE_EXPECT_CONTRACT_DATA = 1, -// HOST_STORAGE_READWRITE_ACCESS_TO_READONLY_ENTRY = 2, -// HOST_STORAGE_ACCESS_TO_UNKNOWN_ENTRY = 3, -// HOST_STORAGE_MISSING_KEY_IN_GET = 4, -// HOST_STORAGE_GET_ON_DELETED_KEY = 5 -// }; -// -// =========================================================================== -xdr.enum("ScHostStorageErrorCode", { - hostStorageUnknownError: 0, - hostStorageExpectContractData: 1, - hostStorageReadwriteAccessToReadonlyEntry: 2, - hostStorageAccessToUnknownEntry: 3, - hostStorageMissingKeyInGet: 4, - hostStorageGetOnDeletedKey: 5, -}); - -// === xdr source ============================================================ -// -// enum SCHostAuthErrorCode -// { -// HOST_AUTH_UNKNOWN_ERROR = 0, -// HOST_AUTH_NONCE_ERROR = 1, -// HOST_AUTH_DUPLICATE_AUTHORIZATION = 2, -// HOST_AUTH_NOT_AUTHORIZED = 3 -// }; -// -// =========================================================================== -xdr.enum("ScHostAuthErrorCode", { - hostAuthUnknownError: 0, - hostAuthNonceError: 1, - hostAuthDuplicateAuthorization: 2, - hostAuthNotAuthorized: 3, -}); - -// === xdr source ============================================================ -// -// enum SCHostContextErrorCode -// { -// HOST_CONTEXT_UNKNOWN_ERROR = 0, -// HOST_CONTEXT_NO_CONTRACT_RUNNING = 1 -// }; -// -// =========================================================================== -xdr.enum("ScHostContextErrorCode", { - hostContextUnknownError: 0, - hostContextNoContractRunning: 1, -}); - -// === xdr source ============================================================ -// -// enum SCVmErrorCode { -// VM_UNKNOWN = 0, -// VM_VALIDATION = 1, -// VM_INSTANTIATION = 2, -// VM_FUNCTION = 3, -// VM_TABLE = 4, -// VM_MEMORY = 5, -// VM_GLOBAL = 6, -// VM_VALUE = 7, -// VM_TRAP_UNREACHABLE = 8, -// VM_TRAP_MEMORY_ACCESS_OUT_OF_BOUNDS = 9, -// VM_TRAP_TABLE_ACCESS_OUT_OF_BOUNDS = 10, -// VM_TRAP_ELEM_UNINITIALIZED = 11, -// VM_TRAP_DIVISION_BY_ZERO = 12, -// VM_TRAP_INTEGER_OVERFLOW = 13, -// VM_TRAP_INVALID_CONVERSION_TO_INT = 14, -// VM_TRAP_STACK_OVERFLOW = 15, -// VM_TRAP_UNEXPECTED_SIGNATURE = 16, -// VM_TRAP_MEM_LIMIT_EXCEEDED = 17, -// VM_TRAP_CPU_LIMIT_EXCEEDED = 18 -// }; -// -// =========================================================================== -xdr.enum("ScVmErrorCode", { - vmUnknown: 0, - vmValidation: 1, - vmInstantiation: 2, - vmFunction: 3, - vmTable: 4, - vmMemory: 5, - vmGlobal: 6, - vmValue: 7, - vmTrapUnreachable: 8, - vmTrapMemoryAccessOutOfBounds: 9, - vmTrapTableAccessOutOfBounds: 10, - vmTrapElemUninitialized: 11, - vmTrapDivisionByZero: 12, - vmTrapIntegerOverflow: 13, - vmTrapInvalidConversionToInt: 14, - vmTrapStackOverflow: 15, - vmTrapUnexpectedSignature: 16, - vmTrapMemLimitExceeded: 17, - vmTrapCpuLimitExceeded: 18, -}); - -// === xdr source ============================================================ -// -// enum SCUnknownErrorCode -// { -// UNKNOWN_ERROR_GENERAL = 0, -// UNKNOWN_ERROR_XDR = 1 -// }; -// -// =========================================================================== -xdr.enum("ScUnknownErrorCode", { - unknownErrorGeneral: 0, - unknownErrorXdr: 1, -}); - -// === xdr source ============================================================ -// -// union SCStatus switch (SCStatusType type) -// { -// case SST_OK: -// void; -// case SST_UNKNOWN_ERROR: -// SCUnknownErrorCode unknownCode; -// case SST_HOST_VALUE_ERROR: -// SCHostValErrorCode valCode; -// case SST_HOST_OBJECT_ERROR: -// SCHostObjErrorCode objCode; -// case SST_HOST_FUNCTION_ERROR: -// SCHostFnErrorCode fnCode; -// case SST_HOST_STORAGE_ERROR: -// SCHostStorageErrorCode storageCode; -// case SST_HOST_CONTEXT_ERROR: -// SCHostContextErrorCode contextCode; -// case SST_VM_ERROR: -// SCVmErrorCode vmCode; -// case SST_CONTRACT_ERROR: -// uint32 contractCode; -// case SST_HOST_AUTH_ERROR: -// SCHostAuthErrorCode authCode; -// }; -// -// =========================================================================== -xdr.union("ScStatus", { - switchOn: xdr.lookup("ScStatusType"), - switchName: "type", - switches: [ - ["sstOk", xdr.void()], - ["sstUnknownError", "unknownCode"], - ["sstHostValueError", "valCode"], - ["sstHostObjectError", "objCode"], - ["sstHostFunctionError", "fnCode"], - ["sstHostStorageError", "storageCode"], - ["sstHostContextError", "contextCode"], - ["sstVmError", "vmCode"], - ["sstContractError", "contractCode"], - ["sstHostAuthError", "authCode"], - ], - arms: { - unknownCode: xdr.lookup("ScUnknownErrorCode"), - valCode: xdr.lookup("ScHostValErrorCode"), - objCode: xdr.lookup("ScHostObjErrorCode"), - fnCode: xdr.lookup("ScHostFnErrorCode"), - storageCode: xdr.lookup("ScHostStorageErrorCode"), - contextCode: xdr.lookup("ScHostContextErrorCode"), - vmCode: xdr.lookup("ScVmErrorCode"), - contractCode: xdr.lookup("Uint32"), - authCode: xdr.lookup("ScHostAuthErrorCode"), - }, -}); - -// === xdr source ============================================================ -// -// struct UInt128Parts { -// uint64 hi; -// uint64 lo; -// }; -// -// =========================================================================== -xdr.struct("UInt128Parts", [ - ["hi", xdr.lookup("Uint64")], - ["lo", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// struct Int128Parts { -// int64 hi; -// uint64 lo; -// }; -// -// =========================================================================== -xdr.struct("Int128Parts", [ - ["hi", xdr.lookup("Int64")], - ["lo", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// struct UInt256Parts { -// uint64 hi_hi; -// uint64 hi_lo; -// uint64 lo_hi; -// uint64 lo_lo; -// }; -// -// =========================================================================== -xdr.struct("UInt256Parts", [ - ["hiHi", xdr.lookup("Uint64")], - ["hiLo", xdr.lookup("Uint64")], - ["loHi", xdr.lookup("Uint64")], - ["loLo", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// struct Int256Parts { -// int64 hi_hi; -// uint64 hi_lo; -// uint64 lo_hi; -// uint64 lo_lo; -// }; -// -// =========================================================================== -xdr.struct("Int256Parts", [ - ["hiHi", xdr.lookup("Int64")], - ["hiLo", xdr.lookup("Uint64")], - ["loHi", xdr.lookup("Uint64")], - ["loLo", xdr.lookup("Uint64")], -]); - -// === xdr source ============================================================ -// -// enum SCContractExecutableType -// { -// SCCONTRACT_EXECUTABLE_WASM_REF = 0, -// SCCONTRACT_EXECUTABLE_TOKEN = 1 -// }; -// -// =========================================================================== -xdr.enum("ScContractExecutableType", { - sccontractExecutableWasmRef: 0, - sccontractExecutableToken: 1, -}); - -// === xdr source ============================================================ -// -// union SCContractExecutable switch (SCContractExecutableType type) -// { -// case SCCONTRACT_EXECUTABLE_WASM_REF: -// Hash wasm_id; -// case SCCONTRACT_EXECUTABLE_TOKEN: -// void; -// }; -// -// =========================================================================== -xdr.union("ScContractExecutable", { - switchOn: xdr.lookup("ScContractExecutableType"), - switchName: "type", - switches: [ - ["sccontractExecutableWasmRef", "wasmId"], - ["sccontractExecutableToken", xdr.void()], - ], - arms: { - wasmId: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// enum SCAddressType -// { -// SC_ADDRESS_TYPE_ACCOUNT = 0, -// SC_ADDRESS_TYPE_CONTRACT = 1 -// }; -// -// =========================================================================== -xdr.enum("ScAddressType", { - scAddressTypeAccount: 0, - scAddressTypeContract: 1, -}); - -// === xdr source ============================================================ -// -// union SCAddress switch (SCAddressType type) -// { -// case SC_ADDRESS_TYPE_ACCOUNT: -// AccountID accountId; -// case SC_ADDRESS_TYPE_CONTRACT: -// Hash contractId; -// }; -// -// =========================================================================== -xdr.union("ScAddress", { - switchOn: xdr.lookup("ScAddressType"), - switchName: "type", - switches: [ - ["scAddressTypeAccount", "accountId"], - ["scAddressTypeContract", "contractId"], - ], - arms: { - accountId: xdr.lookup("AccountId"), - contractId: xdr.lookup("Hash"), - }, -}); - -// === xdr source ============================================================ -// -// const SCVAL_LIMIT = 256000; -// -// =========================================================================== -xdr.const("SCVAL_LIMIT", 256000); - -// === xdr source ============================================================ -// -// const SCSYMBOL_LIMIT = 32; -// -// =========================================================================== -xdr.const("SCSYMBOL_LIMIT", 32); - -// === xdr source ============================================================ -// -// typedef SCVal SCVec; -// -// =========================================================================== -xdr.typedef("ScVec", xdr.varArray(xdr.lookup("ScVal"), xdr.lookup("SCVAL_LIMIT"))); - -// === xdr source ============================================================ -// -// typedef SCMapEntry SCMap; -// -// =========================================================================== -xdr.typedef("ScMap", xdr.varArray(xdr.lookup("ScMapEntry"), xdr.lookup("SCVAL_LIMIT"))); - -// === xdr source ============================================================ -// -// typedef opaque SCBytes; -// -// =========================================================================== -xdr.typedef("ScBytes", xdr.varOpaque(SCVAL_LIMIT)); - -// === xdr source ============================================================ -// -// typedef string SCString; -// -// =========================================================================== -xdr.typedef("ScString", xdr.string(SCVAL_LIMIT)); - -// === xdr source ============================================================ -// -// typedef string SCSymbol; -// -// =========================================================================== -xdr.typedef("ScSymbol", xdr.string(SCSYMBOL_LIMIT)); - -// === xdr source ============================================================ -// -// struct SCNonceKey { -// SCAddress nonce_address; -// }; -// -// =========================================================================== -xdr.struct("ScNonceKey", [ - ["nonceAddress", xdr.lookup("ScAddress")], -]); - -// === xdr source ============================================================ -// -// union SCVal switch (SCValType type) -// { -// -// case SCV_BOOL: -// bool b; -// case SCV_VOID: -// void; -// case SCV_STATUS: -// SCStatus error; -// -// case SCV_U32: -// uint32 u32; -// case SCV_I32: -// int32 i32; -// -// case SCV_U64: -// uint64 u64; -// case SCV_I64: -// int64 i64; -// case SCV_TIMEPOINT: -// TimePoint timepoint; -// case SCV_DURATION: -// Duration duration; -// -// case SCV_U128: -// UInt128Parts u128; -// case SCV_I128: -// Int128Parts i128; -// -// case SCV_U256: -// UInt256Parts u256; -// case SCV_I256: -// Int256Parts i256; -// -// case SCV_BYTES: -// SCBytes bytes; -// case SCV_STRING: -// SCString str; -// case SCV_SYMBOL: -// SCSymbol sym; -// -// // Vec and Map are recursive so need to live -// // behind an option, due to xdrpp limitations. -// case SCV_VEC: -// SCVec *vec; -// case SCV_MAP: -// SCMap *map; -// -// case SCV_CONTRACT_EXECUTABLE: -// SCContractExecutable exec; -// case SCV_ADDRESS: -// SCAddress address; -// -// // Special SCVals reserved for system-constructed contract-data -// // ledger keys, not generally usable elsewhere. -// case SCV_LEDGER_KEY_CONTRACT_EXECUTABLE: -// void; -// case SCV_LEDGER_KEY_NONCE: -// SCNonceKey nonce_key; -// }; -// -// =========================================================================== -xdr.union("ScVal", { - switchOn: xdr.lookup("ScValType"), - switchName: "type", - switches: [ - ["scvBool", "b"], - ["scvVoid", xdr.void()], - ["scvStatus", "error"], - ["scvU32", "u32"], - ["scvI32", "i32"], - ["scvU64", "u64"], - ["scvI64", "i64"], - ["scvTimepoint", "timepoint"], - ["scvDuration", "duration"], - ["scvU128", "u128"], - ["scvI128", "i128"], - ["scvU256", "u256"], - ["scvI256", "i256"], - ["scvBytes", "bytes"], - ["scvString", "str"], - ["scvSymbol", "sym"], - ["scvVec", "vec"], - ["scvMap", "map"], - ["scvContractExecutable", "exec"], - ["scvAddress", "address"], - ["scvLedgerKeyContractExecutable", xdr.void()], - ["scvLedgerKeyNonce", "nonceKey"], - ], - arms: { - b: xdr.bool(), - error: xdr.lookup("ScStatus"), - u32: xdr.lookup("Uint32"), - i32: xdr.lookup("Int32"), - u64: xdr.lookup("Uint64"), - i64: xdr.lookup("Int64"), - timepoint: xdr.lookup("TimePoint"), - duration: xdr.lookup("Duration"), - u128: xdr.lookup("UInt128Parts"), - i128: xdr.lookup("Int128Parts"), - u256: xdr.lookup("UInt256Parts"), - i256: xdr.lookup("Int256Parts"), - bytes: xdr.lookup("ScBytes"), - str: xdr.lookup("ScString"), - sym: xdr.lookup("ScSymbol"), - vec: xdr.option(xdr.lookup("ScVec")), - map: xdr.option(xdr.lookup("ScMap")), - exec: xdr.lookup("ScContractExecutable"), - address: xdr.lookup("ScAddress"), - nonceKey: xdr.lookup("ScNonceKey"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCMapEntry -// { -// SCVal key; -// SCVal val; -// }; -// -// =========================================================================== -xdr.struct("ScMapEntry", [ - ["key", xdr.lookup("ScVal")], - ["val", xdr.lookup("ScVal")], -]); - -// === xdr source ============================================================ -// -// enum SCEnvMetaKind -// { -// SC_ENV_META_KIND_INTERFACE_VERSION = 0 -// }; -// -// =========================================================================== -xdr.enum("ScEnvMetaKind", { - scEnvMetaKindInterfaceVersion: 0, -}); - -// === xdr source ============================================================ -// -// union SCEnvMetaEntry switch (SCEnvMetaKind kind) -// { -// case SC_ENV_META_KIND_INTERFACE_VERSION: -// uint64 interfaceVersion; -// }; -// -// =========================================================================== -xdr.union("ScEnvMetaEntry", { - switchOn: xdr.lookup("ScEnvMetaKind"), - switchName: "kind", - switches: [ - ["scEnvMetaKindInterfaceVersion", "interfaceVersion"], - ], - arms: { - interfaceVersion: xdr.lookup("Uint64"), - }, -}); - -// === xdr source ============================================================ -// -// const SC_SPEC_DOC_LIMIT = 1024; -// -// =========================================================================== -xdr.const("SC_SPEC_DOC_LIMIT", 1024); - -// === xdr source ============================================================ -// -// enum SCSpecType -// { -// SC_SPEC_TYPE_VAL = 0, -// -// // Types with no parameters. -// SC_SPEC_TYPE_BOOL = 1, -// SC_SPEC_TYPE_VOID = 2, -// SC_SPEC_TYPE_STATUS = 3, -// SC_SPEC_TYPE_U32 = 4, -// SC_SPEC_TYPE_I32 = 5, -// SC_SPEC_TYPE_U64 = 6, -// SC_SPEC_TYPE_I64 = 7, -// SC_SPEC_TYPE_TIMEPOINT = 8, -// SC_SPEC_TYPE_DURATION = 9, -// SC_SPEC_TYPE_U128 = 10, -// SC_SPEC_TYPE_I128 = 11, -// SC_SPEC_TYPE_U256 = 12, -// SC_SPEC_TYPE_I256 = 13, -// SC_SPEC_TYPE_BYTES = 14, -// SC_SPEC_TYPE_STRING = 16, -// SC_SPEC_TYPE_SYMBOL = 17, -// SC_SPEC_TYPE_ADDRESS = 19, -// -// // Types with parameters. -// SC_SPEC_TYPE_OPTION = 1000, -// SC_SPEC_TYPE_RESULT = 1001, -// SC_SPEC_TYPE_VEC = 1002, -// SC_SPEC_TYPE_SET = 1003, -// SC_SPEC_TYPE_MAP = 1004, -// SC_SPEC_TYPE_TUPLE = 1005, -// SC_SPEC_TYPE_BYTES_N = 1006, -// -// // User defined types. -// SC_SPEC_TYPE_UDT = 2000 -// }; -// -// =========================================================================== -xdr.enum("ScSpecType", { - scSpecTypeVal: 0, - scSpecTypeBool: 1, - scSpecTypeVoid: 2, - scSpecTypeStatus: 3, - scSpecTypeU32: 4, - scSpecTypeI32: 5, - scSpecTypeU64: 6, - scSpecTypeI64: 7, - scSpecTypeTimepoint: 8, - scSpecTypeDuration: 9, - scSpecTypeU128: 10, - scSpecTypeI128: 11, - scSpecTypeU256: 12, - scSpecTypeI256: 13, - scSpecTypeBytes: 14, - scSpecTypeString: 16, - scSpecTypeSymbol: 17, - scSpecTypeAddress: 19, - scSpecTypeOption: 1000, - scSpecTypeResult: 1001, - scSpecTypeVec: 1002, - scSpecTypeSet: 1003, - scSpecTypeMap: 1004, - scSpecTypeTuple: 1005, - scSpecTypeBytesN: 1006, - scSpecTypeUdt: 2000, -}); - -// === xdr source ============================================================ -// -// struct SCSpecTypeOption -// { -// SCSpecTypeDef valueType; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeOption", [ - ["valueType", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeResult -// { -// SCSpecTypeDef okType; -// SCSpecTypeDef errorType; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeResult", [ - ["okType", xdr.lookup("ScSpecTypeDef")], - ["errorType", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeVec -// { -// SCSpecTypeDef elementType; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeVec", [ - ["elementType", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeMap -// { -// SCSpecTypeDef keyType; -// SCSpecTypeDef valueType; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeMap", [ - ["keyType", xdr.lookup("ScSpecTypeDef")], - ["valueType", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeSet -// { -// SCSpecTypeDef elementType; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeSet", [ - ["elementType", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeTuple -// { -// SCSpecTypeDef valueTypes<12>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeTuple", [ - ["valueTypes", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeBytesN -// { -// uint32 n; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeBytesN", [ - ["n", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecTypeUDT -// { -// string name<60>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecTypeUdt", [ - ["name", xdr.string(60)], -]); - -// === xdr source ============================================================ -// -// union SCSpecTypeDef switch (SCSpecType type) -// { -// case SC_SPEC_TYPE_VAL: -// case SC_SPEC_TYPE_BOOL: -// case SC_SPEC_TYPE_VOID: -// case SC_SPEC_TYPE_STATUS: -// case SC_SPEC_TYPE_U32: -// case SC_SPEC_TYPE_I32: -// case SC_SPEC_TYPE_U64: -// case SC_SPEC_TYPE_I64: -// case SC_SPEC_TYPE_TIMEPOINT: -// case SC_SPEC_TYPE_DURATION: -// case SC_SPEC_TYPE_U128: -// case SC_SPEC_TYPE_I128: -// case SC_SPEC_TYPE_U256: -// case SC_SPEC_TYPE_I256: -// case SC_SPEC_TYPE_BYTES: -// case SC_SPEC_TYPE_STRING: -// case SC_SPEC_TYPE_SYMBOL: -// case SC_SPEC_TYPE_ADDRESS: -// void; -// case SC_SPEC_TYPE_OPTION: -// SCSpecTypeOption option; -// case SC_SPEC_TYPE_RESULT: -// SCSpecTypeResult result; -// case SC_SPEC_TYPE_VEC: -// SCSpecTypeVec vec; -// case SC_SPEC_TYPE_MAP: -// SCSpecTypeMap map; -// case SC_SPEC_TYPE_SET: -// SCSpecTypeSet set; -// case SC_SPEC_TYPE_TUPLE: -// SCSpecTypeTuple tuple; -// case SC_SPEC_TYPE_BYTES_N: -// SCSpecTypeBytesN bytesN; -// case SC_SPEC_TYPE_UDT: -// SCSpecTypeUDT udt; -// }; -// -// =========================================================================== -xdr.union("ScSpecTypeDef", { - switchOn: xdr.lookup("ScSpecType"), - switchName: "type", - switches: [ - ["scSpecTypeVal", xdr.void()], - ["scSpecTypeBool", xdr.void()], - ["scSpecTypeVoid", xdr.void()], - ["scSpecTypeStatus", xdr.void()], - ["scSpecTypeU32", xdr.void()], - ["scSpecTypeI32", xdr.void()], - ["scSpecTypeU64", xdr.void()], - ["scSpecTypeI64", xdr.void()], - ["scSpecTypeTimepoint", xdr.void()], - ["scSpecTypeDuration", xdr.void()], - ["scSpecTypeU128", xdr.void()], - ["scSpecTypeI128", xdr.void()], - ["scSpecTypeU256", xdr.void()], - ["scSpecTypeI256", xdr.void()], - ["scSpecTypeBytes", xdr.void()], - ["scSpecTypeString", xdr.void()], - ["scSpecTypeSymbol", xdr.void()], - ["scSpecTypeAddress", xdr.void()], - ["scSpecTypeOption", "option"], - ["scSpecTypeResult", "result"], - ["scSpecTypeVec", "vec"], - ["scSpecTypeMap", "map"], - ["scSpecTypeSet", "set"], - ["scSpecTypeTuple", "tuple"], - ["scSpecTypeBytesN", "bytesN"], - ["scSpecTypeUdt", "udt"], - ], - arms: { - option: xdr.lookup("ScSpecTypeOption"), - result: xdr.lookup("ScSpecTypeResult"), - vec: xdr.lookup("ScSpecTypeVec"), - map: xdr.lookup("ScSpecTypeMap"), - set: xdr.lookup("ScSpecTypeSet"), - tuple: xdr.lookup("ScSpecTypeTuple"), - bytesN: xdr.lookup("ScSpecTypeBytesN"), - udt: xdr.lookup("ScSpecTypeUdt"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCSpecUDTStructFieldV0 -// { -// string doc; -// string name<30>; -// SCSpecTypeDef type; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtStructFieldV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(30)], - ["type", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTStructV0 -// { -// string doc; -// string lib<80>; -// string name<60>; -// SCSpecUDTStructFieldV0 fields<40>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtStructV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["lib", xdr.string(80)], - ["name", xdr.string(60)], - ["fields", xdr.varArray(xdr.lookup("ScSpecUdtStructFieldV0"), 40)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTUnionCaseVoidV0 -// { -// string doc; -// string name<60>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtUnionCaseVoidV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(60)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTUnionCaseTupleV0 -// { -// string doc; -// string name<60>; -// SCSpecTypeDef type<12>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtUnionCaseTupleV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(60)], - ["type", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], -]); - -// === xdr source ============================================================ -// -// enum SCSpecUDTUnionCaseV0Kind -// { -// SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0, -// SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1 -// }; -// -// =========================================================================== -xdr.enum("ScSpecUdtUnionCaseV0Kind", { - scSpecUdtUnionCaseVoidV0: 0, - scSpecUdtUnionCaseTupleV0: 1, -}); - -// === xdr source ============================================================ -// -// union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind) -// { -// case SC_SPEC_UDT_UNION_CASE_VOID_V0: -// SCSpecUDTUnionCaseVoidV0 voidCase; -// case SC_SPEC_UDT_UNION_CASE_TUPLE_V0: -// SCSpecUDTUnionCaseTupleV0 tupleCase; -// }; -// -// =========================================================================== -xdr.union("ScSpecUdtUnionCaseV0", { - switchOn: xdr.lookup("ScSpecUdtUnionCaseV0Kind"), - switchName: "kind", - switches: [ - ["scSpecUdtUnionCaseVoidV0", "voidCase"], - ["scSpecUdtUnionCaseTupleV0", "tupleCase"], - ], - arms: { - voidCase: xdr.lookup("ScSpecUdtUnionCaseVoidV0"), - tupleCase: xdr.lookup("ScSpecUdtUnionCaseTupleV0"), - }, -}); - -// === xdr source ============================================================ -// -// struct SCSpecUDTUnionV0 -// { -// string doc; -// string lib<80>; -// string name<60>; -// SCSpecUDTUnionCaseV0 cases<50>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtUnionV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["lib", xdr.string(80)], - ["name", xdr.string(60)], - ["cases", xdr.varArray(xdr.lookup("ScSpecUdtUnionCaseV0"), 50)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTEnumCaseV0 -// { -// string doc; -// string name<60>; -// uint32 value; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtEnumCaseV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(60)], - ["value", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTEnumV0 -// { -// string doc; -// string lib<80>; -// string name<60>; -// SCSpecUDTEnumCaseV0 cases<50>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtEnumV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["lib", xdr.string(80)], - ["name", xdr.string(60)], - ["cases", xdr.varArray(xdr.lookup("ScSpecUdtEnumCaseV0"), 50)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTErrorEnumCaseV0 -// { -// string doc; -// string name<60>; -// uint32 value; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtErrorEnumCaseV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(60)], - ["value", xdr.lookup("Uint32")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecUDTErrorEnumV0 -// { -// string doc; -// string lib<80>; -// string name<60>; -// SCSpecUDTErrorEnumCaseV0 cases<50>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecUdtErrorEnumV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["lib", xdr.string(80)], - ["name", xdr.string(60)], - ["cases", xdr.varArray(xdr.lookup("ScSpecUdtErrorEnumCaseV0"), 50)], -]); - -// === xdr source ============================================================ -// -// struct SCSpecFunctionInputV0 -// { -// string doc; -// string name<30>; -// SCSpecTypeDef type; -// }; -// -// =========================================================================== -xdr.struct("ScSpecFunctionInputV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.string(30)], - ["type", xdr.lookup("ScSpecTypeDef")], -]); - -// === xdr source ============================================================ -// -// struct SCSpecFunctionV0 -// { -// string doc; -// SCSymbol name; -// SCSpecFunctionInputV0 inputs<10>; -// SCSpecTypeDef outputs<1>; -// }; -// -// =========================================================================== -xdr.struct("ScSpecFunctionV0", [ - ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], - ["name", xdr.lookup("ScSymbol")], - ["inputs", xdr.varArray(xdr.lookup("ScSpecFunctionInputV0"), 10)], - ["outputs", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 1)], -]); - -// === xdr source ============================================================ -// -// enum SCSpecEntryKind -// { -// SC_SPEC_ENTRY_FUNCTION_V0 = 0, -// SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, -// SC_SPEC_ENTRY_UDT_UNION_V0 = 2, -// SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, -// SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 -// }; -// -// =========================================================================== -xdr.enum("ScSpecEntryKind", { - scSpecEntryFunctionV0: 0, - scSpecEntryUdtStructV0: 1, - scSpecEntryUdtUnionV0: 2, - scSpecEntryUdtEnumV0: 3, - scSpecEntryUdtErrorEnumV0: 4, -}); - -// === xdr source ============================================================ -// -// union SCSpecEntry switch (SCSpecEntryKind kind) -// { -// case SC_SPEC_ENTRY_FUNCTION_V0: -// SCSpecFunctionV0 functionV0; -// case SC_SPEC_ENTRY_UDT_STRUCT_V0: -// SCSpecUDTStructV0 udtStructV0; -// case SC_SPEC_ENTRY_UDT_UNION_V0: -// SCSpecUDTUnionV0 udtUnionV0; -// case SC_SPEC_ENTRY_UDT_ENUM_V0: -// SCSpecUDTEnumV0 udtEnumV0; -// case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: -// SCSpecUDTErrorEnumV0 udtErrorEnumV0; -// }; -// -// =========================================================================== -xdr.union("ScSpecEntry", { - switchOn: xdr.lookup("ScSpecEntryKind"), - switchName: "kind", - switches: [ - ["scSpecEntryFunctionV0", "functionV0"], - ["scSpecEntryUdtStructV0", "udtStructV0"], - ["scSpecEntryUdtUnionV0", "udtUnionV0"], - ["scSpecEntryUdtEnumV0", "udtEnumV0"], - ["scSpecEntryUdtErrorEnumV0", "udtErrorEnumV0"], - ], - arms: { - functionV0: xdr.lookup("ScSpecFunctionV0"), - udtStructV0: xdr.lookup("ScSpecUdtStructV0"), - udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), - udtEnumV0: xdr.lookup("ScSpecUdtEnumV0"), - udtErrorEnumV0: xdr.lookup("ScSpecUdtErrorEnumV0"), - }, -}); - +import * as XDR from "js-xdr"; + +var types = XDR.config((xdr) => { + // Workaround for https://github.com/stellar/xdrgen/issues/152 + // + // The "correct" way would be to replace bare instances of each constant with + // xdr.lookup("..."), but that's more error-prone. + const SCSYMBOL_LIMIT = 32; + const SC_SPEC_DOC_LIMIT = 1024; + + // === xdr source ============================================================ + // + // typedef opaque Value<>; + // + // =========================================================================== + xdr.typedef("Value", xdr.varOpaque()); + + // === xdr source ============================================================ + // + // struct SCPBallot + // { + // uint32 counter; // n + // Value value; // x + // }; + // + // =========================================================================== + xdr.struct("ScpBallot", [ + ["counter", xdr.lookup("Uint32")], + ["value", xdr.lookup("Value")], + ]); + + // === xdr source ============================================================ + // + // enum SCPStatementType + // { + // SCP_ST_PREPARE = 0, + // SCP_ST_CONFIRM = 1, + // SCP_ST_EXTERNALIZE = 2, + // SCP_ST_NOMINATE = 3 + // }; + // + // =========================================================================== + xdr.enum("ScpStatementType", { + scpStPrepare: 0, + scpStConfirm: 1, + scpStExternalize: 2, + scpStNominate: 3, + }); + + // === xdr source ============================================================ + // + // struct SCPNomination + // { + // Hash quorumSetHash; // D + // Value votes<>; // X + // Value accepted<>; // Y + // }; + // + // =========================================================================== + xdr.struct("ScpNomination", [ + ["quorumSetHash", xdr.lookup("Hash")], + ["votes", xdr.varArray(xdr.lookup("Value"), 2147483647)], + ["accepted", xdr.varArray(xdr.lookup("Value"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } + // + // =========================================================================== + xdr.struct("ScpStatementPrepare", [ + ["quorumSetHash", xdr.lookup("Hash")], + ["ballot", xdr.lookup("ScpBallot")], + ["prepared", xdr.option(xdr.lookup("ScpBallot"))], + ["preparedPrime", xdr.option(xdr.lookup("ScpBallot"))], + ["nC", xdr.lookup("Uint32")], + ["nH", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } + // + // =========================================================================== + xdr.struct("ScpStatementConfirm", [ + ["ballot", xdr.lookup("ScpBallot")], + ["nPrepared", xdr.lookup("Uint32")], + ["nCommit", xdr.lookup("Uint32")], + ["nH", xdr.lookup("Uint32")], + ["quorumSetHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } + // + // =========================================================================== + xdr.struct("ScpStatementExternalize", [ + ["commit", xdr.lookup("ScpBallot")], + ["nH", xdr.lookup("Uint32")], + ["commitQuorumSetHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // union switch (SCPStatementType type) + // { + // case SCP_ST_PREPARE: + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } prepare; + // case SCP_ST_CONFIRM: + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } confirm; + // case SCP_ST_EXTERNALIZE: + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } externalize; + // case SCP_ST_NOMINATE: + // SCPNomination nominate; + // } + // + // =========================================================================== + xdr.union("ScpStatementPledges", { + switchOn: xdr.lookup("ScpStatementType"), + switchName: "type", + switches: [ + ["scpStPrepare", "prepare"], + ["scpStConfirm", "confirm"], + ["scpStExternalize", "externalize"], + ["scpStNominate", "nominate"], + ], + arms: { + prepare: xdr.lookup("ScpStatementPrepare"), + confirm: xdr.lookup("ScpStatementConfirm"), + externalize: xdr.lookup("ScpStatementExternalize"), + nominate: xdr.lookup("ScpNomination"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCPStatement + // { + // NodeID nodeID; // v + // uint64 slotIndex; // i + // + // union switch (SCPStatementType type) + // { + // case SCP_ST_PREPARE: + // struct + // { + // Hash quorumSetHash; // D + // SCPBallot ballot; // b + // SCPBallot* prepared; // p + // SCPBallot* preparedPrime; // p' + // uint32 nC; // c.n + // uint32 nH; // h.n + // } prepare; + // case SCP_ST_CONFIRM: + // struct + // { + // SCPBallot ballot; // b + // uint32 nPrepared; // p.n + // uint32 nCommit; // c.n + // uint32 nH; // h.n + // Hash quorumSetHash; // D + // } confirm; + // case SCP_ST_EXTERNALIZE: + // struct + // { + // SCPBallot commit; // c + // uint32 nH; // h.n + // Hash commitQuorumSetHash; // D used before EXTERNALIZE + // } externalize; + // case SCP_ST_NOMINATE: + // SCPNomination nominate; + // } + // pledges; + // }; + // + // =========================================================================== + xdr.struct("ScpStatement", [ + ["nodeId", xdr.lookup("NodeId")], + ["slotIndex", xdr.lookup("Uint64")], + ["pledges", xdr.lookup("ScpStatementPledges")], + ]); + + // === xdr source ============================================================ + // + // struct SCPEnvelope + // { + // SCPStatement statement; + // Signature signature; + // }; + // + // =========================================================================== + xdr.struct("ScpEnvelope", [ + ["statement", xdr.lookup("ScpStatement")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // struct SCPQuorumSet + // { + // uint32 threshold; + // NodeID validators<>; + // SCPQuorumSet innerSets<>; + // }; + // + // =========================================================================== + xdr.struct("ScpQuorumSet", [ + ["threshold", xdr.lookup("Uint32")], + ["validators", xdr.varArray(xdr.lookup("NodeId"), 2147483647)], + ["innerSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // typedef opaque Thresholds[4]; + // + // =========================================================================== + xdr.typedef("Thresholds", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef string string32<32>; + // + // =========================================================================== + xdr.typedef("String32", xdr.string(32)); + + // === xdr source ============================================================ + // + // typedef string string64<64>; + // + // =========================================================================== + xdr.typedef("String64", xdr.string(64)); + + // === xdr source ============================================================ + // + // typedef int64 SequenceNumber; + // + // =========================================================================== + xdr.typedef("SequenceNumber", xdr.lookup("Int64")); + + // === xdr source ============================================================ + // + // typedef opaque DataValue<64>; + // + // =========================================================================== + xdr.typedef("DataValue", xdr.varOpaque(64)); + + // === xdr source ============================================================ + // + // typedef Hash PoolID; + // + // =========================================================================== + xdr.typedef("PoolId", xdr.lookup("Hash")); + + // === xdr source ============================================================ + // + // typedef opaque AssetCode4[4]; + // + // =========================================================================== + xdr.typedef("AssetCode4", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef opaque AssetCode12[12]; + // + // =========================================================================== + xdr.typedef("AssetCode12", xdr.opaque(12)); + + // === xdr source ============================================================ + // + // enum AssetType + // { + // ASSET_TYPE_NATIVE = 0, + // ASSET_TYPE_CREDIT_ALPHANUM4 = 1, + // ASSET_TYPE_CREDIT_ALPHANUM12 = 2, + // ASSET_TYPE_POOL_SHARE = 3 + // }; + // + // =========================================================================== + xdr.enum("AssetType", { + assetTypeNative: 0, + assetTypeCreditAlphanum4: 1, + assetTypeCreditAlphanum12: 2, + assetTypePoolShare: 3, + }); + + // === xdr source ============================================================ + // + // union AssetCode switch (AssetType type) + // { + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AssetCode4 assetCode4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AssetCode12 assetCode12; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("AssetCode", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeCreditAlphanum4", "assetCode4"], + ["assetTypeCreditAlphanum12", "assetCode12"], + ], + arms: { + assetCode4: xdr.lookup("AssetCode4"), + assetCode12: xdr.lookup("AssetCode12"), + }, + }); + + // === xdr source ============================================================ + // + // struct AlphaNum4 + // { + // AssetCode4 assetCode; + // AccountID issuer; + // }; + // + // =========================================================================== + xdr.struct("AlphaNum4", [ + ["assetCode", xdr.lookup("AssetCode4")], + ["issuer", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // struct AlphaNum12 + // { + // AssetCode12 assetCode; + // AccountID issuer; + // }; + // + // =========================================================================== + xdr.struct("AlphaNum12", [ + ["assetCode", xdr.lookup("AssetCode12")], + ["issuer", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // union Asset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("Asset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + }, + }); + + // === xdr source ============================================================ + // + // struct Price + // { + // int32 n; // numerator + // int32 d; // denominator + // }; + // + // =========================================================================== + xdr.struct("Price", [ + ["n", xdr.lookup("Int32")], + ["d", xdr.lookup("Int32")], + ]); + + // === xdr source ============================================================ + // + // struct Liabilities + // { + // int64 buying; + // int64 selling; + // }; + // + // =========================================================================== + xdr.struct("Liabilities", [ + ["buying", xdr.lookup("Int64")], + ["selling", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum ThresholdIndexes + // { + // THRESHOLD_MASTER_WEIGHT = 0, + // THRESHOLD_LOW = 1, + // THRESHOLD_MED = 2, + // THRESHOLD_HIGH = 3 + // }; + // + // =========================================================================== + xdr.enum("ThresholdIndices", { + thresholdMasterWeight: 0, + thresholdLow: 1, + thresholdMed: 2, + thresholdHigh: 3, + }); + + // === xdr source ============================================================ + // + // enum LedgerEntryType + // { + // ACCOUNT = 0, + // TRUSTLINE = 1, + // OFFER = 2, + // DATA = 3, + // CLAIMABLE_BALANCE = 4, + // LIQUIDITY_POOL = 5, + // CONTRACT_DATA = 6, + // CONTRACT_CODE = 7, + // CONFIG_SETTING = 8, + // EXPIRATION = 9 + // }; + // + // =========================================================================== + xdr.enum("LedgerEntryType", { + account: 0, + trustline: 1, + offer: 2, + data: 3, + claimableBalance: 4, + liquidityPool: 5, + contractData: 6, + contractCode: 7, + configSetting: 8, + expiration: 9, + }); + + // === xdr source ============================================================ + // + // struct Signer + // { + // SignerKey key; + // uint32 weight; // really only need 1 byte + // }; + // + // =========================================================================== + xdr.struct("Signer", [ + ["key", xdr.lookup("SignerKey")], + ["weight", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // enum AccountFlags + // { // masks for each flag + // + // // Flags set on issuer accounts + // // TrustLines are created with authorized set to "false" requiring + // // the issuer to set it for each TrustLine + // AUTH_REQUIRED_FLAG = 0x1, + // // If set, the authorized flag in TrustLines can be cleared + // // otherwise, authorization cannot be revoked + // AUTH_REVOCABLE_FLAG = 0x2, + // // Once set, causes all AUTH_* flags to be read-only + // AUTH_IMMUTABLE_FLAG = 0x4, + // // Trustlines are created with clawback enabled set to "true", + // // and claimable balances created from those trustlines are created + // // with clawback enabled set to "true" + // AUTH_CLAWBACK_ENABLED_FLAG = 0x8 + // }; + // + // =========================================================================== + xdr.enum("AccountFlags", { + authRequiredFlag: 1, + authRevocableFlag: 2, + authImmutableFlag: 4, + authClawbackEnabledFlag: 8, + }); + + // === xdr source ============================================================ + // + // const MASK_ACCOUNT_FLAGS = 0x7; + // + // =========================================================================== + xdr.const("MASK_ACCOUNT_FLAGS", 0x7); + + // === xdr source ============================================================ + // + // const MASK_ACCOUNT_FLAGS_V17 = 0xF; + // + // =========================================================================== + xdr.const("MASK_ACCOUNT_FLAGS_V17", 0xf); + + // === xdr source ============================================================ + // + // const MAX_SIGNERS = 20; + // + // =========================================================================== + xdr.const("MAX_SIGNERS", 20); + + // === xdr source ============================================================ + // + // typedef AccountID* SponsorshipDescriptor; + // + // =========================================================================== + xdr.typedef("SponsorshipDescriptor", xdr.option(xdr.lookup("AccountId"))); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV3 + // { + // // We can use this to add more fields, or because it is first, to + // // change AccountEntryExtensionV3 into a union. + // ExtensionPoint ext; + // + // // Ledger number at which `seqNum` took on its present value. + // uint32 seqLedger; + // + // // Time at which `seqNum` took on its present value. + // TimePoint seqTime; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV3", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["seqLedger", xdr.lookup("Uint32")], + ["seqTime", xdr.lookup("TimePoint")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 3: + // AccountEntryExtensionV3 v3; + // } + // + // =========================================================================== + xdr.union("AccountEntryExtensionV2Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [3, "v3"], + ], + arms: { + v3: xdr.lookup("AccountEntryExtensionV3"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV2 + // { + // uint32 numSponsored; + // uint32 numSponsoring; + // SponsorshipDescriptor signerSponsoringIDs; + // + // union switch (int v) + // { + // case 0: + // void; + // case 3: + // AccountEntryExtensionV3 v3; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV2", [ + ["numSponsored", xdr.lookup("Uint32")], + ["numSponsoring", xdr.lookup("Uint32")], + [ + "signerSponsoringIDs", + xdr.varArray( + xdr.lookup("SponsorshipDescriptor"), + xdr.lookup("MAX_SIGNERS") + ), + ], + ["ext", xdr.lookup("AccountEntryExtensionV2Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // AccountEntryExtensionV2 v2; + // } + // + // =========================================================================== + xdr.union("AccountEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [2, "v2"], + ], + arms: { + v2: xdr.lookup("AccountEntryExtensionV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntryExtensionV1 + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // AccountEntryExtensionV2 v2; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntryExtensionV1", [ + ["liabilities", xdr.lookup("Liabilities")], + ["ext", xdr.lookup("AccountEntryExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // AccountEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("AccountEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("AccountEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct AccountEntry + // { + // AccountID accountID; // master public key for this account + // int64 balance; // in stroops + // SequenceNumber seqNum; // last sequence number used for this account + // uint32 numSubEntries; // number of sub-entries this account has + // // drives the reserve + // AccountID* inflationDest; // Account to vote for during inflation + // uint32 flags; // see AccountFlags + // + // string32 homeDomain; // can be used for reverse federation and memo lookup + // + // // fields used for signatures + // // thresholds stores unsigned bytes: [weight of master|low|medium|high] + // Thresholds thresholds; + // + // Signer signers; // possible signers for this account + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // AccountEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("AccountEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["balance", xdr.lookup("Int64")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["numSubEntries", xdr.lookup("Uint32")], + ["inflationDest", xdr.option(xdr.lookup("AccountId"))], + ["flags", xdr.lookup("Uint32")], + ["homeDomain", xdr.lookup("String32")], + ["thresholds", xdr.lookup("Thresholds")], + ["signers", xdr.varArray(xdr.lookup("Signer"), xdr.lookup("MAX_SIGNERS"))], + ["ext", xdr.lookup("AccountEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum TrustLineFlags + // { + // // issuer has authorized account to perform transactions with its credit + // AUTHORIZED_FLAG = 1, + // // issuer has authorized account to maintain and reduce liabilities for its + // // credit + // AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, + // // issuer has specified that it may clawback its credit, and that claimable + // // balances created with its credit may also be clawed back + // TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 + // }; + // + // =========================================================================== + xdr.enum("TrustLineFlags", { + authorizedFlag: 1, + authorizedToMaintainLiabilitiesFlag: 2, + trustlineClawbackEnabledFlag: 4, + }); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS = 1; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS", 1); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS_V13 = 3; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS_V13", 3); + + // === xdr source ============================================================ + // + // const MASK_TRUSTLINE_FLAGS_V17 = 7; + // + // =========================================================================== + xdr.const("MASK_TRUSTLINE_FLAGS_V17", 7); + + // === xdr source ============================================================ + // + // enum LiquidityPoolType + // { + // LIQUIDITY_POOL_CONSTANT_PRODUCT = 0 + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolType", { + liquidityPoolConstantProduct: 0, + }); + + // === xdr source ============================================================ + // + // union TrustLineAsset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // case ASSET_TYPE_POOL_SHARE: + // PoolID liquidityPoolID; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("TrustLineAsset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ["assetTypePoolShare", "liquidityPoolId"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + liquidityPoolId: xdr.lookup("PoolId"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryExtensionV2Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TrustLineEntryExtensionV2 + // { + // int32 liquidityPoolUseCount; + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TrustLineEntryExtensionV2", [ + ["liquidityPoolUseCount", xdr.lookup("Int32")], + ["ext", xdr.lookup("TrustLineEntryExtensionV2Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [2, "v2"], + ], + arms: { + v2: xdr.lookup("TrustLineEntryExtensionV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } + // + // =========================================================================== + xdr.struct("TrustLineEntryV1", [ + ["liabilities", xdr.lookup("Liabilities")], + ["ext", xdr.lookup("TrustLineEntryV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } v1; + // } + // + // =========================================================================== + xdr.union("TrustLineEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("TrustLineEntryV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct TrustLineEntry + // { + // AccountID accountID; // account this trustline belongs to + // TrustLineAsset asset; // type of asset (with issuer) + // int64 balance; // how much of this asset the user has. + // // Asset defines the unit for this; + // + // int64 limit; // balance cannot be above this + // uint32 flags; // see TrustLineFlags + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // struct + // { + // Liabilities liabilities; + // + // union switch (int v) + // { + // case 0: + // void; + // case 2: + // TrustLineEntryExtensionV2 v2; + // } + // ext; + // } v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TrustLineEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["asset", xdr.lookup("TrustLineAsset")], + ["balance", xdr.lookup("Int64")], + ["limit", xdr.lookup("Int64")], + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("TrustLineEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum OfferEntryFlags + // { + // // an offer with this flag will not act on and take a reverse offer of equal + // // price + // PASSIVE_FLAG = 1 + // }; + // + // =========================================================================== + xdr.enum("OfferEntryFlags", { + passiveFlag: 1, + }); + + // === xdr source ============================================================ + // + // const MASK_OFFERENTRY_FLAGS = 1; + // + // =========================================================================== + xdr.const("MASK_OFFERENTRY_FLAGS", 1); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("OfferEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct OfferEntry + // { + // AccountID sellerID; + // int64 offerID; + // Asset selling; // A + // Asset buying; // B + // int64 amount; // amount of A + // + // /* price for this offer: + // price of A in terms of B + // price=AmountB/AmountA=priceNumerator/priceDenominator + // price is after fees + // */ + // Price price; + // uint32 flags; // see OfferEntryFlags + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("OfferEntry", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("OfferEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("DataEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct DataEntry + // { + // AccountID accountID; // account this data belongs to + // string64 dataName; + // DataValue dataValue; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("DataEntry", [ + ["accountId", xdr.lookup("AccountId")], + ["dataName", xdr.lookup("String64")], + ["dataValue", xdr.lookup("DataValue")], + ["ext", xdr.lookup("DataEntryExt")], + ]); + + // === xdr source ============================================================ + // + // enum ClaimPredicateType + // { + // CLAIM_PREDICATE_UNCONDITIONAL = 0, + // CLAIM_PREDICATE_AND = 1, + // CLAIM_PREDICATE_OR = 2, + // CLAIM_PREDICATE_NOT = 3, + // CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, + // CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 + // }; + // + // =========================================================================== + xdr.enum("ClaimPredicateType", { + claimPredicateUnconditional: 0, + claimPredicateAnd: 1, + claimPredicateOr: 2, + claimPredicateNot: 3, + claimPredicateBeforeAbsoluteTime: 4, + claimPredicateBeforeRelativeTime: 5, + }); + + // === xdr source ============================================================ + // + // union ClaimPredicate switch (ClaimPredicateType type) + // { + // case CLAIM_PREDICATE_UNCONDITIONAL: + // void; + // case CLAIM_PREDICATE_AND: + // ClaimPredicate andPredicates<2>; + // case CLAIM_PREDICATE_OR: + // ClaimPredicate orPredicates<2>; + // case CLAIM_PREDICATE_NOT: + // ClaimPredicate* notPredicate; + // case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: + // int64 absBefore; // Predicate will be true if closeTime < absBefore + // case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: + // int64 relBefore; // Seconds since closeTime of the ledger in which the + // // ClaimableBalanceEntry was created + // }; + // + // =========================================================================== + xdr.union("ClaimPredicate", { + switchOn: xdr.lookup("ClaimPredicateType"), + switchName: "type", + switches: [ + ["claimPredicateUnconditional", xdr.void()], + ["claimPredicateAnd", "andPredicates"], + ["claimPredicateOr", "orPredicates"], + ["claimPredicateNot", "notPredicate"], + ["claimPredicateBeforeAbsoluteTime", "absBefore"], + ["claimPredicateBeforeRelativeTime", "relBefore"], + ], + arms: { + andPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), + orPredicates: xdr.varArray(xdr.lookup("ClaimPredicate"), 2), + notPredicate: xdr.option(xdr.lookup("ClaimPredicate")), + absBefore: xdr.lookup("Int64"), + relBefore: xdr.lookup("Int64"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimantType + // { + // CLAIMANT_TYPE_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ClaimantType", { + claimantTypeV0: 0, + }); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID destination; // The account that can use this condition + // ClaimPredicate predicate; // Claimable if predicate is true + // } + // + // =========================================================================== + xdr.struct("ClaimantV0", [ + ["destination", xdr.lookup("AccountId")], + ["predicate", xdr.lookup("ClaimPredicate")], + ]); + + // === xdr source ============================================================ + // + // union Claimant switch (ClaimantType type) + // { + // case CLAIMANT_TYPE_V0: + // struct + // { + // AccountID destination; // The account that can use this condition + // ClaimPredicate predicate; // Claimable if predicate is true + // } v0; + // }; + // + // =========================================================================== + xdr.union("Claimant", { + switchOn: xdr.lookup("ClaimantType"), + switchName: "type", + switches: [["claimantTypeV0", "v0"]], + arms: { + v0: xdr.lookup("ClaimantV0"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimableBalanceIDType + // { + // CLAIMABLE_BALANCE_ID_TYPE_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ClaimableBalanceIdType", { + claimableBalanceIdTypeV0: 0, + }); + + // === xdr source ============================================================ + // + // union ClaimableBalanceID switch (ClaimableBalanceIDType type) + // { + // case CLAIMABLE_BALANCE_ID_TYPE_V0: + // Hash v0; + // }; + // + // =========================================================================== + xdr.union("ClaimableBalanceId", { + switchOn: xdr.lookup("ClaimableBalanceIdType"), + switchName: "type", + switches: [["claimableBalanceIdTypeV0", "v0"]], + arms: { + v0: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimableBalanceFlags + // { + // // If set, the issuer account of the asset held by the claimable balance may + // // clawback the claimable balance + // CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1 + // }; + // + // =========================================================================== + xdr.enum("ClaimableBalanceFlags", { + claimableBalanceClawbackEnabledFlag: 1, + }); + + // === xdr source ============================================================ + // + // const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1; + // + // =========================================================================== + xdr.const("MASK_CLAIMABLE_BALANCE_FLAGS", 0x1); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("ClaimableBalanceEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct ClaimableBalanceEntryExtensionV1 + // { + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // + // uint32 flags; // see ClaimableBalanceFlags + // }; + // + // =========================================================================== + xdr.struct("ClaimableBalanceEntryExtensionV1", [ + ["ext", xdr.lookup("ClaimableBalanceEntryExtensionV1Ext")], + ["flags", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // ClaimableBalanceEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("ClaimableBalanceEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("ClaimableBalanceEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct ClaimableBalanceEntry + // { + // // Unique identifier for this ClaimableBalanceEntry + // ClaimableBalanceID balanceID; + // + // // List of claimants with associated predicate + // Claimant claimants<10>; + // + // // Any asset including native + // Asset asset; + // + // // Amount of asset + // int64 amount; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // ClaimableBalanceEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("ClaimableBalanceEntry", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["ext", xdr.lookup("ClaimableBalanceEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct LiquidityPoolConstantProductParameters + // { + // Asset assetA; // assetA < assetB + // Asset assetB; + // int32 fee; // Fee is in basis points, so the actual rate is (fee/100)% + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolConstantProductParameters", [ + ["assetA", xdr.lookup("Asset")], + ["assetB", xdr.lookup("Asset")], + ["fee", xdr.lookup("Int32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } + // + // =========================================================================== + xdr.struct("LiquidityPoolEntryConstantProduct", [ + ["params", xdr.lookup("LiquidityPoolConstantProductParameters")], + ["reserveA", xdr.lookup("Int64")], + ["reserveB", xdr.lookup("Int64")], + ["totalPoolShares", xdr.lookup("Int64")], + ["poolSharesTrustLineCount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } constantProduct; + // } + // + // =========================================================================== + xdr.union("LiquidityPoolEntryBody", { + switchOn: xdr.lookup("LiquidityPoolType"), + switchName: "type", + switches: [["liquidityPoolConstantProduct", "constantProduct"]], + arms: { + constantProduct: xdr.lookup("LiquidityPoolEntryConstantProduct"), + }, + }); + + // === xdr source ============================================================ + // + // struct LiquidityPoolEntry + // { + // PoolID liquidityPoolID; + // + // union switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // struct + // { + // LiquidityPoolConstantProductParameters params; + // + // int64 reserveA; // amount of A in the pool + // int64 reserveB; // amount of B in the pool + // int64 totalPoolShares; // total number of pool shares issued + // int64 poolSharesTrustLineCount; // number of trust lines for the + // // associated pool shares + // } constantProduct; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolEntry", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["body", xdr.lookup("LiquidityPoolEntryBody")], + ]); + + // === xdr source ============================================================ + // + // enum ContractDataDurability { + // TEMPORARY = 0, + // PERSISTENT = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractDataDurability", { + temporary: 0, + persistent: 1, + }); + + // === xdr source ============================================================ + // + // struct ContractDataEntry { + // ExtensionPoint ext; + // + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // SCVal val; + // }; + // + // =========================================================================== + xdr.struct("ContractDataEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["contract", xdr.lookup("ScAddress")], + ["key", xdr.lookup("ScVal")], + ["durability", xdr.lookup("ContractDataDurability")], + ["val", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // struct ContractCodeEntry { + // ExtensionPoint ext; + // + // Hash hash; + // opaque code<>; + // }; + // + // =========================================================================== + xdr.struct("ContractCodeEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["hash", xdr.lookup("Hash")], + ["code", xdr.varOpaque()], + ]); + + // === xdr source ============================================================ + // + // struct ExpirationEntry { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // uint32 expirationLedgerSeq; + // }; + // + // =========================================================================== + xdr.struct("ExpirationEntry", [ + ["keyHash", xdr.lookup("Hash")], + ["expirationLedgerSeq", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerEntryExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerEntryExtensionV1 + // { + // SponsorshipDescriptor sponsoringID; + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerEntryExtensionV1", [ + ["sponsoringId", xdr.lookup("SponsorshipDescriptor")], + ["ext", xdr.lookup("LedgerEntryExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (LedgerEntryType type) + // { + // case ACCOUNT: + // AccountEntry account; + // case TRUSTLINE: + // TrustLineEntry trustLine; + // case OFFER: + // OfferEntry offer; + // case DATA: + // DataEntry data; + // case CLAIMABLE_BALANCE: + // ClaimableBalanceEntry claimableBalance; + // case LIQUIDITY_POOL: + // LiquidityPoolEntry liquidityPool; + // case CONTRACT_DATA: + // ContractDataEntry contractData; + // case CONTRACT_CODE: + // ContractCodeEntry contractCode; + // case CONFIG_SETTING: + // ConfigSettingEntry configSetting; + // case EXPIRATION: + // ExpirationEntry expiration; + // } + // + // =========================================================================== + xdr.union("LedgerEntryData", { + switchOn: xdr.lookup("LedgerEntryType"), + switchName: "type", + switches: [ + ["account", "account"], + ["trustline", "trustLine"], + ["offer", "offer"], + ["data", "data"], + ["claimableBalance", "claimableBalance"], + ["liquidityPool", "liquidityPool"], + ["contractData", "contractData"], + ["contractCode", "contractCode"], + ["configSetting", "configSetting"], + ["expiration", "expiration"], + ], + arms: { + account: xdr.lookup("AccountEntry"), + trustLine: xdr.lookup("TrustLineEntry"), + offer: xdr.lookup("OfferEntry"), + data: xdr.lookup("DataEntry"), + claimableBalance: xdr.lookup("ClaimableBalanceEntry"), + liquidityPool: xdr.lookup("LiquidityPoolEntry"), + contractData: xdr.lookup("ContractDataEntry"), + contractCode: xdr.lookup("ContractCodeEntry"), + configSetting: xdr.lookup("ConfigSettingEntry"), + expiration: xdr.lookup("ExpirationEntry"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerEntryExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("LedgerEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("LedgerEntryExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerEntry + // { + // uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed + // + // union switch (LedgerEntryType type) + // { + // case ACCOUNT: + // AccountEntry account; + // case TRUSTLINE: + // TrustLineEntry trustLine; + // case OFFER: + // OfferEntry offer; + // case DATA: + // DataEntry data; + // case CLAIMABLE_BALANCE: + // ClaimableBalanceEntry claimableBalance; + // case LIQUIDITY_POOL: + // LiquidityPoolEntry liquidityPool; + // case CONTRACT_DATA: + // ContractDataEntry contractData; + // case CONTRACT_CODE: + // ContractCodeEntry contractCode; + // case CONFIG_SETTING: + // ConfigSettingEntry configSetting; + // case EXPIRATION: + // ExpirationEntry expiration; + // } + // data; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerEntryExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerEntry", [ + ["lastModifiedLedgerSeq", xdr.lookup("Uint32")], + ["data", xdr.lookup("LedgerEntryData")], + ["ext", xdr.lookup("LedgerEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyAccount", [["accountId", xdr.lookup("AccountId")]]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // TrustLineAsset asset; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyTrustLine", [ + ["accountId", xdr.lookup("AccountId")], + ["asset", xdr.lookup("TrustLineAsset")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sellerID; + // int64 offerID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyOffer", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // string64 dataName; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyData", [ + ["accountId", xdr.lookup("AccountId")], + ["dataName", xdr.lookup("String64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimableBalanceID balanceID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyClaimableBalance", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // PoolID liquidityPoolID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyLiquidityPool", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyContractData", [ + ["contract", xdr.lookup("ScAddress")], + ["key", xdr.lookup("ScVal")], + ["durability", xdr.lookup("ContractDataDurability")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash hash; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyContractCode", [["hash", xdr.lookup("Hash")]]); + + // === xdr source ============================================================ + // + // struct + // { + // ConfigSettingID configSettingID; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyConfigSetting", [ + ["configSettingId", xdr.lookup("ConfigSettingId")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // } + // + // =========================================================================== + xdr.struct("LedgerKeyExpiration", [["keyHash", xdr.lookup("Hash")]]); + + // === xdr source ============================================================ + // + // union LedgerKey switch (LedgerEntryType type) + // { + // case ACCOUNT: + // struct + // { + // AccountID accountID; + // } account; + // + // case TRUSTLINE: + // struct + // { + // AccountID accountID; + // TrustLineAsset asset; + // } trustLine; + // + // case OFFER: + // struct + // { + // AccountID sellerID; + // int64 offerID; + // } offer; + // + // case DATA: + // struct + // { + // AccountID accountID; + // string64 dataName; + // } data; + // + // case CLAIMABLE_BALANCE: + // struct + // { + // ClaimableBalanceID balanceID; + // } claimableBalance; + // + // case LIQUIDITY_POOL: + // struct + // { + // PoolID liquidityPoolID; + // } liquidityPool; + // case CONTRACT_DATA: + // struct + // { + // SCAddress contract; + // SCVal key; + // ContractDataDurability durability; + // } contractData; + // case CONTRACT_CODE: + // struct + // { + // Hash hash; + // } contractCode; + // case CONFIG_SETTING: + // struct + // { + // ConfigSettingID configSettingID; + // } configSetting; + // case EXPIRATION: + // struct + // { + // // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash keyHash; + // } expiration; + // }; + // + // =========================================================================== + xdr.union("LedgerKey", { + switchOn: xdr.lookup("LedgerEntryType"), + switchName: "type", + switches: [ + ["account", "account"], + ["trustline", "trustLine"], + ["offer", "offer"], + ["data", "data"], + ["claimableBalance", "claimableBalance"], + ["liquidityPool", "liquidityPool"], + ["contractData", "contractData"], + ["contractCode", "contractCode"], + ["configSetting", "configSetting"], + ["expiration", "expiration"], + ], + arms: { + account: xdr.lookup("LedgerKeyAccount"), + trustLine: xdr.lookup("LedgerKeyTrustLine"), + offer: xdr.lookup("LedgerKeyOffer"), + data: xdr.lookup("LedgerKeyData"), + claimableBalance: xdr.lookup("LedgerKeyClaimableBalance"), + liquidityPool: xdr.lookup("LedgerKeyLiquidityPool"), + contractData: xdr.lookup("LedgerKeyContractData"), + contractCode: xdr.lookup("LedgerKeyContractCode"), + configSetting: xdr.lookup("LedgerKeyConfigSetting"), + expiration: xdr.lookup("LedgerKeyExpiration"), + }, + }); + + // === xdr source ============================================================ + // + // enum EnvelopeType + // { + // ENVELOPE_TYPE_TX_V0 = 0, + // ENVELOPE_TYPE_SCP = 1, + // ENVELOPE_TYPE_TX = 2, + // ENVELOPE_TYPE_AUTH = 3, + // ENVELOPE_TYPE_SCPVALUE = 4, + // ENVELOPE_TYPE_TX_FEE_BUMP = 5, + // ENVELOPE_TYPE_OP_ID = 6, + // ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, + // ENVELOPE_TYPE_CONTRACT_ID = 8, + // ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 + // }; + // + // =========================================================================== + xdr.enum("EnvelopeType", { + envelopeTypeTxV0: 0, + envelopeTypeScp: 1, + envelopeTypeTx: 2, + envelopeTypeAuth: 3, + envelopeTypeScpvalue: 4, + envelopeTypeTxFeeBump: 5, + envelopeTypeOpId: 6, + envelopeTypePoolRevokeOpId: 7, + envelopeTypeContractId: 8, + envelopeTypeSorobanAuthorization: 9, + }); + + // === xdr source ============================================================ + // + // typedef opaque UpgradeType<128>; + // + // =========================================================================== + xdr.typedef("UpgradeType", xdr.varOpaque(128)); + + // === xdr source ============================================================ + // + // enum StellarValueType + // { + // STELLAR_VALUE_BASIC = 0, + // STELLAR_VALUE_SIGNED = 1 + // }; + // + // =========================================================================== + xdr.enum("StellarValueType", { + stellarValueBasic: 0, + stellarValueSigned: 1, + }); + + // === xdr source ============================================================ + // + // struct LedgerCloseValueSignature + // { + // NodeID nodeID; // which node introduced the value + // Signature signature; // nodeID's signature + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseValueSignature", [ + ["nodeId", xdr.lookup("NodeId")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // union switch (StellarValueType v) + // { + // case STELLAR_VALUE_BASIC: + // void; + // case STELLAR_VALUE_SIGNED: + // LedgerCloseValueSignature lcValueSignature; + // } + // + // =========================================================================== + xdr.union("StellarValueExt", { + switchOn: xdr.lookup("StellarValueType"), + switchName: "v", + switches: [ + ["stellarValueBasic", xdr.void()], + ["stellarValueSigned", "lcValueSignature"], + ], + arms: { + lcValueSignature: xdr.lookup("LedgerCloseValueSignature"), + }, + }); + + // === xdr source ============================================================ + // + // struct StellarValue + // { + // Hash txSetHash; // transaction set to apply to previous ledger + // TimePoint closeTime; // network close time + // + // // upgrades to apply to the previous ledger (usually empty) + // // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop + // // unknown steps during consensus if needed. + // // see notes below on 'LedgerUpgrade' for more detail + // // max size is dictated by number of upgrade types (+ room for future) + // UpgradeType upgrades<6>; + // + // // reserved for future use + // union switch (StellarValueType v) + // { + // case STELLAR_VALUE_BASIC: + // void; + // case STELLAR_VALUE_SIGNED: + // LedgerCloseValueSignature lcValueSignature; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("StellarValue", [ + ["txSetHash", xdr.lookup("Hash")], + ["closeTime", xdr.lookup("TimePoint")], + ["upgrades", xdr.varArray(xdr.lookup("UpgradeType"), 6)], + ["ext", xdr.lookup("StellarValueExt")], + ]); + + // === xdr source ============================================================ + // + // const MASK_LEDGER_HEADER_FLAGS = 0x7; + // + // =========================================================================== + xdr.const("MASK_LEDGER_HEADER_FLAGS", 0x7); + + // === xdr source ============================================================ + // + // enum LedgerHeaderFlags + // { + // DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, + // DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, + // DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 + // }; + // + // =========================================================================== + xdr.enum("LedgerHeaderFlags", { + disableLiquidityPoolTradingFlag: 1, + disableLiquidityPoolDepositFlag: 2, + disableLiquidityPoolWithdrawalFlag: 4, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderExtensionV1Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeaderExtensionV1 + // { + // uint32 flags; // LedgerHeaderFlags + // + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeaderExtensionV1", [ + ["flags", xdr.lookup("Uint32")], + ["ext", xdr.lookup("LedgerHeaderExtensionV1Ext")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerHeaderExtensionV1 v1; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "v1"], + ], + arms: { + v1: xdr.lookup("LedgerHeaderExtensionV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeader + // { + // uint32 ledgerVersion; // the protocol version of the ledger + // Hash previousLedgerHash; // hash of the previous ledger header + // StellarValue scpValue; // what consensus agreed to + // Hash txSetResultHash; // the TransactionResultSet that led to this ledger + // Hash bucketListHash; // hash of the ledger state + // + // uint32 ledgerSeq; // sequence number of this ledger + // + // int64 totalCoins; // total number of stroops in existence. + // // 10,000,000 stroops in 1 XLM + // + // int64 feePool; // fees burned since last inflation run + // uint32 inflationSeq; // inflation sequence number + // + // uint64 idPool; // last used global ID, used for generating objects + // + // uint32 baseFee; // base fee per operation in stroops + // uint32 baseReserve; // account base reserve in stroops + // + // uint32 maxTxSetSize; // maximum size a transaction set can be + // + // Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back + // // in time without walking the chain back ledger by ledger + // // each slot contains the oldest ledger that is mod of + // // either 50 5000 50000 or 500000 depending on index + // // skipList[0] mod(50), skipList[1] mod(5000), etc + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // LedgerHeaderExtensionV1 v1; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeader", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["previousLedgerHash", xdr.lookup("Hash")], + ["scpValue", xdr.lookup("StellarValue")], + ["txSetResultHash", xdr.lookup("Hash")], + ["bucketListHash", xdr.lookup("Hash")], + ["ledgerSeq", xdr.lookup("Uint32")], + ["totalCoins", xdr.lookup("Int64")], + ["feePool", xdr.lookup("Int64")], + ["inflationSeq", xdr.lookup("Uint32")], + ["idPool", xdr.lookup("Uint64")], + ["baseFee", xdr.lookup("Uint32")], + ["baseReserve", xdr.lookup("Uint32")], + ["maxTxSetSize", xdr.lookup("Uint32")], + ["skipList", xdr.array(xdr.lookup("Hash"), 4)], + ["ext", xdr.lookup("LedgerHeaderExt")], + ]); + + // === xdr source ============================================================ + // + // enum LedgerUpgradeType + // { + // LEDGER_UPGRADE_VERSION = 1, + // LEDGER_UPGRADE_BASE_FEE = 2, + // LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, + // LEDGER_UPGRADE_BASE_RESERVE = 4, + // LEDGER_UPGRADE_FLAGS = 5, + // LEDGER_UPGRADE_CONFIG = 6, + // LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 + // }; + // + // =========================================================================== + xdr.enum("LedgerUpgradeType", { + ledgerUpgradeVersion: 1, + ledgerUpgradeBaseFee: 2, + ledgerUpgradeMaxTxSetSize: 3, + ledgerUpgradeBaseReserve: 4, + ledgerUpgradeFlags: 5, + ledgerUpgradeConfig: 6, + ledgerUpgradeMaxSorobanTxSetSize: 7, + }); + + // === xdr source ============================================================ + // + // struct ConfigUpgradeSetKey { + // Hash contractID; + // Hash contentHash; + // }; + // + // =========================================================================== + xdr.struct("ConfigUpgradeSetKey", [ + ["contractId", xdr.lookup("Hash")], + ["contentHash", xdr.lookup("Hash")], + ]); + + // === xdr source ============================================================ + // + // union LedgerUpgrade switch (LedgerUpgradeType type) + // { + // case LEDGER_UPGRADE_VERSION: + // uint32 newLedgerVersion; // update ledgerVersion + // case LEDGER_UPGRADE_BASE_FEE: + // uint32 newBaseFee; // update baseFee + // case LEDGER_UPGRADE_MAX_TX_SET_SIZE: + // uint32 newMaxTxSetSize; // update maxTxSetSize + // case LEDGER_UPGRADE_BASE_RESERVE: + // uint32 newBaseReserve; // update baseReserve + // case LEDGER_UPGRADE_FLAGS: + // uint32 newFlags; // update flags + // case LEDGER_UPGRADE_CONFIG: + // // Update arbitrary `ConfigSetting` entries identified by the key. + // ConfigUpgradeSetKey newConfig; + // case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: + // // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without + // // using `LEDGER_UPGRADE_CONFIG`. + // uint32 newMaxSorobanTxSetSize; + // }; + // + // =========================================================================== + xdr.union("LedgerUpgrade", { + switchOn: xdr.lookup("LedgerUpgradeType"), + switchName: "type", + switches: [ + ["ledgerUpgradeVersion", "newLedgerVersion"], + ["ledgerUpgradeBaseFee", "newBaseFee"], + ["ledgerUpgradeMaxTxSetSize", "newMaxTxSetSize"], + ["ledgerUpgradeBaseReserve", "newBaseReserve"], + ["ledgerUpgradeFlags", "newFlags"], + ["ledgerUpgradeConfig", "newConfig"], + ["ledgerUpgradeMaxSorobanTxSetSize", "newMaxSorobanTxSetSize"], + ], + arms: { + newLedgerVersion: xdr.lookup("Uint32"), + newBaseFee: xdr.lookup("Uint32"), + newMaxTxSetSize: xdr.lookup("Uint32"), + newBaseReserve: xdr.lookup("Uint32"), + newFlags: xdr.lookup("Uint32"), + newConfig: xdr.lookup("ConfigUpgradeSetKey"), + newMaxSorobanTxSetSize: xdr.lookup("Uint32"), + }, + }); + + // === xdr source ============================================================ + // + // struct ConfigUpgradeSet { + // ConfigSettingEntry updatedEntry<>; + // }; + // + // =========================================================================== + xdr.struct("ConfigUpgradeSet", [ + [ + "updatedEntry", + xdr.varArray(xdr.lookup("ConfigSettingEntry"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // enum BucketEntryType + // { + // METAENTRY = + // -1, // At-and-after protocol 11: bucket metadata, should come first. + // LIVEENTRY = 0, // Before protocol 11: created-or-updated; + // // At-and-after protocol 11: only updated. + // DEADENTRY = 1, + // INITENTRY = 2 // At-and-after protocol 11: only created. + // }; + // + // =========================================================================== + xdr.enum("BucketEntryType", { + metaentry: -1, + liveentry: 0, + deadentry: 1, + initentry: 2, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("BucketMetadataExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct BucketMetadata + // { + // // Indicates the protocol version used to create / merge this bucket. + // uint32 ledgerVersion; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("BucketMetadata", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["ext", xdr.lookup("BucketMetadataExt")], + ]); + + // === xdr source ============================================================ + // + // union BucketEntry switch (BucketEntryType type) + // { + // case LIVEENTRY: + // case INITENTRY: + // LedgerEntry liveEntry; + // + // case DEADENTRY: + // LedgerKey deadEntry; + // case METAENTRY: + // BucketMetadata metaEntry; + // }; + // + // =========================================================================== + xdr.union("BucketEntry", { + switchOn: xdr.lookup("BucketEntryType"), + switchName: "type", + switches: [ + ["liveentry", "liveEntry"], + ["initentry", "liveEntry"], + ["deadentry", "deadEntry"], + ["metaentry", "metaEntry"], + ], + arms: { + liveEntry: xdr.lookup("LedgerEntry"), + deadEntry: xdr.lookup("LedgerKey"), + metaEntry: xdr.lookup("BucketMetadata"), + }, + }); + + // === xdr source ============================================================ + // + // enum TxSetComponentType + // { + // // txs with effective fee <= bid derived from a base fee (if any). + // // If base fee is not specified, no discount is applied. + // TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 + // }; + // + // =========================================================================== + xdr.enum("TxSetComponentType", { + txsetCompTxsMaybeDiscountedFee: 0, + }); + + // === xdr source ============================================================ + // + // struct + // { + // int64* baseFee; + // TransactionEnvelope txs<>; + // } + // + // =========================================================================== + xdr.struct("TxSetComponentTxsMaybeDiscountedFee", [ + ["baseFee", xdr.option(xdr.lookup("Int64"))], + ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union TxSetComponent switch (TxSetComponentType type) + // { + // case TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE: + // struct + // { + // int64* baseFee; + // TransactionEnvelope txs<>; + // } txsMaybeDiscountedFee; + // }; + // + // =========================================================================== + xdr.union("TxSetComponent", { + switchOn: xdr.lookup("TxSetComponentType"), + switchName: "type", + switches: [["txsetCompTxsMaybeDiscountedFee", "txsMaybeDiscountedFee"]], + arms: { + txsMaybeDiscountedFee: xdr.lookup("TxSetComponentTxsMaybeDiscountedFee"), + }, + }); + + // === xdr source ============================================================ + // + // union TransactionPhase switch (int v) + // { + // case 0: + // TxSetComponent v0Components<>; + // }; + // + // =========================================================================== + xdr.union("TransactionPhase", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0Components"]], + arms: { + v0Components: xdr.varArray(xdr.lookup("TxSetComponent"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionSet + // { + // Hash previousLedgerHash; + // TransactionEnvelope txs<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionSet", [ + ["previousLedgerHash", xdr.lookup("Hash")], + ["txes", xdr.varArray(xdr.lookup("TransactionEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct TransactionSetV1 + // { + // Hash previousLedgerHash; + // TransactionPhase phases<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionSetV1", [ + ["previousLedgerHash", xdr.lookup("Hash")], + ["phases", xdr.varArray(xdr.lookup("TransactionPhase"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union GeneralizedTransactionSet switch (int v) + // { + // // We consider the legacy TransactionSet to be v0. + // case 1: + // TransactionSetV1 v1TxSet; + // }; + // + // =========================================================================== + xdr.union("GeneralizedTransactionSet", { + switchOn: xdr.int(), + switchName: "v", + switches: [[1, "v1TxSet"]], + arms: { + v1TxSet: xdr.lookup("TransactionSetV1"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionResultPair + // { + // Hash transactionHash; + // TransactionResult result; // result for the transaction + // }; + // + // =========================================================================== + xdr.struct("TransactionResultPair", [ + ["transactionHash", xdr.lookup("Hash")], + ["result", xdr.lookup("TransactionResult")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionResultSet + // { + // TransactionResultPair results<>; + // }; + // + // =========================================================================== + xdr.struct("TransactionResultSet", [ + ["results", xdr.varArray(xdr.lookup("TransactionResultPair"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // GeneralizedTransactionSet generalizedTxSet; + // } + // + // =========================================================================== + xdr.union("TransactionHistoryEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "generalizedTxSet"], + ], + arms: { + generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionHistoryEntry + // { + // uint32 ledgerSeq; + // TransactionSet txSet; + // + // // when v != 0, txSet must be empty + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // GeneralizedTransactionSet generalizedTxSet; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionHistoryEntry", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["txSet", xdr.lookup("TransactionSet")], + ["ext", xdr.lookup("TransactionHistoryEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionHistoryResultEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionHistoryResultEntry + // { + // uint32 ledgerSeq; + // TransactionResultSet txResultSet; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionHistoryResultEntry", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["txResultSet", xdr.lookup("TransactionResultSet")], + ["ext", xdr.lookup("TransactionHistoryResultEntryExt")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("LedgerHeaderHistoryEntryExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct LedgerHeaderHistoryEntry + // { + // Hash hash; + // LedgerHeader header; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("LedgerHeaderHistoryEntry", [ + ["hash", xdr.lookup("Hash")], + ["header", xdr.lookup("LedgerHeader")], + ["ext", xdr.lookup("LedgerHeaderHistoryEntryExt")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerSCPMessages + // { + // uint32 ledgerSeq; + // SCPEnvelope messages<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerScpMessages", [ + ["ledgerSeq", xdr.lookup("Uint32")], + ["messages", xdr.varArray(xdr.lookup("ScpEnvelope"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct SCPHistoryEntryV0 + // { + // SCPQuorumSet quorumSets<>; // additional quorum sets used by ledgerMessages + // LedgerSCPMessages ledgerMessages; + // }; + // + // =========================================================================== + xdr.struct("ScpHistoryEntryV0", [ + ["quorumSets", xdr.varArray(xdr.lookup("ScpQuorumSet"), 2147483647)], + ["ledgerMessages", xdr.lookup("LedgerScpMessages")], + ]); + + // === xdr source ============================================================ + // + // union SCPHistoryEntry switch (int v) + // { + // case 0: + // SCPHistoryEntryV0 v0; + // }; + // + // =========================================================================== + xdr.union("ScpHistoryEntry", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("ScpHistoryEntryV0"), + }, + }); + + // === xdr source ============================================================ + // + // enum LedgerEntryChangeType + // { + // LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger + // LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger + // LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger + // LEDGER_ENTRY_STATE = 3 // value of the entry + // }; + // + // =========================================================================== + xdr.enum("LedgerEntryChangeType", { + ledgerEntryCreated: 0, + ledgerEntryUpdated: 1, + ledgerEntryRemoved: 2, + ledgerEntryState: 3, + }); + + // === xdr source ============================================================ + // + // union LedgerEntryChange switch (LedgerEntryChangeType type) + // { + // case LEDGER_ENTRY_CREATED: + // LedgerEntry created; + // case LEDGER_ENTRY_UPDATED: + // LedgerEntry updated; + // case LEDGER_ENTRY_REMOVED: + // LedgerKey removed; + // case LEDGER_ENTRY_STATE: + // LedgerEntry state; + // }; + // + // =========================================================================== + xdr.union("LedgerEntryChange", { + switchOn: xdr.lookup("LedgerEntryChangeType"), + switchName: "type", + switches: [ + ["ledgerEntryCreated", "created"], + ["ledgerEntryUpdated", "updated"], + ["ledgerEntryRemoved", "removed"], + ["ledgerEntryState", "state"], + ], + arms: { + created: xdr.lookup("LedgerEntry"), + updated: xdr.lookup("LedgerEntry"), + removed: xdr.lookup("LedgerKey"), + state: xdr.lookup("LedgerEntry"), + }, + }); + + // === xdr source ============================================================ + // + // typedef LedgerEntryChange LedgerEntryChanges<>; + // + // =========================================================================== + xdr.typedef( + "LedgerEntryChanges", + xdr.varArray(xdr.lookup("LedgerEntryChange"), 2147483647) + ); + + // === xdr source ============================================================ + // + // struct OperationMeta + // { + // LedgerEntryChanges changes; + // }; + // + // =========================================================================== + xdr.struct("OperationMeta", [["changes", xdr.lookup("LedgerEntryChanges")]]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV1 + // { + // LedgerEntryChanges txChanges; // tx level changes if any + // OperationMeta operations<>; // meta for each operation + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV1", [ + ["txChanges", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV2 + // { + // LedgerEntryChanges txChangesBefore; // tx level changes before operations + // // are applied if any + // OperationMeta operations<>; // meta for each operation + // LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // // applied if any + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV2", [ + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ]); + + // === xdr source ============================================================ + // + // enum ContractEventType + // { + // SYSTEM = 0, + // CONTRACT = 1, + // DIAGNOSTIC = 2 + // }; + // + // =========================================================================== + xdr.enum("ContractEventType", { + system: 0, + contract: 1, + diagnostic: 2, + }); + + // === xdr source ============================================================ + // + // struct + // { + // SCVal topics<>; + // SCVal data; + // } + // + // =========================================================================== + xdr.struct("ContractEventV0", [ + ["topics", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], + ["data", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // struct + // { + // SCVal topics<>; + // SCVal data; + // } v0; + // } + // + // =========================================================================== + xdr.union("ContractEventBody", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("ContractEventV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct ContractEvent + // { + // // We can use this to add more fields, or because it + // // is first, to change ContractEvent into a union. + // ExtensionPoint ext; + // + // Hash* contractID; + // ContractEventType type; + // + // union switch (int v) + // { + // case 0: + // struct + // { + // SCVal topics<>; + // SCVal data; + // } v0; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("ContractEvent", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["contractId", xdr.option(xdr.lookup("Hash"))], + ["type", xdr.lookup("ContractEventType")], + ["body", xdr.lookup("ContractEventBody")], + ]); + + // === xdr source ============================================================ + // + // struct DiagnosticEvent + // { + // bool inSuccessfulContractCall; + // ContractEvent event; + // }; + // + // =========================================================================== + xdr.struct("DiagnosticEvent", [ + ["inSuccessfulContractCall", xdr.bool()], + ["event", xdr.lookup("ContractEvent")], + ]); + + // === xdr source ============================================================ + // + // struct SorobanTransactionMeta + // { + // ExtensionPoint ext; + // + // ContractEvent events<>; // custom events populated by the + // // contracts themselves. + // SCVal returnValue; // return value of the host fn invocation + // + // // Diagnostics events that are not hashed. + // // This will contain all contract and diagnostic events. Even ones + // // that were emitted in a failed contract call. + // DiagnosticEvent diagnosticEvents<>; + // }; + // + // =========================================================================== + xdr.struct("SorobanTransactionMeta", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], + ["returnValue", xdr.lookup("ScVal")], + [ + "diagnosticEvents", + xdr.varArray(xdr.lookup("DiagnosticEvent"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // struct TransactionMetaV3 + // { + // ExtensionPoint ext; + // + // LedgerEntryChanges txChangesBefore; // tx level changes before operations + // // are applied if any + // OperationMeta operations<>; // meta for each operation + // LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // // applied if any + // SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for + // // Soroban transactions). + // }; + // + // =========================================================================== + xdr.struct("TransactionMetaV3", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["txChangesBefore", xdr.lookup("LedgerEntryChanges")], + ["operations", xdr.varArray(xdr.lookup("OperationMeta"), 2147483647)], + ["txChangesAfter", xdr.lookup("LedgerEntryChanges")], + ["sorobanMeta", xdr.option(xdr.lookup("SorobanTransactionMeta"))], + ]); + + // === xdr source ============================================================ + // + // struct InvokeHostFunctionSuccessPreImage + // { + // SCVal returnValue; + // ContractEvent events<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeHostFunctionSuccessPreImage", [ + ["returnValue", xdr.lookup("ScVal")], + ["events", xdr.varArray(xdr.lookup("ContractEvent"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union TransactionMeta switch (int v) + // { + // case 0: + // OperationMeta operations<>; + // case 1: + // TransactionMetaV1 v1; + // case 2: + // TransactionMetaV2 v2; + // case 3: + // TransactionMetaV3 v3; + // }; + // + // =========================================================================== + xdr.union("TransactionMeta", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, "operations"], + [1, "v1"], + [2, "v2"], + [3, "v3"], + ], + arms: { + operations: xdr.varArray(xdr.lookup("OperationMeta"), 2147483647), + v1: xdr.lookup("TransactionMetaV1"), + v2: xdr.lookup("TransactionMetaV2"), + v3: xdr.lookup("TransactionMetaV3"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionResultMeta + // { + // TransactionResultPair result; + // LedgerEntryChanges feeProcessing; + // TransactionMeta txApplyProcessing; + // }; + // + // =========================================================================== + xdr.struct("TransactionResultMeta", [ + ["result", xdr.lookup("TransactionResultPair")], + ["feeProcessing", xdr.lookup("LedgerEntryChanges")], + ["txApplyProcessing", xdr.lookup("TransactionMeta")], + ]); + + // === xdr source ============================================================ + // + // struct UpgradeEntryMeta + // { + // LedgerUpgrade upgrade; + // LedgerEntryChanges changes; + // }; + // + // =========================================================================== + xdr.struct("UpgradeEntryMeta", [ + ["upgrade", xdr.lookup("LedgerUpgrade")], + ["changes", xdr.lookup("LedgerEntryChanges")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV0 + // { + // LedgerHeaderHistoryEntry ledgerHeader; + // // NB: txSet is sorted in "Hash order" + // TransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV0", [ + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("TransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV1 + // { + // LedgerHeaderHistoryEntry ledgerHeader; + // + // GeneralizedTransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV1", [ + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct LedgerCloseMetaV2 + // { + // // We forgot to add an ExtensionPoint in v1 but at least + // // we can add one now in v2. + // ExtensionPoint ext; + // + // LedgerHeaderHistoryEntry ledgerHeader; + // + // GeneralizedTransactionSet txSet; + // + // // NB: transactions are sorted in apply order here + // // fees for all transactions are processed first + // // followed by applying transactions + // TransactionResultMeta txProcessing<>; + // + // // upgrades are applied last + // UpgradeEntryMeta upgradesProcessing<>; + // + // // other misc information attached to the ledger close + // SCPHistoryEntry scpInfo<>; + // + // // Size in bytes of BucketList, to support downstream + // // systems calculating storage fees correctly. + // uint64 totalByteSizeOfBucketList; + // + // // Expired temp keys that are being evicted at this ledger. + // LedgerKey evictedTemporaryLedgerKeys<>; + // + // // Expired restorable ledger entries that are being + // // evicted at this ledger. + // LedgerEntry evictedPersistentLedgerEntries<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerCloseMetaV2", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], + ["txSet", xdr.lookup("GeneralizedTransactionSet")], + [ + "txProcessing", + xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), + ], + [ + "upgradesProcessing", + xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), + ], + ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], + ["totalByteSizeOfBucketList", xdr.lookup("Uint64")], + [ + "evictedTemporaryLedgerKeys", + xdr.varArray(xdr.lookup("LedgerKey"), 2147483647), + ], + [ + "evictedPersistentLedgerEntries", + xdr.varArray(xdr.lookup("LedgerEntry"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // union LedgerCloseMeta switch (int v) + // { + // case 0: + // LedgerCloseMetaV0 v0; + // case 1: + // LedgerCloseMetaV1 v1; + // case 2: + // LedgerCloseMetaV2 v2; + // }; + // + // =========================================================================== + xdr.union("LedgerCloseMeta", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, "v0"], + [1, "v1"], + [2, "v2"], + ], + arms: { + v0: xdr.lookup("LedgerCloseMetaV0"), + v1: xdr.lookup("LedgerCloseMetaV1"), + v2: xdr.lookup("LedgerCloseMetaV2"), + }, + }); + + // === xdr source ============================================================ + // + // enum ErrorCode + // { + // ERR_MISC = 0, // Unspecific error + // ERR_DATA = 1, // Malformed data + // ERR_CONF = 2, // Misconfiguration error + // ERR_AUTH = 3, // Authentication failure + // ERR_LOAD = 4 // System overloaded + // }; + // + // =========================================================================== + xdr.enum("ErrorCode", { + errMisc: 0, + errData: 1, + errConf: 2, + errAuth: 3, + errLoad: 4, + }); + + // === xdr source ============================================================ + // + // struct Error + // { + // ErrorCode code; + // string msg<100>; + // }; + // + // =========================================================================== + xdr.struct("Error", [ + ["code", xdr.lookup("ErrorCode")], + ["msg", xdr.string(100)], + ]); + + // === xdr source ============================================================ + // + // struct SendMore + // { + // uint32 numMessages; + // }; + // + // =========================================================================== + xdr.struct("SendMore", [["numMessages", xdr.lookup("Uint32")]]); + + // === xdr source ============================================================ + // + // struct SendMoreExtended + // { + // uint32 numMessages; + // uint32 numBytes; + // }; + // + // =========================================================================== + xdr.struct("SendMoreExtended", [ + ["numMessages", xdr.lookup("Uint32")], + ["numBytes", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct AuthCert + // { + // Curve25519Public pubkey; + // uint64 expiration; + // Signature sig; + // }; + // + // =========================================================================== + xdr.struct("AuthCert", [ + ["pubkey", xdr.lookup("Curve25519Public")], + ["expiration", xdr.lookup("Uint64")], + ["sig", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // struct Hello + // { + // uint32 ledgerVersion; + // uint32 overlayVersion; + // uint32 overlayMinVersion; + // Hash networkID; + // string versionStr<100>; + // int listeningPort; + // NodeID peerID; + // AuthCert cert; + // uint256 nonce; + // }; + // + // =========================================================================== + xdr.struct("Hello", [ + ["ledgerVersion", xdr.lookup("Uint32")], + ["overlayVersion", xdr.lookup("Uint32")], + ["overlayMinVersion", xdr.lookup("Uint32")], + ["networkId", xdr.lookup("Hash")], + ["versionStr", xdr.string(100)], + ["listeningPort", xdr.int()], + ["peerId", xdr.lookup("NodeId")], + ["cert", xdr.lookup("AuthCert")], + ["nonce", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200; + // + // =========================================================================== + xdr.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED", 200); + + // === xdr source ============================================================ + // + // struct Auth + // { + // int flags; + // }; + // + // =========================================================================== + xdr.struct("Auth", [["flags", xdr.int()]]); + + // === xdr source ============================================================ + // + // enum IPAddrType + // { + // IPv4 = 0, + // IPv6 = 1 + // }; + // + // =========================================================================== + xdr.enum("IpAddrType", { + iPv4: 0, + iPv6: 1, + }); + + // === xdr source ============================================================ + // + // union switch (IPAddrType type) + // { + // case IPv4: + // opaque ipv4[4]; + // case IPv6: + // opaque ipv6[16]; + // } + // + // =========================================================================== + xdr.union("PeerAddressIp", { + switchOn: xdr.lookup("IpAddrType"), + switchName: "type", + switches: [ + ["iPv4", "ipv4"], + ["iPv6", "ipv6"], + ], + arms: { + ipv4: xdr.opaque(4), + ipv6: xdr.opaque(16), + }, + }); + + // === xdr source ============================================================ + // + // struct PeerAddress + // { + // union switch (IPAddrType type) + // { + // case IPv4: + // opaque ipv4[4]; + // case IPv6: + // opaque ipv6[16]; + // } + // ip; + // uint32 port; + // uint32 numFailures; + // }; + // + // =========================================================================== + xdr.struct("PeerAddress", [ + ["ip", xdr.lookup("PeerAddressIp")], + ["port", xdr.lookup("Uint32")], + ["numFailures", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // enum MessageType + // { + // ERROR_MSG = 0, + // AUTH = 2, + // DONT_HAVE = 3, + // + // GET_PEERS = 4, // gets a list of peers this guy knows about + // PEERS = 5, + // + // GET_TX_SET = 6, // gets a particular txset by hash + // TX_SET = 7, + // GENERALIZED_TX_SET = 17, + // + // TRANSACTION = 8, // pass on a tx you have heard about + // + // // SCP + // GET_SCP_QUORUMSET = 9, + // SCP_QUORUMSET = 10, + // SCP_MESSAGE = 11, + // GET_SCP_STATE = 12, + // + // // new messages + // HELLO = 13, + // + // SURVEY_REQUEST = 14, + // SURVEY_RESPONSE = 15, + // + // SEND_MORE = 16, + // SEND_MORE_EXTENDED = 20, + // + // FLOOD_ADVERT = 18, + // FLOOD_DEMAND = 19 + // }; + // + // =========================================================================== + xdr.enum("MessageType", { + errorMsg: 0, + auth: 2, + dontHave: 3, + getPeers: 4, + peers: 5, + getTxSet: 6, + txSet: 7, + generalizedTxSet: 17, + transaction: 8, + getScpQuorumset: 9, + scpQuorumset: 10, + scpMessage: 11, + getScpState: 12, + hello: 13, + surveyRequest: 14, + surveyResponse: 15, + sendMore: 16, + sendMoreExtended: 20, + floodAdvert: 18, + floodDemand: 19, + }); + + // === xdr source ============================================================ + // + // struct DontHave + // { + // MessageType type; + // uint256 reqHash; + // }; + // + // =========================================================================== + xdr.struct("DontHave", [ + ["type", xdr.lookup("MessageType")], + ["reqHash", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // enum SurveyMessageCommandType + // { + // SURVEY_TOPOLOGY = 0 + // }; + // + // =========================================================================== + xdr.enum("SurveyMessageCommandType", { + surveyTopology: 0, + }); + + // === xdr source ============================================================ + // + // enum SurveyMessageResponseType + // { + // SURVEY_TOPOLOGY_RESPONSE_V0 = 0, + // SURVEY_TOPOLOGY_RESPONSE_V1 = 1 + // }; + // + // =========================================================================== + xdr.enum("SurveyMessageResponseType", { + surveyTopologyResponseV0: 0, + surveyTopologyResponseV1: 1, + }); + + // === xdr source ============================================================ + // + // struct SurveyRequestMessage + // { + // NodeID surveyorPeerID; + // NodeID surveyedPeerID; + // uint32 ledgerNum; + // Curve25519Public encryptionKey; + // SurveyMessageCommandType commandType; + // }; + // + // =========================================================================== + xdr.struct("SurveyRequestMessage", [ + ["surveyorPeerId", xdr.lookup("NodeId")], + ["surveyedPeerId", xdr.lookup("NodeId")], + ["ledgerNum", xdr.lookup("Uint32")], + ["encryptionKey", xdr.lookup("Curve25519Public")], + ["commandType", xdr.lookup("SurveyMessageCommandType")], + ]); + + // === xdr source ============================================================ + // + // struct SignedSurveyRequestMessage + // { + // Signature requestSignature; + // SurveyRequestMessage request; + // }; + // + // =========================================================================== + xdr.struct("SignedSurveyRequestMessage", [ + ["requestSignature", xdr.lookup("Signature")], + ["request", xdr.lookup("SurveyRequestMessage")], + ]); + + // === xdr source ============================================================ + // + // typedef opaque EncryptedBody<64000>; + // + // =========================================================================== + xdr.typedef("EncryptedBody", xdr.varOpaque(64000)); + + // === xdr source ============================================================ + // + // struct SurveyResponseMessage + // { + // NodeID surveyorPeerID; + // NodeID surveyedPeerID; + // uint32 ledgerNum; + // SurveyMessageCommandType commandType; + // EncryptedBody encryptedBody; + // }; + // + // =========================================================================== + xdr.struct("SurveyResponseMessage", [ + ["surveyorPeerId", xdr.lookup("NodeId")], + ["surveyedPeerId", xdr.lookup("NodeId")], + ["ledgerNum", xdr.lookup("Uint32")], + ["commandType", xdr.lookup("SurveyMessageCommandType")], + ["encryptedBody", xdr.lookup("EncryptedBody")], + ]); + + // === xdr source ============================================================ + // + // struct SignedSurveyResponseMessage + // { + // Signature responseSignature; + // SurveyResponseMessage response; + // }; + // + // =========================================================================== + xdr.struct("SignedSurveyResponseMessage", [ + ["responseSignature", xdr.lookup("Signature")], + ["response", xdr.lookup("SurveyResponseMessage")], + ]); + + // === xdr source ============================================================ + // + // struct PeerStats + // { + // NodeID id; + // string versionStr<100>; + // uint64 messagesRead; + // uint64 messagesWritten; + // uint64 bytesRead; + // uint64 bytesWritten; + // uint64 secondsConnected; + // + // uint64 uniqueFloodBytesRecv; + // uint64 duplicateFloodBytesRecv; + // uint64 uniqueFetchBytesRecv; + // uint64 duplicateFetchBytesRecv; + // + // uint64 uniqueFloodMessageRecv; + // uint64 duplicateFloodMessageRecv; + // uint64 uniqueFetchMessageRecv; + // uint64 duplicateFetchMessageRecv; + // }; + // + // =========================================================================== + xdr.struct("PeerStats", [ + ["id", xdr.lookup("NodeId")], + ["versionStr", xdr.string(100)], + ["messagesRead", xdr.lookup("Uint64")], + ["messagesWritten", xdr.lookup("Uint64")], + ["bytesRead", xdr.lookup("Uint64")], + ["bytesWritten", xdr.lookup("Uint64")], + ["secondsConnected", xdr.lookup("Uint64")], + ["uniqueFloodBytesRecv", xdr.lookup("Uint64")], + ["duplicateFloodBytesRecv", xdr.lookup("Uint64")], + ["uniqueFetchBytesRecv", xdr.lookup("Uint64")], + ["duplicateFetchBytesRecv", xdr.lookup("Uint64")], + ["uniqueFloodMessageRecv", xdr.lookup("Uint64")], + ["duplicateFloodMessageRecv", xdr.lookup("Uint64")], + ["uniqueFetchMessageRecv", xdr.lookup("Uint64")], + ["duplicateFetchMessageRecv", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // typedef PeerStats PeerStatList<25>; + // + // =========================================================================== + xdr.typedef("PeerStatList", xdr.varArray(xdr.lookup("PeerStats"), 25)); + + // === xdr source ============================================================ + // + // struct TopologyResponseBodyV0 + // { + // PeerStatList inboundPeers; + // PeerStatList outboundPeers; + // + // uint32 totalInboundPeerCount; + // uint32 totalOutboundPeerCount; + // }; + // + // =========================================================================== + xdr.struct("TopologyResponseBodyV0", [ + ["inboundPeers", xdr.lookup("PeerStatList")], + ["outboundPeers", xdr.lookup("PeerStatList")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct TopologyResponseBodyV1 + // { + // PeerStatList inboundPeers; + // PeerStatList outboundPeers; + // + // uint32 totalInboundPeerCount; + // uint32 totalOutboundPeerCount; + // + // uint32 maxInboundPeerCount; + // uint32 maxOutboundPeerCount; + // }; + // + // =========================================================================== + xdr.struct("TopologyResponseBodyV1", [ + ["inboundPeers", xdr.lookup("PeerStatList")], + ["outboundPeers", xdr.lookup("PeerStatList")], + ["totalInboundPeerCount", xdr.lookup("Uint32")], + ["totalOutboundPeerCount", xdr.lookup("Uint32")], + ["maxInboundPeerCount", xdr.lookup("Uint32")], + ["maxOutboundPeerCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // union SurveyResponseBody switch (SurveyMessageResponseType type) + // { + // case SURVEY_TOPOLOGY_RESPONSE_V0: + // TopologyResponseBodyV0 topologyResponseBodyV0; + // case SURVEY_TOPOLOGY_RESPONSE_V1: + // TopologyResponseBodyV1 topologyResponseBodyV1; + // }; + // + // =========================================================================== + xdr.union("SurveyResponseBody", { + switchOn: xdr.lookup("SurveyMessageResponseType"), + switchName: "type", + switches: [ + ["surveyTopologyResponseV0", "topologyResponseBodyV0"], + ["surveyTopologyResponseV1", "topologyResponseBodyV1"], + ], + arms: { + topologyResponseBodyV0: xdr.lookup("TopologyResponseBodyV0"), + topologyResponseBodyV1: xdr.lookup("TopologyResponseBodyV1"), + }, + }); + + // === xdr source ============================================================ + // + // const TX_ADVERT_VECTOR_MAX_SIZE = 1000; + // + // =========================================================================== + xdr.const("TX_ADVERT_VECTOR_MAX_SIZE", 1000); + + // === xdr source ============================================================ + // + // typedef Hash TxAdvertVector; + // + // =========================================================================== + xdr.typedef( + "TxAdvertVector", + xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_ADVERT_VECTOR_MAX_SIZE")) + ); + + // === xdr source ============================================================ + // + // struct FloodAdvert + // { + // TxAdvertVector txHashes; + // }; + // + // =========================================================================== + xdr.struct("FloodAdvert", [["txHashes", xdr.lookup("TxAdvertVector")]]); + + // === xdr source ============================================================ + // + // const TX_DEMAND_VECTOR_MAX_SIZE = 1000; + // + // =========================================================================== + xdr.const("TX_DEMAND_VECTOR_MAX_SIZE", 1000); + + // === xdr source ============================================================ + // + // typedef Hash TxDemandVector; + // + // =========================================================================== + xdr.typedef( + "TxDemandVector", + xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_DEMAND_VECTOR_MAX_SIZE")) + ); + + // === xdr source ============================================================ + // + // struct FloodDemand + // { + // TxDemandVector txHashes; + // }; + // + // =========================================================================== + xdr.struct("FloodDemand", [["txHashes", xdr.lookup("TxDemandVector")]]); + + // === xdr source ============================================================ + // + // union StellarMessage switch (MessageType type) + // { + // case ERROR_MSG: + // Error error; + // case HELLO: + // Hello hello; + // case AUTH: + // Auth auth; + // case DONT_HAVE: + // DontHave dontHave; + // case GET_PEERS: + // void; + // case PEERS: + // PeerAddress peers<100>; + // + // case GET_TX_SET: + // uint256 txSetHash; + // case TX_SET: + // TransactionSet txSet; + // case GENERALIZED_TX_SET: + // GeneralizedTransactionSet generalizedTxSet; + // + // case TRANSACTION: + // TransactionEnvelope transaction; + // + // case SURVEY_REQUEST: + // SignedSurveyRequestMessage signedSurveyRequestMessage; + // + // case SURVEY_RESPONSE: + // SignedSurveyResponseMessage signedSurveyResponseMessage; + // + // // SCP + // case GET_SCP_QUORUMSET: + // uint256 qSetHash; + // case SCP_QUORUMSET: + // SCPQuorumSet qSet; + // case SCP_MESSAGE: + // SCPEnvelope envelope; + // case GET_SCP_STATE: + // uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest + // case SEND_MORE: + // SendMore sendMoreMessage; + // case SEND_MORE_EXTENDED: + // SendMoreExtended sendMoreExtendedMessage; + // // Pull mode + // case FLOOD_ADVERT: + // FloodAdvert floodAdvert; + // case FLOOD_DEMAND: + // FloodDemand floodDemand; + // }; + // + // =========================================================================== + xdr.union("StellarMessage", { + switchOn: xdr.lookup("MessageType"), + switchName: "type", + switches: [ + ["errorMsg", "error"], + ["hello", "hello"], + ["auth", "auth"], + ["dontHave", "dontHave"], + ["getPeers", xdr.void()], + ["peers", "peers"], + ["getTxSet", "txSetHash"], + ["txSet", "txSet"], + ["generalizedTxSet", "generalizedTxSet"], + ["transaction", "transaction"], + ["surveyRequest", "signedSurveyRequestMessage"], + ["surveyResponse", "signedSurveyResponseMessage"], + ["getScpQuorumset", "qSetHash"], + ["scpQuorumset", "qSet"], + ["scpMessage", "envelope"], + ["getScpState", "getScpLedgerSeq"], + ["sendMore", "sendMoreMessage"], + ["sendMoreExtended", "sendMoreExtendedMessage"], + ["floodAdvert", "floodAdvert"], + ["floodDemand", "floodDemand"], + ], + arms: { + error: xdr.lookup("Error"), + hello: xdr.lookup("Hello"), + auth: xdr.lookup("Auth"), + dontHave: xdr.lookup("DontHave"), + peers: xdr.varArray(xdr.lookup("PeerAddress"), 100), + txSetHash: xdr.lookup("Uint256"), + txSet: xdr.lookup("TransactionSet"), + generalizedTxSet: xdr.lookup("GeneralizedTransactionSet"), + transaction: xdr.lookup("TransactionEnvelope"), + signedSurveyRequestMessage: xdr.lookup("SignedSurveyRequestMessage"), + signedSurveyResponseMessage: xdr.lookup("SignedSurveyResponseMessage"), + qSetHash: xdr.lookup("Uint256"), + qSet: xdr.lookup("ScpQuorumSet"), + envelope: xdr.lookup("ScpEnvelope"), + getScpLedgerSeq: xdr.lookup("Uint32"), + sendMoreMessage: xdr.lookup("SendMore"), + sendMoreExtendedMessage: xdr.lookup("SendMoreExtended"), + floodAdvert: xdr.lookup("FloodAdvert"), + floodDemand: xdr.lookup("FloodDemand"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // uint64 sequence; + // StellarMessage message; + // HmacSha256Mac mac; + // } + // + // =========================================================================== + xdr.struct("AuthenticatedMessageV0", [ + ["sequence", xdr.lookup("Uint64")], + ["message", xdr.lookup("StellarMessage")], + ["mac", xdr.lookup("HmacSha256Mac")], + ]); + + // === xdr source ============================================================ + // + // union AuthenticatedMessage switch (uint32 v) + // { + // case 0: + // struct + // { + // uint64 sequence; + // StellarMessage message; + // HmacSha256Mac mac; + // } v0; + // }; + // + // =========================================================================== + xdr.union("AuthenticatedMessage", { + switchOn: xdr.lookup("Uint32"), + switchName: "v", + switches: [[0, "v0"]], + arms: { + v0: xdr.lookup("AuthenticatedMessageV0"), + }, + }); + + // === xdr source ============================================================ + // + // const MAX_OPS_PER_TX = 100; + // + // =========================================================================== + xdr.const("MAX_OPS_PER_TX", 100); + + // === xdr source ============================================================ + // + // union LiquidityPoolParameters switch (LiquidityPoolType type) + // { + // case LIQUIDITY_POOL_CONSTANT_PRODUCT: + // LiquidityPoolConstantProductParameters constantProduct; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolParameters", { + switchOn: xdr.lookup("LiquidityPoolType"), + switchName: "type", + switches: [["liquidityPoolConstantProduct", "constantProduct"]], + arms: { + constantProduct: xdr.lookup("LiquidityPoolConstantProductParameters"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // uint64 id; + // uint256 ed25519; + // } + // + // =========================================================================== + xdr.struct("MuxedAccountMed25519", [ + ["id", xdr.lookup("Uint64")], + ["ed25519", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // union MuxedAccount switch (CryptoKeyType type) + // { + // case KEY_TYPE_ED25519: + // uint256 ed25519; + // case KEY_TYPE_MUXED_ED25519: + // struct + // { + // uint64 id; + // uint256 ed25519; + // } med25519; + // }; + // + // =========================================================================== + xdr.union("MuxedAccount", { + switchOn: xdr.lookup("CryptoKeyType"), + switchName: "type", + switches: [ + ["keyTypeEd25519", "ed25519"], + ["keyTypeMuxedEd25519", "med25519"], + ], + arms: { + ed25519: xdr.lookup("Uint256"), + med25519: xdr.lookup("MuxedAccountMed25519"), + }, + }); + + // === xdr source ============================================================ + // + // struct DecoratedSignature + // { + // SignatureHint hint; // last 4 bytes of the public key, used as a hint + // Signature signature; // actual signature + // }; + // + // =========================================================================== + xdr.struct("DecoratedSignature", [ + ["hint", xdr.lookup("SignatureHint")], + ["signature", xdr.lookup("Signature")], + ]); + + // === xdr source ============================================================ + // + // enum OperationType + // { + // CREATE_ACCOUNT = 0, + // PAYMENT = 1, + // PATH_PAYMENT_STRICT_RECEIVE = 2, + // MANAGE_SELL_OFFER = 3, + // CREATE_PASSIVE_SELL_OFFER = 4, + // SET_OPTIONS = 5, + // CHANGE_TRUST = 6, + // ALLOW_TRUST = 7, + // ACCOUNT_MERGE = 8, + // INFLATION = 9, + // MANAGE_DATA = 10, + // BUMP_SEQUENCE = 11, + // MANAGE_BUY_OFFER = 12, + // PATH_PAYMENT_STRICT_SEND = 13, + // CREATE_CLAIMABLE_BALANCE = 14, + // CLAIM_CLAIMABLE_BALANCE = 15, + // BEGIN_SPONSORING_FUTURE_RESERVES = 16, + // END_SPONSORING_FUTURE_RESERVES = 17, + // REVOKE_SPONSORSHIP = 18, + // CLAWBACK = 19, + // CLAWBACK_CLAIMABLE_BALANCE = 20, + // SET_TRUST_LINE_FLAGS = 21, + // LIQUIDITY_POOL_DEPOSIT = 22, + // LIQUIDITY_POOL_WITHDRAW = 23, + // INVOKE_HOST_FUNCTION = 24, + // BUMP_FOOTPRINT_EXPIRATION = 25, + // RESTORE_FOOTPRINT = 26 + // }; + // + // =========================================================================== + xdr.enum("OperationType", { + createAccount: 0, + payment: 1, + pathPaymentStrictReceive: 2, + manageSellOffer: 3, + createPassiveSellOffer: 4, + setOptions: 5, + changeTrust: 6, + allowTrust: 7, + accountMerge: 8, + inflation: 9, + manageData: 10, + bumpSequence: 11, + manageBuyOffer: 12, + pathPaymentStrictSend: 13, + createClaimableBalance: 14, + claimClaimableBalance: 15, + beginSponsoringFutureReserves: 16, + endSponsoringFutureReserves: 17, + revokeSponsorship: 18, + clawback: 19, + clawbackClaimableBalance: 20, + setTrustLineFlags: 21, + liquidityPoolDeposit: 22, + liquidityPoolWithdraw: 23, + invokeHostFunction: 24, + bumpFootprintExpiration: 25, + restoreFootprint: 26, + }); + + // === xdr source ============================================================ + // + // struct CreateAccountOp + // { + // AccountID destination; // account to create + // int64 startingBalance; // amount they end up with + // }; + // + // =========================================================================== + xdr.struct("CreateAccountOp", [ + ["destination", xdr.lookup("AccountId")], + ["startingBalance", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct PaymentOp + // { + // MuxedAccount destination; // recipient of the payment + // Asset asset; // what they end up with + // int64 amount; // amount they end up with + // }; + // + // =========================================================================== + xdr.struct("PaymentOp", [ + ["destination", xdr.lookup("MuxedAccount")], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct PathPaymentStrictReceiveOp + // { + // Asset sendAsset; // asset we pay with + // int64 sendMax; // the maximum amount of sendAsset to + // // send (excluding fees). + // // The operation will fail if can't be met + // + // MuxedAccount destination; // recipient of the payment + // Asset destAsset; // what they end up with + // int64 destAmount; // amount they end up with + // + // Asset path<5>; // additional hops it must go through to get there + // }; + // + // =========================================================================== + xdr.struct("PathPaymentStrictReceiveOp", [ + ["sendAsset", xdr.lookup("Asset")], + ["sendMax", xdr.lookup("Int64")], + ["destination", xdr.lookup("MuxedAccount")], + ["destAsset", xdr.lookup("Asset")], + ["destAmount", xdr.lookup("Int64")], + ["path", xdr.varArray(xdr.lookup("Asset"), 5)], + ]); + + // === xdr source ============================================================ + // + // struct PathPaymentStrictSendOp + // { + // Asset sendAsset; // asset we pay with + // int64 sendAmount; // amount of sendAsset to send (excluding fees) + // + // MuxedAccount destination; // recipient of the payment + // Asset destAsset; // what they end up with + // int64 destMin; // the minimum amount of dest asset to + // // be received + // // The operation will fail if it can't be met + // + // Asset path<5>; // additional hops it must go through to get there + // }; + // + // =========================================================================== + xdr.struct("PathPaymentStrictSendOp", [ + ["sendAsset", xdr.lookup("Asset")], + ["sendAmount", xdr.lookup("Int64")], + ["destination", xdr.lookup("MuxedAccount")], + ["destAsset", xdr.lookup("Asset")], + ["destMin", xdr.lookup("Int64")], + ["path", xdr.varArray(xdr.lookup("Asset"), 5)], + ]); + + // === xdr source ============================================================ + // + // struct ManageSellOfferOp + // { + // Asset selling; + // Asset buying; + // int64 amount; // amount being sold. if set to 0, delete the offer + // Price price; // price of thing being sold in terms of what you are buying + // + // // 0=create a new offer, otherwise edit an existing offer + // int64 offerID; + // }; + // + // =========================================================================== + xdr.struct("ManageSellOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ManageBuyOfferOp + // { + // Asset selling; + // Asset buying; + // int64 buyAmount; // amount being bought. if set to 0, delete the offer + // Price price; // price of thing being bought in terms of what you are + // // selling + // + // // 0=create a new offer, otherwise edit an existing offer + // int64 offerID; + // }; + // + // =========================================================================== + xdr.struct("ManageBuyOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["buyAmount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ["offerId", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct CreatePassiveSellOfferOp + // { + // Asset selling; // A + // Asset buying; // B + // int64 amount; // amount taker gets + // Price price; // cost of A in terms of B + // }; + // + // =========================================================================== + xdr.struct("CreatePassiveSellOfferOp", [ + ["selling", xdr.lookup("Asset")], + ["buying", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["price", xdr.lookup("Price")], + ]); + + // === xdr source ============================================================ + // + // struct SetOptionsOp + // { + // AccountID* inflationDest; // sets the inflation destination + // + // uint32* clearFlags; // which flags to clear + // uint32* setFlags; // which flags to set + // + // // account threshold manipulation + // uint32* masterWeight; // weight of the master account + // uint32* lowThreshold; + // uint32* medThreshold; + // uint32* highThreshold; + // + // string32* homeDomain; // sets the home domain + // + // // Add, update or remove a signer for the account + // // signer is deleted if the weight is 0 + // Signer* signer; + // }; + // + // =========================================================================== + xdr.struct("SetOptionsOp", [ + ["inflationDest", xdr.option(xdr.lookup("AccountId"))], + ["clearFlags", xdr.option(xdr.lookup("Uint32"))], + ["setFlags", xdr.option(xdr.lookup("Uint32"))], + ["masterWeight", xdr.option(xdr.lookup("Uint32"))], + ["lowThreshold", xdr.option(xdr.lookup("Uint32"))], + ["medThreshold", xdr.option(xdr.lookup("Uint32"))], + ["highThreshold", xdr.option(xdr.lookup("Uint32"))], + ["homeDomain", xdr.option(xdr.lookup("String32"))], + ["signer", xdr.option(xdr.lookup("Signer"))], + ]); + + // === xdr source ============================================================ + // + // union ChangeTrustAsset switch (AssetType type) + // { + // case ASSET_TYPE_NATIVE: // Not credit + // void; + // + // case ASSET_TYPE_CREDIT_ALPHANUM4: + // AlphaNum4 alphaNum4; + // + // case ASSET_TYPE_CREDIT_ALPHANUM12: + // AlphaNum12 alphaNum12; + // + // case ASSET_TYPE_POOL_SHARE: + // LiquidityPoolParameters liquidityPool; + // + // // add other asset types here in the future + // }; + // + // =========================================================================== + xdr.union("ChangeTrustAsset", { + switchOn: xdr.lookup("AssetType"), + switchName: "type", + switches: [ + ["assetTypeNative", xdr.void()], + ["assetTypeCreditAlphanum4", "alphaNum4"], + ["assetTypeCreditAlphanum12", "alphaNum12"], + ["assetTypePoolShare", "liquidityPool"], + ], + arms: { + alphaNum4: xdr.lookup("AlphaNum4"), + alphaNum12: xdr.lookup("AlphaNum12"), + liquidityPool: xdr.lookup("LiquidityPoolParameters"), + }, + }); + + // === xdr source ============================================================ + // + // struct ChangeTrustOp + // { + // ChangeTrustAsset line; + // + // // if limit is set to 0, deletes the trust line + // int64 limit; + // }; + // + // =========================================================================== + xdr.struct("ChangeTrustOp", [ + ["line", xdr.lookup("ChangeTrustAsset")], + ["limit", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct AllowTrustOp + // { + // AccountID trustor; + // AssetCode asset; + // + // // One of 0, AUTHORIZED_FLAG, or AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG + // uint32 authorize; + // }; + // + // =========================================================================== + xdr.struct("AllowTrustOp", [ + ["trustor", xdr.lookup("AccountId")], + ["asset", xdr.lookup("AssetCode")], + ["authorize", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ManageDataOp + // { + // string64 dataName; + // DataValue* dataValue; // set to null to clear + // }; + // + // =========================================================================== + xdr.struct("ManageDataOp", [ + ["dataName", xdr.lookup("String64")], + ["dataValue", xdr.option(xdr.lookup("DataValue"))], + ]); + + // === xdr source ============================================================ + // + // struct BumpSequenceOp + // { + // SequenceNumber bumpTo; + // }; + // + // =========================================================================== + xdr.struct("BumpSequenceOp", [["bumpTo", xdr.lookup("SequenceNumber")]]); + + // === xdr source ============================================================ + // + // struct CreateClaimableBalanceOp + // { + // Asset asset; + // int64 amount; + // Claimant claimants<10>; + // }; + // + // =========================================================================== + xdr.struct("CreateClaimableBalanceOp", [ + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ["claimants", xdr.varArray(xdr.lookup("Claimant"), 10)], + ]); + + // === xdr source ============================================================ + // + // struct ClaimClaimableBalanceOp + // { + // ClaimableBalanceID balanceID; + // }; + // + // =========================================================================== + xdr.struct("ClaimClaimableBalanceOp", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct BeginSponsoringFutureReservesOp + // { + // AccountID sponsoredID; + // }; + // + // =========================================================================== + xdr.struct("BeginSponsoringFutureReservesOp", [ + ["sponsoredId", xdr.lookup("AccountId")], + ]); + + // === xdr source ============================================================ + // + // enum RevokeSponsorshipType + // { + // REVOKE_SPONSORSHIP_LEDGER_ENTRY = 0, + // REVOKE_SPONSORSHIP_SIGNER = 1 + // }; + // + // =========================================================================== + xdr.enum("RevokeSponsorshipType", { + revokeSponsorshipLedgerEntry: 0, + revokeSponsorshipSigner: 1, + }); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID accountID; + // SignerKey signerKey; + // } + // + // =========================================================================== + xdr.struct("RevokeSponsorshipOpSigner", [ + ["accountId", xdr.lookup("AccountId")], + ["signerKey", xdr.lookup("SignerKey")], + ]); + + // === xdr source ============================================================ + // + // union RevokeSponsorshipOp switch (RevokeSponsorshipType type) + // { + // case REVOKE_SPONSORSHIP_LEDGER_ENTRY: + // LedgerKey ledgerKey; + // case REVOKE_SPONSORSHIP_SIGNER: + // struct + // { + // AccountID accountID; + // SignerKey signerKey; + // } signer; + // }; + // + // =========================================================================== + xdr.union("RevokeSponsorshipOp", { + switchOn: xdr.lookup("RevokeSponsorshipType"), + switchName: "type", + switches: [ + ["revokeSponsorshipLedgerEntry", "ledgerKey"], + ["revokeSponsorshipSigner", "signer"], + ], + arms: { + ledgerKey: xdr.lookup("LedgerKey"), + signer: xdr.lookup("RevokeSponsorshipOpSigner"), + }, + }); + + // === xdr source ============================================================ + // + // struct ClawbackOp + // { + // Asset asset; + // MuxedAccount from; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("ClawbackOp", [ + ["asset", xdr.lookup("Asset")], + ["from", xdr.lookup("MuxedAccount")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClawbackClaimableBalanceOp + // { + // ClaimableBalanceID balanceID; + // }; + // + // =========================================================================== + xdr.struct("ClawbackClaimableBalanceOp", [ + ["balanceId", xdr.lookup("ClaimableBalanceId")], + ]); + + // === xdr source ============================================================ + // + // struct SetTrustLineFlagsOp + // { + // AccountID trustor; + // Asset asset; + // + // uint32 clearFlags; // which flags to clear + // uint32 setFlags; // which flags to set + // }; + // + // =========================================================================== + xdr.struct("SetTrustLineFlagsOp", [ + ["trustor", xdr.lookup("AccountId")], + ["asset", xdr.lookup("Asset")], + ["clearFlags", xdr.lookup("Uint32")], + ["setFlags", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // const LIQUIDITY_POOL_FEE_V18 = 30; + // + // =========================================================================== + xdr.const("LIQUIDITY_POOL_FEE_V18", 30); + + // === xdr source ============================================================ + // + // struct LiquidityPoolDepositOp + // { + // PoolID liquidityPoolID; + // int64 maxAmountA; // maximum amount of first asset to deposit + // int64 maxAmountB; // maximum amount of second asset to deposit + // Price minPrice; // minimum depositA/depositB + // Price maxPrice; // maximum depositA/depositB + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolDepositOp", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["maxAmountA", xdr.lookup("Int64")], + ["maxAmountB", xdr.lookup("Int64")], + ["minPrice", xdr.lookup("Price")], + ["maxPrice", xdr.lookup("Price")], + ]); + + // === xdr source ============================================================ + // + // struct LiquidityPoolWithdrawOp + // { + // PoolID liquidityPoolID; + // int64 amount; // amount of pool shares to withdraw + // int64 minAmountA; // minimum amount of first asset to withdraw + // int64 minAmountB; // minimum amount of second asset to withdraw + // }; + // + // =========================================================================== + xdr.struct("LiquidityPoolWithdrawOp", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["amount", xdr.lookup("Int64")], + ["minAmountA", xdr.lookup("Int64")], + ["minAmountB", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum HostFunctionType + // { + // HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, + // HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, + // HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 + // }; + // + // =========================================================================== + xdr.enum("HostFunctionType", { + hostFunctionTypeInvokeContract: 0, + hostFunctionTypeCreateContract: 1, + hostFunctionTypeUploadContractWasm: 2, + }); + + // === xdr source ============================================================ + // + // enum ContractIDPreimageType + // { + // CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0, + // CONTRACT_ID_PREIMAGE_FROM_ASSET = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractIdPreimageType", { + contractIdPreimageFromAddress: 0, + contractIdPreimageFromAsset: 1, + }); + + // === xdr source ============================================================ + // + // struct + // { + // SCAddress address; + // uint256 salt; + // } + // + // =========================================================================== + xdr.struct("ContractIdPreimageFromAddress", [ + ["address", xdr.lookup("ScAddress")], + ["salt", xdr.lookup("Uint256")], + ]); + + // === xdr source ============================================================ + // + // union ContractIDPreimage switch (ContractIDPreimageType type) + // { + // case CONTRACT_ID_PREIMAGE_FROM_ADDRESS: + // struct + // { + // SCAddress address; + // uint256 salt; + // } fromAddress; + // case CONTRACT_ID_PREIMAGE_FROM_ASSET: + // Asset fromAsset; + // }; + // + // =========================================================================== + xdr.union("ContractIdPreimage", { + switchOn: xdr.lookup("ContractIdPreimageType"), + switchName: "type", + switches: [ + ["contractIdPreimageFromAddress", "fromAddress"], + ["contractIdPreimageFromAsset", "fromAsset"], + ], + arms: { + fromAddress: xdr.lookup("ContractIdPreimageFromAddress"), + fromAsset: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // struct CreateContractArgs + // { + // ContractIDPreimage contractIDPreimage; + // ContractExecutable executable; + // }; + // + // =========================================================================== + xdr.struct("CreateContractArgs", [ + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ["executable", xdr.lookup("ContractExecutable")], + ]); + + // === xdr source ============================================================ + // + // struct InvokeContractArgs { + // SCAddress contractAddress; + // SCSymbol functionName; + // SCVal args<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeContractArgs", [ + ["contractAddress", xdr.lookup("ScAddress")], + ["functionName", xdr.lookup("ScSymbol")], + ["args", xdr.varArray(xdr.lookup("ScVal"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // union HostFunction switch (HostFunctionType type) + // { + // case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: + // InvokeContractArgs invokeContract; + // case HOST_FUNCTION_TYPE_CREATE_CONTRACT: + // CreateContractArgs createContract; + // case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: + // opaque wasm<>; + // }; + // + // =========================================================================== + xdr.union("HostFunction", { + switchOn: xdr.lookup("HostFunctionType"), + switchName: "type", + switches: [ + ["hostFunctionTypeInvokeContract", "invokeContract"], + ["hostFunctionTypeCreateContract", "createContract"], + ["hostFunctionTypeUploadContractWasm", "wasm"], + ], + arms: { + invokeContract: xdr.lookup("InvokeContractArgs"), + createContract: xdr.lookup("CreateContractArgs"), + wasm: xdr.varOpaque(), + }, + }); + + // === xdr source ============================================================ + // + // enum SorobanAuthorizedFunctionType + // { + // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, + // SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 + // }; + // + // =========================================================================== + xdr.enum("SorobanAuthorizedFunctionType", { + sorobanAuthorizedFunctionTypeContractFn: 0, + sorobanAuthorizedFunctionTypeCreateContractHostFn: 1, + }); + + // === xdr source ============================================================ + // + // union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) + // { + // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: + // InvokeContractArgs contractFn; + // case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: + // CreateContractArgs createContractHostFn; + // }; + // + // =========================================================================== + xdr.union("SorobanAuthorizedFunction", { + switchOn: xdr.lookup("SorobanAuthorizedFunctionType"), + switchName: "type", + switches: [ + ["sorobanAuthorizedFunctionTypeContractFn", "contractFn"], + [ + "sorobanAuthorizedFunctionTypeCreateContractHostFn", + "createContractHostFn", + ], + ], + arms: { + contractFn: xdr.lookup("InvokeContractArgs"), + createContractHostFn: xdr.lookup("CreateContractArgs"), + }, + }); + + // === xdr source ============================================================ + // + // struct SorobanAuthorizedInvocation + // { + // SorobanAuthorizedFunction function; + // SorobanAuthorizedInvocation subInvocations<>; + // }; + // + // =========================================================================== + xdr.struct("SorobanAuthorizedInvocation", [ + ["function", xdr.lookup("SorobanAuthorizedFunction")], + [ + "subInvocations", + xdr.varArray(xdr.lookup("SorobanAuthorizedInvocation"), 2147483647), + ], + ]); + + // === xdr source ============================================================ + // + // struct SorobanAddressCredentials + // { + // SCAddress address; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SCVal signature; + // }; + // + // =========================================================================== + xdr.struct("SorobanAddressCredentials", [ + ["address", xdr.lookup("ScAddress")], + ["nonce", xdr.lookup("Int64")], + ["signatureExpirationLedger", xdr.lookup("Uint32")], + ["signature", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // enum SorobanCredentialsType + // { + // SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0, + // SOROBAN_CREDENTIALS_ADDRESS = 1 + // }; + // + // =========================================================================== + xdr.enum("SorobanCredentialsType", { + sorobanCredentialsSourceAccount: 0, + sorobanCredentialsAddress: 1, + }); + + // === xdr source ============================================================ + // + // union SorobanCredentials switch (SorobanCredentialsType type) + // { + // case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT: + // void; + // case SOROBAN_CREDENTIALS_ADDRESS: + // SorobanAddressCredentials address; + // }; + // + // =========================================================================== + xdr.union("SorobanCredentials", { + switchOn: xdr.lookup("SorobanCredentialsType"), + switchName: "type", + switches: [ + ["sorobanCredentialsSourceAccount", xdr.void()], + ["sorobanCredentialsAddress", "address"], + ], + arms: { + address: xdr.lookup("SorobanAddressCredentials"), + }, + }); + + // === xdr source ============================================================ + // + // struct SorobanAuthorizationEntry + // { + // SorobanCredentials credentials; + // SorobanAuthorizedInvocation rootInvocation; + // }; + // + // =========================================================================== + xdr.struct("SorobanAuthorizationEntry", [ + ["credentials", xdr.lookup("SorobanCredentials")], + ["rootInvocation", xdr.lookup("SorobanAuthorizedInvocation")], + ]); + + // === xdr source ============================================================ + // + // struct InvokeHostFunctionOp + // { + // // Host function to invoke. + // HostFunction hostFunction; + // // Per-address authorizations for this host function. + // SorobanAuthorizationEntry auth<>; + // }; + // + // =========================================================================== + xdr.struct("InvokeHostFunctionOp", [ + ["hostFunction", xdr.lookup("HostFunction")], + ["auth", xdr.varArray(xdr.lookup("SorobanAuthorizationEntry"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct BumpFootprintExpirationOp + // { + // ExtensionPoint ext; + // uint32 ledgersToExpire; + // }; + // + // =========================================================================== + xdr.struct("BumpFootprintExpirationOp", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["ledgersToExpire", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct RestoreFootprintOp + // { + // ExtensionPoint ext; + // }; + // + // =========================================================================== + xdr.struct("RestoreFootprintOp", [["ext", xdr.lookup("ExtensionPoint")]]); + + // === xdr source ============================================================ + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountOp createAccountOp; + // case PAYMENT: + // PaymentOp paymentOp; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; + // case MANAGE_SELL_OFFER: + // ManageSellOfferOp manageSellOfferOp; + // case CREATE_PASSIVE_SELL_OFFER: + // CreatePassiveSellOfferOp createPassiveSellOfferOp; + // case SET_OPTIONS: + // SetOptionsOp setOptionsOp; + // case CHANGE_TRUST: + // ChangeTrustOp changeTrustOp; + // case ALLOW_TRUST: + // AllowTrustOp allowTrustOp; + // case ACCOUNT_MERGE: + // MuxedAccount destination; + // case INFLATION: + // void; + // case MANAGE_DATA: + // ManageDataOp manageDataOp; + // case BUMP_SEQUENCE: + // BumpSequenceOp bumpSequenceOp; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferOp manageBuyOfferOp; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendOp pathPaymentStrictSendOp; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceOp createClaimableBalanceOp; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceOp claimClaimableBalanceOp; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; + // case END_SPONSORING_FUTURE_RESERVES: + // void; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipOp revokeSponsorshipOp; + // case CLAWBACK: + // ClawbackOp clawbackOp; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsOp setTrustLineFlagsOp; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositOp liquidityPoolDepositOp; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionOp invokeHostFunctionOp; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case RESTORE_FOOTPRINT: + // RestoreFootprintOp restoreFootprintOp; + // } + // + // =========================================================================== + xdr.union("OperationBody", { + switchOn: xdr.lookup("OperationType"), + switchName: "type", + switches: [ + ["createAccount", "createAccountOp"], + ["payment", "paymentOp"], + ["pathPaymentStrictReceive", "pathPaymentStrictReceiveOp"], + ["manageSellOffer", "manageSellOfferOp"], + ["createPassiveSellOffer", "createPassiveSellOfferOp"], + ["setOptions", "setOptionsOp"], + ["changeTrust", "changeTrustOp"], + ["allowTrust", "allowTrustOp"], + ["accountMerge", "destination"], + ["inflation", xdr.void()], + ["manageData", "manageDataOp"], + ["bumpSequence", "bumpSequenceOp"], + ["manageBuyOffer", "manageBuyOfferOp"], + ["pathPaymentStrictSend", "pathPaymentStrictSendOp"], + ["createClaimableBalance", "createClaimableBalanceOp"], + ["claimClaimableBalance", "claimClaimableBalanceOp"], + ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesOp"], + ["endSponsoringFutureReserves", xdr.void()], + ["revokeSponsorship", "revokeSponsorshipOp"], + ["clawback", "clawbackOp"], + ["clawbackClaimableBalance", "clawbackClaimableBalanceOp"], + ["setTrustLineFlags", "setTrustLineFlagsOp"], + ["liquidityPoolDeposit", "liquidityPoolDepositOp"], + ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], + ["invokeHostFunction", "invokeHostFunctionOp"], + ["bumpFootprintExpiration", "bumpFootprintExpirationOp"], + ["restoreFootprint", "restoreFootprintOp"], + ], + arms: { + createAccountOp: xdr.lookup("CreateAccountOp"), + paymentOp: xdr.lookup("PaymentOp"), + pathPaymentStrictReceiveOp: xdr.lookup("PathPaymentStrictReceiveOp"), + manageSellOfferOp: xdr.lookup("ManageSellOfferOp"), + createPassiveSellOfferOp: xdr.lookup("CreatePassiveSellOfferOp"), + setOptionsOp: xdr.lookup("SetOptionsOp"), + changeTrustOp: xdr.lookup("ChangeTrustOp"), + allowTrustOp: xdr.lookup("AllowTrustOp"), + destination: xdr.lookup("MuxedAccount"), + manageDataOp: xdr.lookup("ManageDataOp"), + bumpSequenceOp: xdr.lookup("BumpSequenceOp"), + manageBuyOfferOp: xdr.lookup("ManageBuyOfferOp"), + pathPaymentStrictSendOp: xdr.lookup("PathPaymentStrictSendOp"), + createClaimableBalanceOp: xdr.lookup("CreateClaimableBalanceOp"), + claimClaimableBalanceOp: xdr.lookup("ClaimClaimableBalanceOp"), + beginSponsoringFutureReservesOp: xdr.lookup( + "BeginSponsoringFutureReservesOp" + ), + revokeSponsorshipOp: xdr.lookup("RevokeSponsorshipOp"), + clawbackOp: xdr.lookup("ClawbackOp"), + clawbackClaimableBalanceOp: xdr.lookup("ClawbackClaimableBalanceOp"), + setTrustLineFlagsOp: xdr.lookup("SetTrustLineFlagsOp"), + liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), + liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), + invokeHostFunctionOp: xdr.lookup("InvokeHostFunctionOp"), + bumpFootprintExpirationOp: xdr.lookup("BumpFootprintExpirationOp"), + restoreFootprintOp: xdr.lookup("RestoreFootprintOp"), + }, + }); + + // === xdr source ============================================================ + // + // struct Operation + // { + // // sourceAccount is the account used to run the operation + // // if not set, the runtime defaults to "sourceAccount" specified at + // // the transaction level + // MuxedAccount* sourceAccount; + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountOp createAccountOp; + // case PAYMENT: + // PaymentOp paymentOp; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; + // case MANAGE_SELL_OFFER: + // ManageSellOfferOp manageSellOfferOp; + // case CREATE_PASSIVE_SELL_OFFER: + // CreatePassiveSellOfferOp createPassiveSellOfferOp; + // case SET_OPTIONS: + // SetOptionsOp setOptionsOp; + // case CHANGE_TRUST: + // ChangeTrustOp changeTrustOp; + // case ALLOW_TRUST: + // AllowTrustOp allowTrustOp; + // case ACCOUNT_MERGE: + // MuxedAccount destination; + // case INFLATION: + // void; + // case MANAGE_DATA: + // ManageDataOp manageDataOp; + // case BUMP_SEQUENCE: + // BumpSequenceOp bumpSequenceOp; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferOp manageBuyOfferOp; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendOp pathPaymentStrictSendOp; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceOp createClaimableBalanceOp; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceOp claimClaimableBalanceOp; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; + // case END_SPONSORING_FUTURE_RESERVES: + // void; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipOp revokeSponsorshipOp; + // case CLAWBACK: + // ClawbackOp clawbackOp; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsOp setTrustLineFlagsOp; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositOp liquidityPoolDepositOp; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionOp invokeHostFunctionOp; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case RESTORE_FOOTPRINT: + // RestoreFootprintOp restoreFootprintOp; + // } + // body; + // }; + // + // =========================================================================== + xdr.struct("Operation", [ + ["sourceAccount", xdr.option(xdr.lookup("MuxedAccount"))], + ["body", xdr.lookup("OperationBody")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageOperationId", [ + ["sourceAccount", xdr.lookup("AccountId")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["opNum", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // PoolID liquidityPoolID; + // Asset asset; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageRevokeId", [ + ["sourceAccount", xdr.lookup("AccountId")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["opNum", xdr.lookup("Uint32")], + ["liquidityPoolId", xdr.lookup("PoolId")], + ["asset", xdr.lookup("Asset")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash networkID; + // ContractIDPreimage contractIDPreimage; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageContractId", [ + ["networkId", xdr.lookup("Hash")], + ["contractIdPreimage", xdr.lookup("ContractIdPreimage")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // Hash networkID; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SorobanAuthorizedInvocation invocation; + // } + // + // =========================================================================== + xdr.struct("HashIdPreimageSorobanAuthorization", [ + ["networkId", xdr.lookup("Hash")], + ["nonce", xdr.lookup("Int64")], + ["signatureExpirationLedger", xdr.lookup("Uint32")], + ["invocation", xdr.lookup("SorobanAuthorizedInvocation")], + ]); + + // === xdr source ============================================================ + // + // union HashIDPreimage switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_OP_ID: + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // } operationID; + // case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: + // struct + // { + // AccountID sourceAccount; + // SequenceNumber seqNum; + // uint32 opNum; + // PoolID liquidityPoolID; + // Asset asset; + // } revokeID; + // case ENVELOPE_TYPE_CONTRACT_ID: + // struct + // { + // Hash networkID; + // ContractIDPreimage contractIDPreimage; + // } contractID; + // case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: + // struct + // { + // Hash networkID; + // int64 nonce; + // uint32 signatureExpirationLedger; + // SorobanAuthorizedInvocation invocation; + // } sorobanAuthorization; + // }; + // + // =========================================================================== + xdr.union("HashIdPreimage", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeOpId", "operationId"], + ["envelopeTypePoolRevokeOpId", "revokeId"], + ["envelopeTypeContractId", "contractId"], + ["envelopeTypeSorobanAuthorization", "sorobanAuthorization"], + ], + arms: { + operationId: xdr.lookup("HashIdPreimageOperationId"), + revokeId: xdr.lookup("HashIdPreimageRevokeId"), + contractId: xdr.lookup("HashIdPreimageContractId"), + sorobanAuthorization: xdr.lookup("HashIdPreimageSorobanAuthorization"), + }, + }); + + // === xdr source ============================================================ + // + // enum MemoType + // { + // MEMO_NONE = 0, + // MEMO_TEXT = 1, + // MEMO_ID = 2, + // MEMO_HASH = 3, + // MEMO_RETURN = 4 + // }; + // + // =========================================================================== + xdr.enum("MemoType", { + memoNone: 0, + memoText: 1, + memoId: 2, + memoHash: 3, + memoReturn: 4, + }); + + // === xdr source ============================================================ + // + // union Memo switch (MemoType type) + // { + // case MEMO_NONE: + // void; + // case MEMO_TEXT: + // string text<28>; + // case MEMO_ID: + // uint64 id; + // case MEMO_HASH: + // Hash hash; // the hash of what to pull from the content server + // case MEMO_RETURN: + // Hash retHash; // the hash of the tx you are rejecting + // }; + // + // =========================================================================== + xdr.union("Memo", { + switchOn: xdr.lookup("MemoType"), + switchName: "type", + switches: [ + ["memoNone", xdr.void()], + ["memoText", "text"], + ["memoId", "id"], + ["memoHash", "hash"], + ["memoReturn", "retHash"], + ], + arms: { + text: xdr.string(28), + id: xdr.lookup("Uint64"), + hash: xdr.lookup("Hash"), + retHash: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // struct TimeBounds + // { + // TimePoint minTime; + // TimePoint maxTime; // 0 here means no maxTime + // }; + // + // =========================================================================== + xdr.struct("TimeBounds", [ + ["minTime", xdr.lookup("TimePoint")], + ["maxTime", xdr.lookup("TimePoint")], + ]); + + // === xdr source ============================================================ + // + // struct LedgerBounds + // { + // uint32 minLedger; + // uint32 maxLedger; // 0 here means no maxLedger + // }; + // + // =========================================================================== + xdr.struct("LedgerBounds", [ + ["minLedger", xdr.lookup("Uint32")], + ["maxLedger", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct PreconditionsV2 + // { + // TimeBounds* timeBounds; + // + // // Transaction only valid for ledger numbers n such that + // // minLedger <= n < maxLedger (if maxLedger == 0, then + // // only minLedger is checked) + // LedgerBounds* ledgerBounds; + // + // // If NULL, only valid when sourceAccount's sequence number + // // is seqNum - 1. Otherwise, valid when sourceAccount's + // // sequence number n satisfies minSeqNum <= n < tx.seqNum. + // // Note that after execution the account's sequence number + // // is always raised to tx.seqNum, and a transaction is not + // // valid if tx.seqNum is too high to ensure replay protection. + // SequenceNumber* minSeqNum; + // + // // For the transaction to be valid, the current ledger time must + // // be at least minSeqAge greater than sourceAccount's seqTime. + // Duration minSeqAge; + // + // // For the transaction to be valid, the current ledger number + // // must be at least minSeqLedgerGap greater than sourceAccount's + // // seqLedger. + // uint32 minSeqLedgerGap; + // + // // 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. + // SignerKey extraSigners<2>; + // }; + // + // =========================================================================== + xdr.struct("PreconditionsV2", [ + ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], + ["ledgerBounds", xdr.option(xdr.lookup("LedgerBounds"))], + ["minSeqNum", xdr.option(xdr.lookup("SequenceNumber"))], + ["minSeqAge", xdr.lookup("Duration")], + ["minSeqLedgerGap", xdr.lookup("Uint32")], + ["extraSigners", xdr.varArray(xdr.lookup("SignerKey"), 2)], + ]); + + // === xdr source ============================================================ + // + // enum PreconditionType + // { + // PRECOND_NONE = 0, + // PRECOND_TIME = 1, + // PRECOND_V2 = 2 + // }; + // + // =========================================================================== + xdr.enum("PreconditionType", { + precondNone: 0, + precondTime: 1, + precondV2: 2, + }); + + // === xdr source ============================================================ + // + // union Preconditions switch (PreconditionType type) + // { + // case PRECOND_NONE: + // void; + // case PRECOND_TIME: + // TimeBounds timeBounds; + // case PRECOND_V2: + // PreconditionsV2 v2; + // }; + // + // =========================================================================== + xdr.union("Preconditions", { + switchOn: xdr.lookup("PreconditionType"), + switchName: "type", + switches: [ + ["precondNone", xdr.void()], + ["precondTime", "timeBounds"], + ["precondV2", "v2"], + ], + arms: { + timeBounds: xdr.lookup("TimeBounds"), + v2: xdr.lookup("PreconditionsV2"), + }, + }); + + // === xdr source ============================================================ + // + // struct LedgerFootprint + // { + // LedgerKey readOnly<>; + // LedgerKey readWrite<>; + // }; + // + // =========================================================================== + xdr.struct("LedgerFootprint", [ + ["readOnly", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ["readWrite", xdr.varArray(xdr.lookup("LedgerKey"), 2147483647)], + ]); + + // === xdr source ============================================================ + // + // struct SorobanResources + // { + // // The ledger footprint of the transaction. + // LedgerFootprint footprint; + // // The maximum number of instructions this transaction can use + // uint32 instructions; + // + // // The maximum number of bytes this transaction can read from ledger + // uint32 readBytes; + // // The maximum number of bytes this transaction can write to ledger + // uint32 writeBytes; + // }; + // + // =========================================================================== + xdr.struct("SorobanResources", [ + ["footprint", xdr.lookup("LedgerFootprint")], + ["instructions", xdr.lookup("Uint32")], + ["readBytes", xdr.lookup("Uint32")], + ["writeBytes", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SorobanTransactionData + // { + // ExtensionPoint ext; + // SorobanResources resources; + // // Portion of transaction `fee` allocated to refundable fees. + // int64 refundableFee; + // }; + // + // =========================================================================== + xdr.struct("SorobanTransactionData", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["resources", xdr.lookup("SorobanResources")], + ["refundableFee", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionV0Ext", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionV0 + // { + // uint256 sourceAccountEd25519; + // uint32 fee; + // SequenceNumber seqNum; + // TimeBounds* timeBounds; + // Memo memo; + // Operation operations; + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionV0", [ + ["sourceAccountEd25519", xdr.lookup("Uint256")], + ["fee", xdr.lookup("Uint32")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["timeBounds", xdr.option(xdr.lookup("TimeBounds"))], + ["memo", xdr.lookup("Memo")], + [ + "operations", + xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX")), + ], + ["ext", xdr.lookup("TransactionV0Ext")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionV0Envelope + // { + // TransactionV0 tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("TransactionV0Envelope", [ + ["tx", xdr.lookup("TransactionV0")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // SorobanTransactionData sorobanData; + // } + // + // =========================================================================== + xdr.union("TransactionExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [ + [0, xdr.void()], + [1, "sorobanData"], + ], + arms: { + sorobanData: xdr.lookup("SorobanTransactionData"), + }, + }); + + // === xdr source ============================================================ + // + // struct Transaction + // { + // // account used to run the transaction + // MuxedAccount sourceAccount; + // + // // the fee the sourceAccount will pay + // uint32 fee; + // + // // sequence number to consume in the account + // SequenceNumber seqNum; + // + // // validity conditions + // Preconditions cond; + // + // Memo memo; + // + // Operation operations; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // case 1: + // SorobanTransactionData sorobanData; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("Transaction", [ + ["sourceAccount", xdr.lookup("MuxedAccount")], + ["fee", xdr.lookup("Uint32")], + ["seqNum", xdr.lookup("SequenceNumber")], + ["cond", xdr.lookup("Preconditions")], + ["memo", xdr.lookup("Memo")], + [ + "operations", + xdr.varArray(xdr.lookup("Operation"), xdr.lookup("MAX_OPS_PER_TX")), + ], + ["ext", xdr.lookup("TransactionExt")], + ]); + + // === xdr source ============================================================ + // + // struct TransactionV1Envelope + // { + // Transaction tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("TransactionV1Envelope", [ + ["tx", xdr.lookup("Transaction")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // } + // + // =========================================================================== + xdr.union("FeeBumpTransactionInnerTx", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [["envelopeTypeTx", "v1"]], + arms: { + v1: xdr.lookup("TransactionV1Envelope"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("FeeBumpTransactionExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct FeeBumpTransaction + // { + // MuxedAccount feeSource; + // int64 fee; + // union switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // } + // innerTx; + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("FeeBumpTransaction", [ + ["feeSource", xdr.lookup("MuxedAccount")], + ["fee", xdr.lookup("Int64")], + ["innerTx", xdr.lookup("FeeBumpTransactionInnerTx")], + ["ext", xdr.lookup("FeeBumpTransactionExt")], + ]); + + // === xdr source ============================================================ + // + // struct FeeBumpTransactionEnvelope + // { + // FeeBumpTransaction tx; + // /* Each decorated signature is a signature over the SHA256 hash of + // * a TransactionSignaturePayload */ + // DecoratedSignature signatures<20>; + // }; + // + // =========================================================================== + xdr.struct("FeeBumpTransactionEnvelope", [ + ["tx", xdr.lookup("FeeBumpTransaction")], + ["signatures", xdr.varArray(xdr.lookup("DecoratedSignature"), 20)], + ]); + + // === xdr source ============================================================ + // + // union TransactionEnvelope switch (EnvelopeType type) + // { + // case ENVELOPE_TYPE_TX_V0: + // TransactionV0Envelope v0; + // case ENVELOPE_TYPE_TX: + // TransactionV1Envelope v1; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransactionEnvelope feeBump; + // }; + // + // =========================================================================== + xdr.union("TransactionEnvelope", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeTxV0", "v0"], + ["envelopeTypeTx", "v1"], + ["envelopeTypeTxFeeBump", "feeBump"], + ], + arms: { + v0: xdr.lookup("TransactionV0Envelope"), + v1: xdr.lookup("TransactionV1Envelope"), + feeBump: xdr.lookup("FeeBumpTransactionEnvelope"), + }, + }); + + // === xdr source ============================================================ + // + // union switch (EnvelopeType type) + // { + // // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 + // case ENVELOPE_TYPE_TX: + // Transaction tx; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransaction feeBump; + // } + // + // =========================================================================== + xdr.union("TransactionSignaturePayloadTaggedTransaction", { + switchOn: xdr.lookup("EnvelopeType"), + switchName: "type", + switches: [ + ["envelopeTypeTx", "tx"], + ["envelopeTypeTxFeeBump", "feeBump"], + ], + arms: { + tx: xdr.lookup("Transaction"), + feeBump: xdr.lookup("FeeBumpTransaction"), + }, + }); + + // === xdr source ============================================================ + // + // struct TransactionSignaturePayload + // { + // Hash networkId; + // union switch (EnvelopeType type) + // { + // // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 + // case ENVELOPE_TYPE_TX: + // Transaction tx; + // case ENVELOPE_TYPE_TX_FEE_BUMP: + // FeeBumpTransaction feeBump; + // } + // taggedTransaction; + // }; + // + // =========================================================================== + xdr.struct("TransactionSignaturePayload", [ + ["networkId", xdr.lookup("Hash")], + [ + "taggedTransaction", + xdr.lookup("TransactionSignaturePayloadTaggedTransaction"), + ], + ]); + + // === xdr source ============================================================ + // + // enum ClaimAtomType + // { + // CLAIM_ATOM_TYPE_V0 = 0, + // CLAIM_ATOM_TYPE_ORDER_BOOK = 1, + // CLAIM_ATOM_TYPE_LIQUIDITY_POOL = 2 + // }; + // + // =========================================================================== + xdr.enum("ClaimAtomType", { + claimAtomTypeV0: 0, + claimAtomTypeOrderBook: 1, + claimAtomTypeLiquidityPool: 2, + }); + + // === xdr source ============================================================ + // + // struct ClaimOfferAtomV0 + // { + // // emitted to identify the offer + // uint256 sellerEd25519; // Account that owns the offer + // int64 offerID; + // + // // amount and asset taken from the owner + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the owner + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimOfferAtomV0", [ + ["sellerEd25519", xdr.lookup("Uint256")], + ["offerId", xdr.lookup("Int64")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClaimOfferAtom + // { + // // emitted to identify the offer + // AccountID sellerID; // Account that owns the offer + // int64 offerID; + // + // // amount and asset taken from the owner + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the owner + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimOfferAtom", [ + ["sellerId", xdr.lookup("AccountId")], + ["offerId", xdr.lookup("Int64")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ClaimLiquidityAtom + // { + // PoolID liquidityPoolID; + // + // // amount and asset taken from the pool + // Asset assetSold; + // int64 amountSold; + // + // // amount and asset sent to the pool + // Asset assetBought; + // int64 amountBought; + // }; + // + // =========================================================================== + xdr.struct("ClaimLiquidityAtom", [ + ["liquidityPoolId", xdr.lookup("PoolId")], + ["assetSold", xdr.lookup("Asset")], + ["amountSold", xdr.lookup("Int64")], + ["assetBought", xdr.lookup("Asset")], + ["amountBought", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union ClaimAtom switch (ClaimAtomType type) + // { + // case CLAIM_ATOM_TYPE_V0: + // ClaimOfferAtomV0 v0; + // case CLAIM_ATOM_TYPE_ORDER_BOOK: + // ClaimOfferAtom orderBook; + // case CLAIM_ATOM_TYPE_LIQUIDITY_POOL: + // ClaimLiquidityAtom liquidityPool; + // }; + // + // =========================================================================== + xdr.union("ClaimAtom", { + switchOn: xdr.lookup("ClaimAtomType"), + switchName: "type", + switches: [ + ["claimAtomTypeV0", "v0"], + ["claimAtomTypeOrderBook", "orderBook"], + ["claimAtomTypeLiquidityPool", "liquidityPool"], + ], + arms: { + v0: xdr.lookup("ClaimOfferAtomV0"), + orderBook: xdr.lookup("ClaimOfferAtom"), + liquidityPool: xdr.lookup("ClaimLiquidityAtom"), + }, + }); + + // === xdr source ============================================================ + // + // enum CreateAccountResultCode + // { + // // codes considered as "success" for the operation + // CREATE_ACCOUNT_SUCCESS = 0, // account was created + // + // // codes considered as "failure" for the operation + // CREATE_ACCOUNT_MALFORMED = -1, // invalid destination + // CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account + // CREATE_ACCOUNT_LOW_RESERVE = + // -3, // would create an account below the min reserve + // CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists + // }; + // + // =========================================================================== + xdr.enum("CreateAccountResultCode", { + createAccountSuccess: 0, + createAccountMalformed: -1, + createAccountUnderfunded: -2, + createAccountLowReserve: -3, + createAccountAlreadyExist: -4, + }); + + // === xdr source ============================================================ + // + // union CreateAccountResult switch (CreateAccountResultCode code) + // { + // case CREATE_ACCOUNT_SUCCESS: + // void; + // case CREATE_ACCOUNT_MALFORMED: + // case CREATE_ACCOUNT_UNDERFUNDED: + // case CREATE_ACCOUNT_LOW_RESERVE: + // case CREATE_ACCOUNT_ALREADY_EXIST: + // void; + // }; + // + // =========================================================================== + xdr.union("CreateAccountResult", { + switchOn: xdr.lookup("CreateAccountResultCode"), + switchName: "code", + switches: [ + ["createAccountSuccess", xdr.void()], + ["createAccountMalformed", xdr.void()], + ["createAccountUnderfunded", xdr.void()], + ["createAccountLowReserve", xdr.void()], + ["createAccountAlreadyExist", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum PaymentResultCode + // { + // // codes considered as "success" for the operation + // PAYMENT_SUCCESS = 0, // payment successfully completed + // + // // codes considered as "failure" for the operation + // PAYMENT_MALFORMED = -1, // bad input + // PAYMENT_UNDERFUNDED = -2, // not enough funds in source account + // PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account + // PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer + // PAYMENT_NO_DESTINATION = -5, // destination account does not exist + // PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset + // PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset + // PAYMENT_LINE_FULL = -8, // destination would go above their limit + // PAYMENT_NO_ISSUER = -9 // missing issuer on asset + // }; + // + // =========================================================================== + xdr.enum("PaymentResultCode", { + paymentSuccess: 0, + paymentMalformed: -1, + paymentUnderfunded: -2, + paymentSrcNoTrust: -3, + paymentSrcNotAuthorized: -4, + paymentNoDestination: -5, + paymentNoTrust: -6, + paymentNotAuthorized: -7, + paymentLineFull: -8, + paymentNoIssuer: -9, + }); + + // === xdr source ============================================================ + // + // union PaymentResult switch (PaymentResultCode code) + // { + // case PAYMENT_SUCCESS: + // void; + // case PAYMENT_MALFORMED: + // case PAYMENT_UNDERFUNDED: + // case PAYMENT_SRC_NO_TRUST: + // case PAYMENT_SRC_NOT_AUTHORIZED: + // case PAYMENT_NO_DESTINATION: + // case PAYMENT_NO_TRUST: + // case PAYMENT_NOT_AUTHORIZED: + // case PAYMENT_LINE_FULL: + // case PAYMENT_NO_ISSUER: + // void; + // }; + // + // =========================================================================== + xdr.union("PaymentResult", { + switchOn: xdr.lookup("PaymentResultCode"), + switchName: "code", + switches: [ + ["paymentSuccess", xdr.void()], + ["paymentMalformed", xdr.void()], + ["paymentUnderfunded", xdr.void()], + ["paymentSrcNoTrust", xdr.void()], + ["paymentSrcNotAuthorized", xdr.void()], + ["paymentNoDestination", xdr.void()], + ["paymentNoTrust", xdr.void()], + ["paymentNotAuthorized", xdr.void()], + ["paymentLineFull", xdr.void()], + ["paymentNoIssuer", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum PathPaymentStrictReceiveResultCode + // { + // // codes considered as "success" for the operation + // PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success + // + // // codes considered as "failure" for the operation + // PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input + // PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = + // -2, // not enough funds in source account + // PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = + // -3, // no trust line on source account + // PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = + // -4, // source not authorized to transfer + // PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = + // -5, // destination account does not exist + // PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = + // -6, // dest missing a trust line for asset + // PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = + // -7, // dest not authorized to hold asset + // PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = + // -8, // dest would go above their limit + // PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset + // PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = + // -10, // not enough offers to satisfy path + // PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = + // -11, // would cross one of its own offers + // PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax + // }; + // + // =========================================================================== + xdr.enum("PathPaymentStrictReceiveResultCode", { + pathPaymentStrictReceiveSuccess: 0, + pathPaymentStrictReceiveMalformed: -1, + pathPaymentStrictReceiveUnderfunded: -2, + pathPaymentStrictReceiveSrcNoTrust: -3, + pathPaymentStrictReceiveSrcNotAuthorized: -4, + pathPaymentStrictReceiveNoDestination: -5, + pathPaymentStrictReceiveNoTrust: -6, + pathPaymentStrictReceiveNotAuthorized: -7, + pathPaymentStrictReceiveLineFull: -8, + pathPaymentStrictReceiveNoIssuer: -9, + pathPaymentStrictReceiveTooFewOffers: -10, + pathPaymentStrictReceiveOfferCrossSelf: -11, + pathPaymentStrictReceiveOverSendmax: -12, + }); + + // === xdr source ============================================================ + // + // struct SimplePaymentResult + // { + // AccountID destination; + // Asset asset; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("SimplePaymentResult", [ + ["destination", xdr.lookup("AccountId")], + ["asset", xdr.lookup("Asset")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } + // + // =========================================================================== + xdr.struct("PathPaymentStrictReceiveResultSuccess", [ + ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["last", xdr.lookup("SimplePaymentResult")], + ]); + + // === xdr source ============================================================ + // + // union PathPaymentStrictReceiveResult switch ( + // PathPaymentStrictReceiveResultCode code) + // { + // case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS: + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } success; + // case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED: + // case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED: + // case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST: + // case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION: + // case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST: + // case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL: + // void; + // case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER: + // Asset noIssuer; // the asset that caused the error + // case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS: + // case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF: + // case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX: + // void; + // }; + // + // =========================================================================== + xdr.union("PathPaymentStrictReceiveResult", { + switchOn: xdr.lookup("PathPaymentStrictReceiveResultCode"), + switchName: "code", + switches: [ + ["pathPaymentStrictReceiveSuccess", "success"], + ["pathPaymentStrictReceiveMalformed", xdr.void()], + ["pathPaymentStrictReceiveUnderfunded", xdr.void()], + ["pathPaymentStrictReceiveSrcNoTrust", xdr.void()], + ["pathPaymentStrictReceiveSrcNotAuthorized", xdr.void()], + ["pathPaymentStrictReceiveNoDestination", xdr.void()], + ["pathPaymentStrictReceiveNoTrust", xdr.void()], + ["pathPaymentStrictReceiveNotAuthorized", xdr.void()], + ["pathPaymentStrictReceiveLineFull", xdr.void()], + ["pathPaymentStrictReceiveNoIssuer", "noIssuer"], + ["pathPaymentStrictReceiveTooFewOffers", xdr.void()], + ["pathPaymentStrictReceiveOfferCrossSelf", xdr.void()], + ["pathPaymentStrictReceiveOverSendmax", xdr.void()], + ], + arms: { + success: xdr.lookup("PathPaymentStrictReceiveResultSuccess"), + noIssuer: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // enum PathPaymentStrictSendResultCode + // { + // // codes considered as "success" for the operation + // PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success + // + // // codes considered as "failure" for the operation + // PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input + // PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = + // -2, // not enough funds in source account + // PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = + // -3, // no trust line on source account + // PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = + // -4, // source not authorized to transfer + // PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = + // -5, // destination account does not exist + // PATH_PAYMENT_STRICT_SEND_NO_TRUST = + // -6, // dest missing a trust line for asset + // PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = + // -7, // dest not authorized to hold asset + // PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit + // PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset + // PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = + // -10, // not enough offers to satisfy path + // PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = + // -11, // would cross one of its own offers + // PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin + // }; + // + // =========================================================================== + xdr.enum("PathPaymentStrictSendResultCode", { + pathPaymentStrictSendSuccess: 0, + pathPaymentStrictSendMalformed: -1, + pathPaymentStrictSendUnderfunded: -2, + pathPaymentStrictSendSrcNoTrust: -3, + pathPaymentStrictSendSrcNotAuthorized: -4, + pathPaymentStrictSendNoDestination: -5, + pathPaymentStrictSendNoTrust: -6, + pathPaymentStrictSendNotAuthorized: -7, + pathPaymentStrictSendLineFull: -8, + pathPaymentStrictSendNoIssuer: -9, + pathPaymentStrictSendTooFewOffers: -10, + pathPaymentStrictSendOfferCrossSelf: -11, + pathPaymentStrictSendUnderDestmin: -12, + }); + + // === xdr source ============================================================ + // + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } + // + // =========================================================================== + xdr.struct("PathPaymentStrictSendResultSuccess", [ + ["offers", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["last", xdr.lookup("SimplePaymentResult")], + ]); + + // === xdr source ============================================================ + // + // union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code) + // { + // case PATH_PAYMENT_STRICT_SEND_SUCCESS: + // struct + // { + // ClaimAtom offers<>; + // SimplePaymentResult last; + // } success; + // case PATH_PAYMENT_STRICT_SEND_MALFORMED: + // case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED: + // case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST: + // case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION: + // case PATH_PAYMENT_STRICT_SEND_NO_TRUST: + // case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED: + // case PATH_PAYMENT_STRICT_SEND_LINE_FULL: + // void; + // case PATH_PAYMENT_STRICT_SEND_NO_ISSUER: + // Asset noIssuer; // the asset that caused the error + // case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS: + // case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF: + // case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN: + // void; + // }; + // + // =========================================================================== + xdr.union("PathPaymentStrictSendResult", { + switchOn: xdr.lookup("PathPaymentStrictSendResultCode"), + switchName: "code", + switches: [ + ["pathPaymentStrictSendSuccess", "success"], + ["pathPaymentStrictSendMalformed", xdr.void()], + ["pathPaymentStrictSendUnderfunded", xdr.void()], + ["pathPaymentStrictSendSrcNoTrust", xdr.void()], + ["pathPaymentStrictSendSrcNotAuthorized", xdr.void()], + ["pathPaymentStrictSendNoDestination", xdr.void()], + ["pathPaymentStrictSendNoTrust", xdr.void()], + ["pathPaymentStrictSendNotAuthorized", xdr.void()], + ["pathPaymentStrictSendLineFull", xdr.void()], + ["pathPaymentStrictSendNoIssuer", "noIssuer"], + ["pathPaymentStrictSendTooFewOffers", xdr.void()], + ["pathPaymentStrictSendOfferCrossSelf", xdr.void()], + ["pathPaymentStrictSendUnderDestmin", xdr.void()], + ], + arms: { + success: xdr.lookup("PathPaymentStrictSendResultSuccess"), + noIssuer: xdr.lookup("Asset"), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageSellOfferResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_SELL_OFFER_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid + // MANAGE_SELL_OFFER_SELL_NO_TRUST = + // -2, // no trust line for what we're selling + // MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying + // MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell + // MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy + // MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying + // MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell + // MANAGE_SELL_OFFER_CROSS_SELF = + // -8, // would cross an offer from the same user + // MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling + // MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying + // + // // update errors + // MANAGE_SELL_OFFER_NOT_FOUND = + // -11, // offerID does not match an existing offer + // + // MANAGE_SELL_OFFER_LOW_RESERVE = + // -12 // not enough funds to create a new Offer + // }; + // + // =========================================================================== + xdr.enum("ManageSellOfferResultCode", { + manageSellOfferSuccess: 0, + manageSellOfferMalformed: -1, + manageSellOfferSellNoTrust: -2, + manageSellOfferBuyNoTrust: -3, + manageSellOfferSellNotAuthorized: -4, + manageSellOfferBuyNotAuthorized: -5, + manageSellOfferLineFull: -6, + manageSellOfferUnderfunded: -7, + manageSellOfferCrossSelf: -8, + manageSellOfferSellNoIssuer: -9, + manageSellOfferBuyNoIssuer: -10, + manageSellOfferNotFound: -11, + manageSellOfferLowReserve: -12, + }); + + // === xdr source ============================================================ + // + // enum ManageOfferEffect + // { + // MANAGE_OFFER_CREATED = 0, + // MANAGE_OFFER_UPDATED = 1, + // MANAGE_OFFER_DELETED = 2 + // }; + // + // =========================================================================== + xdr.enum("ManageOfferEffect", { + manageOfferCreated: 0, + manageOfferUpdated: 1, + manageOfferDeleted: 2, + }); + + // === xdr source ============================================================ + // + // union switch (ManageOfferEffect effect) + // { + // case MANAGE_OFFER_CREATED: + // case MANAGE_OFFER_UPDATED: + // OfferEntry offer; + // case MANAGE_OFFER_DELETED: + // void; + // } + // + // =========================================================================== + xdr.union("ManageOfferSuccessResultOffer", { + switchOn: xdr.lookup("ManageOfferEffect"), + switchName: "effect", + switches: [ + ["manageOfferCreated", "offer"], + ["manageOfferUpdated", "offer"], + ["manageOfferDeleted", xdr.void()], + ], + arms: { + offer: xdr.lookup("OfferEntry"), + }, + }); + + // === xdr source ============================================================ + // + // struct ManageOfferSuccessResult + // { + // // offers that got claimed while creating this offer + // ClaimAtom offersClaimed<>; + // + // union switch (ManageOfferEffect effect) + // { + // case MANAGE_OFFER_CREATED: + // case MANAGE_OFFER_UPDATED: + // OfferEntry offer; + // case MANAGE_OFFER_DELETED: + // void; + // } + // offer; + // }; + // + // =========================================================================== + xdr.struct("ManageOfferSuccessResult", [ + ["offersClaimed", xdr.varArray(xdr.lookup("ClaimAtom"), 2147483647)], + ["offer", xdr.lookup("ManageOfferSuccessResultOffer")], + ]); + + // === xdr source ============================================================ + // + // union ManageSellOfferResult switch (ManageSellOfferResultCode code) + // { + // case MANAGE_SELL_OFFER_SUCCESS: + // ManageOfferSuccessResult success; + // case MANAGE_SELL_OFFER_MALFORMED: + // case MANAGE_SELL_OFFER_SELL_NO_TRUST: + // case MANAGE_SELL_OFFER_BUY_NO_TRUST: + // case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED: + // case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED: + // case MANAGE_SELL_OFFER_LINE_FULL: + // case MANAGE_SELL_OFFER_UNDERFUNDED: + // case MANAGE_SELL_OFFER_CROSS_SELF: + // case MANAGE_SELL_OFFER_SELL_NO_ISSUER: + // case MANAGE_SELL_OFFER_BUY_NO_ISSUER: + // case MANAGE_SELL_OFFER_NOT_FOUND: + // case MANAGE_SELL_OFFER_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageSellOfferResult", { + switchOn: xdr.lookup("ManageSellOfferResultCode"), + switchName: "code", + switches: [ + ["manageSellOfferSuccess", "success"], + ["manageSellOfferMalformed", xdr.void()], + ["manageSellOfferSellNoTrust", xdr.void()], + ["manageSellOfferBuyNoTrust", xdr.void()], + ["manageSellOfferSellNotAuthorized", xdr.void()], + ["manageSellOfferBuyNotAuthorized", xdr.void()], + ["manageSellOfferLineFull", xdr.void()], + ["manageSellOfferUnderfunded", xdr.void()], + ["manageSellOfferCrossSelf", xdr.void()], + ["manageSellOfferSellNoIssuer", xdr.void()], + ["manageSellOfferBuyNoIssuer", xdr.void()], + ["manageSellOfferNotFound", xdr.void()], + ["manageSellOfferLowReserve", xdr.void()], + ], + arms: { + success: xdr.lookup("ManageOfferSuccessResult"), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageBuyOfferResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_BUY_OFFER_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // MANAGE_BUY_OFFER_MALFORMED = -1, // generated offer would be invalid + // MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling + // MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying + // MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell + // MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy + // MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying + // MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell + // MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user + // MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling + // MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying + // + // // update errors + // MANAGE_BUY_OFFER_NOT_FOUND = + // -11, // offerID does not match an existing offer + // + // MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer + // }; + // + // =========================================================================== + xdr.enum("ManageBuyOfferResultCode", { + manageBuyOfferSuccess: 0, + manageBuyOfferMalformed: -1, + manageBuyOfferSellNoTrust: -2, + manageBuyOfferBuyNoTrust: -3, + manageBuyOfferSellNotAuthorized: -4, + manageBuyOfferBuyNotAuthorized: -5, + manageBuyOfferLineFull: -6, + manageBuyOfferUnderfunded: -7, + manageBuyOfferCrossSelf: -8, + manageBuyOfferSellNoIssuer: -9, + manageBuyOfferBuyNoIssuer: -10, + manageBuyOfferNotFound: -11, + manageBuyOfferLowReserve: -12, + }); + + // === xdr source ============================================================ + // + // union ManageBuyOfferResult switch (ManageBuyOfferResultCode code) + // { + // case MANAGE_BUY_OFFER_SUCCESS: + // ManageOfferSuccessResult success; + // case MANAGE_BUY_OFFER_MALFORMED: + // case MANAGE_BUY_OFFER_SELL_NO_TRUST: + // case MANAGE_BUY_OFFER_BUY_NO_TRUST: + // case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED: + // case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED: + // case MANAGE_BUY_OFFER_LINE_FULL: + // case MANAGE_BUY_OFFER_UNDERFUNDED: + // case MANAGE_BUY_OFFER_CROSS_SELF: + // case MANAGE_BUY_OFFER_SELL_NO_ISSUER: + // case MANAGE_BUY_OFFER_BUY_NO_ISSUER: + // case MANAGE_BUY_OFFER_NOT_FOUND: + // case MANAGE_BUY_OFFER_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageBuyOfferResult", { + switchOn: xdr.lookup("ManageBuyOfferResultCode"), + switchName: "code", + switches: [ + ["manageBuyOfferSuccess", "success"], + ["manageBuyOfferMalformed", xdr.void()], + ["manageBuyOfferSellNoTrust", xdr.void()], + ["manageBuyOfferBuyNoTrust", xdr.void()], + ["manageBuyOfferSellNotAuthorized", xdr.void()], + ["manageBuyOfferBuyNotAuthorized", xdr.void()], + ["manageBuyOfferLineFull", xdr.void()], + ["manageBuyOfferUnderfunded", xdr.void()], + ["manageBuyOfferCrossSelf", xdr.void()], + ["manageBuyOfferSellNoIssuer", xdr.void()], + ["manageBuyOfferBuyNoIssuer", xdr.void()], + ["manageBuyOfferNotFound", xdr.void()], + ["manageBuyOfferLowReserve", xdr.void()], + ], + arms: { + success: xdr.lookup("ManageOfferSuccessResult"), + }, + }); + + // === xdr source ============================================================ + // + // enum SetOptionsResultCode + // { + // // codes considered as "success" for the operation + // SET_OPTIONS_SUCCESS = 0, + // // codes considered as "failure" for the operation + // SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer + // SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached + // SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags + // SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist + // SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option + // SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag + // SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold + // SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey + // SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain + // SET_OPTIONS_AUTH_REVOCABLE_REQUIRED = + // -10 // auth revocable is required for clawback + // }; + // + // =========================================================================== + xdr.enum("SetOptionsResultCode", { + setOptionsSuccess: 0, + setOptionsLowReserve: -1, + setOptionsTooManySigners: -2, + setOptionsBadFlags: -3, + setOptionsInvalidInflation: -4, + setOptionsCantChange: -5, + setOptionsUnknownFlag: -6, + setOptionsThresholdOutOfRange: -7, + setOptionsBadSigner: -8, + setOptionsInvalidHomeDomain: -9, + setOptionsAuthRevocableRequired: -10, + }); + + // === xdr source ============================================================ + // + // union SetOptionsResult switch (SetOptionsResultCode code) + // { + // case SET_OPTIONS_SUCCESS: + // void; + // case SET_OPTIONS_LOW_RESERVE: + // case SET_OPTIONS_TOO_MANY_SIGNERS: + // case SET_OPTIONS_BAD_FLAGS: + // case SET_OPTIONS_INVALID_INFLATION: + // case SET_OPTIONS_CANT_CHANGE: + // case SET_OPTIONS_UNKNOWN_FLAG: + // case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE: + // case SET_OPTIONS_BAD_SIGNER: + // case SET_OPTIONS_INVALID_HOME_DOMAIN: + // case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED: + // void; + // }; + // + // =========================================================================== + xdr.union("SetOptionsResult", { + switchOn: xdr.lookup("SetOptionsResultCode"), + switchName: "code", + switches: [ + ["setOptionsSuccess", xdr.void()], + ["setOptionsLowReserve", xdr.void()], + ["setOptionsTooManySigners", xdr.void()], + ["setOptionsBadFlags", xdr.void()], + ["setOptionsInvalidInflation", xdr.void()], + ["setOptionsCantChange", xdr.void()], + ["setOptionsUnknownFlag", xdr.void()], + ["setOptionsThresholdOutOfRange", xdr.void()], + ["setOptionsBadSigner", xdr.void()], + ["setOptionsInvalidHomeDomain", xdr.void()], + ["setOptionsAuthRevocableRequired", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ChangeTrustResultCode + // { + // // codes considered as "success" for the operation + // CHANGE_TRUST_SUCCESS = 0, + // // codes considered as "failure" for the operation + // CHANGE_TRUST_MALFORMED = -1, // bad input + // CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer + // CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance + // // cannot create with a limit of 0 + // CHANGE_TRUST_LOW_RESERVE = + // -4, // not enough funds to create a new trust line, + // CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed + // CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool + // CHANGE_TRUST_CANNOT_DELETE = + // -7, // Asset trustline is still referenced in a pool + // CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = + // -8 // Asset trustline is deauthorized + // }; + // + // =========================================================================== + xdr.enum("ChangeTrustResultCode", { + changeTrustSuccess: 0, + changeTrustMalformed: -1, + changeTrustNoIssuer: -2, + changeTrustInvalidLimit: -3, + changeTrustLowReserve: -4, + changeTrustSelfNotAllowed: -5, + changeTrustTrustLineMissing: -6, + changeTrustCannotDelete: -7, + changeTrustNotAuthMaintainLiabilities: -8, + }); + + // === xdr source ============================================================ + // + // union ChangeTrustResult switch (ChangeTrustResultCode code) + // { + // case CHANGE_TRUST_SUCCESS: + // void; + // case CHANGE_TRUST_MALFORMED: + // case CHANGE_TRUST_NO_ISSUER: + // case CHANGE_TRUST_INVALID_LIMIT: + // case CHANGE_TRUST_LOW_RESERVE: + // case CHANGE_TRUST_SELF_NOT_ALLOWED: + // case CHANGE_TRUST_TRUST_LINE_MISSING: + // case CHANGE_TRUST_CANNOT_DELETE: + // case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES: + // void; + // }; + // + // =========================================================================== + xdr.union("ChangeTrustResult", { + switchOn: xdr.lookup("ChangeTrustResultCode"), + switchName: "code", + switches: [ + ["changeTrustSuccess", xdr.void()], + ["changeTrustMalformed", xdr.void()], + ["changeTrustNoIssuer", xdr.void()], + ["changeTrustInvalidLimit", xdr.void()], + ["changeTrustLowReserve", xdr.void()], + ["changeTrustSelfNotAllowed", xdr.void()], + ["changeTrustTrustLineMissing", xdr.void()], + ["changeTrustCannotDelete", xdr.void()], + ["changeTrustNotAuthMaintainLiabilities", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum AllowTrustResultCode + // { + // // codes considered as "success" for the operation + // ALLOW_TRUST_SUCCESS = 0, + // // codes considered as "failure" for the operation + // ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM + // ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline + // // source account does not require trust + // ALLOW_TRUST_TRUST_NOT_REQUIRED = -3, + // ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust, + // ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed + // ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created + // // on revoke due to low reserves + // }; + // + // =========================================================================== + xdr.enum("AllowTrustResultCode", { + allowTrustSuccess: 0, + allowTrustMalformed: -1, + allowTrustNoTrustLine: -2, + allowTrustTrustNotRequired: -3, + allowTrustCantRevoke: -4, + allowTrustSelfNotAllowed: -5, + allowTrustLowReserve: -6, + }); + + // === xdr source ============================================================ + // + // union AllowTrustResult switch (AllowTrustResultCode code) + // { + // case ALLOW_TRUST_SUCCESS: + // void; + // case ALLOW_TRUST_MALFORMED: + // case ALLOW_TRUST_NO_TRUST_LINE: + // case ALLOW_TRUST_TRUST_NOT_REQUIRED: + // case ALLOW_TRUST_CANT_REVOKE: + // case ALLOW_TRUST_SELF_NOT_ALLOWED: + // case ALLOW_TRUST_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("AllowTrustResult", { + switchOn: xdr.lookup("AllowTrustResultCode"), + switchName: "code", + switches: [ + ["allowTrustSuccess", xdr.void()], + ["allowTrustMalformed", xdr.void()], + ["allowTrustNoTrustLine", xdr.void()], + ["allowTrustTrustNotRequired", xdr.void()], + ["allowTrustCantRevoke", xdr.void()], + ["allowTrustSelfNotAllowed", xdr.void()], + ["allowTrustLowReserve", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum AccountMergeResultCode + // { + // // codes considered as "success" for the operation + // ACCOUNT_MERGE_SUCCESS = 0, + // // codes considered as "failure" for the operation + // ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself + // ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist + // ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set + // ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers + // ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed + // ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to + // // destination balance + // ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor + // }; + // + // =========================================================================== + xdr.enum("AccountMergeResultCode", { + accountMergeSuccess: 0, + accountMergeMalformed: -1, + accountMergeNoAccount: -2, + accountMergeImmutableSet: -3, + accountMergeHasSubEntries: -4, + accountMergeSeqnumTooFar: -5, + accountMergeDestFull: -6, + accountMergeIsSponsor: -7, + }); + + // === xdr source ============================================================ + // + // union AccountMergeResult switch (AccountMergeResultCode code) + // { + // case ACCOUNT_MERGE_SUCCESS: + // int64 sourceAccountBalance; // how much got transferred from source account + // case ACCOUNT_MERGE_MALFORMED: + // case ACCOUNT_MERGE_NO_ACCOUNT: + // case ACCOUNT_MERGE_IMMUTABLE_SET: + // case ACCOUNT_MERGE_HAS_SUB_ENTRIES: + // case ACCOUNT_MERGE_SEQNUM_TOO_FAR: + // case ACCOUNT_MERGE_DEST_FULL: + // case ACCOUNT_MERGE_IS_SPONSOR: + // void; + // }; + // + // =========================================================================== + xdr.union("AccountMergeResult", { + switchOn: xdr.lookup("AccountMergeResultCode"), + switchName: "code", + switches: [ + ["accountMergeSuccess", "sourceAccountBalance"], + ["accountMergeMalformed", xdr.void()], + ["accountMergeNoAccount", xdr.void()], + ["accountMergeImmutableSet", xdr.void()], + ["accountMergeHasSubEntries", xdr.void()], + ["accountMergeSeqnumTooFar", xdr.void()], + ["accountMergeDestFull", xdr.void()], + ["accountMergeIsSponsor", xdr.void()], + ], + arms: { + sourceAccountBalance: xdr.lookup("Int64"), + }, + }); + + // === xdr source ============================================================ + // + // enum InflationResultCode + // { + // // codes considered as "success" for the operation + // INFLATION_SUCCESS = 0, + // // codes considered as "failure" for the operation + // INFLATION_NOT_TIME = -1 + // }; + // + // =========================================================================== + xdr.enum("InflationResultCode", { + inflationSuccess: 0, + inflationNotTime: -1, + }); + + // === xdr source ============================================================ + // + // struct InflationPayout // or use PaymentResultAtom to limit types? + // { + // AccountID destination; + // int64 amount; + // }; + // + // =========================================================================== + xdr.struct("InflationPayout", [ + ["destination", xdr.lookup("AccountId")], + ["amount", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // union InflationResult switch (InflationResultCode code) + // { + // case INFLATION_SUCCESS: + // InflationPayout payouts<>; + // case INFLATION_NOT_TIME: + // void; + // }; + // + // =========================================================================== + xdr.union("InflationResult", { + switchOn: xdr.lookup("InflationResultCode"), + switchName: "code", + switches: [ + ["inflationSuccess", "payouts"], + ["inflationNotTime", xdr.void()], + ], + arms: { + payouts: xdr.varArray(xdr.lookup("InflationPayout"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // enum ManageDataResultCode + // { + // // codes considered as "success" for the operation + // MANAGE_DATA_SUCCESS = 0, + // // codes considered as "failure" for the operation + // MANAGE_DATA_NOT_SUPPORTED_YET = + // -1, // The network hasn't moved to this protocol change yet + // MANAGE_DATA_NAME_NOT_FOUND = + // -2, // Trying to remove a Data Entry that isn't there + // MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry + // MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string + // }; + // + // =========================================================================== + xdr.enum("ManageDataResultCode", { + manageDataSuccess: 0, + manageDataNotSupportedYet: -1, + manageDataNameNotFound: -2, + manageDataLowReserve: -3, + manageDataInvalidName: -4, + }); + + // === xdr source ============================================================ + // + // union ManageDataResult switch (ManageDataResultCode code) + // { + // case MANAGE_DATA_SUCCESS: + // void; + // case MANAGE_DATA_NOT_SUPPORTED_YET: + // case MANAGE_DATA_NAME_NOT_FOUND: + // case MANAGE_DATA_LOW_RESERVE: + // case MANAGE_DATA_INVALID_NAME: + // void; + // }; + // + // =========================================================================== + xdr.union("ManageDataResult", { + switchOn: xdr.lookup("ManageDataResultCode"), + switchName: "code", + switches: [ + ["manageDataSuccess", xdr.void()], + ["manageDataNotSupportedYet", xdr.void()], + ["manageDataNameNotFound", xdr.void()], + ["manageDataLowReserve", xdr.void()], + ["manageDataInvalidName", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum BumpSequenceResultCode + // { + // // codes considered as "success" for the operation + // BUMP_SEQUENCE_SUCCESS = 0, + // // codes considered as "failure" for the operation + // BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds + // }; + // + // =========================================================================== + xdr.enum("BumpSequenceResultCode", { + bumpSequenceSuccess: 0, + bumpSequenceBadSeq: -1, + }); + + // === xdr source ============================================================ + // + // union BumpSequenceResult switch (BumpSequenceResultCode code) + // { + // case BUMP_SEQUENCE_SUCCESS: + // void; + // case BUMP_SEQUENCE_BAD_SEQ: + // void; + // }; + // + // =========================================================================== + xdr.union("BumpSequenceResult", { + switchOn: xdr.lookup("BumpSequenceResultCode"), + switchName: "code", + switches: [ + ["bumpSequenceSuccess", xdr.void()], + ["bumpSequenceBadSeq", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum CreateClaimableBalanceResultCode + // { + // CREATE_CLAIMABLE_BALANCE_SUCCESS = 0, + // CREATE_CLAIMABLE_BALANCE_MALFORMED = -1, + // CREATE_CLAIMABLE_BALANCE_LOW_RESERVE = -2, + // CREATE_CLAIMABLE_BALANCE_NO_TRUST = -3, + // CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -4, + // CREATE_CLAIMABLE_BALANCE_UNDERFUNDED = -5 + // }; + // + // =========================================================================== + xdr.enum("CreateClaimableBalanceResultCode", { + createClaimableBalanceSuccess: 0, + createClaimableBalanceMalformed: -1, + createClaimableBalanceLowReserve: -2, + createClaimableBalanceNoTrust: -3, + createClaimableBalanceNotAuthorized: -4, + createClaimableBalanceUnderfunded: -5, + }); + + // === xdr source ============================================================ + // + // union CreateClaimableBalanceResult switch ( + // CreateClaimableBalanceResultCode code) + // { + // case CREATE_CLAIMABLE_BALANCE_SUCCESS: + // ClaimableBalanceID balanceID; + // case CREATE_CLAIMABLE_BALANCE_MALFORMED: + // case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE: + // case CREATE_CLAIMABLE_BALANCE_NO_TRUST: + // case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED: + // case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED: + // void; + // }; + // + // =========================================================================== + xdr.union("CreateClaimableBalanceResult", { + switchOn: xdr.lookup("CreateClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["createClaimableBalanceSuccess", "balanceId"], + ["createClaimableBalanceMalformed", xdr.void()], + ["createClaimableBalanceLowReserve", xdr.void()], + ["createClaimableBalanceNoTrust", xdr.void()], + ["createClaimableBalanceNotAuthorized", xdr.void()], + ["createClaimableBalanceUnderfunded", xdr.void()], + ], + arms: { + balanceId: xdr.lookup("ClaimableBalanceId"), + }, + }); + + // === xdr source ============================================================ + // + // enum ClaimClaimableBalanceResultCode + // { + // CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0, + // CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, + // CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2, + // CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3, + // CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4, + // CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5 + // }; + // + // =========================================================================== + xdr.enum("ClaimClaimableBalanceResultCode", { + claimClaimableBalanceSuccess: 0, + claimClaimableBalanceDoesNotExist: -1, + claimClaimableBalanceCannotClaim: -2, + claimClaimableBalanceLineFull: -3, + claimClaimableBalanceNoTrust: -4, + claimClaimableBalanceNotAuthorized: -5, + }); + + // === xdr source ============================================================ + // + // union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code) + // { + // case CLAIM_CLAIMABLE_BALANCE_SUCCESS: + // void; + // case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST: + // case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM: + // case CLAIM_CLAIMABLE_BALANCE_LINE_FULL: + // case CLAIM_CLAIMABLE_BALANCE_NO_TRUST: + // case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClaimClaimableBalanceResult", { + switchOn: xdr.lookup("ClaimClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["claimClaimableBalanceSuccess", xdr.void()], + ["claimClaimableBalanceDoesNotExist", xdr.void()], + ["claimClaimableBalanceCannotClaim", xdr.void()], + ["claimClaimableBalanceLineFull", xdr.void()], + ["claimClaimableBalanceNoTrust", xdr.void()], + ["claimClaimableBalanceNotAuthorized", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum BeginSponsoringFutureReservesResultCode + // { + // // codes considered as "success" for the operation + // BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1, + // BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2, + // BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3 + // }; + // + // =========================================================================== + xdr.enum("BeginSponsoringFutureReservesResultCode", { + beginSponsoringFutureReservesSuccess: 0, + beginSponsoringFutureReservesMalformed: -1, + beginSponsoringFutureReservesAlreadySponsored: -2, + beginSponsoringFutureReservesRecursive: -3, + }); + + // === xdr source ============================================================ + // + // union BeginSponsoringFutureReservesResult switch ( + // BeginSponsoringFutureReservesResultCode code) + // { + // case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS: + // void; + // case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED: + // case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED: + // case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE: + // void; + // }; + // + // =========================================================================== + xdr.union("BeginSponsoringFutureReservesResult", { + switchOn: xdr.lookup("BeginSponsoringFutureReservesResultCode"), + switchName: "code", + switches: [ + ["beginSponsoringFutureReservesSuccess", xdr.void()], + ["beginSponsoringFutureReservesMalformed", xdr.void()], + ["beginSponsoringFutureReservesAlreadySponsored", xdr.void()], + ["beginSponsoringFutureReservesRecursive", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum EndSponsoringFutureReservesResultCode + // { + // // codes considered as "success" for the operation + // END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1 + // }; + // + // =========================================================================== + xdr.enum("EndSponsoringFutureReservesResultCode", { + endSponsoringFutureReservesSuccess: 0, + endSponsoringFutureReservesNotSponsored: -1, + }); + + // === xdr source ============================================================ + // + // union EndSponsoringFutureReservesResult switch ( + // EndSponsoringFutureReservesResultCode code) + // { + // case END_SPONSORING_FUTURE_RESERVES_SUCCESS: + // void; + // case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED: + // void; + // }; + // + // =========================================================================== + xdr.union("EndSponsoringFutureReservesResult", { + switchOn: xdr.lookup("EndSponsoringFutureReservesResultCode"), + switchName: "code", + switches: [ + ["endSponsoringFutureReservesSuccess", xdr.void()], + ["endSponsoringFutureReservesNotSponsored", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum RevokeSponsorshipResultCode + // { + // // codes considered as "success" for the operation + // REVOKE_SPONSORSHIP_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1, + // REVOKE_SPONSORSHIP_NOT_SPONSOR = -2, + // REVOKE_SPONSORSHIP_LOW_RESERVE = -3, + // REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4, + // REVOKE_SPONSORSHIP_MALFORMED = -5 + // }; + // + // =========================================================================== + xdr.enum("RevokeSponsorshipResultCode", { + revokeSponsorshipSuccess: 0, + revokeSponsorshipDoesNotExist: -1, + revokeSponsorshipNotSponsor: -2, + revokeSponsorshipLowReserve: -3, + revokeSponsorshipOnlyTransferable: -4, + revokeSponsorshipMalformed: -5, + }); + + // === xdr source ============================================================ + // + // union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code) + // { + // case REVOKE_SPONSORSHIP_SUCCESS: + // void; + // case REVOKE_SPONSORSHIP_DOES_NOT_EXIST: + // case REVOKE_SPONSORSHIP_NOT_SPONSOR: + // case REVOKE_SPONSORSHIP_LOW_RESERVE: + // case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE: + // case REVOKE_SPONSORSHIP_MALFORMED: + // void; + // }; + // + // =========================================================================== + xdr.union("RevokeSponsorshipResult", { + switchOn: xdr.lookup("RevokeSponsorshipResultCode"), + switchName: "code", + switches: [ + ["revokeSponsorshipSuccess", xdr.void()], + ["revokeSponsorshipDoesNotExist", xdr.void()], + ["revokeSponsorshipNotSponsor", xdr.void()], + ["revokeSponsorshipLowReserve", xdr.void()], + ["revokeSponsorshipOnlyTransferable", xdr.void()], + ["revokeSponsorshipMalformed", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ClawbackResultCode + // { + // // codes considered as "success" for the operation + // CLAWBACK_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // CLAWBACK_MALFORMED = -1, + // CLAWBACK_NOT_CLAWBACK_ENABLED = -2, + // CLAWBACK_NO_TRUST = -3, + // CLAWBACK_UNDERFUNDED = -4 + // }; + // + // =========================================================================== + xdr.enum("ClawbackResultCode", { + clawbackSuccess: 0, + clawbackMalformed: -1, + clawbackNotClawbackEnabled: -2, + clawbackNoTrust: -3, + clawbackUnderfunded: -4, + }); + + // === xdr source ============================================================ + // + // union ClawbackResult switch (ClawbackResultCode code) + // { + // case CLAWBACK_SUCCESS: + // void; + // case CLAWBACK_MALFORMED: + // case CLAWBACK_NOT_CLAWBACK_ENABLED: + // case CLAWBACK_NO_TRUST: + // case CLAWBACK_UNDERFUNDED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClawbackResult", { + switchOn: xdr.lookup("ClawbackResultCode"), + switchName: "code", + switches: [ + ["clawbackSuccess", xdr.void()], + ["clawbackMalformed", xdr.void()], + ["clawbackNotClawbackEnabled", xdr.void()], + ["clawbackNoTrust", xdr.void()], + ["clawbackUnderfunded", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum ClawbackClaimableBalanceResultCode + // { + // // codes considered as "success" for the operation + // CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, + // CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2, + // CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3 + // }; + // + // =========================================================================== + xdr.enum("ClawbackClaimableBalanceResultCode", { + clawbackClaimableBalanceSuccess: 0, + clawbackClaimableBalanceDoesNotExist: -1, + clawbackClaimableBalanceNotIssuer: -2, + clawbackClaimableBalanceNotClawbackEnabled: -3, + }); + + // === xdr source ============================================================ + // + // union ClawbackClaimableBalanceResult switch ( + // ClawbackClaimableBalanceResultCode code) + // { + // case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS: + // void; + // case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST: + // case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER: + // case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED: + // void; + // }; + // + // =========================================================================== + xdr.union("ClawbackClaimableBalanceResult", { + switchOn: xdr.lookup("ClawbackClaimableBalanceResultCode"), + switchName: "code", + switches: [ + ["clawbackClaimableBalanceSuccess", xdr.void()], + ["clawbackClaimableBalanceDoesNotExist", xdr.void()], + ["clawbackClaimableBalanceNotIssuer", xdr.void()], + ["clawbackClaimableBalanceNotClawbackEnabled", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum SetTrustLineFlagsResultCode + // { + // // codes considered as "success" for the operation + // SET_TRUST_LINE_FLAGS_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // SET_TRUST_LINE_FLAGS_MALFORMED = -1, + // SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2, + // SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3, + // SET_TRUST_LINE_FLAGS_INVALID_STATE = -4, + // SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created + // // on revoke due to low reserves + // }; + // + // =========================================================================== + xdr.enum("SetTrustLineFlagsResultCode", { + setTrustLineFlagsSuccess: 0, + setTrustLineFlagsMalformed: -1, + setTrustLineFlagsNoTrustLine: -2, + setTrustLineFlagsCantRevoke: -3, + setTrustLineFlagsInvalidState: -4, + setTrustLineFlagsLowReserve: -5, + }); + + // === xdr source ============================================================ + // + // union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code) + // { + // case SET_TRUST_LINE_FLAGS_SUCCESS: + // void; + // case SET_TRUST_LINE_FLAGS_MALFORMED: + // case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE: + // case SET_TRUST_LINE_FLAGS_CANT_REVOKE: + // case SET_TRUST_LINE_FLAGS_INVALID_STATE: + // case SET_TRUST_LINE_FLAGS_LOW_RESERVE: + // void; + // }; + // + // =========================================================================== + xdr.union("SetTrustLineFlagsResult", { + switchOn: xdr.lookup("SetTrustLineFlagsResultCode"), + switchName: "code", + switches: [ + ["setTrustLineFlagsSuccess", xdr.void()], + ["setTrustLineFlagsMalformed", xdr.void()], + ["setTrustLineFlagsNoTrustLine", xdr.void()], + ["setTrustLineFlagsCantRevoke", xdr.void()], + ["setTrustLineFlagsInvalidState", xdr.void()], + ["setTrustLineFlagsLowReserve", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum LiquidityPoolDepositResultCode + // { + // // codes considered as "success" for the operation + // LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input + // LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the + // // assets + // LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the + // // assets + // LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of + // // the assets + // LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't + // // have sufficient limit + // LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds + // LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolDepositResultCode", { + liquidityPoolDepositSuccess: 0, + liquidityPoolDepositMalformed: -1, + liquidityPoolDepositNoTrust: -2, + liquidityPoolDepositNotAuthorized: -3, + liquidityPoolDepositUnderfunded: -4, + liquidityPoolDepositLineFull: -5, + liquidityPoolDepositBadPrice: -6, + liquidityPoolDepositPoolFull: -7, + }); + + // === xdr source ============================================================ + // + // union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code) + // { + // case LIQUIDITY_POOL_DEPOSIT_SUCCESS: + // void; + // case LIQUIDITY_POOL_DEPOSIT_MALFORMED: + // case LIQUIDITY_POOL_DEPOSIT_NO_TRUST: + // case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED: + // case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED: + // case LIQUIDITY_POOL_DEPOSIT_LINE_FULL: + // case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE: + // case LIQUIDITY_POOL_DEPOSIT_POOL_FULL: + // void; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolDepositResult", { + switchOn: xdr.lookup("LiquidityPoolDepositResultCode"), + switchName: "code", + switches: [ + ["liquidityPoolDepositSuccess", xdr.void()], + ["liquidityPoolDepositMalformed", xdr.void()], + ["liquidityPoolDepositNoTrust", xdr.void()], + ["liquidityPoolDepositNotAuthorized", xdr.void()], + ["liquidityPoolDepositUnderfunded", xdr.void()], + ["liquidityPoolDepositLineFull", xdr.void()], + ["liquidityPoolDepositBadPrice", xdr.void()], + ["liquidityPoolDepositPoolFull", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum LiquidityPoolWithdrawResultCode + // { + // // codes considered as "success" for the operation + // LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input + // LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the + // // assets + // LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the + // // pool share + // LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one + // // of the assets + // LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough + // }; + // + // =========================================================================== + xdr.enum("LiquidityPoolWithdrawResultCode", { + liquidityPoolWithdrawSuccess: 0, + liquidityPoolWithdrawMalformed: -1, + liquidityPoolWithdrawNoTrust: -2, + liquidityPoolWithdrawUnderfunded: -3, + liquidityPoolWithdrawLineFull: -4, + liquidityPoolWithdrawUnderMinimum: -5, + }); + + // === xdr source ============================================================ + // + // union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code) + // { + // case LIQUIDITY_POOL_WITHDRAW_SUCCESS: + // void; + // case LIQUIDITY_POOL_WITHDRAW_MALFORMED: + // case LIQUIDITY_POOL_WITHDRAW_NO_TRUST: + // case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED: + // case LIQUIDITY_POOL_WITHDRAW_LINE_FULL: + // case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: + // void; + // }; + // + // =========================================================================== + xdr.union("LiquidityPoolWithdrawResult", { + switchOn: xdr.lookup("LiquidityPoolWithdrawResultCode"), + switchName: "code", + switches: [ + ["liquidityPoolWithdrawSuccess", xdr.void()], + ["liquidityPoolWithdrawMalformed", xdr.void()], + ["liquidityPoolWithdrawNoTrust", xdr.void()], + ["liquidityPoolWithdrawUnderfunded", xdr.void()], + ["liquidityPoolWithdrawLineFull", xdr.void()], + ["liquidityPoolWithdrawUnderMinimum", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum InvokeHostFunctionResultCode + // { + // // codes considered as "success" for the operation + // INVOKE_HOST_FUNCTION_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // INVOKE_HOST_FUNCTION_MALFORMED = -1, + // INVOKE_HOST_FUNCTION_TRAPPED = -2, + // INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, + // INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + // INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 + // }; + // + // =========================================================================== + xdr.enum("InvokeHostFunctionResultCode", { + invokeHostFunctionSuccess: 0, + invokeHostFunctionMalformed: -1, + invokeHostFunctionTrapped: -2, + invokeHostFunctionResourceLimitExceeded: -3, + invokeHostFunctionEntryExpired: -4, + invokeHostFunctionInsufficientRefundableFee: -5, + }); + + // === xdr source ============================================================ + // + // union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) + // { + // case INVOKE_HOST_FUNCTION_SUCCESS: + // Hash success; // sha256(InvokeHostFunctionSuccessPreImage) + // case INVOKE_HOST_FUNCTION_MALFORMED: + // case INVOKE_HOST_FUNCTION_TRAPPED: + // case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: + // case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: + // case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("InvokeHostFunctionResult", { + switchOn: xdr.lookup("InvokeHostFunctionResultCode"), + switchName: "code", + switches: [ + ["invokeHostFunctionSuccess", "success"], + ["invokeHostFunctionMalformed", xdr.void()], + ["invokeHostFunctionTrapped", xdr.void()], + ["invokeHostFunctionResourceLimitExceeded", xdr.void()], + ["invokeHostFunctionEntryExpired", xdr.void()], + ["invokeHostFunctionInsufficientRefundableFee", xdr.void()], + ], + arms: { + success: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum BumpFootprintExpirationResultCode + // { + // // codes considered as "success" for the operation + // BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, + // BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, + // BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + // }; + // + // =========================================================================== + xdr.enum("BumpFootprintExpirationResultCode", { + bumpFootprintExpirationSuccess: 0, + bumpFootprintExpirationMalformed: -1, + bumpFootprintExpirationResourceLimitExceeded: -2, + bumpFootprintExpirationInsufficientRefundableFee: -3, + }); + + // === xdr source ============================================================ + // + // union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) + // { + // case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + // void; + // case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: + // case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: + // case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("BumpFootprintExpirationResult", { + switchOn: xdr.lookup("BumpFootprintExpirationResultCode"), + switchName: "code", + switches: [ + ["bumpFootprintExpirationSuccess", xdr.void()], + ["bumpFootprintExpirationMalformed", xdr.void()], + ["bumpFootprintExpirationResourceLimitExceeded", xdr.void()], + ["bumpFootprintExpirationInsufficientRefundableFee", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum RestoreFootprintResultCode + // { + // // codes considered as "success" for the operation + // RESTORE_FOOTPRINT_SUCCESS = 0, + // + // // codes considered as "failure" for the operation + // RESTORE_FOOTPRINT_MALFORMED = -1, + // RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, + // RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 + // }; + // + // =========================================================================== + xdr.enum("RestoreFootprintResultCode", { + restoreFootprintSuccess: 0, + restoreFootprintMalformed: -1, + restoreFootprintResourceLimitExceeded: -2, + restoreFootprintInsufficientRefundableFee: -3, + }); + + // === xdr source ============================================================ + // + // union RestoreFootprintResult switch (RestoreFootprintResultCode code) + // { + // case RESTORE_FOOTPRINT_SUCCESS: + // void; + // case RESTORE_FOOTPRINT_MALFORMED: + // case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED: + // case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE: + // void; + // }; + // + // =========================================================================== + xdr.union("RestoreFootprintResult", { + switchOn: xdr.lookup("RestoreFootprintResultCode"), + switchName: "code", + switches: [ + ["restoreFootprintSuccess", xdr.void()], + ["restoreFootprintMalformed", xdr.void()], + ["restoreFootprintResourceLimitExceeded", xdr.void()], + ["restoreFootprintInsufficientRefundableFee", xdr.void()], + ], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum OperationResultCode + // { + // opINNER = 0, // inner object result is valid + // + // opBAD_AUTH = -1, // too few valid signatures / wrong network + // opNO_ACCOUNT = -2, // source account was not found + // opNOT_SUPPORTED = -3, // operation not supported at this time + // opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached + // opEXCEEDED_WORK_LIMIT = -5, // operation did too much work + // opTOO_MANY_SPONSORING = -6 // account is sponsoring too many entries + // }; + // + // =========================================================================== + xdr.enum("OperationResultCode", { + opInner: 0, + opBadAuth: -1, + opNoAccount: -2, + opNotSupported: -3, + opTooManySubentries: -4, + opExceededWorkLimit: -5, + opTooManySponsoring: -6, + }); + + // === xdr source ============================================================ + // + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountResult createAccountResult; + // case PAYMENT: + // PaymentResult paymentResult; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; + // case MANAGE_SELL_OFFER: + // ManageSellOfferResult manageSellOfferResult; + // case CREATE_PASSIVE_SELL_OFFER: + // ManageSellOfferResult createPassiveSellOfferResult; + // case SET_OPTIONS: + // SetOptionsResult setOptionsResult; + // case CHANGE_TRUST: + // ChangeTrustResult changeTrustResult; + // case ALLOW_TRUST: + // AllowTrustResult allowTrustResult; + // case ACCOUNT_MERGE: + // AccountMergeResult accountMergeResult; + // case INFLATION: + // InflationResult inflationResult; + // case MANAGE_DATA: + // ManageDataResult manageDataResult; + // case BUMP_SEQUENCE: + // BumpSequenceResult bumpSeqResult; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferResult manageBuyOfferResult; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendResult pathPaymentStrictSendResult; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceResult createClaimableBalanceResult; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceResult claimClaimableBalanceResult; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; + // case END_SPONSORING_FUTURE_RESERVES: + // EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipResult revokeSponsorshipResult; + // case CLAWBACK: + // ClawbackResult clawbackResult; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsResult setTrustLineFlagsResult; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositResult liquidityPoolDepositResult; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionResult invokeHostFunctionResult; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case RESTORE_FOOTPRINT: + // RestoreFootprintResult restoreFootprintResult; + // } + // + // =========================================================================== + xdr.union("OperationResultTr", { + switchOn: xdr.lookup("OperationType"), + switchName: "type", + switches: [ + ["createAccount", "createAccountResult"], + ["payment", "paymentResult"], + ["pathPaymentStrictReceive", "pathPaymentStrictReceiveResult"], + ["manageSellOffer", "manageSellOfferResult"], + ["createPassiveSellOffer", "createPassiveSellOfferResult"], + ["setOptions", "setOptionsResult"], + ["changeTrust", "changeTrustResult"], + ["allowTrust", "allowTrustResult"], + ["accountMerge", "accountMergeResult"], + ["inflation", "inflationResult"], + ["manageData", "manageDataResult"], + ["bumpSequence", "bumpSeqResult"], + ["manageBuyOffer", "manageBuyOfferResult"], + ["pathPaymentStrictSend", "pathPaymentStrictSendResult"], + ["createClaimableBalance", "createClaimableBalanceResult"], + ["claimClaimableBalance", "claimClaimableBalanceResult"], + ["beginSponsoringFutureReserves", "beginSponsoringFutureReservesResult"], + ["endSponsoringFutureReserves", "endSponsoringFutureReservesResult"], + ["revokeSponsorship", "revokeSponsorshipResult"], + ["clawback", "clawbackResult"], + ["clawbackClaimableBalance", "clawbackClaimableBalanceResult"], + ["setTrustLineFlags", "setTrustLineFlagsResult"], + ["liquidityPoolDeposit", "liquidityPoolDepositResult"], + ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], + ["invokeHostFunction", "invokeHostFunctionResult"], + ["bumpFootprintExpiration", "bumpFootprintExpirationResult"], + ["restoreFootprint", "restoreFootprintResult"], + ], + arms: { + createAccountResult: xdr.lookup("CreateAccountResult"), + paymentResult: xdr.lookup("PaymentResult"), + pathPaymentStrictReceiveResult: xdr.lookup( + "PathPaymentStrictReceiveResult" + ), + manageSellOfferResult: xdr.lookup("ManageSellOfferResult"), + createPassiveSellOfferResult: xdr.lookup("ManageSellOfferResult"), + setOptionsResult: xdr.lookup("SetOptionsResult"), + changeTrustResult: xdr.lookup("ChangeTrustResult"), + allowTrustResult: xdr.lookup("AllowTrustResult"), + accountMergeResult: xdr.lookup("AccountMergeResult"), + inflationResult: xdr.lookup("InflationResult"), + manageDataResult: xdr.lookup("ManageDataResult"), + bumpSeqResult: xdr.lookup("BumpSequenceResult"), + manageBuyOfferResult: xdr.lookup("ManageBuyOfferResult"), + pathPaymentStrictSendResult: xdr.lookup("PathPaymentStrictSendResult"), + createClaimableBalanceResult: xdr.lookup("CreateClaimableBalanceResult"), + claimClaimableBalanceResult: xdr.lookup("ClaimClaimableBalanceResult"), + beginSponsoringFutureReservesResult: xdr.lookup( + "BeginSponsoringFutureReservesResult" + ), + endSponsoringFutureReservesResult: xdr.lookup( + "EndSponsoringFutureReservesResult" + ), + revokeSponsorshipResult: xdr.lookup("RevokeSponsorshipResult"), + clawbackResult: xdr.lookup("ClawbackResult"), + clawbackClaimableBalanceResult: xdr.lookup( + "ClawbackClaimableBalanceResult" + ), + setTrustLineFlagsResult: xdr.lookup("SetTrustLineFlagsResult"), + liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), + liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), + invokeHostFunctionResult: xdr.lookup("InvokeHostFunctionResult"), + bumpFootprintExpirationResult: xdr.lookup( + "BumpFootprintExpirationResult" + ), + restoreFootprintResult: xdr.lookup("RestoreFootprintResult"), + }, + }); + + // === xdr source ============================================================ + // + // union OperationResult switch (OperationResultCode code) + // { + // case opINNER: + // union switch (OperationType type) + // { + // case CREATE_ACCOUNT: + // CreateAccountResult createAccountResult; + // case PAYMENT: + // PaymentResult paymentResult; + // case PATH_PAYMENT_STRICT_RECEIVE: + // PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; + // case MANAGE_SELL_OFFER: + // ManageSellOfferResult manageSellOfferResult; + // case CREATE_PASSIVE_SELL_OFFER: + // ManageSellOfferResult createPassiveSellOfferResult; + // case SET_OPTIONS: + // SetOptionsResult setOptionsResult; + // case CHANGE_TRUST: + // ChangeTrustResult changeTrustResult; + // case ALLOW_TRUST: + // AllowTrustResult allowTrustResult; + // case ACCOUNT_MERGE: + // AccountMergeResult accountMergeResult; + // case INFLATION: + // InflationResult inflationResult; + // case MANAGE_DATA: + // ManageDataResult manageDataResult; + // case BUMP_SEQUENCE: + // BumpSequenceResult bumpSeqResult; + // case MANAGE_BUY_OFFER: + // ManageBuyOfferResult manageBuyOfferResult; + // case PATH_PAYMENT_STRICT_SEND: + // PathPaymentStrictSendResult pathPaymentStrictSendResult; + // case CREATE_CLAIMABLE_BALANCE: + // CreateClaimableBalanceResult createClaimableBalanceResult; + // case CLAIM_CLAIMABLE_BALANCE: + // ClaimClaimableBalanceResult claimClaimableBalanceResult; + // case BEGIN_SPONSORING_FUTURE_RESERVES: + // BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; + // case END_SPONSORING_FUTURE_RESERVES: + // EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; + // case REVOKE_SPONSORSHIP: + // RevokeSponsorshipResult revokeSponsorshipResult; + // case CLAWBACK: + // ClawbackResult clawbackResult; + // case CLAWBACK_CLAIMABLE_BALANCE: + // ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; + // case SET_TRUST_LINE_FLAGS: + // SetTrustLineFlagsResult setTrustLineFlagsResult; + // case LIQUIDITY_POOL_DEPOSIT: + // LiquidityPoolDepositResult liquidityPoolDepositResult; + // case LIQUIDITY_POOL_WITHDRAW: + // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; + // case INVOKE_HOST_FUNCTION: + // InvokeHostFunctionResult invokeHostFunctionResult; + // case BUMP_FOOTPRINT_EXPIRATION: + // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case RESTORE_FOOTPRINT: + // RestoreFootprintResult restoreFootprintResult; + // } + // tr; + // case opBAD_AUTH: + // case opNO_ACCOUNT: + // case opNOT_SUPPORTED: + // case opTOO_MANY_SUBENTRIES: + // case opEXCEEDED_WORK_LIMIT: + // case opTOO_MANY_SPONSORING: + // void; + // }; + // + // =========================================================================== + xdr.union("OperationResult", { + switchOn: xdr.lookup("OperationResultCode"), + switchName: "code", + switches: [ + ["opInner", "tr"], + ["opBadAuth", xdr.void()], + ["opNoAccount", xdr.void()], + ["opNotSupported", xdr.void()], + ["opTooManySubentries", xdr.void()], + ["opExceededWorkLimit", xdr.void()], + ["opTooManySponsoring", xdr.void()], + ], + arms: { + tr: xdr.lookup("OperationResultTr"), + }, + }); + + // === xdr source ============================================================ + // + // enum TransactionResultCode + // { + // txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded + // txSUCCESS = 0, // all operations succeeded + // + // txFAILED = -1, // one of the operations failed (none were applied) + // + // txTOO_EARLY = -2, // ledger closeTime before minTime + // txTOO_LATE = -3, // ledger closeTime after maxTime + // txMISSING_OPERATION = -4, // no operation was specified + // txBAD_SEQ = -5, // sequence number does not match source account + // + // txBAD_AUTH = -6, // too few valid signatures / wrong network + // txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve + // txNO_ACCOUNT = -8, // source account not found + // txINSUFFICIENT_FEE = -9, // fee is too small + // txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction + // txINTERNAL_ERROR = -11, // an unknown error occurred + // + // txNOT_SUPPORTED = -12, // transaction type not supported + // txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed + // txBAD_SPONSORSHIP = -14, // sponsorship not confirmed + // txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met + // txMALFORMED = -16, // precondition is invalid + // txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met + // }; + // + // =========================================================================== + xdr.enum("TransactionResultCode", { + txFeeBumpInnerSuccess: 1, + txSuccess: 0, + txFailed: -1, + txTooEarly: -2, + txTooLate: -3, + txMissingOperation: -4, + txBadSeq: -5, + txBadAuth: -6, + txInsufficientBalance: -7, + txNoAccount: -8, + txInsufficientFee: -9, + txBadAuthExtra: -10, + txInternalError: -11, + txNotSupported: -12, + txFeeBumpInnerFailed: -13, + txBadSponsorship: -14, + txBadMinSeqAgeOrGap: -15, + txMalformed: -16, + txSorobanInvalid: -17, + }); + + // === xdr source ============================================================ + // + // union switch (TransactionResultCode code) + // { + // // txFEE_BUMP_INNER_SUCCESS is not included + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // txFEE_BUMP_INNER_FAILED is not included + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // + // =========================================================================== + xdr.union("InnerTransactionResultResult", { + switchOn: xdr.lookup("TransactionResultCode"), + switchName: "code", + switches: [ + ["txSuccess", "results"], + ["txFailed", "results"], + ["txTooEarly", xdr.void()], + ["txTooLate", xdr.void()], + ["txMissingOperation", xdr.void()], + ["txBadSeq", xdr.void()], + ["txBadAuth", xdr.void()], + ["txInsufficientBalance", xdr.void()], + ["txNoAccount", xdr.void()], + ["txInsufficientFee", xdr.void()], + ["txBadAuthExtra", xdr.void()], + ["txInternalError", xdr.void()], + ["txNotSupported", xdr.void()], + ["txBadSponsorship", xdr.void()], + ["txBadMinSeqAgeOrGap", xdr.void()], + ["txMalformed", xdr.void()], + ["txSorobanInvalid", xdr.void()], + ], + arms: { + results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("InnerTransactionResultExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct InnerTransactionResult + // { + // // Always 0. Here for binary compatibility. + // int64 feeCharged; + // + // union switch (TransactionResultCode code) + // { + // // txFEE_BUMP_INNER_SUCCESS is not included + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // txFEE_BUMP_INNER_FAILED is not included + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // result; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("InnerTransactionResult", [ + ["feeCharged", xdr.lookup("Int64")], + ["result", xdr.lookup("InnerTransactionResultResult")], + ["ext", xdr.lookup("InnerTransactionResultExt")], + ]); + + // === xdr source ============================================================ + // + // struct InnerTransactionResultPair + // { + // Hash transactionHash; // hash of the inner transaction + // InnerTransactionResult result; // result for the inner transaction + // }; + // + // =========================================================================== + xdr.struct("InnerTransactionResultPair", [ + ["transactionHash", xdr.lookup("Hash")], + ["result", xdr.lookup("InnerTransactionResult")], + ]); + + // === xdr source ============================================================ + // + // union switch (TransactionResultCode code) + // { + // case txFEE_BUMP_INNER_SUCCESS: + // case txFEE_BUMP_INNER_FAILED: + // InnerTransactionResultPair innerResultPair; + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // case txFEE_BUMP_INNER_FAILED: handled above + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionResultResult", { + switchOn: xdr.lookup("TransactionResultCode"), + switchName: "code", + switches: [ + ["txFeeBumpInnerSuccess", "innerResultPair"], + ["txFeeBumpInnerFailed", "innerResultPair"], + ["txSuccess", "results"], + ["txFailed", "results"], + ["txTooEarly", xdr.void()], + ["txTooLate", xdr.void()], + ["txMissingOperation", xdr.void()], + ["txBadSeq", xdr.void()], + ["txBadAuth", xdr.void()], + ["txInsufficientBalance", xdr.void()], + ["txNoAccount", xdr.void()], + ["txInsufficientFee", xdr.void()], + ["txBadAuthExtra", xdr.void()], + ["txInternalError", xdr.void()], + ["txNotSupported", xdr.void()], + ["txBadSponsorship", xdr.void()], + ["txBadMinSeqAgeOrGap", xdr.void()], + ["txMalformed", xdr.void()], + ["txSorobanInvalid", xdr.void()], + ], + arms: { + innerResultPair: xdr.lookup("InnerTransactionResultPair"), + results: xdr.varArray(xdr.lookup("OperationResult"), 2147483647), + }, + }); + + // === xdr source ============================================================ + // + // union switch (int v) + // { + // case 0: + // void; + // } + // + // =========================================================================== + xdr.union("TransactionResultExt", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // struct TransactionResult + // { + // int64 feeCharged; // actual fee charged for the transaction + // + // union switch (TransactionResultCode code) + // { + // case txFEE_BUMP_INNER_SUCCESS: + // case txFEE_BUMP_INNER_FAILED: + // InnerTransactionResultPair innerResultPair; + // case txSUCCESS: + // case txFAILED: + // OperationResult results<>; + // case txTOO_EARLY: + // case txTOO_LATE: + // case txMISSING_OPERATION: + // case txBAD_SEQ: + // case txBAD_AUTH: + // case txINSUFFICIENT_BALANCE: + // case txNO_ACCOUNT: + // case txINSUFFICIENT_FEE: + // case txBAD_AUTH_EXTRA: + // case txINTERNAL_ERROR: + // case txNOT_SUPPORTED: + // // case txFEE_BUMP_INNER_FAILED: handled above + // case txBAD_SPONSORSHIP: + // case txBAD_MIN_SEQ_AGE_OR_GAP: + // case txMALFORMED: + // case txSOROBAN_INVALID: + // void; + // } + // result; + // + // // reserved for future use + // union switch (int v) + // { + // case 0: + // void; + // } + // ext; + // }; + // + // =========================================================================== + xdr.struct("TransactionResult", [ + ["feeCharged", xdr.lookup("Int64")], + ["result", xdr.lookup("TransactionResultResult")], + ["ext", xdr.lookup("TransactionResultExt")], + ]); + + // === xdr source ============================================================ + // + // typedef opaque Hash[32]; + // + // =========================================================================== + xdr.typedef("Hash", xdr.opaque(32)); + + // === xdr source ============================================================ + // + // typedef opaque uint256[32]; + // + // =========================================================================== + xdr.typedef("Uint256", xdr.opaque(32)); + + // === xdr source ============================================================ + // + // typedef unsigned int uint32; + // + // =========================================================================== + xdr.typedef("Uint32", xdr.uint()); + + // === xdr source ============================================================ + // + // typedef int int32; + // + // =========================================================================== + xdr.typedef("Int32", xdr.int()); + + // === xdr source ============================================================ + // + // typedef unsigned hyper uint64; + // + // =========================================================================== + xdr.typedef("Uint64", xdr.uhyper()); + + // === xdr source ============================================================ + // + // typedef hyper int64; + // + // =========================================================================== + xdr.typedef("Int64", xdr.hyper()); + + // === xdr source ============================================================ + // + // typedef uint64 TimePoint; + // + // =========================================================================== + xdr.typedef("TimePoint", xdr.lookup("Uint64")); + + // === xdr source ============================================================ + // + // typedef uint64 Duration; + // + // =========================================================================== + xdr.typedef("Duration", xdr.lookup("Uint64")); + + // === xdr source ============================================================ + // + // union ExtensionPoint switch (int v) + // { + // case 0: + // void; + // }; + // + // =========================================================================== + xdr.union("ExtensionPoint", { + switchOn: xdr.int(), + switchName: "v", + switches: [[0, xdr.void()]], + arms: {}, + }); + + // === xdr source ============================================================ + // + // enum CryptoKeyType + // { + // KEY_TYPE_ED25519 = 0, + // KEY_TYPE_PRE_AUTH_TX = 1, + // KEY_TYPE_HASH_X = 2, + // KEY_TYPE_ED25519_SIGNED_PAYLOAD = 3, + // // MUXED enum values for supported type are derived from the enum values + // // above by ORing them with 0x100 + // KEY_TYPE_MUXED_ED25519 = 0x100 + // }; + // + // =========================================================================== + xdr.enum("CryptoKeyType", { + keyTypeEd25519: 0, + keyTypePreAuthTx: 1, + keyTypeHashX: 2, + keyTypeEd25519SignedPayload: 3, + keyTypeMuxedEd25519: 256, + }); + + // === xdr source ============================================================ + // + // enum PublicKeyType + // { + // PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519 + // }; + // + // =========================================================================== + xdr.enum("PublicKeyType", { + publicKeyTypeEd25519: 0, + }); + + // === xdr source ============================================================ + // + // enum SignerKeyType + // { + // SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, + // SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, + // SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X, + // SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD + // }; + // + // =========================================================================== + xdr.enum("SignerKeyType", { + signerKeyTypeEd25519: 0, + signerKeyTypePreAuthTx: 1, + signerKeyTypeHashX: 2, + signerKeyTypeEd25519SignedPayload: 3, + }); + + // === xdr source ============================================================ + // + // union PublicKey switch (PublicKeyType type) + // { + // case PUBLIC_KEY_TYPE_ED25519: + // uint256 ed25519; + // }; + // + // =========================================================================== + xdr.union("PublicKey", { + switchOn: xdr.lookup("PublicKeyType"), + switchName: "type", + switches: [["publicKeyTypeEd25519", "ed25519"]], + arms: { + ed25519: xdr.lookup("Uint256"), + }, + }); + + // === xdr source ============================================================ + // + // struct + // { + // /* Public key that must sign the payload. */ + // uint256 ed25519; + // /* Payload to be raw signed by ed25519. */ + // opaque payload<64>; + // } + // + // =========================================================================== + xdr.struct("SignerKeyEd25519SignedPayload", [ + ["ed25519", xdr.lookup("Uint256")], + ["payload", xdr.varOpaque(64)], + ]); + + // === xdr source ============================================================ + // + // union SignerKey switch (SignerKeyType type) + // { + // case SIGNER_KEY_TYPE_ED25519: + // uint256 ed25519; + // case SIGNER_KEY_TYPE_PRE_AUTH_TX: + // /* SHA-256 Hash of TransactionSignaturePayload structure */ + // uint256 preAuthTx; + // case SIGNER_KEY_TYPE_HASH_X: + // /* Hash of random 256 bit preimage X */ + // uint256 hashX; + // case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD: + // struct + // { + // /* Public key that must sign the payload. */ + // uint256 ed25519; + // /* Payload to be raw signed by ed25519. */ + // opaque payload<64>; + // } ed25519SignedPayload; + // }; + // + // =========================================================================== + xdr.union("SignerKey", { + switchOn: xdr.lookup("SignerKeyType"), + switchName: "type", + switches: [ + ["signerKeyTypeEd25519", "ed25519"], + ["signerKeyTypePreAuthTx", "preAuthTx"], + ["signerKeyTypeHashX", "hashX"], + ["signerKeyTypeEd25519SignedPayload", "ed25519SignedPayload"], + ], + arms: { + ed25519: xdr.lookup("Uint256"), + preAuthTx: xdr.lookup("Uint256"), + hashX: xdr.lookup("Uint256"), + ed25519SignedPayload: xdr.lookup("SignerKeyEd25519SignedPayload"), + }, + }); + + // === xdr source ============================================================ + // + // typedef opaque Signature<64>; + // + // =========================================================================== + xdr.typedef("Signature", xdr.varOpaque(64)); + + // === xdr source ============================================================ + // + // typedef opaque SignatureHint[4]; + // + // =========================================================================== + xdr.typedef("SignatureHint", xdr.opaque(4)); + + // === xdr source ============================================================ + // + // typedef PublicKey NodeID; + // + // =========================================================================== + xdr.typedef("NodeId", xdr.lookup("PublicKey")); + + // === xdr source ============================================================ + // + // typedef PublicKey AccountID; + // + // =========================================================================== + xdr.typedef("AccountId", xdr.lookup("PublicKey")); + + // === xdr source ============================================================ + // + // struct Curve25519Secret + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("Curve25519Secret", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct Curve25519Public + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("Curve25519Public", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct HmacSha256Key + // { + // opaque key[32]; + // }; + // + // =========================================================================== + xdr.struct("HmacSha256Key", [["key", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // struct HmacSha256Mac + // { + // opaque mac[32]; + // }; + // + // =========================================================================== + xdr.struct("HmacSha256Mac", [["mac", xdr.opaque(32)]]); + + // === xdr source ============================================================ + // + // enum SCValType + // { + // SCV_BOOL = 0, + // SCV_VOID = 1, + // SCV_ERROR = 2, + // + // // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. + // SCV_U32 = 3, + // SCV_I32 = 4, + // + // // 64 bits is naturally supported by both WASM and XDR also. + // SCV_U64 = 5, + // SCV_I64 = 6, + // + // // Time-related u64 subtypes with their own functions and formatting. + // SCV_TIMEPOINT = 7, + // SCV_DURATION = 8, + // + // // 128 bits is naturally supported by Rust and we use it for Soroban + // // fixed-point arithmetic prices / balances / similar "quantities". These + // // are represented in XDR as a pair of 2 u64s. + // SCV_U128 = 9, + // SCV_I128 = 10, + // + // // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine + // // word, so for interop use we include this even though it requires a small + // // amount of Rust guest and/or host library code. + // SCV_U256 = 11, + // SCV_I256 = 12, + // + // // Bytes come in 3 flavors, 2 of which have meaningfully different + // // formatting and validity-checking / domain-restriction. + // SCV_BYTES = 13, + // SCV_STRING = 14, + // SCV_SYMBOL = 15, + // + // // Vecs and maps are just polymorphic containers of other ScVals. + // SCV_VEC = 16, + // SCV_MAP = 17, + // + // // Address is the universal identifier for contracts and classic + // // accounts. + // SCV_ADDRESS = 18, + // + // // The following are the internal SCVal variants that are not + // // exposed to the contracts. + // SCV_CONTRACT_INSTANCE = 19, + // + // // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique + // // symbolic SCVals used as the key for ledger entries for a contract's + // // instance and an address' nonce, respectively. + // SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20, + // SCV_LEDGER_KEY_NONCE = 21 + // }; + // + // =========================================================================== + xdr.enum("ScValType", { + scvBool: 0, + scvVoid: 1, + scvError: 2, + scvU32: 3, + scvI32: 4, + scvU64: 5, + scvI64: 6, + scvTimepoint: 7, + scvDuration: 8, + scvU128: 9, + scvI128: 10, + scvU256: 11, + scvI256: 12, + scvBytes: 13, + scvString: 14, + scvSymbol: 15, + scvVec: 16, + scvMap: 17, + scvAddress: 18, + scvContractInstance: 19, + scvLedgerKeyContractInstance: 20, + scvLedgerKeyNonce: 21, + }); + + // === xdr source ============================================================ + // + // enum SCErrorType + // { + // SCE_CONTRACT = 0, // Contract-specific, user-defined codes. + // SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode. + // SCE_CONTEXT = 2, // Errors in the contract's host context. + // SCE_STORAGE = 3, // Errors accessing host storage. + // SCE_OBJECT = 4, // Errors working with host objects. + // SCE_CRYPTO = 5, // Errors in cryptographic operations. + // SCE_EVENTS = 6, // Errors while emitting events. + // SCE_BUDGET = 7, // Errors relating to budget limits. + // SCE_VALUE = 8, // Errors working with host values or SCVals. + // SCE_AUTH = 9 // Errors from the authentication subsystem. + // }; + // + // =========================================================================== + xdr.enum("ScErrorType", { + sceContract: 0, + sceWasmVm: 1, + sceContext: 2, + sceStorage: 3, + sceObject: 4, + sceCrypto: 5, + sceEvents: 6, + sceBudget: 7, + sceValue: 8, + sceAuth: 9, + }); + + // === xdr source ============================================================ + // + // enum SCErrorCode + // { + // SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero). + // SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds. + // SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data. + // SCEC_MISSING_VALUE = 3, // Some value was required but not provided. + // SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed. + // SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit. + // SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not. + // SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic. + // SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected. + // SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected. + // }; + // + // =========================================================================== + xdr.enum("ScErrorCode", { + scecArithDomain: 0, + scecIndexBounds: 1, + scecInvalidInput: 2, + scecMissingValue: 3, + scecExistingValue: 4, + scecExceededLimit: 5, + scecInvalidAction: 6, + scecInternalError: 7, + scecUnexpectedType: 8, + scecUnexpectedSize: 9, + }); + + // === xdr source ============================================================ + // + // union SCError switch (SCErrorType type) + // { + // case SCE_CONTRACT: + // uint32 contractCode; + // case SCE_WASM_VM: + // case SCE_CONTEXT: + // case SCE_STORAGE: + // case SCE_OBJECT: + // case SCE_CRYPTO: + // case SCE_EVENTS: + // case SCE_BUDGET: + // case SCE_VALUE: + // case SCE_AUTH: + // SCErrorCode code; + // }; + // + // =========================================================================== + xdr.union("ScError", { + switchOn: xdr.lookup("ScErrorType"), + switchName: "type", + switches: [ + ["sceContract", "contractCode"], + ["sceWasmVm", "code"], + ["sceContext", "code"], + ["sceStorage", "code"], + ["sceObject", "code"], + ["sceCrypto", "code"], + ["sceEvents", "code"], + ["sceBudget", "code"], + ["sceValue", "code"], + ["sceAuth", "code"], + ], + arms: { + contractCode: xdr.lookup("Uint32"), + code: xdr.lookup("ScErrorCode"), + }, + }); + + // === xdr source ============================================================ + // + // struct UInt128Parts { + // uint64 hi; + // uint64 lo; + // }; + // + // =========================================================================== + xdr.struct("UInt128Parts", [ + ["hi", xdr.lookup("Uint64")], + ["lo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct Int128Parts { + // int64 hi; + // uint64 lo; + // }; + // + // =========================================================================== + xdr.struct("Int128Parts", [ + ["hi", xdr.lookup("Int64")], + ["lo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct UInt256Parts { + // uint64 hi_hi; + // uint64 hi_lo; + // uint64 lo_hi; + // uint64 lo_lo; + // }; + // + // =========================================================================== + xdr.struct("UInt256Parts", [ + ["hiHi", xdr.lookup("Uint64")], + ["hiLo", xdr.lookup("Uint64")], + ["loHi", xdr.lookup("Uint64")], + ["loLo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // struct Int256Parts { + // int64 hi_hi; + // uint64 hi_lo; + // uint64 lo_hi; + // uint64 lo_lo; + // }; + // + // =========================================================================== + xdr.struct("Int256Parts", [ + ["hiHi", xdr.lookup("Int64")], + ["hiLo", xdr.lookup("Uint64")], + ["loHi", xdr.lookup("Uint64")], + ["loLo", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // enum ContractExecutableType + // { + // CONTRACT_EXECUTABLE_WASM = 0, + // CONTRACT_EXECUTABLE_TOKEN = 1 + // }; + // + // =========================================================================== + xdr.enum("ContractExecutableType", { + contractExecutableWasm: 0, + contractExecutableToken: 1, + }); + + // === xdr source ============================================================ + // + // union ContractExecutable switch (ContractExecutableType type) + // { + // case CONTRACT_EXECUTABLE_WASM: + // Hash wasm_hash; + // case CONTRACT_EXECUTABLE_TOKEN: + // void; + // }; + // + // =========================================================================== + xdr.union("ContractExecutable", { + switchOn: xdr.lookup("ContractExecutableType"), + switchName: "type", + switches: [ + ["contractExecutableWasm", "wasmHash"], + ["contractExecutableToken", xdr.void()], + ], + arms: { + wasmHash: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // enum SCAddressType + // { + // SC_ADDRESS_TYPE_ACCOUNT = 0, + // SC_ADDRESS_TYPE_CONTRACT = 1 + // }; + // + // =========================================================================== + xdr.enum("ScAddressType", { + scAddressTypeAccount: 0, + scAddressTypeContract: 1, + }); + + // === xdr source ============================================================ + // + // union SCAddress switch (SCAddressType type) + // { + // case SC_ADDRESS_TYPE_ACCOUNT: + // AccountID accountId; + // case SC_ADDRESS_TYPE_CONTRACT: + // Hash contractId; + // }; + // + // =========================================================================== + xdr.union("ScAddress", { + switchOn: xdr.lookup("ScAddressType"), + switchName: "type", + switches: [ + ["scAddressTypeAccount", "accountId"], + ["scAddressTypeContract", "contractId"], + ], + arms: { + accountId: xdr.lookup("AccountId"), + contractId: xdr.lookup("Hash"), + }, + }); + + // === xdr source ============================================================ + // + // const SCSYMBOL_LIMIT = 32; + // + // =========================================================================== + xdr.const("SCSYMBOL_LIMIT", 32); + + // === xdr source ============================================================ + // + // typedef SCVal SCVec<>; + // + // =========================================================================== + xdr.typedef("ScVec", xdr.varArray(xdr.lookup("ScVal"), 2147483647)); + + // === xdr source ============================================================ + // + // typedef SCMapEntry SCMap<>; + // + // =========================================================================== + xdr.typedef("ScMap", xdr.varArray(xdr.lookup("ScMapEntry"), 2147483647)); + + // === xdr source ============================================================ + // + // typedef opaque SCBytes<>; + // + // =========================================================================== + xdr.typedef("ScBytes", xdr.varOpaque()); + + // === xdr source ============================================================ + // + // typedef string SCString<>; + // + // =========================================================================== + xdr.typedef("ScString", xdr.string()); + + // === xdr source ============================================================ + // + // typedef string SCSymbol; + // + // =========================================================================== + xdr.typedef("ScSymbol", xdr.string(SCSYMBOL_LIMIT)); + + // === xdr source ============================================================ + // + // struct SCNonceKey { + // int64 nonce; + // }; + // + // =========================================================================== + xdr.struct("ScNonceKey", [["nonce", xdr.lookup("Int64")]]); + + // === xdr source ============================================================ + // + // struct SCContractInstance { + // ContractExecutable executable; + // SCMap* storage; + // }; + // + // =========================================================================== + xdr.struct("ScContractInstance", [ + ["executable", xdr.lookup("ContractExecutable")], + ["storage", xdr.option(xdr.lookup("ScMap"))], + ]); + + // === xdr source ============================================================ + // + // union SCVal switch (SCValType type) + // { + // + // case SCV_BOOL: + // bool b; + // case SCV_VOID: + // void; + // case SCV_ERROR: + // SCError error; + // + // case SCV_U32: + // uint32 u32; + // case SCV_I32: + // int32 i32; + // + // case SCV_U64: + // uint64 u64; + // case SCV_I64: + // int64 i64; + // case SCV_TIMEPOINT: + // TimePoint timepoint; + // case SCV_DURATION: + // Duration duration; + // + // case SCV_U128: + // UInt128Parts u128; + // case SCV_I128: + // Int128Parts i128; + // + // case SCV_U256: + // UInt256Parts u256; + // case SCV_I256: + // Int256Parts i256; + // + // case SCV_BYTES: + // SCBytes bytes; + // case SCV_STRING: + // SCString str; + // case SCV_SYMBOL: + // SCSymbol sym; + // + // // Vec and Map are recursive so need to live + // // behind an option, due to xdrpp limitations. + // case SCV_VEC: + // SCVec *vec; + // case SCV_MAP: + // SCMap *map; + // + // case SCV_ADDRESS: + // SCAddress address; + // + // // Special SCVals reserved for system-constructed contract-data + // // ledger keys, not generally usable elsewhere. + // case SCV_LEDGER_KEY_CONTRACT_INSTANCE: + // void; + // case SCV_LEDGER_KEY_NONCE: + // SCNonceKey nonce_key; + // + // case SCV_CONTRACT_INSTANCE: + // SCContractInstance instance; + // }; + // + // =========================================================================== + xdr.union("ScVal", { + switchOn: xdr.lookup("ScValType"), + switchName: "type", + switches: [ + ["scvBool", "b"], + ["scvVoid", xdr.void()], + ["scvError", "error"], + ["scvU32", "u32"], + ["scvI32", "i32"], + ["scvU64", "u64"], + ["scvI64", "i64"], + ["scvTimepoint", "timepoint"], + ["scvDuration", "duration"], + ["scvU128", "u128"], + ["scvI128", "i128"], + ["scvU256", "u256"], + ["scvI256", "i256"], + ["scvBytes", "bytes"], + ["scvString", "str"], + ["scvSymbol", "sym"], + ["scvVec", "vec"], + ["scvMap", "map"], + ["scvAddress", "address"], + ["scvLedgerKeyContractInstance", xdr.void()], + ["scvLedgerKeyNonce", "nonceKey"], + ["scvContractInstance", "instance"], + ], + arms: { + b: xdr.bool(), + error: xdr.lookup("ScError"), + u32: xdr.lookup("Uint32"), + i32: xdr.lookup("Int32"), + u64: xdr.lookup("Uint64"), + i64: xdr.lookup("Int64"), + timepoint: xdr.lookup("TimePoint"), + duration: xdr.lookup("Duration"), + u128: xdr.lookup("UInt128Parts"), + i128: xdr.lookup("Int128Parts"), + u256: xdr.lookup("UInt256Parts"), + i256: xdr.lookup("Int256Parts"), + bytes: xdr.lookup("ScBytes"), + str: xdr.lookup("ScString"), + sym: xdr.lookup("ScSymbol"), + vec: xdr.option(xdr.lookup("ScVec")), + map: xdr.option(xdr.lookup("ScMap")), + address: xdr.lookup("ScAddress"), + nonceKey: xdr.lookup("ScNonceKey"), + instance: xdr.lookup("ScContractInstance"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCMapEntry + // { + // SCVal key; + // SCVal val; + // }; + // + // =========================================================================== + xdr.struct("ScMapEntry", [ + ["key", xdr.lookup("ScVal")], + ["val", xdr.lookup("ScVal")], + ]); + + // === xdr source ============================================================ + // + // enum SCEnvMetaKind + // { + // SC_ENV_META_KIND_INTERFACE_VERSION = 0 + // }; + // + // =========================================================================== + xdr.enum("ScEnvMetaKind", { + scEnvMetaKindInterfaceVersion: 0, + }); + + // === xdr source ============================================================ + // + // union SCEnvMetaEntry switch (SCEnvMetaKind kind) + // { + // case SC_ENV_META_KIND_INTERFACE_VERSION: + // uint64 interfaceVersion; + // }; + // + // =========================================================================== + xdr.union("ScEnvMetaEntry", { + switchOn: xdr.lookup("ScEnvMetaKind"), + switchName: "kind", + switches: [["scEnvMetaKindInterfaceVersion", "interfaceVersion"]], + arms: { + interfaceVersion: xdr.lookup("Uint64"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCMetaV0 + // { + // string key<>; + // string val<>; + // }; + // + // =========================================================================== + xdr.struct("ScMetaV0", [ + ["key", xdr.string()], + ["val", xdr.string()], + ]); + + // === xdr source ============================================================ + // + // enum SCMetaKind + // { + // SC_META_V0 = 0 + // }; + // + // =========================================================================== + xdr.enum("ScMetaKind", { + scMetaV0: 0, + }); + + // === xdr source ============================================================ + // + // union SCMetaEntry switch (SCMetaKind kind) + // { + // case SC_META_V0: + // SCMetaV0 v0; + // }; + // + // =========================================================================== + xdr.union("ScMetaEntry", { + switchOn: xdr.lookup("ScMetaKind"), + switchName: "kind", + switches: [["scMetaV0", "v0"]], + arms: { + v0: xdr.lookup("ScMetaV0"), + }, + }); + + // === xdr source ============================================================ + // + // const SC_SPEC_DOC_LIMIT = 1024; + // + // =========================================================================== + xdr.const("SC_SPEC_DOC_LIMIT", 1024); + + // === xdr source ============================================================ + // + // enum SCSpecType + // { + // SC_SPEC_TYPE_VAL = 0, + // + // // Types with no parameters. + // SC_SPEC_TYPE_BOOL = 1, + // SC_SPEC_TYPE_VOID = 2, + // SC_SPEC_TYPE_ERROR = 3, + // SC_SPEC_TYPE_U32 = 4, + // SC_SPEC_TYPE_I32 = 5, + // SC_SPEC_TYPE_U64 = 6, + // SC_SPEC_TYPE_I64 = 7, + // SC_SPEC_TYPE_TIMEPOINT = 8, + // SC_SPEC_TYPE_DURATION = 9, + // SC_SPEC_TYPE_U128 = 10, + // SC_SPEC_TYPE_I128 = 11, + // SC_SPEC_TYPE_U256 = 12, + // SC_SPEC_TYPE_I256 = 13, + // SC_SPEC_TYPE_BYTES = 14, + // SC_SPEC_TYPE_STRING = 16, + // SC_SPEC_TYPE_SYMBOL = 17, + // SC_SPEC_TYPE_ADDRESS = 19, + // + // // Types with parameters. + // SC_SPEC_TYPE_OPTION = 1000, + // SC_SPEC_TYPE_RESULT = 1001, + // SC_SPEC_TYPE_VEC = 1002, + // SC_SPEC_TYPE_MAP = 1004, + // SC_SPEC_TYPE_TUPLE = 1005, + // SC_SPEC_TYPE_BYTES_N = 1006, + // + // // User defined types. + // SC_SPEC_TYPE_UDT = 2000 + // }; + // + // =========================================================================== + xdr.enum("ScSpecType", { + scSpecTypeVal: 0, + scSpecTypeBool: 1, + scSpecTypeVoid: 2, + scSpecTypeError: 3, + scSpecTypeU32: 4, + scSpecTypeI32: 5, + scSpecTypeU64: 6, + scSpecTypeI64: 7, + scSpecTypeTimepoint: 8, + scSpecTypeDuration: 9, + scSpecTypeU128: 10, + scSpecTypeI128: 11, + scSpecTypeU256: 12, + scSpecTypeI256: 13, + scSpecTypeBytes: 14, + scSpecTypeString: 16, + scSpecTypeSymbol: 17, + scSpecTypeAddress: 19, + scSpecTypeOption: 1000, + scSpecTypeResult: 1001, + scSpecTypeVec: 1002, + scSpecTypeMap: 1004, + scSpecTypeTuple: 1005, + scSpecTypeBytesN: 1006, + scSpecTypeUdt: 2000, + }); + + // === xdr source ============================================================ + // + // struct SCSpecTypeOption + // { + // SCSpecTypeDef valueType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeOption", [["valueType", xdr.lookup("ScSpecTypeDef")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeResult + // { + // SCSpecTypeDef okType; + // SCSpecTypeDef errorType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeResult", [ + ["okType", xdr.lookup("ScSpecTypeDef")], + ["errorType", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeVec + // { + // SCSpecTypeDef elementType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeVec", [["elementType", xdr.lookup("ScSpecTypeDef")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeMap + // { + // SCSpecTypeDef keyType; + // SCSpecTypeDef valueType; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeMap", [ + ["keyType", xdr.lookup("ScSpecTypeDef")], + ["valueType", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeTuple + // { + // SCSpecTypeDef valueTypes<12>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeTuple", [ + ["valueTypes", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeBytesN + // { + // uint32 n; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeBytesN", [["n", xdr.lookup("Uint32")]]); + + // === xdr source ============================================================ + // + // struct SCSpecTypeUDT + // { + // string name<60>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecTypeUdt", [["name", xdr.string(60)]]); + + // === xdr source ============================================================ + // + // union SCSpecTypeDef switch (SCSpecType type) + // { + // case SC_SPEC_TYPE_VAL: + // case SC_SPEC_TYPE_BOOL: + // case SC_SPEC_TYPE_VOID: + // case SC_SPEC_TYPE_ERROR: + // case SC_SPEC_TYPE_U32: + // case SC_SPEC_TYPE_I32: + // case SC_SPEC_TYPE_U64: + // case SC_SPEC_TYPE_I64: + // case SC_SPEC_TYPE_TIMEPOINT: + // case SC_SPEC_TYPE_DURATION: + // case SC_SPEC_TYPE_U128: + // case SC_SPEC_TYPE_I128: + // case SC_SPEC_TYPE_U256: + // case SC_SPEC_TYPE_I256: + // case SC_SPEC_TYPE_BYTES: + // case SC_SPEC_TYPE_STRING: + // case SC_SPEC_TYPE_SYMBOL: + // case SC_SPEC_TYPE_ADDRESS: + // void; + // case SC_SPEC_TYPE_OPTION: + // SCSpecTypeOption option; + // case SC_SPEC_TYPE_RESULT: + // SCSpecTypeResult result; + // case SC_SPEC_TYPE_VEC: + // SCSpecTypeVec vec; + // case SC_SPEC_TYPE_MAP: + // SCSpecTypeMap map; + // case SC_SPEC_TYPE_TUPLE: + // SCSpecTypeTuple tuple; + // case SC_SPEC_TYPE_BYTES_N: + // SCSpecTypeBytesN bytesN; + // case SC_SPEC_TYPE_UDT: + // SCSpecTypeUDT udt; + // }; + // + // =========================================================================== + xdr.union("ScSpecTypeDef", { + switchOn: xdr.lookup("ScSpecType"), + switchName: "type", + switches: [ + ["scSpecTypeVal", xdr.void()], + ["scSpecTypeBool", xdr.void()], + ["scSpecTypeVoid", xdr.void()], + ["scSpecTypeError", xdr.void()], + ["scSpecTypeU32", xdr.void()], + ["scSpecTypeI32", xdr.void()], + ["scSpecTypeU64", xdr.void()], + ["scSpecTypeI64", xdr.void()], + ["scSpecTypeTimepoint", xdr.void()], + ["scSpecTypeDuration", xdr.void()], + ["scSpecTypeU128", xdr.void()], + ["scSpecTypeI128", xdr.void()], + ["scSpecTypeU256", xdr.void()], + ["scSpecTypeI256", xdr.void()], + ["scSpecTypeBytes", xdr.void()], + ["scSpecTypeString", xdr.void()], + ["scSpecTypeSymbol", xdr.void()], + ["scSpecTypeAddress", xdr.void()], + ["scSpecTypeOption", "option"], + ["scSpecTypeResult", "result"], + ["scSpecTypeVec", "vec"], + ["scSpecTypeMap", "map"], + ["scSpecTypeTuple", "tuple"], + ["scSpecTypeBytesN", "bytesN"], + ["scSpecTypeUdt", "udt"], + ], + arms: { + option: xdr.lookup("ScSpecTypeOption"), + result: xdr.lookup("ScSpecTypeResult"), + vec: xdr.lookup("ScSpecTypeVec"), + map: xdr.lookup("ScSpecTypeMap"), + tuple: xdr.lookup("ScSpecTypeTuple"), + bytesN: xdr.lookup("ScSpecTypeBytesN"), + udt: xdr.lookup("ScSpecTypeUdt"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructFieldV0 + // { + // string doc; + // string name<30>; + // SCSpecTypeDef type; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtStructFieldV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTStructV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTStructFieldV0 fields<40>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtStructV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["fields", xdr.varArray(xdr.lookup("ScSpecUdtStructFieldV0"), 40)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionCaseVoidV0 + // { + // string doc; + // string name<60>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionCaseVoidV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionCaseTupleV0 + // { + // string doc; + // string name<60>; + // SCSpecTypeDef type<12>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionCaseTupleV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["type", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 12)], + ]); + + // === xdr source ============================================================ + // + // enum SCSpecUDTUnionCaseV0Kind + // { + // SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0, + // SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1 + // }; + // + // =========================================================================== + xdr.enum("ScSpecUdtUnionCaseV0Kind", { + scSpecUdtUnionCaseVoidV0: 0, + scSpecUdtUnionCaseTupleV0: 1, + }); + + // === xdr source ============================================================ + // + // union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind) + // { + // case SC_SPEC_UDT_UNION_CASE_VOID_V0: + // SCSpecUDTUnionCaseVoidV0 voidCase; + // case SC_SPEC_UDT_UNION_CASE_TUPLE_V0: + // SCSpecUDTUnionCaseTupleV0 tupleCase; + // }; + // + // =========================================================================== + xdr.union("ScSpecUdtUnionCaseV0", { + switchOn: xdr.lookup("ScSpecUdtUnionCaseV0Kind"), + switchName: "kind", + switches: [ + ["scSpecUdtUnionCaseVoidV0", "voidCase"], + ["scSpecUdtUnionCaseTupleV0", "tupleCase"], + ], + arms: { + voidCase: xdr.lookup("ScSpecUdtUnionCaseVoidV0"), + tupleCase: xdr.lookup("ScSpecUdtUnionCaseTupleV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct SCSpecUDTUnionV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTUnionCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtUnionV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtUnionCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTEnumCaseV0 + // { + // string doc; + // string name<60>; + // uint32 value; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtEnumCaseV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["value", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTEnumV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTEnumCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtEnumV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtEnumCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTErrorEnumCaseV0 + // { + // string doc; + // string name<60>; + // uint32 value; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtErrorEnumCaseV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(60)], + ["value", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecUDTErrorEnumV0 + // { + // string doc; + // string lib<80>; + // string name<60>; + // SCSpecUDTErrorEnumCaseV0 cases<50>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecUdtErrorEnumV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["lib", xdr.string(80)], + ["name", xdr.string(60)], + ["cases", xdr.varArray(xdr.lookup("ScSpecUdtErrorEnumCaseV0"), 50)], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecFunctionInputV0 + // { + // string doc; + // string name<30>; + // SCSpecTypeDef type; + // }; + // + // =========================================================================== + xdr.struct("ScSpecFunctionInputV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.string(30)], + ["type", xdr.lookup("ScSpecTypeDef")], + ]); + + // === xdr source ============================================================ + // + // struct SCSpecFunctionV0 + // { + // string doc; + // SCSymbol name; + // SCSpecFunctionInputV0 inputs<10>; + // SCSpecTypeDef outputs<1>; + // }; + // + // =========================================================================== + xdr.struct("ScSpecFunctionV0", [ + ["doc", xdr.string(SC_SPEC_DOC_LIMIT)], + ["name", xdr.lookup("ScSymbol")], + ["inputs", xdr.varArray(xdr.lookup("ScSpecFunctionInputV0"), 10)], + ["outputs", xdr.varArray(xdr.lookup("ScSpecTypeDef"), 1)], + ]); + + // === xdr source ============================================================ + // + // enum SCSpecEntryKind + // { + // SC_SPEC_ENTRY_FUNCTION_V0 = 0, + // SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, + // SC_SPEC_ENTRY_UDT_UNION_V0 = 2, + // SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, + // SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 + // }; + // + // =========================================================================== + xdr.enum("ScSpecEntryKind", { + scSpecEntryFunctionV0: 0, + scSpecEntryUdtStructV0: 1, + scSpecEntryUdtUnionV0: 2, + scSpecEntryUdtEnumV0: 3, + scSpecEntryUdtErrorEnumV0: 4, + }); + + // === xdr source ============================================================ + // + // union SCSpecEntry switch (SCSpecEntryKind kind) + // { + // case SC_SPEC_ENTRY_FUNCTION_V0: + // SCSpecFunctionV0 functionV0; + // case SC_SPEC_ENTRY_UDT_STRUCT_V0: + // SCSpecUDTStructV0 udtStructV0; + // case SC_SPEC_ENTRY_UDT_UNION_V0: + // SCSpecUDTUnionV0 udtUnionV0; + // case SC_SPEC_ENTRY_UDT_ENUM_V0: + // SCSpecUDTEnumV0 udtEnumV0; + // case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: + // SCSpecUDTErrorEnumV0 udtErrorEnumV0; + // }; + // + // =========================================================================== + xdr.union("ScSpecEntry", { + switchOn: xdr.lookup("ScSpecEntryKind"), + switchName: "kind", + switches: [ + ["scSpecEntryFunctionV0", "functionV0"], + ["scSpecEntryUdtStructV0", "udtStructV0"], + ["scSpecEntryUdtUnionV0", "udtUnionV0"], + ["scSpecEntryUdtEnumV0", "udtEnumV0"], + ["scSpecEntryUdtErrorEnumV0", "udtErrorEnumV0"], + ], + arms: { + functionV0: xdr.lookup("ScSpecFunctionV0"), + udtStructV0: xdr.lookup("ScSpecUdtStructV0"), + udtUnionV0: xdr.lookup("ScSpecUdtUnionV0"), + udtEnumV0: xdr.lookup("ScSpecUdtEnumV0"), + udtErrorEnumV0: xdr.lookup("ScSpecUdtErrorEnumV0"), + }, + }); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractExecutionLanesV0 + // { + // // maximum number of Soroban transactions per ledger + // uint32 ledgerMaxTxCount; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractExecutionLanesV0", [ + ["ledgerMaxTxCount", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractComputeV0 + // { + // // Maximum instructions per ledger + // int64 ledgerMaxInstructions; + // // Maximum instructions per transaction + // int64 txMaxInstructions; + // // Cost of 10000 instructions + // int64 feeRatePerInstructionsIncrement; + // + // // Memory limit per transaction. Unlike instructions, there is no fee + // // for memory, just the limit. + // uint32 txMemoryLimit; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractComputeV0", [ + ["ledgerMaxInstructions", xdr.lookup("Int64")], + ["txMaxInstructions", xdr.lookup("Int64")], + ["feeRatePerInstructionsIncrement", xdr.lookup("Int64")], + ["txMemoryLimit", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractLedgerCostV0 + // { + // // Maximum number of ledger entry read operations per ledger + // uint32 ledgerMaxReadLedgerEntries; + // // Maximum number of bytes that can be read per ledger + // uint32 ledgerMaxReadBytes; + // // Maximum number of ledger entry write operations per ledger + // uint32 ledgerMaxWriteLedgerEntries; + // // Maximum number of bytes that can be written per ledger + // uint32 ledgerMaxWriteBytes; + // + // // Maximum number of ledger entry read operations per transaction + // uint32 txMaxReadLedgerEntries; + // // Maximum number of bytes that can be read per transaction + // uint32 txMaxReadBytes; + // // Maximum number of ledger entry write operations per transaction + // uint32 txMaxWriteLedgerEntries; + // // Maximum number of bytes that can be written per transaction + // uint32 txMaxWriteBytes; + // + // int64 feeReadLedgerEntry; // Fee per ledger entry read + // int64 feeWriteLedgerEntry; // Fee per ledger entry write + // + // int64 feeRead1KB; // Fee for reading 1KB + // + // // The following parameters determine the write fee per 1KB. + // // Write fee grows linearly until bucket list reaches this size + // int64 bucketListTargetSizeBytes; + // // Fee per 1KB write when the bucket list is empty + // int64 writeFee1KBBucketListLow; + // // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` + // int64 writeFee1KBBucketListHigh; + // // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` + // uint32 bucketListWriteFeeGrowthFactor; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractLedgerCostV0", [ + ["ledgerMaxReadLedgerEntries", xdr.lookup("Uint32")], + ["ledgerMaxReadBytes", xdr.lookup("Uint32")], + ["ledgerMaxWriteLedgerEntries", xdr.lookup("Uint32")], + ["ledgerMaxWriteBytes", xdr.lookup("Uint32")], + ["txMaxReadLedgerEntries", xdr.lookup("Uint32")], + ["txMaxReadBytes", xdr.lookup("Uint32")], + ["txMaxWriteLedgerEntries", xdr.lookup("Uint32")], + ["txMaxWriteBytes", xdr.lookup("Uint32")], + ["feeReadLedgerEntry", xdr.lookup("Int64")], + ["feeWriteLedgerEntry", xdr.lookup("Int64")], + ["feeRead1Kb", xdr.lookup("Int64")], + ["bucketListTargetSizeBytes", xdr.lookup("Int64")], + ["writeFee1KbBucketListLow", xdr.lookup("Int64")], + ["writeFee1KbBucketListHigh", xdr.lookup("Int64")], + ["bucketListWriteFeeGrowthFactor", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractHistoricalDataV0 + // { + // int64 feeHistorical1KB; // Fee for storing 1KB in archives + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractHistoricalDataV0", [ + ["feeHistorical1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractEventsV0 + // { + // // Maximum size of events that a contract call can emit. + // uint32 txMaxContractEventsSizeBytes; + // // Fee for generating 1KB of contract events. + // int64 feeContractEvents1KB; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractEventsV0", [ + ["txMaxContractEventsSizeBytes", xdr.lookup("Uint32")], + ["feeContractEvents1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct ConfigSettingContractBandwidthV0 + // { + // // Maximum sum of all transaction sizes in the ledger in bytes + // uint32 ledgerMaxTxsSizeBytes; + // // Maximum size in bytes for a transaction + // uint32 txMaxSizeBytes; + // + // // Fee for 1 KB of transaction size + // int64 feeTxSize1KB; + // }; + // + // =========================================================================== + xdr.struct("ConfigSettingContractBandwidthV0", [ + ["ledgerMaxTxsSizeBytes", xdr.lookup("Uint32")], + ["txMaxSizeBytes", xdr.lookup("Uint32")], + ["feeTxSize1Kb", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // enum ContractCostType { + // // Cost of running 1 wasm instruction + // WasmInsnExec = 0, + // // Cost of growing wasm linear memory by 1 page + // WasmMemAlloc = 1, + // // Cost of allocating a chuck of host memory (in bytes) + // HostMemAlloc = 2, + // // Cost of copying a chuck of bytes into a pre-allocated host memory + // HostMemCpy = 3, + // // Cost of comparing two slices of host memory + // HostMemCmp = 4, + // // Cost of a host function dispatch, not including the actual work done by + // // the function nor the cost of VM invocation machinary + // DispatchHostFunction = 5, + // // Cost of visiting a host object from the host object storage. Exists to + // // make sure some baseline cost coverage, i.e. repeatly visiting objects + // // by the guest will always incur some charges. + // VisitObject = 6, + // // Cost of serializing an xdr object to bytes + // ValSer = 7, + // // Cost of deserializing an xdr object from bytes + // ValDeser = 8, + // // Cost of computing the sha256 hash from bytes + // ComputeSha256Hash = 9, + // // Cost of computing the ed25519 pubkey from bytes + // ComputeEd25519PubKey = 10, + // // Cost of accessing an entry in a Map. + // MapEntry = 11, + // // Cost of accessing an entry in a Vec + // VecEntry = 12, + // // Cost of verifying ed25519 signature of a payload. + // VerifyEd25519Sig = 13, + // // Cost of reading a slice of vm linear memory + // VmMemRead = 14, + // // Cost of writing to a slice of vm linear memory + // VmMemWrite = 15, + // // Cost of instantiation a VM from wasm bytes code. + // VmInstantiation = 16, + // // Cost of instantiation a VM from a cached state. + // VmCachedInstantiation = 17, + // // Cost of invoking a function on the VM. If the function is a host function, + // // additional cost will be covered by `DispatchHostFunction`. + // InvokeVmFunction = 18, + // // Cost of computing a keccak256 hash from bytes. + // ComputeKeccak256Hash = 19, + // // Cost of computing an ECDSA secp256k1 pubkey from bytes. + // ComputeEcdsaSecp256k1Key = 20, + // // Cost of computing an ECDSA secp256k1 signature from bytes. + // ComputeEcdsaSecp256k1Sig = 21, + // // Cost of recovering an ECDSA secp256k1 key from a signature. + // RecoverEcdsaSecp256k1Key = 22, + // // Cost of int256 addition (`+`) and subtraction (`-`) operations + // Int256AddSub = 23, + // // Cost of int256 multiplication (`*`) operation + // Int256Mul = 24, + // // Cost of int256 division (`/`) operation + // Int256Div = 25, + // // Cost of int256 power (`exp`) operation + // Int256Pow = 26, + // // Cost of int256 shift (`shl`, `shr`) operation + // Int256Shift = 27 + // }; + // + // =========================================================================== + xdr.enum("ContractCostType", { + wasmInsnExec: 0, + wasmMemAlloc: 1, + hostMemAlloc: 2, + hostMemCpy: 3, + hostMemCmp: 4, + dispatchHostFunction: 5, + visitObject: 6, + valSer: 7, + valDeser: 8, + computeSha256Hash: 9, + computeEd25519PubKey: 10, + mapEntry: 11, + vecEntry: 12, + verifyEd25519Sig: 13, + vmMemRead: 14, + vmMemWrite: 15, + vmInstantiation: 16, + vmCachedInstantiation: 17, + invokeVmFunction: 18, + computeKeccak256Hash: 19, + computeEcdsaSecp256k1Key: 20, + computeEcdsaSecp256k1Sig: 21, + recoverEcdsaSecp256k1Key: 22, + int256AddSub: 23, + int256Mul: 24, + int256Div: 25, + int256Pow: 26, + int256Shift: 27, + }); + + // === xdr source ============================================================ + // + // struct ContractCostParamEntry { + // // use `ext` to add more terms (e.g. higher order polynomials) in the future + // ExtensionPoint ext; + // + // int64 constTerm; + // int64 linearTerm; + // }; + // + // =========================================================================== + xdr.struct("ContractCostParamEntry", [ + ["ext", xdr.lookup("ExtensionPoint")], + ["constTerm", xdr.lookup("Int64")], + ["linearTerm", xdr.lookup("Int64")], + ]); + + // === xdr source ============================================================ + // + // struct StateExpirationSettings { + // uint32 maxEntryExpiration; + // uint32 minTempEntryExpiration; + // uint32 minPersistentEntryExpiration; + // + // // rent_fee = wfee_rate_average / rent_rate_denominator_for_type + // int64 persistentRentRateDenominator; + // int64 tempRentRateDenominator; + // + // // max number of entries that emit expiration meta in a single ledger + // uint32 maxEntriesToExpire; + // + // // Number of snapshots to use when calculating average BucketList size + // uint32 bucketListSizeWindowSampleSize; + // + // // Maximum number of bytes that we scan for eviction per ledger + // uint64 evictionScanSize; + // + // // Lowest BucketList level to be scanned to evict entries + // uint32 startingEvictionScanLevel; + // }; + // + // =========================================================================== + xdr.struct("StateExpirationSettings", [ + ["maxEntryExpiration", xdr.lookup("Uint32")], + ["minTempEntryExpiration", xdr.lookup("Uint32")], + ["minPersistentEntryExpiration", xdr.lookup("Uint32")], + ["persistentRentRateDenominator", xdr.lookup("Int64")], + ["tempRentRateDenominator", xdr.lookup("Int64")], + ["maxEntriesToExpire", xdr.lookup("Uint32")], + ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], + ["evictionScanSize", xdr.lookup("Uint64")], + ["startingEvictionScanLevel", xdr.lookup("Uint32")], + ]); + + // === xdr source ============================================================ + // + // struct EvictionIterator { + // uint32 bucketListLevel; + // bool isCurrBucket; + // uint64 bucketFileOffset; + // }; + // + // =========================================================================== + xdr.struct("EvictionIterator", [ + ["bucketListLevel", xdr.lookup("Uint32")], + ["isCurrBucket", xdr.bool()], + ["bucketFileOffset", xdr.lookup("Uint64")], + ]); + + // === xdr source ============================================================ + // + // const CONTRACT_COST_COUNT_LIMIT = 1024; + // + // =========================================================================== + xdr.const("CONTRACT_COST_COUNT_LIMIT", 1024); + + // === xdr source ============================================================ + // + // typedef ContractCostParamEntry ContractCostParams; + // + // =========================================================================== + xdr.typedef( + "ContractCostParams", + xdr.varArray( + xdr.lookup("ContractCostParamEntry"), + xdr.lookup("CONTRACT_COST_COUNT_LIMIT") + ) + ); + + // === xdr source ============================================================ + // + // enum ConfigSettingID + // { + // CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, + // CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, + // CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, + // CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, + // CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4, + // CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, + // CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6, + // CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, + // CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, + // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, + // CONFIG_SETTING_STATE_EXPIRATION = 10, + // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, + // CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, + // CONFIG_SETTING_EVICTION_ITERATOR = 13 + // }; + // + // =========================================================================== + xdr.enum("ConfigSettingId", { + configSettingContractMaxSizeBytes: 0, + configSettingContractComputeV0: 1, + configSettingContractLedgerCostV0: 2, + configSettingContractHistoricalDataV0: 3, + configSettingContractEventsV0: 4, + configSettingContractBandwidthV0: 5, + configSettingContractCostParamsCpuInstructions: 6, + configSettingContractCostParamsMemoryBytes: 7, + configSettingContractDataKeySizeBytes: 8, + configSettingContractDataEntrySizeBytes: 9, + configSettingStateExpiration: 10, + configSettingContractExecutionLanes: 11, + configSettingBucketlistSizeWindow: 12, + configSettingEvictionIterator: 13, + }); + + // === xdr source ============================================================ + // + // union ConfigSettingEntry switch (ConfigSettingID configSettingID) + // { + // case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: + // uint32 contractMaxSizeBytes; + // case CONFIG_SETTING_CONTRACT_COMPUTE_V0: + // ConfigSettingContractComputeV0 contractCompute; + // case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: + // ConfigSettingContractLedgerCostV0 contractLedgerCost; + // case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: + // ConfigSettingContractHistoricalDataV0 contractHistoricalData; + // case CONFIG_SETTING_CONTRACT_EVENTS_V0: + // ConfigSettingContractEventsV0 contractEvents; + // case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: + // ConfigSettingContractBandwidthV0 contractBandwidth; + // case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: + // ContractCostParams contractCostParamsCpuInsns; + // case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: + // ContractCostParams contractCostParamsMemBytes; + // case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: + // uint32 contractDataKeySizeBytes; + // case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: + // uint32 contractDataEntrySizeBytes; + // case CONFIG_SETTING_STATE_EXPIRATION: + // StateExpirationSettings stateExpirationSettings; + // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: + // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; + // case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: + // uint64 bucketListSizeWindow<>; + // case CONFIG_SETTING_EVICTION_ITERATOR: + // EvictionIterator evictionIterator; + // }; + // + // =========================================================================== + xdr.union("ConfigSettingEntry", { + switchOn: xdr.lookup("ConfigSettingId"), + switchName: "configSettingId", + switches: [ + ["configSettingContractMaxSizeBytes", "contractMaxSizeBytes"], + ["configSettingContractComputeV0", "contractCompute"], + ["configSettingContractLedgerCostV0", "contractLedgerCost"], + ["configSettingContractHistoricalDataV0", "contractHistoricalData"], + ["configSettingContractEventsV0", "contractEvents"], + ["configSettingContractBandwidthV0", "contractBandwidth"], + [ + "configSettingContractCostParamsCpuInstructions", + "contractCostParamsCpuInsns", + ], + [ + "configSettingContractCostParamsMemoryBytes", + "contractCostParamsMemBytes", + ], + ["configSettingContractDataKeySizeBytes", "contractDataKeySizeBytes"], + ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], + ["configSettingStateExpiration", "stateExpirationSettings"], + ["configSettingContractExecutionLanes", "contractExecutionLanes"], + ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], + ["configSettingEvictionIterator", "evictionIterator"], + ], + arms: { + contractMaxSizeBytes: xdr.lookup("Uint32"), + contractCompute: xdr.lookup("ConfigSettingContractComputeV0"), + contractLedgerCost: xdr.lookup("ConfigSettingContractLedgerCostV0"), + contractHistoricalData: xdr.lookup( + "ConfigSettingContractHistoricalDataV0" + ), + contractEvents: xdr.lookup("ConfigSettingContractEventsV0"), + contractBandwidth: xdr.lookup("ConfigSettingContractBandwidthV0"), + contractCostParamsCpuInsns: xdr.lookup("ContractCostParams"), + contractCostParamsMemBytes: xdr.lookup("ContractCostParams"), + contractDataKeySizeBytes: xdr.lookup("Uint32"), + contractDataEntrySizeBytes: xdr.lookup("Uint32"), + stateExpirationSettings: xdr.lookup("StateExpirationSettings"), + contractExecutionLanes: xdr.lookup( + "ConfigSettingContractExecutionLanesV0" + ), + bucketListSizeWindow: xdr.varArray(xdr.lookup("Uint64"), 2147483647), + evictionIterator: xdr.lookup("EvictionIterator"), + }, + }); }); export default types; diff --git a/src/index.js b/src/index.js index 78a147446..8b77fff69 100644 --- a/src/index.js +++ b/src/index.js @@ -38,6 +38,7 @@ export { Claimant } from './claimant'; export { Networks } from './network'; export { StrKey } from './strkey'; export { SignerKey } from './signerkey'; +export { Soroban } from './soroban'; export { decodeAddressToMuxedAccount, encodeMuxedAccountToAddress, @@ -45,4 +46,18 @@ export { encodeMuxedAccount } from './util/decode_encode_muxed_account'; +// +// Soroban +// + +export { Contract } from './contract'; +export { Address } from './address'; +export * from './numbers'; +export * from './scval'; +export * from './events'; +export * from './sorobandata_builder'; +export * from './auth'; + +export * from './invocation'; + export default module.exports; diff --git a/src/invocation.js b/src/invocation.js new file mode 100644 index 000000000..4ad48e20c --- /dev/null +++ b/src/invocation.js @@ -0,0 +1,198 @@ +import { Asset } from './asset'; +import { Address } from './address'; +import { scValToNative } from './scval'; + +/** + * @typedef CreateInvocation + * + * @prop {'wasm'|'sac'} type a type indicating if this creation was a custom + * contract or a wrapping of an existing Stellar asset + * @prop {string} [token] when `type=='sac'`, the canonical {@link Asset} that + * is being wrapped by this Stellar Asset Contract + * @prop {object} [wasm] when `type=='wasm'`, add'l creation parameters + * + * @prop {string} wasm.hash hex hash of WASM bytecode backing this contract + * @prop {string} wasm.address contract address of this deployment + * @prop {string} wasm.salt hex salt that the user consumed when creating + * this contract (encoded in the resulting address) + */ + +/** + * @typedef ExecuteInvocation + * + * @prop {string} source the strkey of the contract (C...) being invoked + * @prop {string} function the name of the function being invoked + * @prop {any[]} args the natively-represented parameters to the function + * invocation (see {@link scValToNative}) for rules on how they're + * represented a JS types + */ + +/** + * @typedef InvocationTree + * @prop {'execute' | 'create'} type the type of invocation occurring, either + * contract creation or host function execution + * @prop {CreateInvocation | ExecuteInvocation} args the parameters to the + * invocation, depending on the type + * @prop {InvocationTree[]} invocations any sub-invocations that (may) occur + * as a result of this invocation (i.e. a tree of call stacks) + */ + +/** + * 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. + * + * @param {xdr.SorobanAuthorizedInvocation} root the raw XDR of the invocation, + * likely acquired from transaction simulation. this is either from the + * {@link Operation.invokeHostFunction} itself (the `func` field), or from + * the authorization entries ({@link xdr.SorobanAuthorizationEntry}, the + * `rootInvocation` field) + * + * @returns {InvocationTree} a human-readable version of the invocation tree + * + * @example + * Here, we show a browser modal after simulating an arbitrary transaction, + * `tx`, which we assume has an `Operation.invokeHostFunction` inside of it: + * + * ```typescript + * import { Server, buildInvocationTree } from 'soroban-client'; + * + * const s = new Server("fill in accordingly"); + * + * s.simulateTransaction(tx).then( + * (resp: SorobanRpc.SimulateTransactionResponse) => { + * if (SorobanRpc.isSuccessfulSim(resp) && ) { + * // bold assumption: there's a valid result with an auth entry + * alert( + * "You are authorizing the following invocation:\n" + + * JSON.stringify( + * buildInvocationTree(resp.result!.auth[0].rootInvocation()), + * null, + * 2 + * ) + * ); + * } + * } + * ); + * ``` + */ +export function buildInvocationTree(root) { + const fn = root.function(); + + /** @type {InvocationTree} */ + const output = {}; + + /** @type {xdr.CreateContractArgs | xdr.InvokeContractArgs} */ + const inner = fn.value(); + + switch (fn.switch().value) { + // sorobanAuthorizedFunctionTypeContractFn + case 0: + output.type = 'execute'; + output.args = { + source: Address.fromScAddress(inner.contractAddress()).toString(), + function: inner.functionName(), + args: inner.args().map((arg) => scValToNative(arg)) + }; + break; + + // sorobanAuthorizedFunctionTypeCreateContractHostFn + case 1: { + output.type = 'create'; + output.args = {}; + + // If the executable is a WASM, the preimage MUST be an address. If it's a + // token, the preimage MUST be an asset. This is a cheeky way to check + // that, because wasm=0, token=1 and address=0, asset=1 in the XDR switch + // values. + // + // The first part may not be true in V2, but we'd need to update this code + // anyway so it can still be an error. + const [exec, preimage] = [inner.executable(), inner.contractIdPreimage()]; + if (!!exec.switch().value !== !!preimage.switch().value) { + throw new Error( + `creation function appears invalid: ${JSON.stringify( + inner + )} (should be wasm+address or token+asset)` + ); + } + + switch (exec.switch().value) { + // contractExecutableWasm + case 0: { + /** @type {xdr.ContractIdPreimageFromAddress} */ + const details = preimage.fromAddress(); + + output.args.type = 'wasm'; + output.args.wasm = { + salt: details.salt().toString('hex'), + hash: exec.wasmHash().toString('hex'), + address: Address.fromScAddress(details.address()).toString() + }; + break; + } + + // contractExecutableToken + case 1: + output.args.type = 'sac'; + output.args.asset = Asset.fromOperation( + preimage.fromAsset() + ).toString(); + break; + + default: + throw new Error(`unknown creation type: ${JSON.stringify(exec)}`); + } + + break; + } + + default: + throw new Error( + `unknown invocation type (${fn.switch()}): ${JSON.stringify(fn)}` + ); + } + + output.invocations = root.subInvocations().map((i) => buildInvocationTree(i)); + return output; +} + +/** + * @callback InvocationWalker + * + * @param {xdr.SorobanAuthorizedInvocation} node the currently explored node + * @param {number} depth the depth of the tree this node is occurring at (the + * root starts at a depth of 1) + * @param {xdr.SorobanAuthorizedInvocation} [parent] this `node`s parent node, + * if any (i.e. this doesn't exist at the root) + * + * @returns {boolean?} returning `false` is a hint to stop exploring + */ + +/** + * 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. + * + * @param {xdr.SorobanAuthorizedInvocation} root the tree to explore + * @param {InvocationWalker} callback the callback to execute for each node + * @returns {void} + */ +export function walkInvocationTree(root, callback) { + walkHelper(root, 1, callback); +} + +function walkHelper(node, depth, callback, parent) { + if (callback(node, depth, parent) === false /* allow void rv */) { + return; + } + + node + .subInvocations() + .forEach((i) => walkHelper(i, depth + 1, callback, node)); +} diff --git a/src/network.js b/src/network.js index 9e549d911..20c7ac12c 100644 --- a/src/network.js +++ b/src/network.js @@ -2,9 +2,15 @@ * Contains passphrases for common networks: * * `Networks.PUBLIC`: `Public Global Stellar Network ; September 2015` * * `Networks.TESTNET`: `Test SDF Network ; September 2015` - * @type {{PUBLIC: string, TESTNET: string}} + * * `Networks.FUTURENET`: `Test SDF Future Network ; October 2022` + * * `Networks.STANDALONE`: `Standalone Network ; February 2017` + * + * @type {{PUBLIC: string, TESTNET: string, FUTURENET: string, STANDALONE: string }} */ export const Networks = { PUBLIC: 'Public Global Stellar Network ; September 2015', - TESTNET: 'Test SDF Network ; September 2015' + TESTNET: 'Test SDF Network ; September 2015', + FUTURENET: 'Test SDF Future Network ; October 2022', + SANDBOX: 'Local Sandbox Stellar Network ; September 2022', + STANDALONE: 'Standalone Network ; February 2017' }; diff --git a/src/numbers/index.js b/src/numbers/index.js new file mode 100644 index 000000000..e2b6244a9 --- /dev/null +++ b/src/numbers/index.js @@ -0,0 +1,59 @@ +import { XdrLargeInt } from './xdr_large_int'; + +export { Uint128 } from './uint128'; +export { Uint256 } from './uint256'; +export { Int128 } from './int128'; +export { Int256 } from './int256'; +export { ScInt } from './sc_int'; +export { XdrLargeInt }; + +/** + * Transforms an opaque {@link 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 {@link XdrLargeInt}. + * + * @example + * let scv = contract.call("add", x, y); // assume it returns an xdr.ScVal + * let bigi = scValToBigInt(scv); + * + * new ScInt(bigi); // if you don't care about types, and + * new XdrLargeInt('i128', bigi); // if you do + * + * @param {xdr.ScVal} scv - the raw XDR value to parse into an integer + * @returns {bigint} the native value of this input value + * + * @throws {TypeError} if the `scv` input value doesn't represent an integer + */ +export function scValToBigInt(scv) { + const scIntType = XdrLargeInt.getType(scv.switch().name); + + switch (scv.switch().name) { + case 'scvU32': + case 'scvI32': + return BigInt(scv.value()); + + case 'scvU64': + case 'scvI64': + return new XdrLargeInt(scIntType, scv.value()).toBigInt(); + + case 'scvU128': + case 'scvI128': + return new XdrLargeInt(scIntType, [ + scv.value().lo(), + scv.value().hi() + ]).toBigInt(); + + case 'scvU256': + case 'scvI256': + return new XdrLargeInt(scIntType, [ + scv.value().loLo(), + scv.value().loHi(), + scv.value().hiLo(), + scv.value().hiHi() + ]).toBigInt(); + + default: + throw TypeError(`expected integer type, got ${scv.switch()}`); + } +} diff --git a/src/numbers/int128.js b/src/numbers/int128.js new file mode 100644 index 000000000..a543342aa --- /dev/null +++ b/src/numbers/int128.js @@ -0,0 +1,23 @@ +import { LargeInt } from 'js-xdr'; + +export class Int128 extends LargeInt { + /** + * Construct a signed 128-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ + constructor(...args) { + super(args); + } + + get unsigned() { + return false; + } + + get size() { + return 128; + } +} + +Int128.defineIntBoundaries(); diff --git a/src/numbers/int256.js b/src/numbers/int256.js new file mode 100644 index 000000000..76e155c30 --- /dev/null +++ b/src/numbers/int256.js @@ -0,0 +1,23 @@ +import { LargeInt } from 'js-xdr'; + +export class Int256 extends LargeInt { + /** + * Construct a signed 256-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ + constructor(...args) { + super(args); + } + + get unsigned() { + return false; + } + + get size() { + return 256; + } +} + +Int256.defineIntBoundaries(); diff --git a/src/numbers/sc_int.js b/src/numbers/sc_int.js new file mode 100644 index 000000000..86432e52c --- /dev/null +++ b/src/numbers/sc_int.js @@ -0,0 +1,114 @@ +import { XdrLargeInt } from './xdr_large_int'; + +/** + * Provides an easier way to manipulate large numbers for Stellar operations. + * + * You can instantiate this 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 {@link XdrLargeInt}. For + * example, you could do `new XdrLargeInt('u128', bytes...).toBigInt()`. + * + * @example + * import sdk from "stellar-base"; + * + * // You have an ScVal from a contract and want to parse it into JS native. + * const value = sdk.xdr.ScVal.fromXDR(someXdr, "base64"); + * const bigi = sdk.ScInt.fromScVal(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 = sdk.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: + * sdk.ScInt("123456789123456789") + * sdk.ScInt(123456789123456789n); + * sdk.ScInt(1n << 140n); + * sdk.ScInt(-42); + * sdk.ScInt.fromScVal(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 = sdk.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(); + * + * @param {number|bigint|string} value - 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)`. + * + * @param {object} [opts] - an optional object controlling optional parameters + * @param {string} [opts.type] - force a specific data type. the type choices + * are: 'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the + * smallest one that fits the `value`) + * + * @throws {RangeError} if the `value` is invalid (e.g. floating point), too + * large (i.e. exceeds a 256-bit value), or doesn't fit in the `opts.type` + * + * @throws {TypeError} on missing parameters, or if the "signedness" of `opts` + * doesn't match input `value`, e.g. passing `{type: 'u64'}` yet passing -1n + * + * @throws {SyntaxError} if a string `value` can't be parsed as a big integer + */ +export class ScInt extends XdrLargeInt { + constructor(value, opts) { + const signed = value < 0; + let type = opts?.type ?? ''; + if (type.startsWith('u') && signed) { + throw TypeError(`specified type ${opts.type} yet negative (${value})`); + } + + // If unspecified, we make a best guess at the type based on the bit length + // of the value, treating 64 as a minimum and 256 as a maximum. + if (type === '') { + type = signed ? 'i' : 'u'; + const bitlen = nearestBigIntSize(value); + + switch (bitlen) { + case 64: + case 128: + case 256: + type += bitlen.toString(); + break; + + default: + throw RangeError( + `expected 64/128/256 bits for input (${value}), got ${bitlen}` + ); + } + } + + super(type, value); + } +} + +function nearestBigIntSize(bigI) { + // Note: Even though BigInt.toString(2) includes the negative sign for + // negative values (???), the following is still accurate, because the + // negative sign would be represented by a sign bit. + const bitlen = bigI.toString(2).length; + return [64, 128, 256].find((len) => bitlen <= len) ?? bitlen; +} diff --git a/src/numbers/uint128.js b/src/numbers/uint128.js new file mode 100644 index 000000000..1f0642324 --- /dev/null +++ b/src/numbers/uint128.js @@ -0,0 +1,23 @@ +import { LargeInt } from 'js-xdr'; + +export class Uint128 extends LargeInt { + /** + * Construct an unsigned 128-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ + constructor(...args) { + super(args); + } + + get unsigned() { + return true; + } + + get size() { + return 128; + } +} + +Uint128.defineIntBoundaries(); diff --git a/src/numbers/uint256.js b/src/numbers/uint256.js new file mode 100644 index 000000000..c7ac461f4 --- /dev/null +++ b/src/numbers/uint256.js @@ -0,0 +1,23 @@ +import { LargeInt } from 'js-xdr'; + +export class Uint256 extends LargeInt { + /** + * Construct an unsigned 256-bit integer that can be XDR-encoded. + * + * @param {Array} args - one or more slices to encode + * in big-endian format (i.e. earlier elements are higher bits) + */ + constructor(...args) { + super(args); + } + + get unsigned() { + return true; + } + + get size() { + return 256; + } +} + +Uint256.defineIntBoundaries(); diff --git a/src/numbers/xdr_large_int.js b/src/numbers/xdr_large_int.js new file mode 100644 index 000000000..c8869ca5b --- /dev/null +++ b/src/numbers/xdr_large_int.js @@ -0,0 +1,254 @@ +/* eslint no-bitwise: ["error", {"allow": [">>"]}] */ +import { Hyper, UnsignedHyper } from 'js-xdr'; + +import { Uint128 } from './uint128'; +import { Uint256 } from './uint256'; +import { Int128 } from './int128'; +import { Int256 } from './int256'; + +import xdr from '../xdr'; + +/** + * A wrapper class to represent large XDR-encodable integers. + * + * This operates at a lower level than {@link 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. + * + * @param {string} type - force a specific data type. the type choices are: + * 'i64', 'u64', 'i128', 'u128', 'i256', and 'u256' (default: the smallest + * one that fits the `value`) (see {@link XdrLargeInt.isType}) + * @param {number|bigint|string|Array} values a list of + * integer-like values interpreted in big-endian order + */ +export class XdrLargeInt { + /** + * @type {xdr.LargeInt} + */ + int; // child class of a jsXdr.LargeInt + + /** + * @type {string} - one of i64, u64, i128, u128, i256, or u256 + */ + type; + + constructor(type, values) { + if (!(values instanceof Array)) { + values = [values]; + } + + // normalize values to one type + values = values.map((i) => { + // micro-optimization to no-op on the likeliest input value: + if (typeof i === 'bigint') { + return i; + } + if (i instanceof XdrLargeInt) { + return i.toBigInt(); + } + return BigInt(i); + }); + + switch (type) { + case 'i64': + this.int = new Hyper(values); + break; + case 'i128': + this.int = new Int128(values); + break; + case 'i256': + this.int = new Int256(values); + break; + case 'u64': + this.int = new UnsignedHyper(values); + break; + case 'u128': + this.int = new Uint128(values); + break; + case 'u256': + this.int = new Uint256(values); + break; + default: + throw TypeError(`invalid type: ${type}`); + } + + this.type = type; + } + + /** + * @returns {number} + * @throws {RangeError} if the value can't fit into a Number + */ + toNumber() { + const bi = this.int.toBigInt(); + if (bi > Number.MAX_SAFE_INTEGER || bi < Number.MIN_SAFE_INTEGER) { + throw RangeError( + `value ${bi} not in range for Number ` + + `[${Number.MAX_SAFE_INTEGER}, ${Number.MIN_SAFE_INTEGER}]` + ); + } + + return Number(bi); + } + + /** @returns {bigint} */ + toBigInt() { + return this.int.toBigInt(); + } + + /** @returns {xdr.ScVal} the integer encoded with `ScValType = I64` */ + toI64() { + this._sizeCheck(64); + const v = this.toBigInt(); + if (BigInt.asIntN(64, v) !== v) { + throw RangeError(`value too large for i64: ${v}`); + } + + return xdr.ScVal.scvI64(new xdr.Int64(v)); + } + + /** @returns {xdr.ScVal} the integer encoded with `ScValType = U64` */ + toU64() { + this._sizeCheck(64); + return xdr.ScVal.scvU64( + new xdr.Uint64(BigInt.asUintN(64, this.toBigInt())) // reiterpret as unsigned + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = I128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toI128() { + this._sizeCheck(128); + + const v = this.int.toBigInt(); + const hi64 = BigInt.asIntN(64, v >> 64n); // encode top 64 w/ sign bit + const lo64 = BigInt.asUintN(64, v); // grab btm 64, encode sign + + return xdr.ScVal.scvI128( + new xdr.Int128Parts({ + hi: new xdr.Int64(hi64), + lo: new xdr.Uint64(lo64) + }) + ); + } + + /** + * @returns {xdr.ScVal} the integer encoded with `ScValType = U128` + * @throws {RangeError} if the value cannot fit in 128 bits + */ + toU128() { + this._sizeCheck(128); + const v = this.int.toBigInt(); + + return xdr.ScVal.scvU128( + new xdr.UInt128Parts({ + hi: new xdr.Uint64(BigInt.asUintN(64, v >> 64n)), + lo: new xdr.Uint64(BigInt.asUintN(64, v)) + }) + ); + } + + /** @returns {xdr.ScVal} the integer encoded with `ScValType = I256` */ + toI256() { + const v = this.int.toBigInt(); + const hiHi64 = BigInt.asIntN(64, v >> 192n); // keep sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); + const loLo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvI256( + new xdr.Int256Parts({ + hiHi: new xdr.Int64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); + } + + /** @returns {xdr.ScVal} the integer encoded with `ScValType = U256` */ + toU256() { + const v = this.int.toBigInt(); + const hiHi64 = BigInt.asUintN(64, v >> 192n); // encode sign bit + const hiLo64 = BigInt.asUintN(64, v >> 128n); + const loHi64 = BigInt.asUintN(64, v >> 64n); + const loLo64 = BigInt.asUintN(64, v); + + return xdr.ScVal.scvU256( + new xdr.UInt256Parts({ + hiHi: new xdr.Uint64(hiHi64), + hiLo: new xdr.Uint64(hiLo64), + loHi: new xdr.Uint64(loHi64), + loLo: new xdr.Uint64(loLo64) + }) + ); + } + + /** @returns {xdr.ScVal} the smallest interpretation of the stored value */ + toScVal() { + switch (this.type) { + case 'i64': + return this.toI64(); + case 'i128': + return this.toI128(); + case 'i256': + return this.toI256(); + case 'u64': + return this.toU64(); + case 'u128': + return this.toU128(); + case 'u256': + return this.toU256(); + default: + throw TypeError(`invalid type: ${this.type}`); + } + } + + valueOf() { + return this.int.valueOf(); + } + + toString() { + return this.int.toString(); + } + + toJSON() { + return { + value: this.toBigInt().toString(), + type: this.type + }; + } + + _sizeCheck(bits) { + if (this.int.size > bits) { + throw RangeError(`value too large for ${bits} bits (${this.type})`); + } + } + + static isType(type) { + switch (type) { + case 'i64': + case 'i128': + case 'i256': + case 'u64': + case 'u128': + case 'u256': + return true; + default: + return false; + } + } + + /** + * Convert the raw `ScValType` string (e.g. 'scvI128', generated by the XDR) + * to a type description for {@link XdrLargeInt} construction (e.g. 'i128') + * + * @param {string} scvType the `xdr.ScValType` as a string + * @returns {string} a suitable equivalent type to construct this object + */ + static getType(scvType) { + return scvType.slice(3).toLowerCase(); + } +} diff --git a/src/operation.js b/src/operation.js index 1d03e217a..0712f66f8 100644 --- a/src/operation.js +++ b/src/operation.js @@ -56,7 +56,10 @@ export const AuthImmutableFlag = 1 << 2; export const AuthClawbackEnabledFlag = 1 << 3; /** - * `Operation` class represents [operations](https://developers.stellar.org/docs/glossary/operations/) in Stellar network. + * `Operation` class represents + * [operations](https://developers.stellar.org/docs/glossary/operations/) in + * Stellar network. + * * Use one of static methods to create operations: * * `{@link Operation.createAccount}` * * `{@link Operation.payment}` @@ -88,6 +91,9 @@ export const AuthClawbackEnabledFlag = 1 << 3; * * `{@link Operation.setTrustLineFlags}` * * `{@link Operation.liquidityPoolDeposit}` * * `{@link Operation.liquidityPoolWithdraw}` + * * `{@link Operation.invokeHostFunction}` + * * `{@link Operation.bumpFootprintExpiration}` + * * `{@link Operation.restoreFootprint}` * * @class Operation */ @@ -369,6 +375,21 @@ export class Operation { result.minAmountB = this._fromXDRAmount(attrs.minAmountB()); break; } + case 'invokeHostFunction': { + result.type = 'invokeHostFunction'; + result.func = attrs.hostFunction(); + result.auth = attrs.auth() ?? []; + break; + } + case 'bumpFootprintExpiration': { + result.type = 'bumpFootprintExpiration'; + result.ledgersToExpire = attrs.ledgersToExpire(); + break; + } + case 'restoreFootprint': { + result.type = 'restoreFootprint'; + break; + } default: { throw new Error(`Unknown operation: ${operationName}`); } @@ -650,3 +671,6 @@ Operation.clawback = ops.clawback; Operation.setTrustLineFlags = ops.setTrustLineFlags; Operation.liquidityPoolDeposit = ops.liquidityPoolDeposit; Operation.liquidityPoolWithdraw = ops.liquidityPoolWithdraw; +Operation.invokeHostFunction = ops.invokeHostFunction; +Operation.bumpFootprintExpiration = ops.bumpFootprintExpiration; +Operation.restoreFootprint = ops.restoreFootprint; diff --git a/src/operations/bump_footprint_expiration.js b/src/operations/bump_footprint_expiration.js new file mode 100644 index 000000000..7d2fbe9c4 --- /dev/null +++ b/src/operations/bump_footprint_expiration.js @@ -0,0 +1,41 @@ +import xdr from '../xdr'; + +/** + * Builds an operation to bump the expiration of a footprint (read and written + * ledger keys). Its only parameter is the number of ledgers to extend + * expiration for. + * + * The footprint itself is derived from the transaction (see + * {@link TransactionBuilder}'s `opts.sorobanData` parameter, which is a + * {@link xdr.SorobanTransactionData} instance that contains fee data & resource + * usage as part of {@link xdr.SorobanResources}). + * + * @function + * @alias Operation.bumpFootprintExpiration + * + * @param {object} opts - object holding operation parameters + * @param {number} opts.ledgersToExpire - the number of ledgers past the LCL + * (last closed ledger) by which to extend the validity of the ledger keys in + * this transaction + * @param {string} [opts.source] - an optional source account + * + * @returns {xdr.Operation} a Bump Footprint Expiration operation + * (xdr.BumpFootprintExpirationOp) + */ +export function bumpFootprintExpiration(opts) { + if ((opts.ledgersToExpire ?? -1) <= 0) { + throw new RangeError("ledgersToExpire isn't a ledger quantity (uint32)"); + } + + const bumpFootprintOp = new xdr.BumpFootprintExpirationOp({ + ext: new xdr.ExtensionPoint(0), + ledgersToExpire: opts.ledgersToExpire + }); + + const opAttributes = { + body: xdr.OperationBody.bumpFootprintExpiration(bumpFootprintOp) + }; + this.setSourceAccount(opAttributes, opts); + + return new xdr.Operation(opAttributes); +} diff --git a/src/operations/create_account.js b/src/operations/create_account.js index 1cb28ddd8..b3edcbcf1 100644 --- a/src/operations/create_account.js +++ b/src/operations/create_account.js @@ -19,7 +19,7 @@ export function createAccount(opts) { } if (!this.isValidAmount(opts.startingBalance, true)) { throw new TypeError( - 'startingBalance must be of type String, represent a non-negative number and have at most 7 digits after the decimal' + this.constructAmountRequirementsError('startingBalance') ); } const attributes = {}; diff --git a/src/operations/index.js b/src/operations/index.js index 459fc729e..82d32de93 100644 --- a/src/operations/index.js +++ b/src/operations/index.js @@ -30,3 +30,6 @@ export { clawback } from './clawback'; export { setTrustLineFlags } from './set_trustline_flags'; export { liquidityPoolDeposit } from './liquidity_pool_deposit'; export { liquidityPoolWithdraw } from './liquidity_pool_withdraw'; +export { invokeHostFunction } from './invoke_host_function'; +export { bumpFootprintExpiration } from './bump_footprint_expiration'; +export { restoreFootprint } from './restore_footprint'; diff --git a/src/operations/invoke_host_function.js b/src/operations/invoke_host_function.js new file mode 100644 index 000000000..b46aa287e --- /dev/null +++ b/src/operations/invoke_host_function.js @@ -0,0 +1,37 @@ +import xdr from '../xdr'; + +/** + * Invokes a single smart contract function. + * + * @function + * @alias Operation.invokeHostFunction + * + * @param {object} opts - options object + * @param {xdr.HostFunction} opts.func - host function to execute (with its + * wrapped parameters) + * @param {xdr.SorobanAuthorizationEntry[]} [opts.auth] - list outlining the + * tree of authorizations required for the call + * @param {string} [opts.source] - an optional source account + * + * @returns {xdr.Operation} an Invoke Host Function operation + * (xdr.InvokeHostFunctionOp) + */ +export function invokeHostFunction(opts) { + if (!opts.func) { + throw new TypeError( + `host function invocation ('func') required (got ${JSON.stringify(opts)})` + ); + } + + const invokeHostFunctionOp = new xdr.InvokeHostFunctionOp({ + hostFunction: opts.func, + auth: opts.auth || [] + }); + + const opAttributes = { + body: xdr.OperationBody.invokeHostFunction(invokeHostFunctionOp) + }; + this.setSourceAccount(opAttributes, opts); + + return new xdr.Operation(opAttributes); +} diff --git a/src/operations/liquidity_pool_deposit.js b/src/operations/liquidity_pool_deposit.js index 6bdbce904..eb39b41e5 100644 --- a/src/operations/liquidity_pool_deposit.js +++ b/src/operations/liquidity_pool_deposit.js @@ -31,12 +31,12 @@ export function liquidityPoolDeposit(opts = {}) { attributes.liquidityPoolId = xdr.PoolId.fromXDR(liquidityPoolId, 'hex'); if (!this.isValidAmount(maxAmountA, true)) { - throw new TypeError('maxAmountA argument is required'); + throw new TypeError(this.constructAmountRequirementsError('maxAmountA')); } attributes.maxAmountA = this._toXDRAmount(maxAmountA); if (!this.isValidAmount(maxAmountB, true)) { - throw new TypeError('maxAmountB argument is required'); + throw new TypeError(this.constructAmountRequirementsError('maxAmountB')); } attributes.maxAmountB = this._toXDRAmount(maxAmountB); diff --git a/src/operations/liquidity_pool_withdraw.js b/src/operations/liquidity_pool_withdraw.js index 0696bf044..0768e1edc 100644 --- a/src/operations/liquidity_pool_withdraw.js +++ b/src/operations/liquidity_pool_withdraw.js @@ -24,17 +24,17 @@ export function liquidityPoolWithdraw(opts = {}) { attributes.liquidityPoolId = xdr.PoolId.fromXDR(opts.liquidityPoolId, 'hex'); if (!this.isValidAmount(opts.amount)) { - throw new TypeError('amount argument is required'); + throw new TypeError(this.constructAmountRequirementsError('amount')); } attributes.amount = this._toXDRAmount(opts.amount); if (!this.isValidAmount(opts.minAmountA, true)) { - throw new TypeError('minAmountA argument is required'); + throw new TypeError(this.constructAmountRequirementsError('minAmountA')); } attributes.minAmountA = this._toXDRAmount(opts.minAmountA); if (!this.isValidAmount(opts.minAmountB, true)) { - throw new TypeError('minAmountB argument is required'); + throw new TypeError(this.constructAmountRequirementsError('minAmountB')); } attributes.minAmountB = this._toXDRAmount(opts.minAmountB); diff --git a/src/operations/restore_footprint.js b/src/operations/restore_footprint.js new file mode 100644 index 000000000..b13b5a885 --- /dev/null +++ b/src/operations/restore_footprint.js @@ -0,0 +1,29 @@ +import xdr from '../xdr'; + +/** + * Builds a footprint restoration operation. + * + * It takes no parameters because the relevant footprint is derived from the + * transaction itself (see {@link TransactionBuilder}'s `opts.sorobanData` + * parameter (or {@link TransactionBuilder.setSorobanData} / + * {@link TransactionBuilder.setLedgerKeys}), which is a + * {@link xdr.SorobanTransactionData} instance that contains fee data & resource + * usage as part of {@link xdr.SorobanTransactionData}). + * + * @function + * @alias Operation.restoreFootprint + * + * @param {object} [opts] - an optional set of parameters + * @param {string} [opts.source] - an optional source account + * + * @returns {xdr.Operation} a Bump Footprint Expiration operation + * (xdr.RestoreFootprintOp) + */ +export function restoreFootprint(opts = {}) { + const op = new xdr.RestoreFootprintOp({ ext: new xdr.ExtensionPoint(0) }); + const opAttributes = { + body: xdr.OperationBody.restoreFootprint(op) + }; + this.setSourceAccount(opAttributes, opts ?? {}); + return new xdr.Operation(opAttributes); +} diff --git a/src/scval.js b/src/scval.js new file mode 100644 index 000000000..a7d5a8223 --- /dev/null +++ b/src/scval.js @@ -0,0 +1,370 @@ +import xdr from './xdr'; + +import { Address } from './address'; +import { Contract } from './contract'; +import { ScInt, XdrLargeInt, scValToBigInt } from './numbers/index'; + +/** + * Attempts to convert native types into smart contract values + * ({@link xdr.ScVal}). + * + * Provides conversions from smart contract XDR values ({@link 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 {@link ScInt}) + * + * - {@link Address} or {@link 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. + * + * @param {any} val - a native (or convertible) input value to wrap + * @param {object} [opts] - an optional set of hints around the type of + * conversion you'd like to see + * @param {string} [opts.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 {@link 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`. + * + * @returns {xdr.ScVal} a wrapped, smart, XDR version of the input value + * @throws {TypeError} 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). + * @see scValToNative + * + * @example + * 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({ 'hello': 1, 'world': [ true, false ] }, { + * type: { + * 'hello': [ 'symbol', 'i128' ], + * } + * }) + * // gives scvMap with entries: [ + * // [ scvSymbol, scvI128 ], + * // [ scvString, scvArray ] + * // ] + * + * @example + * import { nativeToScVal, scValToNative, ScInt, xdr } from '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'], + * }; + * + * // 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 + */ +export function nativeToScVal(val, opts = {}) { + switch (typeof val) { + case 'object': + if (val === null) { + return xdr.ScVal.scvVoid(); + } + + if (val instanceof xdr.ScVal) { + return val; // should we copy? + } + + if (val instanceof Address) { + return val.toScVal(); + } + + if (val instanceof Contract) { + return val.address().toScVal(); + } + + if (val instanceof Uint8Array || Buffer.isBuffer(val)) { + const copy = Uint8Array.from(val); + switch (opts?.type ?? 'bytes') { + case 'bytes': + return xdr.ScVal.scvBytes(copy); + case 'symbol': + return xdr.ScVal.scvSymbol(copy); + case 'string': + return xdr.ScVal.scvString(copy); + default: + throw new TypeError( + `invalid type (${opts.type}) specified for bytes-like value` + ); + } + } + + if (Array.isArray(val)) { + if (val.length > 0 && val.some((v) => typeof v !== typeof val[0])) { + throw new TypeError( + `array values (${val}) must have the same type (types: ${val + .map((v) => typeof v) + .join(',')})` + ); + } + return xdr.ScVal.scvVec(val.map((v) => nativeToScVal(v, opts))); + } + + if ((val.constructor?.name ?? '') !== 'Object') { + throw new TypeError( + `cannot interpret ${ + val.constructor?.name + } value as ScVal (${JSON.stringify(val)})` + ); + } + + return xdr.ScVal.scvMap( + Object.entries(val).map(([k, v]) => { + // the type can be specified with an entry for the key and the value, + // e.g. val = { 'hello': 1 } and opts.type = { hello: [ 'symbol', + // 'u128' ]} or you can use `null` for the default interpretation + const [keyType, valType] = (opts?.type ?? {})[k] ?? [null, null]; + const keyOpts = keyType ? { type: keyType } : {}; + const valOpts = valType ? { type: valType } : {}; + + return new xdr.ScMapEntry({ + key: nativeToScVal(k, keyOpts), + val: nativeToScVal(v, valOpts) + }); + }) + ); + + case 'number': + case 'bigint': + switch (opts?.type) { + case 'u32': + return xdr.ScVal.scvU32(val); + + case 'i32': + return xdr.ScVal.scvI32(val); + + default: + break; + } + + return new ScInt(val, { type: opts?.type }).toScVal(); + + case 'string': { + const optType = opts?.type ?? 'string'; + switch (optType) { + case 'string': + return xdr.ScVal.scvString(val); + + case 'symbol': + return xdr.ScVal.scvSymbol(val); + + case 'address': + return new Address(val).toScVal(); + + default: + if (XdrLargeInt.isType(optType)) { + return new XdrLargeInt(optType, val).toScVal(); + } + + throw new TypeError( + `invalid type (${opts.type}) specified for string value` + ); + } + } + + case 'boolean': + return xdr.ScVal.scvBool(val); + + case 'undefined': + return xdr.ScVal.scvVoid(); + + case 'function': // FIXME: Is this too helpful? + return nativeToScVal(val()); + + default: + throw new TypeError(`failed to convert typeof ${typeof val} (${val})`); + } +} + +/** + * 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 -> `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. + * + * @param {xdr.ScVal} scv - the input smart contract value + * + * @returns {any} + * @see nativeToScVal + */ +export function scValToNative(scv) { + // we use the verbose xdr.ScValType..value form here because it's faster + // than string comparisons and the underlying constants never need to be + // updated + switch (scv.switch().value) { + case xdr.ScValType.scvVoid().value: + return null; + + // these can be converted to bigints directly + case xdr.ScValType.scvU64().value: + case xdr.ScValType.scvI64().value: + return scv.value().toBigInt(); + + // these can be parsed by internal abstractions note that this can also + // handle the above two cases, but it's not as efficient (another + // type-check, parsing, etc.) + case xdr.ScValType.scvU128().value: + case xdr.ScValType.scvI128().value: + case xdr.ScValType.scvU256().value: + case xdr.ScValType.scvI256().value: + return scValToBigInt(scv); + + case xdr.ScValType.scvVec().value: + return (scv.vec() ?? []).map(scValToNative); + + case xdr.ScValType.scvAddress().value: + return Address.fromScVal(scv).toString(); + + case xdr.ScValType.scvMap().value: + return Object.fromEntries( + (scv.map() ?? []).map((entry) => [ + scValToNative(entry.key()), + scValToNative(entry.val()) + ]) + ); + + // these return the primitive type directly + case xdr.ScValType.scvBool().value: + case xdr.ScValType.scvU32().value: + case xdr.ScValType.scvI32().value: + case xdr.ScValType.scvBytes().value: + return scv.value(); + + // Symbols are limited to [a-zA-Z0-9_]+, so we can safely make ascii strings + // + // Strings, however, are "presented" as strings and we treat them as such + // (in other words, string = bytes with a hint that it's text). If the user + // encoded non-printable bytes in their string value, that's on them. + // + // Note that we assume a utf8 encoding (ascii-compatible). For other + // encodings, you should probably use bytes anyway. If it cannot be decoded, + // the raw bytes are returned. + case xdr.ScValType.scvSymbol().value: + case xdr.ScValType.scvString().value: { + const v = scv.value(); // string|Buffer + if (Buffer.isBuffer(v) || ArrayBuffer.isView(v)) { + try { + return new TextDecoder().decode(v); + } catch (e) { + return new Uint8Array(v.buffer); // copy of bytes + } + } + return v; // string already + } + + // these can be converted to bigint + case xdr.ScValType.scvTimepoint().value: + case xdr.ScValType.scvDuration().value: + return new xdr.Uint64(scv.value()).toBigInt(); + + case xdr.ScValType.scvStatus().value: + // TODO: Convert each status type into a human-readable error string? + switch (scv.value().switch()) { + case xdr.ScStatusType.sstOk().value: + case xdr.ScStatusType.sstUnknownError().value: + case xdr.ScStatusType.sstHostValueError().value: + case xdr.ScStatusType.sstHostObjectError().value: + case xdr.ScStatusType.sstHostFunctionError().value: + case xdr.ScStatusType.sstHostStorageError().value: + case xdr.ScStatusType.sstHostContextError().value: + case xdr.ScStatusType.sstVmError().value: + case xdr.ScStatusType.sstContractError().value: + case xdr.ScStatusType.sstHostAuthError().value: + default: + break; + } + + // in the fallthrough case, just return the underlying value directly + default: + return scv.value(); + } +} diff --git a/src/soroban.js b/src/soroban.js new file mode 100644 index 000000000..197d3e85f --- /dev/null +++ b/src/soroban.js @@ -0,0 +1,68 @@ +/** + * Soroban helper class + * formatting, parsing, and etc + * @class Soroban + */ +export class Soroban { + /** + * All arithmetic inside the contract is performed on integers to + * avoid potential precision and consistency issues of floating-point + * + * This function takes the smart contract value and its decimals (if the token has any) and returns a display value + * @param {string} amount - the token amount you want to display + * @param {number} decimals - specify how many decimal places a token has + * @returns {string} - display value + */ + static formatTokenAmount(amount, decimals) { + let formatted = amount; + + if (amount.includes('.')) { + throw new Error('No decimal is allowed'); + } + + if (decimals > 0) { + if (decimals > formatted.length) { + formatted = ['0', formatted.toString().padStart(decimals, '0')].join( + '.' + ); + } else { + formatted = [ + formatted.slice(0, -decimals), + formatted.slice(-decimals) + ].join('.'); + } + } + + // remove trailing zero if any + return formatted.replace(/(\.\d*?)0+$/, '$1'); + } + + /** + * parse 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. + * @param {string} value - the token amount you want to use it on smart contract + * @param {number} decimals - specify how many decimal places a token has + * @returns {string} - smart contract value + * + * + * @example + * const displayValueAmount = "123.4560" + * const parsedAmountForSmartContract = parseTokenAmount("123.4560", 5); + * parsedAmountForSmartContract === "12345600" + */ + static parseTokenAmount(value, decimals) { + const [whole, fraction, ...rest] = value.split('.').slice(); + + if (rest.length) { + throw new Error(`Invalid decimal value: ${value}`); + } + + const shifted = BigInt( + whole + (fraction?.padEnd(decimals, '0') ?? '0'.repeat(decimals)) + ); + + return shifted.toString(); + } +} diff --git a/src/sorobandata_builder.js b/src/sorobandata_builder.js new file mode 100644 index 000000000..4d74ccd2c --- /dev/null +++ b/src/sorobandata_builder.js @@ -0,0 +1,197 @@ +import xdr from './xdr'; + +/** + * Supports building {@link xdr.SorobanTransactionData} structures with various + * items set to specific values. + * + * This is recommended for when you are building + * {@link Operation.bumpFootprintExpiration} / + * {@link Operation.restoreFootprint} operations and need to + * {@link TransactionBuilder.setSorobanData} to avoid (re)building the entire + * data structure from scratch. + * + * @constructor + * + * @param {string | xdr.SorobanTransactionData} [sorobanData] either a + * base64-encoded string that represents an + * {@link 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 + * + * @example + * // You want to use an existing data blob but override specific parts. + * const newData = new SorobanDataBuilder(existing) + * .setReadOnly(someLedgerKeys) + * .setRefundableFee("1000") + * .build(); + * + * // You want an instance from scratch + * const newData = new SorobanDataBuilder() + * .setFootprint([someLedgerKey], []) + * .setRefundableFee("1000") + * .build(); + */ +export class SorobanDataBuilder { + _data; + + constructor(sorobanData) { + let data; + + if (!sorobanData) { + data = new xdr.SorobanTransactionData({ + resources: new xdr.SorobanResources({ + footprint: new xdr.LedgerFootprint({ readOnly: [], readWrite: [] }), + instructions: 0, + readBytes: 0, + writeBytes: 0 + }), + ext: new xdr.ExtensionPoint(0), + refundableFee: new xdr.Int64(0) + }); + } else if ( + typeof sorobanData === 'string' || + ArrayBuffer.isView(sorobanData) + ) { + data = SorobanDataBuilder.fromXDR(sorobanData); + } else { + data = SorobanDataBuilder.fromXDR(sorobanData.toXDR()); // copy + } + + this._data = data; + } + + /** + * Decodes and builds a {@link xdr.SorobanTransactionData} instance. + * @param {Uint8Array|Buffer|string} data raw input to decode + * @returns {xdr.SorobanTransactionData} + */ + static fromXDR(data) { + return xdr.SorobanTransactionData.fromXDR( + data, + typeof data === 'string' ? 'base64' : 'raw' + ); + } + + /** + * Sets the "refundable" fee portion of the Soroban data. + * @param {number | bigint | string} fee the refundable fee to set (int64) + * @returns {SorobanDataBuilder} + */ + setRefundableFee(fee) { + this._data.refundableFee(new xdr.Int64(fee)); + return this; + } + + /** + * 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. + * + * @param {number} cpuInstrs number of CPU instructions + * @param {number} readBytes number of bytes being read + * @param {number} writeBytes number of bytes being written + * + * @returns {SorobanDataBuilder} + */ + setResources(cpuInstrs, readBytes, writeBytes) { + this._data.resources().instructions(cpuInstrs); + this._data.resources().readBytes(readBytes); + this._data.resources().writeBytes(writeBytes); + + return this; + } + + /** + * Appends the given ledger keys to the existing storage access footprint. + * @param {xdr.LedgerKey[]} readOnly read-only keys to add + * @param {xdr.LedgerKey[]} readWrite read-write keys to add + * @returns {SorobanDataBuilder} this builder instance + */ + appendFootprint(readOnly, readWrite) { + return this.setFootprint( + this.getReadOnly().concat(readOnly), + this.getReadWrite().concat(readWrite) + ); + } + + /** + * Sets the storage access footprint to be a certain set of ledger keys. + * + * You can also set each field explicitly via + * {@link SorobanDataBuilder.setReadOnly} and + * {@link SorobanDataBuilder.setReadWrite} or add to the existing footprint + * via {@link SorobanDataBuilder.appendFootprint}. + * + * Passing `null|undefined` to either parameter will IGNORE the existing + * values. If you want to clear them, pass `[]`, instead. + * + * @param {xdr.LedgerKey[]|null} [readOnly] 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 + * @param {xdr.LedgerKey[]|null} [readWrite] 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 + * @returns {SorobanDataBuilder} this builder instance + */ + setFootprint(readOnly, readWrite) { + if (readOnly !== null) { + // null means "leave me alone" + this.setReadOnly(readOnly); + } + if (readWrite !== null) { + this.setReadWrite(readWrite); + } + return this; + } + + /** + * @param {xdr.LedgerKey[]} readOnly read-only keys in the access footprint + * @returns {SorobanDataBuilder} + */ + setReadOnly(readOnly) { + this._data + .resources() + .footprint() + .readOnly(readOnly ?? []); + return this; + } + + /** + * @param {xdr.LedgerKey[]} readWrite read-write keys in the access footprint + * @returns {SorobanDataBuilder} + */ + setReadWrite(readWrite) { + this._data + .resources() + .footprint() + .readWrite(readWrite ?? []); + return this; + } + + /** + * @returns {xdr.SorobanTransactionData} a copy of the final data structure + */ + build() { + return xdr.SorobanTransactionData.fromXDR(this._data.toXDR()); // clone + } + + // + // getters follow + // + + /** @returns {xdr.LedgerKey[]} the read-only storage access pattern */ + getReadOnly() { + return this.getFootprint().readOnly(); + } + + /** @returns {xdr.LedgerKey[]} the read-write storage access pattern */ + getReadWrite() { + return this.getFootprint().readWrite(); + } + + /** @returns {xdr.LedgerFootprint} the storage access pattern */ + getFootprint() { + return this._data.resources().footprint(); + } +} diff --git a/src/strkey.js b/src/strkey.js index 65db862d8..b40157aa9 100644 --- a/src/strkey.js +++ b/src/strkey.js @@ -9,7 +9,8 @@ const versionBytes = { med25519PublicKey: 12 << 3, // M preAuthTx: 19 << 3, // T sha256Hash: 23 << 3, // X - signedPayload: 15 << 3 // P + signedPayload: 15 << 3, // P + contract: 2 << 3 // C }; const strkeyTypes = { @@ -18,7 +19,8 @@ const strkeyTypes = { M: 'med25519PublicKey', T: 'preAuthTx', X: 'sha256Hash', - P: 'signedPayload' + P: 'signedPayload', + C: 'contract' }; /** @@ -176,6 +178,33 @@ export class StrKey { return isValid('signedPayload', address); } + /** + * Encodes raw data to strkey contract (C...). + * @param {Buffer} data data to encode + * @returns {string} + */ + static encodeContract(data) { + return encodeCheck('contract', data); + } + + /** + * Decodes strkey contract (C...) to raw data. + * @param {string} address address to decode + * @returns {Buffer} + */ + static decodeContract(address) { + return decodeCheck('contract', address); + } + + /** + * Checks validity of alleged contract (C...) strkey address. + * @param {string} address signer key to check + * @returns {boolean} + */ + static isValidContract(address) { + return isValid('contract', address); + } + static getVersionByteForPrefix(address) { return strkeyTypes[address[0]]; } @@ -204,7 +233,8 @@ function isValid(versionByteName, encoded) { case 'ed25519PublicKey': // falls through case 'ed25519SecretSeed': // falls through case 'preAuthTx': // falls through - case 'sha256Hash': + case 'sha256Hash': // falls through + case 'contract': if (encoded.length !== 56) { return false; } @@ -238,7 +268,8 @@ function isValid(versionByteName, encoded) { case 'ed25519PublicKey': // falls through case 'ed25519SecretSeed': // falls through case 'preAuthTx': // falls through - case 'sha256Hash': + case 'sha256Hash': // falls through + case 'contract': return decoded.length === 32; case 'med25519PublicKey': diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 495316aa6..db3181684 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -2,11 +2,18 @@ import { UnsignedHyper } from 'js-xdr'; import BigNumber from 'bignumber.js'; import xdr from './xdr'; + +import { Account } from './account'; +import { MuxedAccount } from './muxed_account'; +import { decodeAddressToMuxedAccount } from './util/decode_encode_muxed_account'; + import { Transaction } from './transaction'; import { FeeBumpTransaction } from './fee_bump_transaction'; +import { SorobanDataBuilder } from './sorobandata_builder'; + +import { StrKey } from './strkey'; import { SignerKey } from './signerkey'; import { Memo } from './memo'; -import { decodeAddressToMuxedAccount } from './util/decode_encode_muxed_account'; /** * Minimum base fee for transactions. If this fee is below the network @@ -106,6 +113,15 @@ export const TimeoutInfinite = 0; * @param {string} [opts.networkPassphrase] passphrase of the * target Stellar network (e.g. "Public Global Stellar Network ; September * 2015" for the pubnet) + * @param {xdr.SorobanTransactionData | string} [opts.sorobanData] - an + * optional instance of {@link xdr.SorobanTransactionData} to be set as the + * internal `Transaction.Ext.SorobanData` field (either the xdr object or a + * base64 string). In the case of Soroban transactions, this can be obtained + * from a prior simulation of the transaction with a contract invocation and + * provides necessary resource estimations. You can also use + * {@link SorobanDataBuilder} to construct complicated combinations of + * parameters without mucking with XDR directly. **Note:** For + * non-contract(non-Soroban) transactions, this has no effect. */ export class TransactionBuilder { constructor(sourceAccount, opts = {}) { @@ -129,6 +145,74 @@ export class TransactionBuilder { this.extraSigners = opts.extraSigners ? [...opts.extraSigners] : null; this.memo = opts.memo || Memo.none(); this.networkPassphrase = opts.networkPassphrase || null; + + this.sorobanData = opts.sorobanData + ? new SorobanDataBuilder(opts.sorobanData).build() + : null; + } + + /** + * Creates a builder instance using an existing {@link 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). + * + * @param {Transaction} tx a "template" transaction to clone exactly + * @param {object} [opts] additional options to override the clone, e.g. + * {fee: '1000'} will override the existing base fee derived from `tx` (see + * the {@link TransactionBuilder} constructor for detailed options) + * + * @returns {TransactionBuilder} a "prepared" builder instance with the same + * configuration and operations as the given transaction + * + * @warning This does not clone the transaction's + * {@link xdr.SorobanTransactionData} (if applicable), use + * {@link SorobanDataBuilder} and {@link TransactionBuilder.setSorobanData} + * as needed, instead.. + * + * @todo This cannot clone {@link FeeBumpTransaction}s, yet. + */ + static cloneFrom(tx, opts = {}) { + if (!(tx instanceof Transaction)) { + throw new TypeError(`expected a 'Transaction', got: ${tx}`); + } + + const sequenceNum = `${parseInt(tx.sequence, 10) - 1}`; + + let source; + // rebuild the source account based on the strkey + if (StrKey.isValidMed25519PublicKey(tx.source)) { + source = MuxedAccount.fromAddress(tx.source, sequenceNum); + } else if (StrKey.isValidEd25519PublicKey(tx.source)) { + source = new Account(tx.source, sequenceNum); + } else { + throw new TypeError(`unsupported tx source account: ${tx.source}`); + } + + // the initial fee passed to the builder gets scaled up based on the number + // of operations at the end, so we have to down-scale first + const unscaledFee = parseInt(tx.fee, 10) / tx.operations.length; + + const builder = new TransactionBuilder(source, { + fee: (unscaledFee || BASE_FEE).toString(), + memo: tx.memo, + networkPassphrase: tx.networkPassphrase, + timebounds: tx.timeBounds, + ledgerbounds: tx.ledgerBounds, + minAccountSequence: tx.minAccountSequence, + minAccountSequenceAge: tx.minAccountSequenceAge, + minAccountSequenceLedgerGap: tx.minAccountSequenceLedgerGap, + extraSigners: tx.extraSigners, + ...opts + }); + + tx._tx.operations().forEach((op) => builder.addOperation(op)); + + return builder; } /** @@ -144,6 +228,15 @@ export class TransactionBuilder { return this; } + /** + * Removes the operations from the builder (useful when cloning). + * @returns {TransactionBuilder} this builder instance + */ + clearOperations() { + this.operations = []; + return this; + } + /** * Adds a memo to the transaction. * @param {Memo} memo {@link Memo} object @@ -434,6 +527,30 @@ export class TransactionBuilder { return this; } + /** + * 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 + * {@link 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. + * {@link Operation.invokeHostFunction}, providing necessary resource + * and storage footprint estimations for contract invocation. + * + * @param {xdr.SorobanTransactionData | string} sorobanData the + * {@link xdr.SorobanTransactionData} as a raw xdr object or a base64 + * string to be decoded + * + * @returns {TransactionBuilder} + * @see {SorobanDataBuilder} + */ + setSorobanData(sorobanData) { + this.sorobanData = new SorobanDataBuilder(sorobanData).build(); + return this; + } + /** * This will build the transaction. * It will also increment the source account's sequence number by 1. @@ -513,7 +630,17 @@ export class TransactionBuilder { } attrs.sourceAccount = decodeAddressToMuxedAccount(this.source.accountId()); - attrs.ext = new xdr.TransactionExt(0); + + // TODO - remove this workaround for TransactionExt ts constructor + // and use the typescript generated static factory method once fixed + // https://github.com/stellar/dts-xdr/issues/5 + if (this.sorobanData) { + // @ts-ignore + attrs.ext = new xdr.TransactionExt(1, this.sorobanData); + } else { + // @ts-ignore + attrs.ext = new xdr.TransactionExt(0, xdr.Void); + } const xtx = new xdr.Transaction(attrs); xtx.operations(this.operations); diff --git a/test/unit/address_test.js b/test/unit/address_test.js new file mode 100644 index 000000000..87ec37657 --- /dev/null +++ b/test/unit/address_test.js @@ -0,0 +1,140 @@ +describe('Address', function () { + const ACCOUNT = 'GBBM6BKZPEHWYO3E3YKREDPQXMS4VK35YLNU7NFBRI26RAN7GI5POFBB'; + const CONTRACT = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const MUXED_ADDRESS = + 'MA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVAAAAAAAAAAAAAJLK'; + + describe('.constructor', function () { + it('fails to create Address object from an invalid address', function () { + expect(() => new StellarBase.Address('GBBB')).to.throw( + /Unsupported address type/ + ); + }); + + it('creates an Address object for accounts', function () { + let account = new StellarBase.Address(ACCOUNT); + expect(account.toString()).to.equal(ACCOUNT); + }); + + it('creates an Address object for contracts', function () { + let account = new StellarBase.Address(CONTRACT); + expect(account.toString()).to.equal(CONTRACT); + }); + + it('wont create Address objects from muxed account strings', function () { + expect(() => { + new StellarBase.Account(MUXED_ADDRESS, '123'); + }).to.throw(/MuxedAccount/); + }); + }); + + describe('static constructors', function () { + it('.fromString', function () { + let account = StellarBase.Address.fromString(ACCOUNT); + expect(account.toString()).to.equal(ACCOUNT); + }); + + it('.account', function () { + let account = StellarBase.Address.account(Buffer.alloc(32)); + expect(account.toString()).to.equal( + 'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF' + ); + }); + + it('.contract', function () { + let account = StellarBase.Address.contract(Buffer.alloc(32)); + expect(account.toString()).to.equal( + 'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4' + ); + }); + + describe('.fromScAddress', function () { + it('creates an Address object for accounts', function () { + let scAddress = StellarBase.xdr.ScAddress.scAddressTypeAccount( + StellarBase.xdr.PublicKey.publicKeyTypeEd25519( + StellarBase.StrKey.decodeEd25519PublicKey(ACCOUNT) + ) + ); + let account = StellarBase.Address.fromScAddress(scAddress); + expect(account.toString()).to.equal(ACCOUNT); + }); + + it('creates an Address object for contracts', function () { + let scAddress = StellarBase.xdr.ScAddress.scAddressTypeContract( + StellarBase.StrKey.decodeContract(CONTRACT) + ); + let contract = StellarBase.Address.fromScAddress(scAddress); + expect(contract.toString()).to.equal(CONTRACT); + }); + }); + + describe('.fromScVal', function () { + it('creates an Address object for accounts', function () { + let scVal = StellarBase.xdr.ScVal.scvAddress( + StellarBase.xdr.ScAddress.scAddressTypeAccount( + StellarBase.xdr.PublicKey.publicKeyTypeEd25519( + StellarBase.StrKey.decodeEd25519PublicKey(ACCOUNT) + ) + ) + ); + let account = StellarBase.Address.fromScVal(scVal); + expect(account.toString()).to.equal(ACCOUNT); + }); + + it('creates an Address object for contracts', function () { + let scVal = StellarBase.xdr.ScVal.scvAddress( + StellarBase.xdr.ScAddress.scAddressTypeContract( + StellarBase.StrKey.decodeContract(CONTRACT) + ) + ); + let contract = StellarBase.Address.fromScVal(scVal); + expect(contract.toString()).to.equal(CONTRACT); + }); + }); + }); + + describe('.toScAddress', function () { + it('converts accounts to an ScAddress', function () { + const a = new StellarBase.Address(ACCOUNT); + const s = a.toScAddress(); + expect(s).to.be.instanceof(StellarBase.xdr.ScAddress); + expect(s.switch()).to.equal( + StellarBase.xdr.ScAddressType.scAddressTypeAccount() + ); + }); + + it('converts contracts to an ScAddress', function () { + const a = new StellarBase.Address(CONTRACT); + const s = a.toScAddress(); + expect(s).to.be.instanceof(StellarBase.xdr.ScAddress); + expect(s.switch()).to.equal( + StellarBase.xdr.ScAddressType.scAddressTypeContract() + ); + }); + }); + + describe('.toScVal', function () { + it('converts to an ScAddress', function () { + const a = new StellarBase.Address(ACCOUNT); + const s = a.toScVal(); + expect(s).to.be.instanceof(StellarBase.xdr.ScVal); + expect(s.address()).to.deep.equal(a.toScAddress()); + }); + }); + + describe('.toBuffer', function () { + it('returns the raw public key bytes for accounts', function () { + const a = new StellarBase.Address(ACCOUNT); + const b = a.toBuffer(); + expect(b).to.deep.equal( + StellarBase.StrKey.decodeEd25519PublicKey(ACCOUNT) + ); + }); + + it('returns the raw public key bytes for contracts', function () { + const a = new StellarBase.Address(CONTRACT); + const b = a.toBuffer(); + expect(b).to.deep.equal(StellarBase.StrKey.decodeContract(CONTRACT)); + }); + }); +}); diff --git a/test/unit/asset_test.js b/test/unit/asset_test.js index 61191009b..7208ece92 100644 --- a/test/unit/asset_test.js +++ b/test/unit/asset_test.js @@ -1,29 +1,29 @@ +const { Asset } = StellarBase; + describe('Asset', function () { describe('constructor', function () { it("throws an error when there's no issuer for non XLM type asset", function () { - expect(() => new StellarBase.Asset('USD')).to.throw( - /Issuer cannot be null/ - ); + expect(() => new Asset('USD')).to.throw(/Issuer cannot be null/); }); it('throws an error when code is invalid', function () { expect( () => - new StellarBase.Asset( + new Asset( '', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ) ).to.throw(/Asset code is invalid/); expect( () => - new StellarBase.Asset( + new Asset( '1234567890123', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ) ).to.throw(/Asset code is invalid/); expect( () => - new StellarBase.Asset( + new Asset( 'ab_', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ) @@ -31,20 +31,18 @@ describe('Asset', function () { }); it('throws an error when issuer is invalid', function () { - expect(() => new StellarBase.Asset('USD', 'GCEZWKCA5')).to.throw( - /Issuer is invalid/ - ); + expect(() => new Asset('USD', 'GCEZWKCA5')).to.throw(/Issuer is invalid/); }); }); describe('getCode()', function () { it('returns a code for a native asset object', function () { - var asset = new StellarBase.Asset.native(); + var asset = new Asset.native(); expect(asset.getCode()).to.be.equal('XLM'); }); it('returns a code for a non-native asset', function () { - var asset = new StellarBase.Asset( + var asset = new Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -54,12 +52,12 @@ describe('Asset', function () { describe('getIssuer()', function () { it('returns a code for a native asset object', function () { - var asset = new StellarBase.Asset.native(); + var asset = new Asset.native(); expect(asset.getIssuer()).to.be.undefined; }); it('returns a code for a non-native asset', function () { - var asset = new StellarBase.Asset( + var asset = new Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -71,12 +69,12 @@ describe('Asset', function () { describe('getAssetType()', function () { it('returns native for native assets', function () { - var asset = StellarBase.Asset.native(); + var asset = Asset.native(); expect(asset.getAssetType()).to.eq('native'); }); it('returns credit_alphanum4 if the asset code length is between 1 and 4', function () { - var asset = new StellarBase.Asset( + var asset = new Asset( 'ABCD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -84,7 +82,7 @@ describe('Asset', function () { }); it('returns credit_alphanum12 if the asset code length is between 5 and 12', function () { - var asset = new StellarBase.Asset( + var asset = new Asset( 'ABCDEF', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -94,7 +92,7 @@ describe('Asset', function () { describe('toXDRObject(), toChangeTrustXDRObject(), toTrustLineXDRObject', function () { it('parses a native asset object', function () { - const asset = new StellarBase.Asset.native(); + const asset = new Asset.native(); let xdr = asset.toXDRObject(); expect(xdr).to.be.instanceof(StellarBase.xdr.Asset); @@ -116,7 +114,7 @@ describe('Asset', function () { }); it('parses a 3-alphanum asset object', function () { - const asset = new StellarBase.Asset( + const asset = new Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -141,7 +139,7 @@ describe('Asset', function () { }); it('parses a 4-alphanum asset object', function () { - const asset = new StellarBase.Asset( + const asset = new Asset( 'BART', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -165,7 +163,7 @@ describe('Asset', function () { }); it('parses a 5-alphanum asset object', function () { - const asset = new StellarBase.Asset( + const asset = new Asset( '12345', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -189,7 +187,7 @@ describe('Asset', function () { }); it('parses a 12-alphanum asset object', function () { - const asset = new StellarBase.Asset( + const asset = new Asset( '123456789012', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -216,9 +214,9 @@ describe('Asset', function () { describe('fromOperation()', function () { it('parses a native asset XDR', function () { var xdr = new StellarBase.xdr.Asset.assetTypeNative(); - var asset = StellarBase.Asset.fromOperation(xdr); + var asset = Asset.fromOperation(xdr); - expect(asset).to.be.instanceof(StellarBase.Asset); + expect(asset).to.be.instanceof(Asset); expect(asset.isNative()).to.equal(true); }); @@ -234,9 +232,9 @@ describe('Asset', function () { assetType ); - var asset = StellarBase.Asset.fromOperation(xdr); + var asset = Asset.fromOperation(xdr); - expect(asset).to.be.instanceof(StellarBase.Asset); + expect(asset).to.be.instanceof(Asset); expect(asset.getCode()).to.equal(assetCode); expect(asset.getIssuer()).to.equal(issuer); }); @@ -253,9 +251,9 @@ describe('Asset', function () { assetType ); - var asset = StellarBase.Asset.fromOperation(xdr); + var asset = Asset.fromOperation(xdr); - expect(asset).to.be.instanceof(StellarBase.Asset); + expect(asset).to.be.instanceof(Asset); expect(asset.getCode()).to.equal(assetCode); expect(asset.getIssuer()).to.equal(issuer); }); @@ -263,12 +261,12 @@ describe('Asset', function () { describe('toString()', function () { it("returns 'native' for native asset", function () { - var asset = StellarBase.Asset.native(); + var asset = Asset.native(); expect(asset.toString()).to.be.equal('native'); }); it("returns 'code:issuer' for non-native asset", function () { - var asset = new StellarBase.Asset( + var asset = new Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); @@ -279,104 +277,125 @@ describe('Asset', function () { }); describe('compare()', function () { - const assetA = new StellarBase.Asset( + const assetA = new Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' ); - const assetB = new StellarBase.Asset( + const assetB = new Asset( 'USD', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); it('throws an error if the input assets are invalid', function () { - expect(() => StellarBase.Asset.compare()).to.throw(/assetA is invalid/); + expect(() => Asset.compare()).to.throw(/assetA is invalid/); - expect(() => StellarBase.Asset.compare(assetA)).to.throw( - /assetB is invalid/ - ); + expect(() => Asset.compare(assetA)).to.throw(/assetB is invalid/); - expect(() => StellarBase.Asset.compare(assetA, assetB)).to.not.throw; + expect(() => Asset.compare(assetA, assetB)).to.not.throw; }); it('returns false if assets are equal', function () { - const XLM = new StellarBase.Asset.native(); - expect(StellarBase.Asset.compare(XLM, XLM)).to.eq(0); - expect(StellarBase.Asset.compare(assetA, assetA)).to.eq(0); - expect(StellarBase.Asset.compare(assetB, assetB)).to.eq(0); + const XLM = new Asset.native(); + expect(Asset.compare(XLM, XLM)).to.eq(0); + expect(Asset.compare(assetA, assetA)).to.eq(0); + expect(Asset.compare(assetB, assetB)).to.eq(0); }); it('test if asset types are being validated as native < anum4 < anum12', function () { - const XLM = new StellarBase.Asset.native(); - const anum4 = new StellarBase.Asset( + const XLM = new Asset.native(); + const anum4 = new Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' ); - const anum12 = new StellarBase.Asset( + const anum12 = new Asset( 'ARSTANUM12', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' ); - expect(StellarBase.Asset.compare(XLM, XLM)).to.eq(0); - expect(StellarBase.Asset.compare(XLM, anum4)).to.eq(-1); - expect(StellarBase.Asset.compare(XLM, anum12)).to.eq(-1); + expect(Asset.compare(XLM, XLM)).to.eq(0); + expect(Asset.compare(XLM, anum4)).to.eq(-1); + expect(Asset.compare(XLM, anum12)).to.eq(-1); - expect(StellarBase.Asset.compare(anum4, XLM)).to.eq(1); - expect(StellarBase.Asset.compare(anum4, anum4)).to.eq(0); - expect(StellarBase.Asset.compare(anum4, anum12)).to.eq(-1); + expect(Asset.compare(anum4, XLM)).to.eq(1); + expect(Asset.compare(anum4, anum4)).to.eq(0); + expect(Asset.compare(anum4, anum12)).to.eq(-1); - expect(StellarBase.Asset.compare(anum12, XLM)).to.eq(1); - expect(StellarBase.Asset.compare(anum12, anum4)).to.eq(1); - expect(StellarBase.Asset.compare(anum12, anum12)).to.eq(0); + expect(Asset.compare(anum12, XLM)).to.eq(1); + expect(Asset.compare(anum12, anum4)).to.eq(1); + expect(Asset.compare(anum12, anum12)).to.eq(0); }); it('test if asset codes are being validated as assetCodeA < assetCodeB', function () { - const assetARST = new StellarBase.Asset( + const assetARST = new Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' ); - const assetUSDX = new StellarBase.Asset('USDA', assetARST.getIssuer()); + const assetUSDX = new Asset('USDA', assetARST.getIssuer()); - expect(StellarBase.Asset.compare(assetARST, assetARST)).to.eq(0); - expect(StellarBase.Asset.compare(assetARST, assetUSDX)).to.eq(-1); + expect(Asset.compare(assetARST, assetARST)).to.eq(0); + expect(Asset.compare(assetARST, assetUSDX)).to.eq(-1); - expect(StellarBase.Asset.compare(assetUSDX, assetARST)).to.eq(1); - expect(StellarBase.Asset.compare(assetUSDX, assetUSDX)).to.eq(0); + expect(Asset.compare(assetUSDX, assetARST)).to.eq(1); + expect(Asset.compare(assetUSDX, assetUSDX)).to.eq(0); // uppercase should be smaller - const assetLower = new StellarBase.Asset('aRST', assetARST.getIssuer()); - expect(StellarBase.Asset.compare(assetARST, assetLower)).to.eq(-1); - expect(StellarBase.Asset.compare(assetLower, assetA)).to.eq(1); + const assetLower = new Asset('aRST', assetARST.getIssuer()); + expect(Asset.compare(assetARST, assetLower)).to.eq(-1); + expect(Asset.compare(assetLower, assetA)).to.eq(1); }); it('test if asset issuers are being validated as assetIssuerA < assetIssuerB', function () { - const assetIssuerA = new StellarBase.Asset( + const assetIssuerA = new Asset( 'ARST', 'GB7TAYRUZGE6TVT7NHP5SMIZRNQA6PLM423EYISAOAP3MKYIQMVYP2JO' ); - const assetIssuerB = new StellarBase.Asset( + const assetIssuerB = new Asset( 'ARST', 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' ); - expect(StellarBase.Asset.compare(assetIssuerA, assetIssuerB)).to.eq(-1); - expect(StellarBase.Asset.compare(assetIssuerA, assetIssuerA)).to.eq(0); + expect(Asset.compare(assetIssuerA, assetIssuerB)).to.eq(-1); + expect(Asset.compare(assetIssuerA, assetIssuerA)).to.eq(0); - expect(StellarBase.Asset.compare(assetIssuerB, assetIssuerA)).to.eq(1); - expect(StellarBase.Asset.compare(assetIssuerB, assetIssuerB)).to.eq(0); + expect(Asset.compare(assetIssuerB, assetIssuerA)).to.eq(1); + expect(Asset.compare(assetIssuerB, assetIssuerB)).to.eq(0); }); it('test if codes with upper-case letters are sorted before lower-case letters', function () { // All upper-case letters should come before any lower-case ones - const assetA = new StellarBase.Asset( + const assetA = new Asset( 'B', 'GA7NLOF4EHWMJF6DBXXV2H6AYI7IHYWNFZR6R52BYBLY7TE5Q74AIDRA' ); - const assetB = new StellarBase.Asset( + const assetB = new Asset( 'a', 'GA7NLOF4EHWMJF6DBXXV2H6AYI7IHYWNFZR6R52BYBLY7TE5Q74AIDRA' ); - expect(StellarBase.Asset.compare(assetA, assetB)).to.eq(-1); + expect(Asset.compare(assetA, assetB)).to.eq(-1); + }); + }); + + describe('contractId()', function () { + it('creates the correct contract IDs', function () { + [ + [ + Asset.native(), + 'CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT' + ], + [ + new Asset( + 'USD', + 'GCP2QKBFLLEEWYVKAIXIJIJNCZ6XEBIE4PCDB6BF3GUB6FGE2RQ3HDVP' + ), + 'CCWNZPARJG7KQ6N4BGZ5OBWKSSK4AVQ5URLDRXB4ZJXKGEJQTIIRPAHN' + ] + ].forEach(([asset, contractId]) => { + expect(asset.contractId(StellarBase.Networks.FUTURENET)).to.equal( + contractId, + `the asset was: ${asset.toString()}` + ); + }); }); }); }); diff --git a/test/unit/auth_test.js b/test/unit/auth_test.js new file mode 100644 index 000000000..83fc3fea2 --- /dev/null +++ b/test/unit/auth_test.js @@ -0,0 +1,80 @@ +const xdr = StellarBase.xdr; + +describe('building authorization entries', function () { + const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const kp = StellarBase.Keypair.random(); + const invocation = new xdr.SorobanAuthorizedInvocation({ + function: + xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn( + new xdr.InvokeContractArgs({ + contractAddress: new StellarBase.Address(contractId).toScAddress(), + functionName: 'hello', + args: [StellarBase.nativeToScVal('world!')] + }) + ), + subInvocations: [] + }); + + it('built an mock invocation correctly', function () { + invocation.toXDR(); + }); + + it('works with keypairs', function () { + const entry = StellarBase.authorizeInvocation( + kp, + StellarBase.Networks.FUTURENET, + 123, + invocation + ); + + let cred = entry.credentials().address(); + expect(cred.signatureExpirationLedger()).to.equal(123); + + let sig = cred.signature().vec(); + expect(sig.length).to.equal( + 1, + `signature isn't in the right format: ${sig}` + ); + + const args = StellarBase.scValToNative(sig[0]); + expect( + StellarBase.StrKey.encodeEd25519PublicKey(args['public_key']) + ).to.equal(kp.publicKey()); + expect(entry.rootInvocation()).to.eql(invocation); + + // TODO: Validate the signature using the XDR structure. + + const nextEntry = StellarBase.authorizeInvocation( + kp, + StellarBase.Networks.FUTURENET, + 123, + invocation + ); + const nextCred = nextEntry.credentials().address(); + + expect(cred.nonce()).to.not.equal(nextCred.nonce()); + }); + + it('works asynchronously', function (done) { + StellarBase.authorizeInvocationCallback( + kp.publicKey(), + async (v) => kp.sign(v), + StellarBase.Networks.FUTURENET, + 123, + invocation + ) + .then((entry) => { + let cred = entry.credentials().address(); + let args = StellarBase.scValToNative(cred.signature().vec()[0]); + + expect(cred.signatureExpirationLedger()).to.equal(123); + expect( + StellarBase.StrKey.encodeEd25519PublicKey(args['public_key']) + ).to.equal(kp.publicKey()); + expect(entry.rootInvocation()).to.eql(invocation); + + done(); + }) + .catch((err) => done(err)); + }); +}); diff --git a/test/unit/browser_test.js b/test/unit/browser_test.js deleted file mode 100644 index e0e51f94b..000000000 --- a/test/unit/browser_test.js +++ /dev/null @@ -1,8 +0,0 @@ -describe('Browser version tests', function () { - it('window object exists', function () { - if (typeof window !== 'undefined') { - // Test passes if window is defined - expect(true).to.be.true; - } - }); -}); diff --git a/test/unit/contract_test.js b/test/unit/contract_test.js new file mode 100644 index 000000000..91f9f575b --- /dev/null +++ b/test/unit/contract_test.js @@ -0,0 +1,93 @@ +const { Contract, xdr } = StellarBase; +const NULL_ADDRESS = 'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM'; + +describe('Contract', function () { + describe('constructor', function () { + it('parses strkeys', function () { + let contractId = + 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + let contract = new Contract(contractId); + expect(contract.contractId('strkey')).to.equal(contractId); + }); + + it('throws on obsolete hex ids', function () { + expect(() => new Contract('0'.repeat(63) + '1')).to.throw(); + }); + + it('throws on invalid ids', function () { + expect(() => new Contract('foobar')).to.throw(); + }); + }); + + describe('address', function () { + it('returns the contract address', function () { + let contract = new Contract(NULL_ADDRESS); + expect(contract.address().toString()).to.equal(NULL_ADDRESS); + }); + }); + + describe('getFootprint', function () { + it('includes the correct contract ledger keys', function () { + let contract = new Contract(NULL_ADDRESS); + expect(contract.contractId()).to.equal(NULL_ADDRESS); + + const actual = contract.getFootprint(); + const expected = [ + new xdr.LedgerKey.contractCode( + new xdr.LedgerKeyContractCode({ + hash: StellarBase.StrKey.decodeContract(contract.contractId()) + }) + ), + new xdr.LedgerKey.contractData( + new xdr.LedgerKeyContractData({ + contract: contract.address().toScAddress(), + key: xdr.ScVal.scvLedgerKeyContractInstance(), + durability: xdr.ContractDataDurability.persistent() + }) + ) + ]; + + expect(actual).to.eql(expected); + }); + }); + + describe('call', function () { + const contract = new Contract(NULL_ADDRESS); + let call = contract.call( + 'method', + StellarBase.nativeToScVal('arg!'), + StellarBase.nativeToScVal(2, { type: 'i32' }) + ); + + xit('builds valid XDR', function () { + call.toXDR(); + }); + + let args = call + .body() + .invokeHostFunctionOp() + .hostFunction() + .invokeContract(); + + it('passes the contract id as an ScAddress', function () { + expect(args.contractAddress()).to.deep.equal( + new Contract(NULL_ADDRESS).address().toScAddress() + ); + }); + + it('passes the method name as the second arg', function () { + expect(args.functionName()).to.deep.equal(xdr.ScVal.scvSymbol('method')); + }); + + it('passes all params after that', function () { + expect(args.args()).to.deep.equal([ + xdr.ScVal.scvString('arg!'), + xdr.ScVal.scvI32(2) + ]); + }); + + xit('works with no parameters', function () { + contract.call('empty').toXDR(); + }); + }); +}); diff --git a/test/unit/events_test.js b/test/unit/events_test.js new file mode 100644 index 000000000..e58470464 --- /dev/null +++ b/test/unit/events_test.js @@ -0,0 +1,54 @@ +const [nativeToScVal, scValToNative, ScInt, humanizeEvents, xdr] = [ + StellarBase.nativeToScVal, + StellarBase.scValToNative, + StellarBase.ScInt, + StellarBase.humanizeEvents, + StellarBase.xdr +]; // shorthand + +describe('humanizing raw events', function () { + const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const topics1 = nativeToScVal([1, 2, 3]).value(); + const data1 = nativeToScVal({ hello: 'world' }); + + // workaround for xdr.ContractEventBody.0(...) being invalid lol + const bodyModel = xdr.ContractEventBody.fromXDR('AAAAAAAAAAAAAAAB', 'base64'); + const cloneAndSet = (newBody) => { + const clone = xdr.ContractEventBody.fromXDR(bodyModel.toXDR()); + clone.v0().topics(newBody.topics); + clone.v0().data(newBody.data); + return clone; + }; + + const events = [ + new xdr.DiagnosticEvent({ + inSuccessfulContractCall: true, + event: new xdr.ContractEvent({ + ext: new xdr.ExtensionPoint(0), + contractId: StellarBase.StrKey.decodeContract(contractId), + type: xdr.ContractEventType.contract(), + body: cloneAndSet({ + topics: topics1, + data: data1 + }) + }) + }) + ]; + + it('built valid events for testing', function () { + // sanity check: valid xdr + events.map((e) => e.toXDR()); + }); + + it('makes diagnostic events human-readable', function () { + const readable = StellarBase.humanizeEvents(events); + + expect(readable.length).to.equal(events.length, `${events} != ${readable}`); + expect(readable[0]).to.eql({ + type: 'contract', + contractId: contractId, + topics: topics1.map(scValToNative), + data: scValToNative(data1) + }); + }); +}); diff --git a/test/unit/i256_test.js b/test/unit/i256_test.js new file mode 100644 index 000000000..6aa3f8c81 --- /dev/null +++ b/test/unit/i256_test.js @@ -0,0 +1,90 @@ +// import { XdrWriter, XdrReader } from 'js-xdr'; +const I256 = StellarBase.Int256; // shorthand + +describe('I256.isValid', function () { + it('returns true for I256 instances', function () { + expect(I256.isValid(I256.MIN_VALUE)).to.be.true; + expect(I256.isValid(I256.MAX_VALUE)).to.be.true; + expect(I256.isValid(I256.fromString('0'))).to.be.true; + expect(I256.isValid(I256.fromString('-1'))).to.be.true; + expect(I256.isValid(5n)).to.be.true; + }); + + it('returns false for non I256', function () { + expect(I256.isValid(null)).to.be.false; + expect(I256.isValid(undefined)).to.be.false; + expect(I256.isValid([])).to.be.false; + expect(I256.isValid({})).to.be.false; + expect(I256.isValid(1)).to.be.false; + expect(I256.isValid(true)).to.be.false; + }); +}); + +describe('I256.slice', function () { + it('slices number to parts', function () { + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(32) + ).to.be.eql([1n, -2n, 3n, -4n, 5n, -6n, 7n, -8n]); + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(64) + ).to.be.eql([-0x1ffffffffn, -0x3fffffffdn, -0x5fffffffbn, -0x7fffffff9n]); + expect( + new I256( + -0x7fffffff800000005fffffffa00000003fffffffc00000001ffffffffn + ).slice(128) + ).to.be.eql([-0x3fffffffc00000001ffffffffn, -0x7fffffff800000005fffffffbn]); + }); +}); + +describe('I256.fromString', function () { + it('works for positive numbers', function () { + expect(I256.fromString('1059').toString()).to.eql('1059'); + }); + + it('works for negative numbers', function () { + expect( + I256.fromString('-105909234885029834059234850234985028304085').toString() + ).to.eql('-105909234885029834059234850234985028304085'); + }); + + it('fails when providing a string with a decimal place', function () { + expect(() => I256.fromString('105946095601.5')).to.throw(/bigint-like/); + }); +}); + +/* +describe('Int256.read', function () { + it('decodes correctly', function () { + expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(0)); + expect(read([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])).to.eql(new I256(1)); + expect(read([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(-1)); + expect(read([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])).to.eql(new I256(I256.MAX_VALUE)); + expect(read([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])).to.eql(new I256(I256.MIN_VALUE)); + }); + + function read(bytes) { + let io = new XdrReader(bytes); + return I256.read(io); + } +}); + +describe('I256.write', function () { + it('encodes correctly', function () { + expect(write(new I256(0))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + expect(write(new I256(1))).to.eql([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]); + expect(write(new I256(-1))).to.eql([0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); + expect(write(I256.MAX_VALUE)).to.eql([0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]); + expect(write(I256.MIN_VALUE)).to.eql([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + }); + + function write(value) { + let io = new XdrWriter(8); + I256.write(value, io); + return io.toArray(); + } +}); +*/ diff --git a/test/unit/invocation_test.js b/test/unit/invocation_test.js new file mode 100644 index 000000000..be7b1d093 --- /dev/null +++ b/test/unit/invocation_test.js @@ -0,0 +1,245 @@ +const { + Keypair, + Asset, + StrKey, + xdr, + hash, + Address, + Contract, + nativeToScVal, + buildInvocationTree, + walkInvocationTree +} = StellarBase; + +// Here's a complicated invocation tree whose pseudo-structure is supposed to +// represent a high-level contract interaction involving two transfers of native +// SAC tokens underneath it. +// +// Though this may feel contrived (because it is), it highlights the importance +// of presenting complex invocation trees in a friendly manner to users. +// +// purchase("SomeNft:G...", 7 xlm) +// | +// +--- create(wrap: "SomeNft:G...") +// | +// +--- swap(xlm, usdc, from, to) +// | | +// | |- xlm.transfer(from, to, 7) +// | | +// | |- usdc.transfer(to, from, 1) +// | +// +--- someNft.transfer(invoker, someNft, 2) +// | +// +--- create(custom wasm contract) +function rk() { + return Keypair.random().publicKey(); +} + +function makeInvocation(contract, name, ...args) { + return xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeContractFn( + new xdr.InvokeContractArgs({ + contractAddress: contract.address().toScAddress(), + functionName: name, + args: args.map(nativeToScVal) + }) + ); +} + +describe('parsing invocation trees', function () { + const invoker = rk(); + const [nftContract, swapContract, xlmContract, usdcContract] = [ + 1, 2, 3, 4 + ].map(() => { + // ezpz method to generate random contract IDs + const buf = hash(Keypair.random().publicKey()); + return new Contract(StrKey.encodeContract(buf)); + }); + + const nftId = rk(); + const usdcId = rk(); + const dest = rk(); + const rootInvocation = new xdr.SorobanAuthorizedInvocation({ + function: makeInvocation(nftContract, 'purchase', `SomeNft:${nftId}`, 7), + subInvocations: [ + new xdr.SorobanAuthorizedInvocation({ + function: + xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeCreateContractHostFn( + new xdr.CreateContractArgs({ + contractIdPreimage: + xdr.ContractIdPreimage.contractIdPreimageFromAsset( + new Asset('TEST', nftId).toXDRObject() + ), + executable: xdr.ContractExecutable.contractExecutableToken() + }) + ), + subInvocations: [] + }), + new xdr.SorobanAuthorizedInvocation({ + function: makeInvocation( + swapContract, + 'swap', + 'native', + `USDC:${usdcId}`, + new Address(invoker).toScVal(), + new Address(dest).toScVal() + ), + subInvocations: [ + new xdr.SorobanAuthorizedInvocation({ + function: makeInvocation( + xlmContract, + 'transfer', + new Address(invoker).toScVal(), + '7' + ), + subInvocations: [] + }), + new xdr.SorobanAuthorizedInvocation({ + function: makeInvocation( + usdcContract, + 'transfer', + new Address(invoker).toScVal(), + '1' + ), + subInvocations: [] + }) + ] + }), + new xdr.SorobanAuthorizedInvocation({ + function: makeInvocation( + nftContract, + 'transfer', + nftContract.address().toScVal(), + '2' + ), + subInvocations: [] + }), + new xdr.SorobanAuthorizedInvocation({ + function: + xdr.SorobanAuthorizedFunction.sorobanAuthorizedFunctionTypeCreateContractHostFn( + new xdr.CreateContractArgs({ + contractIdPreimage: + xdr.ContractIdPreimage.contractIdPreimageFromAddress( + new xdr.ContractIdPreimageFromAddress({ + address: nftContract.address().toScAddress(), + salt: Buffer.alloc(32, 0) + }) + ), + executable: xdr.ContractExecutable.contractExecutableWasm( + Buffer.alloc(32, '\x20') + ) + }) + ), + subInvocations: [] + }) + ] + }); + + const expectedParsed = { + type: 'execute', + args: { + source: nftContract.contractId(), + function: 'purchase', + args: [`SomeNft:${nftId}`, '7'] + }, + invocations: [ + { + type: 'create', + args: { + type: 'sac', + asset: `TEST:${nftId}` + }, + invocations: [] + }, + { + type: 'execute', + args: { + source: swapContract.contractId(), + function: 'swap', + args: ['native', `USDC:${usdcId}`, invoker, dest] + }, + invocations: [ + { + type: 'execute', + args: { + source: xlmContract.contractId(), + function: 'transfer', + args: [invoker, '7'] + }, + invocations: [] + }, + { + type: 'execute', + args: { + source: usdcContract.contractId(), + function: 'transfer', + args: [invoker, '1'] + }, + invocations: [] + } + ] + }, + { + type: 'execute', + args: { + source: nftContract.contractId(), + function: 'transfer', + args: [nftContract.contractId(), '2'] + }, + invocations: [] + }, + + { + type: 'create', + args: { + type: 'wasm', + wasm: { + salt: '00'.repeat(32), + hash: '20'.repeat(32), + address: nftContract.contractId() + } + }, + invocations: [] + } + ] + }; + + it('builds an invocation tree', function () { + expect(() => rootInvocation.toXDR()).not.to.throw( + undefined, + 'the rootInvocation is not a valid SorobanAuthorizedInvocation instance' + ); + }); + + it('outputs a human-readable version of it', function () { + const parsed = buildInvocationTree(rootInvocation); + expect( + JSON.stringify( + parsed, + (_, val) => (typeof val === 'bigint' ? val.toString() : val), + 2 + ) + ).to.deep.equal(JSON.stringify(expectedParsed, null, 2)); + }); + + it('walks correctly', function () { + let walkCount = 0; + let walkSet = {}; + let maxDepth = 0; + + walkInvocationTree(rootInvocation, (node, depth, parent) => { + walkCount++; + const s = node.toXDR('base64'); + walkSet[s] = s in walkSet ? walkSet[s] + 1 : 1; + maxDepth = Math.max(maxDepth, depth); + return true; + }); + + // 7 nodes walked, exactly once each + expect(walkCount).to.equal(7, `${walkSet}`); + expect( + Object.values(walkSet).reduce((accum, curr) => accum + curr, 0) + ).to.equal(7, `${walkSet}`); + expect(Object.values(walkSet).every((val) => val !== 0)).to.be.true; + expect(maxDepth).to.equal(3); + }); +}); diff --git a/test/unit/operation_test.js b/test/unit/operation_test.js index a91fb77af..b16ab293f 100644 --- a/test/unit/operation_test.js +++ b/test/unit/operation_test.js @@ -1,9 +1,6 @@ import BigNumber from 'bignumber.js'; -import { - encodeMuxedAccountToAddress, - encodeMuxedAccount -} from '../../src/util/decode_encode_muxed_account.js'; +const { encodeMuxedAccountToAddress, encodeMuxedAccount } = StellarBase; describe('Operation', function () { describe('.createAccount()', function () { @@ -44,9 +41,7 @@ describe('Operation', function () { startingBalance: '0', source: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' }; - expect(() => StellarBase.Operation.createAccount(opts)).not.to.throw( - /startingBalance must be of type String, represent a non-negative number and have at most 7 digits after the decimal/ - ); + expect(() => StellarBase.Operation.createAccount(opts)).not.to.throw(); }); it('fails to create createAccount operation with an invalid startingBalance', function () { @@ -56,7 +51,7 @@ describe('Operation', function () { source: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ' }; expect(() => StellarBase.Operation.createAccount(opts)).to.throw( - /startingBalance must be of type String, represent a non-negative number and have at most 7 digits after the decimal/ + /startingBalance argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); }); @@ -2018,6 +2013,75 @@ describe('Operation', function () { }); }); + describe('invokeHostFunction()', function () { + it('creates operation', function () { + const contractId = + 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const c = new StellarBase.Contract(contractId); + const op = StellarBase.Operation.invokeHostFunction({ + func: StellarBase.xdr.HostFunction.hostFunctionTypeInvokeContract( + new StellarBase.xdr.InvokeContractArgs({ + contractAddress: c.address().toScAddress(), + functionName: 'hello', + args: [StellarBase.nativeToScVal('world')] + }) + ), + auth: [] + }); + var xdr = op.toXDR('hex'); + var operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); + + expect(operation.body().switch().name).to.equal('invokeHostFunction'); + var obj = StellarBase.Operation.fromXDRObject(operation); + expect(obj.type).to.be.equal('invokeHostFunction'); + expect(obj.func.switch().name).to.equal('hostFunctionTypeInvokeContract'); + expect(obj.auth).to.deep.equal([]); + }); + + it('throws when no func passed', function () { + expect(() => + StellarBase.Operation.invokeHostFunction({ + auth: [] + }) + ).to.throw(/\('func'\) required/); + }); + }); + + describe('bumpFootprintExpiration()', function () { + it('creates operation', function () { + const op = StellarBase.Operation.bumpFootprintExpiration({ + ledgersToExpire: 1234 + }); + const xdr = op.toXDR('hex'); + const operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); + + expect(operation.body().switch().name).to.equal( + 'bumpFootprintExpiration' + ); + const obj = StellarBase.Operation.fromXDRObject(operation); + expect(obj.type).to.be.equal('bumpFootprintExpiration'); + expect(obj.ledgersToExpire).to.equal(1234); + + expect(() => { + StellarBase.Operation.bumpFootprintExpiration({ + ledgersToExpire: 0 + }); + }).to.throw(/ledger quantity/i); + }); + }); + + describe('restoreFootprint()', function () { + it('creates operation', function () { + const op = StellarBase.Operation.restoreFootprint(); + const xdr = op.toXDR('hex'); + const operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); + + expect(operation.body().switch().name).to.equal('restoreFootprint'); + const obj = StellarBase.Operation.fromXDRObject(operation); + expect(obj.type).to.be.equal('restoreFootprint'); + }); + }); + describe('revokeTrustlineSponsorship()', function () { it('creates a revokeTrustlineSponsorship', function () { const account = @@ -2401,12 +2465,12 @@ describe('Operation', function () { opts.liquidityPoolId = 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7'; expect(() => StellarBase.Operation.liquidityPoolDeposit(opts)).to.throw( - /maxAmountA argument is required/ + /maxAmountA argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); opts.maxAmountA = '10'; expect(() => StellarBase.Operation.liquidityPoolDeposit(opts)).to.throw( - /maxAmountB argument is required/ + /maxAmountB argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); opts.maxAmountB = '20'; @@ -2420,8 +2484,9 @@ describe('Operation', function () { ); opts.maxPrice = '0.55'; - expect(() => StellarBase.Operation.liquidityPoolDeposit(opts)).to.not - .throw; + expect(() => + StellarBase.Operation.liquidityPoolDeposit(opts) + ).to.not.throw(); }); it('throws an error if prices are negative', function () { @@ -2583,22 +2648,23 @@ describe('Operation', function () { opts.liquidityPoolId = 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7'; expect(() => StellarBase.Operation.liquidityPoolWithdraw(opts)).to.throw( - /amount argument is required/ + /amount argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); opts.amount = '10'; expect(() => StellarBase.Operation.liquidityPoolWithdraw(opts)).to.throw( - /minAmountA argument is required/ + /minAmountA argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); opts.minAmountA = '10000'; expect(() => StellarBase.Operation.liquidityPoolWithdraw(opts)).to.throw( - /minAmountB argument is required/ + /minAmountB argument must be of type String, represent a positive number and have at most 7 digits after the decimal/ ); opts.minAmountB = '20000'; - expect(() => StellarBase.Operation.liquidityPoolWithdraw(opts)).to.not - .throw; + expect(() => + StellarBase.Operation.liquidityPoolWithdraw(opts) + ).to.not.throw(); }); it('creates a liquidityPoolWithdraw', function () { diff --git a/test/unit/scint_test.js b/test/unit/scint_test.js new file mode 100644 index 000000000..5666bef84 --- /dev/null +++ b/test/unit/scint_test.js @@ -0,0 +1,306 @@ +const I128 = StellarBase.Int128; +const U128 = StellarBase.Uint128; +const I256 = StellarBase.Int256; +const U256 = StellarBase.Uint256; +const xdr = StellarBase.xdr; // shorthand + +describe('creating large integers', function () { + describe('picks the right types', function () { + Object.entries({ + u64: [1, '1', 0xdeadbeef, (1n << 64n) - 1n], + u128: [1n << 64n, (1n << 128n) - 1n], + u256: [1n << 128n, (1n << 256n) - 1n] + }).forEach(([type, values]) => { + values.forEach((value) => { + it(`picks ${type} for ${value}`, function () { + const bi = new StellarBase.ScInt(value); + expect(bi.type).to.equal(type); + expect(bi.toBigInt()).to.equal(BigInt(value)); + }); + }); + }); + }); + + it('has correct utility methods', function () { + const v = + 123456789123456789123456789123456789123456789123456789123456789123456789n; + const i = new StellarBase.ScInt(v); + expect(i.valueOf()).to.be.eql(new U256(v)); + expect(i.toString()).to.equal( + '123456789123456789123456789123456789123456789123456789123456789123456789' + ); + expect(i.toJSON()).to.be.eql({ value: v.toString(), type: 'u256' }); + }); + + describe('64 bit inputs', function () { + const sentinel = 800000085n; + + it('handles u64', function () { + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(b.toNumber()).to.equal(Number(sentinel)); + let u64 = b.toU64().u64(); + expect(u64.low).to.equal(Number(sentinel)); + expect(u64.high).to.equal(0); + + b = new StellarBase.ScInt(-sentinel); + expect(b.toBigInt()).to.equal(-sentinel); + expect(b.toNumber()).to.equal(Number(-sentinel)); + u64 = b.toU64().u64(); + expect(u64.low).to.equal(b.toNumber()); + expect(u64.high).to.equal(-1); + }); + + it('handles i64', function () { + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(b.toNumber()).to.equal(Number(sentinel)); + let i64 = b.toI64().i64(); + + expect(new xdr.Int64([i64.low, i64.high]).toBigInt()).to.equal(sentinel); + }); + + it(`upscales u64 to 128`, function () { + const b = new StellarBase.ScInt(sentinel); + const i128 = b.toI128().i128(); + expect(i128.lo().toBigInt()).to.equal(sentinel); + expect(i128.hi().toBigInt()).to.equal(0n); + }); + + it(`upscales i64 to 128`, function () { + const b = new StellarBase.ScInt(-sentinel); + const i128 = b.toI128().i128(); + const hi = i128.hi().toBigInt(); + const lo = i128.lo().toBigInt(); + + const assembled = new I128([lo, hi]).toBigInt(); + expect(assembled).to.equal(-sentinel); + }); + + it(`upscales i64 to 256`, function () { + const b = new StellarBase.ScInt(sentinel); + const i = b.toI256().i256(); + + const [hiHi, hiLo, loHi, loLo] = [ + i.hiHi(), + i.hiLo(), + i.loHi(), + i.loLo() + ].map((i) => i.toBigInt()); + + expect(hiHi).to.equal(0n); + expect(hiLo).to.equal(0n); + expect(loHi).to.equal(0n); + expect(loLo).to.equal(sentinel); + + let assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(sentinel); + + assembled = new U256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(sentinel); + }); + + it(`upscales i64 to 256`, function () { + const b = new StellarBase.ScInt(-sentinel); + const i = b.toI256().i256(); + + const [hiHi, hiLo, loHi, loLo] = [ + i.hiHi(), + i.hiLo(), + i.loHi(), + i.loLo() + ].map((i) => i.toBigInt()); + + expect(hiHi).to.equal(-1n); + expect(hiLo).to.equal(BigInt.asUintN(64, -1n)); + expect(loHi).to.equal(BigInt.asUintN(64, -1n)); + expect(loLo).to.equal(BigInt.asUintN(64, -sentinel)); + + let assembled = new I256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(-sentinel); + + assembled = new U256([loLo, loHi, hiLo, hiHi]).toBigInt(); + expect(assembled).to.equal(BigInt.asUintN(256, -sentinel)); + }); + }); + + describe('128 bit inputs', function () { + const sentinel = 800000000000000000000085n; // 80 bits long + + it('handles inputs', function () { + let b = new StellarBase.ScInt(sentinel); + expect(b.toBigInt()).to.equal(sentinel); + expect(() => b.toNumber()).to.throw(/not in range/i); + expect(() => b.toU64()).to.throw(/too large/i); + expect(() => b.toI64()).to.throw(/too large/i); + + let u128 = b.toU128().u128(); + expect( + new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high + ]).toBigInt() + ).to.equal(sentinel); + + b = new StellarBase.ScInt(-sentinel); + u128 = b.toU128().u128(); + expect( + new U128([ + u128.lo().low, + u128.lo().high, + u128.hi().low, + u128.hi().high + ]).toBigInt() + ).to.equal(BigInt.asUintN(128, -sentinel)); + + b = new StellarBase.ScInt(sentinel); + let i128 = b.toI128().i128(); + expect( + new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high + ]).toBigInt() + ).to.equal(sentinel); + + b = new StellarBase.ScInt(-sentinel); + i128 = b.toI128().i128(); + expect( + new I128([ + i128.lo().low, + i128.lo().high, + i128.hi().low, + i128.hi().high + ]).toBigInt() + ).to.equal(-sentinel); + }); + + it('upscales to 256 bits', function () { + let b = new StellarBase.ScInt(-sentinel); + let i256 = b.toI256().i256(); + let u256 = b.toU256().u256(); + + expect( + new I256([ + i256.loLo().low, + i256.loLo().high, + i256.loHi().low, + i256.loHi().high, + i256.hiLo().low, + i256.hiLo().high, + i256.hiHi().low, + i256.hiHi().high + ]).toBigInt() + ).to.equal(-sentinel); + + expect( + new U256([ + u256.loLo().low, + u256.loLo().high, + u256.loHi().low, + u256.loHi().high, + u256.hiLo().low, + u256.hiLo().high, + u256.hiHi().low, + u256.hiHi().high + ]).toBigInt() + ).to.equal(BigInt.asUintN(256, -sentinel)); + }); + }); + + describe('conversion to/from ScVals', function () { + const v = 80000085n; + const i = new StellarBase.ScInt(v); + + [ + [i.toI64(), 'i64'], + [i.toU64(), 'u64'], + [i.toI128(), 'i128'], + [i.toU128(), 'u128'], + [i.toI256(), 'i256'], + [i.toU256(), 'u256'] + ].forEach(([scv, type]) => { + it(`works for ${type}`, function () { + expect(scv.switch().name).to.equal(`scv${type.toUpperCase()}`); + expect(typeof scv.toXDR('base64')).to.equal('string'); + + const bigi = StellarBase.scValToBigInt(scv); + expect(bigi).to.equal(v); + expect(new StellarBase.ScInt(bigi, { type }).toJSON()).to.eql({ + ...i.toJSON(), + type + }); + }); + }); + + it('works for 32-bit', function () { + const i32 = new xdr.ScVal.scvI32(Number(v)); + const u32 = new xdr.ScVal.scvU32(Number(v)); + + expect(StellarBase.scValToBigInt(i32)).to.equal(v); + expect(StellarBase.scValToBigInt(u32)).to.equal(v); + }); + + it('throws for non-integers', function () { + expect(() => + StellarBase.scValToBigInt(new xdr.ScVal.scvString('hello')) + ).to.throw(/integer/i); + }); + }); + + describe('error handling', function () { + ['u64', 'u128', 'u256'].forEach((type) => { + it(`throws when signed parts and {type: '${type}'}`, function () { + expect(() => new StellarBase.ScInt(-2, { type })).to.throw(/negative/i); + }); + }); + + it('throws when too big', function () { + expect(() => new StellarBase.ScInt(1n << 400n)).to.throw(/expected/i); + }); + + it('throws when big interpreted as small', function () { + let big; + + big = new StellarBase.ScInt(1n << 64n); + expect(() => big.toNumber()).to.throw(/not in range/i); + + big = new StellarBase.ScInt(Number.MAX_SAFE_INTEGER + 1); + expect(() => big.toNumber()).to.throw(/not in range/i); + + big = new StellarBase.ScInt(1, { type: 'i128' }); + expect(() => big.toU64()).to.throw(/too large/i); + expect(() => big.toI64()).to.throw(/too large/i); + + big = new StellarBase.ScInt(1, { type: 'i256' }); + expect(() => big.toU64()).to.throw(/too large/i); + expect(() => big.toI64()).to.throw(/too large/i); + expect(() => big.toI128()).to.throw(/too large/i); + expect(() => big.toU128()).to.throw(/too large/i); + }); + }); +}); + +describe('creating raw large XDR integers', function () { + describe('array inputs', function () { + [ + ['i64', 2], + ['i128', 4], + ['i256', 8] + ].forEach(([type, count], idx) => { + it(`works for ${type}`, function () { + const input = new Array(count).fill(1n); + const xdrI = new StellarBase.XdrLargeInt(type, input); + + let expected = input.reduce((accum, v, i) => { + return (accum << 32n) | v; + }, 0n); + + expect(xdrI.toBigInt()).to.equal(expected); + }); + }); + }); +}); diff --git a/test/unit/scval_test.js b/test/unit/scval_test.js new file mode 100644 index 000000000..cc0fa8456 --- /dev/null +++ b/test/unit/scval_test.js @@ -0,0 +1,240 @@ +const { + xdr, + ScInt, + Address, + Keypair, + XdrLargeInt, + scValToNative, + nativeToScVal, + scValToBigInt +} = StellarBase; + +describe('parsing and building ScVals', function () { + const 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'] + }; + + const targetScv = xdr.ScVal.scvMap( + [ + ['bool', xdr.ScVal.scvBool(true)], + ['void', xdr.ScVal.scvVoid()], + ['u32', xdr.ScVal.scvU32(1)], + ['i32', xdr.ScVal.scvI32(1)], + ['u64', xdr.ScVal.scvU64(new xdr.Uint64(1))], + ['i64', xdr.ScVal.scvI64(new xdr.Int64(-1))], + ['u128', new ScInt(1, { type: 'u128' }).toScVal()], + ['i128', new ScInt(1, { type: 'i128' }).toScVal()], + ['u256', new ScInt(1, { type: 'u256' }).toScVal()], + ['i256', new ScInt(1, { type: 'i256' }).toScVal()], + [ + 'map', + xdr.ScVal.scvMap([ + new xdr.ScMapEntry({ + key: xdr.ScVal.scvString('arbitrary'), + val: xdr.ScVal.scvU64(new xdr.Uint64(1)) + }), + new xdr.ScMapEntry({ + key: xdr.ScVal.scvString('nested'), + val: xdr.ScVal.scvString('values') + }), + new xdr.ScMapEntry({ + key: xdr.ScVal.scvString('etc'), + val: xdr.ScVal.scvBool(false) + }) + ]) + ], + [ + 'vec', + xdr.ScVal.scvVec(['same', 'type', 'list'].map(xdr.ScVal.scvString)) + ] + ].map(([type, scv]) => { + return new xdr.ScMapEntry({ + key: new xdr.ScVal.scvString(type), + val: scv + }); + }) + ); + + it('builds an ScVal from all intended native types', function () { + const scv = nativeToScVal(gigaMap); + + // test case expectation sanity check + expect(targetScv.value().length).to.equal(Object.keys(gigaMap).length); + expect(scv.switch().name).to.equal('scvMap'); + expect(scv.value().length).to.equal(targetScv.value().length); + + // iterate for granular errors on failures + targetScv.value().forEach((entry, idx) => { + const actual = scv.value()[idx]; + // console.log(idx, 'exp:', JSON.stringify(entry)); + // console.log(idx, 'act:', JSON.stringify(actual)); + expect(entry).to.deep.equal(actual, `item ${idx} doesn't match`); + }); + + expect(scv.toXDR('base64')).to.deep.equal(targetScv.toXDR('base64')); + }); + + it('converts ScVal to intended native types', function () { + const kp = StellarBase.Keypair.random(); + const inputVec = ['Hello', 'there.', 'General', 'Kenobi!']; + + [ + [xdr.ScVal.scvVoid(), null], + [xdr.ScVal.scvBool(true), true], + [xdr.ScVal.scvBool(false), false], + [xdr.ScVal.scvU32(1), 1], + [xdr.ScVal.scvI32(1), 1], + [new ScInt(11).toU64(), 11n], + [new ScInt(11).toI64(), 11n], + [new ScInt(22).toU128(), 22n], + [new ScInt(22).toI128(), 22n], + [new ScInt(33).toU256(), 33n], + [new ScInt(33).toI256(), 33n], + [xdr.ScVal.scvTimepoint(new xdr.Uint64(44n)), 44n], + [xdr.ScVal.scvDuration(new xdr.Uint64(55n)), 55n], + [xdr.ScVal.scvBytes(Buffer.alloc(32, 123)), Buffer.from('{'.repeat(32))], + [ + xdr.ScVal.scvBytes(Buffer.alloc(32, 123)), + new Uint8Array(32).fill(123, 0, 32) + ], + [xdr.ScVal.scvString('hello there!'), 'hello there!'], + [xdr.ScVal.scvSymbol('hello'), 'hello'], + [xdr.ScVal.scvString(Buffer.from('hello')), 'hello'], // ensure conversion + [xdr.ScVal.scvSymbol(Buffer.from('hello')), 'hello'], // ensure conversion + [ + new StellarBase.Address(kp.publicKey()).toScVal(), + (actual) => actual.toString() === kp.publicKey() + ], + [xdr.ScVal.scvVec(inputVec.map(xdr.ScVal.scvString)), inputVec], + [ + xdr.ScVal.scvMap( + [ + [new ScInt(0).toI256(), xdr.ScVal.scvBool(true)], + [xdr.ScVal.scvBool(false), xdr.ScVal.scvString('second')], + [ + xdr.ScVal.scvU32(2), + xdr.ScVal.scvVec(inputVec.map(xdr.ScVal.scvString)) + ] + ].map(([key, val]) => new xdr.ScMapEntry({ key, val })) + ), + { + 0: true, + false: 'second', + 2: inputVec + } + ] + ].forEach(([scv, expected]) => { + expect(() => scv.toXDR(), 'ScVal is invalid').to.not.throw(); + + const actual = scValToNative(scv); + + if (typeof expected === 'function') { + expect(expected(actual), `converting ${scv} to native`).to.be.true; + } else { + expect(actual).to.deep.equal(expected); + } + }); + }); + + it('converts native types with customized types', function () { + [ + [1, 'u32', 'scvU32'], + [1, 'i32', 'scvI32'], + [1, 'i64', 'scvI64'], + [1, 'i128', 'scvI128'], + [1, 'u256', 'scvU256'], + ['a', 'symbol', 'scvSymbol'], + ['a', undefined, 'scvString'], + [Buffer.from('abcdefg'), undefined, 'scvBytes'], + [Buffer.from('abcdefg'), 'string', 'scvString'], + [Buffer.from('abcdefg'), 'symbol', 'scvSymbol'] + ].forEach(([input, typeSpec, outType]) => { + let scv = nativeToScVal(input, { type: typeSpec }); + expect(scv.switch().name).to.equal( + outType, + `in: ${input}, ${typeSpec}\nout: ${JSON.stringify(scv, null, 2)}` + ); + }); + + let scv; + + scv = nativeToScVal(['a', 'b', 'c'], { type: 'symbol' }); + expect(scv.switch().name).to.equal('scvVec'); + scv.value().forEach((v) => { + expect(v.switch().name).to.equal('scvSymbol'); + }); + + scv = nativeToScVal( + { + hello: 'world', + goodbye: [1, 2, 3] + }, + { + type: { + hello: ['symbol', null], + goodbye: [null, 'i32'] + } + } + ); + let e; + expect(scv.switch().name).to.equal('scvMap'); + + e = scv.value()[0]; + expect(e.key().switch().name).to.equal('scvSymbol', `${JSON.stringify(e)}`); + expect(e.val().switch().name).to.equal('scvString', `${JSON.stringify(e)}`); + + e = scv.value()[1]; + expect(e.key().switch().name).to.equal('scvString', `${JSON.stringify(e)}`); + expect(e.val().switch().name).to.equal('scvVec', `${JSON.stringify(e)}`); + expect(e.val().value()[0].switch().name).to.equal( + 'scvI32', + `${JSON.stringify(e)}` + ); + }); + + it('throws on arrays with mixed types', function () { + expect(() => nativeToScVal([1, 'a', false])).to.throw(/same type/i); + }); + + it('lets strings be large integer ScVals', function () { + ['i64', 'i128', 'i256', 'u64', 'u128', 'u256'].forEach((type) => { + const scv = nativeToScVal('12345', { type }); + expect(XdrLargeInt.getType(scv.switch().name)).to.equal(type); + expect(scValToBigInt(scv)).to.equal(BigInt(12345)); + }); + + expect(() => nativeToScVal('not a number', { type: 'i128' })).to.throw(); + expect(() => nativeToScVal('12345', { type: 'notnumeric' })).to.throw(); + expect(() => nativeToScVal('use a Number', { type: 'i32' })).to.throw(); + }); + + it('lets strings be addresses', function () { + [ + 'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM', + 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE', + Keypair.random().publicKey(), + Keypair.random().publicKey() + ].forEach((addr) => { + const scv = nativeToScVal(addr, { type: 'address' }); + const equiv = new Address(addr).toScVal(); + + expect(scv.switch().name).to.be.equal('scvAddress'); + expect(scv).to.deep.equal(equiv); + }); + }); +}); diff --git a/test/unit/soroban_test.js b/test/unit/soroban_test.js new file mode 100644 index 000000000..c2726fc70 --- /dev/null +++ b/test/unit/soroban_test.js @@ -0,0 +1,85 @@ +describe('Soroban', function () { + describe('formatTokenAmount', function () { + const SUCCESS_TEST_CASES = [ + { amount: '1000000001', decimals: 7, expected: '100.0000001' }, + { amount: '10000000010', decimals: 5, expected: '100000.0001' }, + { amount: '10000000010', decimals: 0, expected: '10000000010' }, + { amount: '10000', decimals: 10, expected: '0.000001' }, + { amount: '1567890', decimals: 10, expected: '0.000156789' }, + { amount: '1230', decimals: 0, expected: '1230' } + ]; + + const FAILED_TEST_CASES = [ + { + amount: '1000000001.1', + decimals: 7, + expected: /No decimal is allowed/ + }, + { + amount: '10000.00001.1', + decimals: 4, + expected: /No decimal is allowed/ + } + ]; + + SUCCESS_TEST_CASES.forEach((testCase) => { + it(`returns ${testCase.expected} for ${testCase.amount} with ${testCase.decimals} decimals`, function () { + expect( + StellarBase.Soroban.formatTokenAmount( + testCase.amount, + testCase.decimals + ) + ).to.equal(testCase.expected); + }); + }); + + FAILED_TEST_CASES.forEach((testCase) => { + it(`fails on the input with decimals`, function () { + expect(() => + StellarBase.Soroban.formatTokenAmount( + testCase.amount, + testCase.decimals + ) + ).to.throw(testCase.expected); + }); + }); + }); + + describe('parseTokenAmount', function () { + const SUCCESS_TEST_CASES = [ + { amount: '100', decimals: 2, expected: '10000' }, + { amount: '123.4560', decimals: 5, expected: '12345600' }, + { amount: '100', decimals: 5, expected: '10000000' } + ]; + + const FAILED_TEST_CASES = [ + { + amount: '1000000.001.1', + decimals: 7, + expected: /Invalid decimal value/i + } + ]; + + SUCCESS_TEST_CASES.forEach((testCase) => { + it(`returns ${testCase.expected} for ${testCase.amount} of a token with ${testCase.decimals} decimals`, function () { + expect( + StellarBase.Soroban.parseTokenAmount( + testCase.amount, + testCase.decimals + ) + ).to.equal(testCase.expected); + }); + }); + + FAILED_TEST_CASES.forEach((testCase) => { + it(`fails on the input with more than one decimals`, function () { + expect(() => + StellarBase.Soroban.parseTokenAmount( + testCase.amount, + testCase.decimals + ) + ).to.throw(testCase.expected); + }); + }); + }); +}); diff --git a/test/unit/sorobandata_builder_test.js b/test/unit/sorobandata_builder_test.js new file mode 100644 index 000000000..96cb7ea3c --- /dev/null +++ b/test/unit/sorobandata_builder_test.js @@ -0,0 +1,80 @@ +let xdr = StellarBase.xdr; +let dataBuilder = StellarBase.SorobanDataBuilder; + +describe('SorobanTransactionData can be built', function () { + const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const c = new StellarBase.Contract(contractId); + + const sentinel = new xdr.SorobanTransactionData({ + resources: new xdr.SorobanResources({ + footprint: new xdr.LedgerFootprint({ readOnly: [], readWrite: [] }), + instructions: 1, + readBytes: 2, + writeBytes: 3 + }), + ext: new xdr.ExtensionPoint(0), + refundableFee: new xdr.Int64(5) + }); + + const key = c.getFootprint()[0]; + + it('constructs from xdr, base64, and nothing', function () { + new dataBuilder(); + const fromRaw = new dataBuilder(sentinel).build(); + const fromStr = new dataBuilder(sentinel.toXDR('base64')).build(); + + expect(fromRaw).to.eql(sentinel); + expect(fromStr).to.eql(sentinel); + + const baseline = new dataBuilder().build(); + [null, '', 0].forEach((falsy) => { + const db = new dataBuilder(falsy).build(); + expect(db).to.eql(baseline); + }); + }); + + it('sets properties as expected', function () { + expect( + new dataBuilder().setResources(1, 2, 3).setRefundableFee(5).build() + ).to.eql(sentinel); + + // this isn't a valid param but we're just checking that setters work + const withFootprint = new dataBuilder().setFootprint([key], [key]).build(); + expect(withFootprint.resources().footprint().readOnly()[0]).to.eql(key); + expect(withFootprint.resources().footprint().readWrite()[0]).to.eql(key); + }); + + it('leaves untouched footprints untouched', function () { + const builder = new dataBuilder(); + + const data = builder.setFootprint([key], [key]).build(); + const data2 = new dataBuilder(data).setFootprint(null, []).build(); + + expect(data.resources().footprint().readOnly()).to.eql([key]); + expect(data.resources().footprint().readWrite()).to.eql([key]); + expect(data2.resources().footprint().readOnly()).to.eql([key]); + expect(data2.resources().footprint().readWrite()).to.eql([]); + }); + + it('appends footprints', function () { + const builder = new dataBuilder(); + + const data = builder + .setFootprint([key], [key]) + .appendFootprint([key, key], []); + const built = data.build(); + + expect(data.getReadOnly()).to.eql([key, key, key]); + expect(data.getReadWrite()).to.eql([key]); + expect(built.resources().footprint().readOnly()).to.eql([key, key, key]); + expect(built.resources().footprint().readWrite()).to.eql([key]); + }); + + it('makes copies on build()', function () { + const builder = new dataBuilder(); + const first = builder.build(); + const second = builder.setRefundableFee(100).build(); + + expect(first.refundableFee()).to.not.eql(second.refundableFee()); + }); +}); diff --git a/test/unit/strkey_test.js b/test/unit/strkey_test.js index f1734de3c..d0e0e0095 100644 --- a/test/unit/strkey_test.js +++ b/test/unit/strkey_test.js @@ -392,6 +392,27 @@ describe('StrKey', function () { }); }); + describe('#contracts', function () { + it('valid w/ 32-byte payload', function () { + const strkey = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const buf = StellarBase.StrKey.decodeContract(strkey); + + expect(buf.toString('hex')).to.equal( + '363eaa3867841fbad0f4ed88c779e4fe66e56a2470dc98c0ec9c073d05c7b103' + ); + + expect(StellarBase.StrKey.encodeContract(buf)).to.equal(strkey); + }); + + it('isValid', function () { + const valid = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + expect(StellarBase.StrKey.isValidContract(valid)).to.be.true; + const invalid = + 'GA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + expect(StellarBase.StrKey.isValidContract(invalid)).to.be.false; + }); + }); + describe('#invalidStrKeys', function () { // From https://stellar.org/protocol/sep-23#invalid-test-cases const BAD_STRKEYS = [ diff --git a/test/unit/transaction_builder_test.js b/test/unit/transaction_builder_test.js index 4419eb3de..e069f49ae 100644 --- a/test/unit/transaction_builder_test.js +++ b/test/unit/transaction_builder_test.js @@ -1,5 +1,5 @@ import { isValidDate } from '../../src/transaction_builder.js'; -import { encodeMuxedAccountToAddress } from '../../src/util/decode_encode_muxed_account.js'; +const { encodeMuxedAccountToAddress } = StellarBase; describe('TransactionBuilder', function () { describe('constructs a native payment transaction with one operation', function () { @@ -62,6 +62,97 @@ describe('TransactionBuilder', function () { }); }); + describe('constructs a transaction with soroban data', function () { + var ext; + var source; + var sorobanTransactionData; + beforeEach(function () { + source = new StellarBase.Account( + 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ', + '0' + ); + sorobanTransactionData = new StellarBase.SorobanDataBuilder() + .setResources(0, 5, 0) + .setRefundableFee(1) + .build(); + }); + + const contractId = + 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE'; + const c = new StellarBase.Contract(contractId); + + it('should set the soroban data from object', function (done) { + let transaction = new StellarBase.TransactionBuilder(source, { fee: 100 }) + .setNetworkPassphrase(StellarBase.Networks.TESTNET) + .addOperation( + StellarBase.Operation.invokeHostFunction({ + func: StellarBase.xdr.HostFunction.hostFunctionTypeInvokeContract( + new StellarBase.xdr.InvokeContractArgs({ + contractAddress: c.address().toScAddress(), + functionName: 'hello', + args: [StellarBase.nativeToScVal('world')] + }) + ), + auth: [] + }) + ) + .setSorobanData(sorobanTransactionData) + .setTimeout(StellarBase.TimeoutInfinite) + .build(); + + expect( + transaction.toEnvelope().v1().tx().ext().sorobanData() + ).to.deep.equal(sorobanTransactionData); + done(); + }); + it('should set the soroban data from xdr string', function (done) { + let transaction = new StellarBase.TransactionBuilder(source, { fee: 100 }) + .setNetworkPassphrase(StellarBase.Networks.TESTNET) + .addOperation( + StellarBase.Operation.invokeHostFunction({ + func: StellarBase.xdr.HostFunction.hostFunctionTypeInvokeContract( + new StellarBase.xdr.InvokeContractArgs({ + contractAddress: c.address().toScAddress(), + functionName: 'hello', + args: [StellarBase.nativeToScVal('world')] + }) + ), + auth: [] + }) + ) + .setSorobanData(sorobanTransactionData.toXDR('base64')) + .setTimeout(StellarBase.TimeoutInfinite) + .build(); + + expect( + transaction.toEnvelope().v1().tx().ext().sorobanData() + ).to.deep.equal(sorobanTransactionData); + done(); + }); + + it('should set the transaction Ext to default when soroban data present', function (done) { + let transaction = new StellarBase.TransactionBuilder(source, { fee: 100 }) + .setNetworkPassphrase(StellarBase.Networks.TESTNET) + .addOperation( + StellarBase.Operation.invokeHostFunction({ + func: StellarBase.xdr.HostFunction.hostFunctionTypeInvokeContract( + new StellarBase.xdr.InvokeContractArgs({ + contractAddress: c.address().toScAddress(), + functionName: 'hello', + args: [StellarBase.nativeToScVal('world')] + }) + ), + auth: [] + }) + ) + .setTimeout(StellarBase.TimeoutInfinite) + .build(); + + expect(transaction.toEnvelope().v1().tx().ext().switch()).equal(0); + done(); + }); + }); + describe('constructs a native payment transaction with two operations', function () { var source; var destination1; @@ -817,5 +908,51 @@ describe('TransactionBuilder', function () { source.baseAccount().accountId() ); }); + + it('clones existing transactions', function () { + const operations = [ + StellarBase.Operation.payment({ + source: source.accountId(), + destination: destination, + amount: amount, + asset: asset + }), + StellarBase.Operation.clawback({ + source: source.baseAccount().accountId(), + from: destination, + amount: amount, + asset: asset + }) + ]; + + let builder = new StellarBase.TransactionBuilder(source, { + fee: '100', + timebounds: { minTime: 0, maxTime: 0 }, + memo: new StellarBase.Memo(StellarBase.MemoText, 'Testing cloning'), + networkPassphrase + }) + .addOperation(operations[0]) + .addOperation(operations[1]); + + let tx = builder.build(); + let cloneTx = StellarBase.TransactionBuilder.cloneFrom(tx).build(); + + expect(cloneTx).to.eql( + tx, + `txs differ:` + + `\n(src) ${JSON.stringify(tx, null, 2)}` + + `\n(dst) ${JSON.stringify(cloneTx, null, 2)}` + ); + + cloneTx = StellarBase.TransactionBuilder.cloneFrom(tx, { + fee: '10000' + }).build(); + expect(cloneTx.fee).to.equal('20000'); // double because two ops + + cloneTx = StellarBase.TransactionBuilder.cloneFrom(tx) + .clearOperations() + .build(); + expect(cloneTx.operations).to.be.empty; + }); }); }); diff --git a/types/curr.d.ts b/types/curr.d.ts index 4f4a18072..9941c15ee 100644 --- a/types/curr.d.ts +++ b/types/curr.d.ts @@ -1,4 +1,4 @@ -// Automatically generated on 2023-04-20T14:53:00-08:00 +// Automatically generated on 2023-09-11T12:23:00-08:00 import { Operation } from './index'; export {}; @@ -16,9 +16,9 @@ declare namespace xdrHidden { body(value?: xdr.OperationBody): xdr.OperationBody; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): xdr.Operation; @@ -28,19 +28,21 @@ declare namespace xdrHidden { static toXDR(value: xdr.Operation): Buffer; - static fromXDR(input: Buffer, format?: "raw"): xdr.Operation; + static fromXDR(input: Buffer, format?: 'raw'): xdr.Operation; - static fromXDR(input: string, format: "hex" | "base64"): xdr.Operation; + static fromXDR(input: string, format: 'hex' | 'base64'): xdr.Operation; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } } export namespace xdr { export import Operation = xdrHidden.Operation2; // tslint:disable-line:strict-export-declare-modifiers + type Hash = Opaque[]; // workaround, cause unknown + interface SignedInt { readonly MAX_VALUE: 2147483647; readonly MIN_VALUE: -2147483648; @@ -48,10 +50,10 @@ export namespace xdr { write(value: number, io: Buffer): void; isValid(value: number): boolean; toXDR(value: number): Buffer; - fromXDR(input: Buffer, format?: "raw"): number; - fromXDR(input: string, format: "hex" | "base64"): number; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): number; + fromXDR(input: string, format: 'hex' | 'base64'): number; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } interface UnsignedInt { @@ -61,10 +63,10 @@ export namespace xdr { write(value: number, io: Buffer): void; isValid(value: number): boolean; toXDR(value: number): Buffer; - fromXDR(input: Buffer, format?: "raw"): number; - fromXDR(input: string, format: "hex" | "base64"): number; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): number; + fromXDR(input: string, format: 'hex' | 'base64'): number; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } interface Bool { @@ -72,10 +74,10 @@ export namespace xdr { write(value: boolean, io: Buffer): void; isValid(value: boolean): boolean; toXDR(value: boolean): Buffer; - fromXDR(input: Buffer, format?: "raw"): boolean; - fromXDR(input: string, format: "hex" | "base64"): boolean; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): boolean; + fromXDR(input: string, format: 'hex' | 'base64'): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Hyper { @@ -85,21 +87,23 @@ export namespace xdr { unsigned: boolean; - constructor(low: number, high: number); + constructor( + values: string | bigint | number | Array, + ); - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static toXDR(value: Hyper): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Hyper; + static fromXDR(input: Buffer, format?: 'raw'): Hyper; - static fromXDR(input: string, format: "hex" | "base64"): Hyper; + static fromXDR(input: string, format: 'hex' | 'base64'): Hyper; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; static readonly MAX_VALUE: Hyper; @@ -114,6 +118,10 @@ export namespace xdr { static fromBytes(low: number, high: number): Hyper; static isValid(value: Hyper): boolean; + + toBigInt(): bigint; + + toString(): string; } class UnsignedHyper { @@ -123,21 +131,23 @@ export namespace xdr { unsigned: boolean; - constructor(low: number, high: number); + constructor( + values: string | bigint | number | Array, + ); - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static toXDR(value: UnsignedHyper): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UnsignedHyper; + static fromXDR(input: Buffer, format?: 'raw'): UnsignedHyper; - static fromXDR(input: string, format: "hex" | "base64"): UnsignedHyper; + static fromXDR(input: string, format: 'hex' | 'base64'): UnsignedHyper; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; static readonly MAX_VALUE: UnsignedHyper; @@ -152,6 +162,10 @@ export namespace xdr { static fromBytes(low: number, high: number): UnsignedHyper; static isValid(value: UnsignedHyper): boolean; + + toBigInt(): bigint; + + toString(): string; } class XDRString { @@ -167,13 +181,13 @@ export namespace xdr { toXDR(value: string | Buffer): Buffer; - fromXDR(input: Buffer, format?: "raw"): Buffer; + fromXDR(input: Buffer, format?: 'raw'): Buffer; - fromXDR(input: string, format: "hex" | "base64"): Buffer; + fromXDR(input: string, format: 'hex' | 'base64'): Buffer; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class XDRArray { @@ -185,13 +199,13 @@ export namespace xdr { toXDR(value: T[]): Buffer; - fromXDR(input: Buffer, format?: "raw"): T[]; + fromXDR(input: Buffer, format?: 'raw'): T[]; - fromXDR(input: string, format: "hex" | "base64"): T[]; + fromXDR(input: string, format: 'hex' | 'base64'): T[]; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Opaque { @@ -205,13 +219,13 @@ export namespace xdr { toXDR(value: Buffer): Buffer; - fromXDR(input: Buffer, format?: "raw"): Buffer; + fromXDR(input: Buffer, format?: 'raw'): Buffer; - fromXDR(input: string, format: "hex" | "base64"): Buffer; + fromXDR(input: string, format: 'hex' | 'base64'): Buffer; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class VarOpaque extends Opaque {} @@ -231,21 +245,21 @@ export namespace xdr { toXDR(value: any): Buffer; - fromXDR(input: Buffer, format?: "raw"): any; + fromXDR(input: Buffer, format?: 'raw'): any; - fromXDR(input: string, format: "hex" | "base64"): any; + fromXDR(input: string, format: 'hex' | 'base64'): any; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementType { readonly name: - | "scpStPrepare" - | "scpStConfirm" - | "scpStExternalize" - | "scpStNominate"; + | 'scpStPrepare' + | 'scpStConfirm' + | 'scpStExternalize' + | 'scpStNominate'; readonly value: 0 | 1 | 2 | 3; @@ -260,10 +274,10 @@ export namespace xdr { class AssetType { readonly name: - | "assetTypeNative" - | "assetTypeCreditAlphanum4" - | "assetTypeCreditAlphanum12" - | "assetTypePoolShare"; + | 'assetTypeNative' + | 'assetTypeCreditAlphanum4' + | 'assetTypeCreditAlphanum12' + | 'assetTypePoolShare'; readonly value: 0 | 1 | 2 | 3; @@ -278,10 +292,10 @@ export namespace xdr { class ThresholdIndices { readonly name: - | "thresholdMasterWeight" - | "thresholdLow" - | "thresholdMed" - | "thresholdHigh"; + | 'thresholdMasterWeight' + | 'thresholdLow' + | 'thresholdMed' + | 'thresholdHigh'; readonly value: 0 | 1 | 2 | 3; @@ -296,14 +310,18 @@ export namespace xdr { class LedgerEntryType { readonly name: - | "account" - | "trustline" - | "offer" - | "data" - | "claimableBalance" - | "liquidityPool"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5; + | 'account' + | 'trustline' + | 'offer' + | 'data' + | 'claimableBalance' + | 'liquidityPool' + | 'contractData' + | 'contractCode' + | 'configSetting' + | 'expiration'; + + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; static account(): LedgerEntryType; @@ -316,14 +334,22 @@ export namespace xdr { static claimableBalance(): LedgerEntryType; static liquidityPool(): LedgerEntryType; + + static contractData(): LedgerEntryType; + + static contractCode(): LedgerEntryType; + + static configSetting(): LedgerEntryType; + + static expiration(): LedgerEntryType; } class AccountFlags { readonly name: - | "authRequiredFlag" - | "authRevocableFlag" - | "authImmutableFlag" - | "authClawbackEnabledFlag"; + | 'authRequiredFlag' + | 'authRevocableFlag' + | 'authImmutableFlag' + | 'authClawbackEnabledFlag'; readonly value: 1 | 2 | 4 | 8; @@ -338,9 +364,9 @@ export namespace xdr { class TrustLineFlags { readonly name: - | "authorizedFlag" - | "authorizedToMaintainLiabilitiesFlag" - | "trustlineClawbackEnabledFlag"; + | 'authorizedFlag' + | 'authorizedToMaintainLiabilitiesFlag' + | 'trustlineClawbackEnabledFlag'; readonly value: 1 | 2 | 4; @@ -352,7 +378,7 @@ export namespace xdr { } class LiquidityPoolType { - readonly name: "liquidityPoolConstantProduct"; + readonly name: 'liquidityPoolConstantProduct'; readonly value: 0; @@ -360,7 +386,7 @@ export namespace xdr { } class OfferEntryFlags { - readonly name: "passiveFlag"; + readonly name: 'passiveFlag'; readonly value: 1; @@ -369,12 +395,12 @@ export namespace xdr { class ClaimPredicateType { readonly name: - | "claimPredicateUnconditional" - | "claimPredicateAnd" - | "claimPredicateOr" - | "claimPredicateNot" - | "claimPredicateBeforeAbsoluteTime" - | "claimPredicateBeforeRelativeTime"; + | 'claimPredicateUnconditional' + | 'claimPredicateAnd' + | 'claimPredicateOr' + | 'claimPredicateNot' + | 'claimPredicateBeforeAbsoluteTime' + | 'claimPredicateBeforeRelativeTime'; readonly value: 0 | 1 | 2 | 3 | 4 | 5; @@ -392,7 +418,7 @@ export namespace xdr { } class ClaimantType { - readonly name: "claimantTypeV0"; + readonly name: 'claimantTypeV0'; readonly value: 0; @@ -400,7 +426,7 @@ export namespace xdr { } class ClaimableBalanceIdType { - readonly name: "claimableBalanceIdTypeV0"; + readonly name: 'claimableBalanceIdTypeV0'; readonly value: 0; @@ -408,25 +434,37 @@ export namespace xdr { } class ClaimableBalanceFlags { - readonly name: "claimableBalanceClawbackEnabledFlag"; + readonly name: 'claimableBalanceClawbackEnabledFlag'; readonly value: 1; static claimableBalanceClawbackEnabledFlag(): ClaimableBalanceFlags; } + class ContractDataDurability { + readonly name: 'temporary' | 'persistent'; + + readonly value: 0 | 1; + + static temporary(): ContractDataDurability; + + static persistent(): ContractDataDurability; + } + class EnvelopeType { readonly name: - | "envelopeTypeTxV0" - | "envelopeTypeScp" - | "envelopeTypeTx" - | "envelopeTypeAuth" - | "envelopeTypeScpvalue" - | "envelopeTypeTxFeeBump" - | "envelopeTypeOpId" - | "envelopeTypePoolRevokeOpId"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7; + | 'envelopeTypeTxV0' + | 'envelopeTypeScp' + | 'envelopeTypeTx' + | 'envelopeTypeAuth' + | 'envelopeTypeScpvalue' + | 'envelopeTypeTxFeeBump' + | 'envelopeTypeOpId' + | 'envelopeTypePoolRevokeOpId' + | 'envelopeTypeContractId' + | 'envelopeTypeSorobanAuthorization'; + + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; static envelopeTypeTxV0(): EnvelopeType; @@ -443,10 +481,14 @@ export namespace xdr { static envelopeTypeOpId(): EnvelopeType; static envelopeTypePoolRevokeOpId(): EnvelopeType; + + static envelopeTypeContractId(): EnvelopeType; + + static envelopeTypeSorobanAuthorization(): EnvelopeType; } class StellarValueType { - readonly name: "stellarValueBasic" | "stellarValueSigned"; + readonly name: 'stellarValueBasic' | 'stellarValueSigned'; readonly value: 0 | 1; @@ -457,9 +499,9 @@ export namespace xdr { class LedgerHeaderFlags { readonly name: - | "disableLiquidityPoolTradingFlag" - | "disableLiquidityPoolDepositFlag" - | "disableLiquidityPoolWithdrawalFlag"; + | 'disableLiquidityPoolTradingFlag' + | 'disableLiquidityPoolDepositFlag' + | 'disableLiquidityPoolWithdrawalFlag'; readonly value: 1 | 2 | 4; @@ -472,13 +514,15 @@ export namespace xdr { class LedgerUpgradeType { readonly name: - | "ledgerUpgradeVersion" - | "ledgerUpgradeBaseFee" - | "ledgerUpgradeMaxTxSetSize" - | "ledgerUpgradeBaseReserve" - | "ledgerUpgradeFlags"; + | 'ledgerUpgradeVersion' + | 'ledgerUpgradeBaseFee' + | 'ledgerUpgradeMaxTxSetSize' + | 'ledgerUpgradeBaseReserve' + | 'ledgerUpgradeFlags' + | 'ledgerUpgradeConfig' + | 'ledgerUpgradeMaxSorobanTxSetSize'; - readonly value: 1 | 2 | 3 | 4 | 5; + readonly value: 1 | 2 | 3 | 4 | 5 | 6 | 7; static ledgerUpgradeVersion(): LedgerUpgradeType; @@ -489,10 +533,14 @@ export namespace xdr { static ledgerUpgradeBaseReserve(): LedgerUpgradeType; static ledgerUpgradeFlags(): LedgerUpgradeType; + + static ledgerUpgradeConfig(): LedgerUpgradeType; + + static ledgerUpgradeMaxSorobanTxSetSize(): LedgerUpgradeType; } class BucketEntryType { - readonly name: "metaentry" | "liveentry" | "deadentry" | "initentry"; + readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; readonly value: -1 | 0 | 1 | 2; @@ -506,7 +554,7 @@ export namespace xdr { } class TxSetComponentType { - readonly name: "txsetCompTxsMaybeDiscountedFee"; + readonly name: 'txsetCompTxsMaybeDiscountedFee'; readonly value: 0; @@ -515,10 +563,10 @@ export namespace xdr { class LedgerEntryChangeType { readonly name: - | "ledgerEntryCreated" - | "ledgerEntryUpdated" - | "ledgerEntryRemoved" - | "ledgerEntryState"; + | 'ledgerEntryCreated' + | 'ledgerEntryUpdated' + | 'ledgerEntryRemoved' + | 'ledgerEntryState'; readonly value: 0 | 1 | 2 | 3; @@ -531,8 +579,20 @@ export namespace xdr { static ledgerEntryState(): LedgerEntryChangeType; } + class ContractEventType { + readonly name: 'system' | 'contract' | 'diagnostic'; + + readonly value: 0 | 1 | 2; + + static system(): ContractEventType; + + static contract(): ContractEventType; + + static diagnostic(): ContractEventType; + } + class ErrorCode { - readonly name: "errMisc" | "errData" | "errConf" | "errAuth" | "errLoad"; + readonly name: 'errMisc' | 'errData' | 'errConf' | 'errAuth' | 'errLoad'; readonly value: 0 | 1 | 2 | 3 | 4; @@ -548,7 +608,7 @@ export namespace xdr { } class IpAddrType { - readonly name: "iPv4" | "iPv6"; + readonly name: 'iPv4' | 'iPv6'; readonly value: 0 | 1; @@ -559,25 +619,26 @@ export namespace xdr { class MessageType { readonly name: - | "errorMsg" - | "auth" - | "dontHave" - | "getPeers" - | "peers" - | "getTxSet" - | "txSet" - | "generalizedTxSet" - | "transaction" - | "getScpQuorumset" - | "scpQuorumset" - | "scpMessage" - | "getScpState" - | "hello" - | "surveyRequest" - | "surveyResponse" - | "sendMore" - | "floodAdvert" - | "floodDemand"; + | 'errorMsg' + | 'auth' + | 'dontHave' + | 'getPeers' + | 'peers' + | 'getTxSet' + | 'txSet' + | 'generalizedTxSet' + | 'transaction' + | 'getScpQuorumset' + | 'scpQuorumset' + | 'scpMessage' + | 'getScpState' + | 'hello' + | 'surveyRequest' + | 'surveyResponse' + | 'sendMore' + | 'sendMoreExtended' + | 'floodAdvert' + | 'floodDemand'; readonly value: | 0 @@ -597,6 +658,7 @@ export namespace xdr { | 14 | 15 | 16 + | 20 | 18 | 19; @@ -634,45 +696,60 @@ export namespace xdr { static sendMore(): MessageType; + static sendMoreExtended(): MessageType; + static floodAdvert(): MessageType; static floodDemand(): MessageType; } class SurveyMessageCommandType { - readonly name: "surveyTopology"; + readonly name: 'surveyTopology'; readonly value: 0; static surveyTopology(): SurveyMessageCommandType; } + class SurveyMessageResponseType { + readonly name: 'surveyTopologyResponseV0' | 'surveyTopologyResponseV1'; + + readonly value: 0 | 1; + + static surveyTopologyResponseV0(): SurveyMessageResponseType; + + static surveyTopologyResponseV1(): SurveyMessageResponseType; + } + class OperationType { readonly name: - | "createAccount" - | "payment" - | "pathPaymentStrictReceive" - | "manageSellOffer" - | "createPassiveSellOffer" - | "setOptions" - | "changeTrust" - | "allowTrust" - | "accountMerge" - | "inflation" - | "manageData" - | "bumpSequence" - | "manageBuyOffer" - | "pathPaymentStrictSend" - | "createClaimableBalance" - | "claimClaimableBalance" - | "beginSponsoringFutureReserves" - | "endSponsoringFutureReserves" - | "revokeSponsorship" - | "clawback" - | "clawbackClaimableBalance" - | "setTrustLineFlags" - | "liquidityPoolDeposit" - | "liquidityPoolWithdraw"; + | 'createAccount' + | 'payment' + | 'pathPaymentStrictReceive' + | 'manageSellOffer' + | 'createPassiveSellOffer' + | 'setOptions' + | 'changeTrust' + | 'allowTrust' + | 'accountMerge' + | 'inflation' + | 'manageData' + | 'bumpSequence' + | 'manageBuyOffer' + | 'pathPaymentStrictSend' + | 'createClaimableBalance' + | 'claimClaimableBalance' + | 'beginSponsoringFutureReserves' + | 'endSponsoringFutureReserves' + | 'revokeSponsorship' + | 'clawback' + | 'clawbackClaimableBalance' + | 'setTrustLineFlags' + | 'liquidityPoolDeposit' + | 'liquidityPoolWithdraw' + | 'invokeHostFunction' + | 'bumpFootprintExpiration' + | 'restoreFootprint'; readonly value: | 0 @@ -698,7 +775,10 @@ export namespace xdr { | 20 | 21 | 22 - | 23; + | 23 + | 24 + | 25 + | 26; static createAccount(): OperationType; @@ -747,10 +827,16 @@ export namespace xdr { static liquidityPoolDeposit(): OperationType; static liquidityPoolWithdraw(): OperationType; + + static invokeHostFunction(): OperationType; + + static bumpFootprintExpiration(): OperationType; + + static restoreFootprint(): OperationType; } class RevokeSponsorshipType { - readonly name: "revokeSponsorshipLedgerEntry" | "revokeSponsorshipSigner"; + readonly name: 'revokeSponsorshipLedgerEntry' | 'revokeSponsorshipSigner'; readonly value: 0 | 1; @@ -759,13 +845,64 @@ export namespace xdr { static revokeSponsorshipSigner(): RevokeSponsorshipType; } + class HostFunctionType { + readonly name: + | 'hostFunctionTypeInvokeContract' + | 'hostFunctionTypeCreateContract' + | 'hostFunctionTypeUploadContractWasm'; + + readonly value: 0 | 1 | 2; + + static hostFunctionTypeInvokeContract(): HostFunctionType; + + static hostFunctionTypeCreateContract(): HostFunctionType; + + static hostFunctionTypeUploadContractWasm(): HostFunctionType; + } + + class ContractIdPreimageType { + readonly name: + | 'contractIdPreimageFromAddress' + | 'contractIdPreimageFromAsset'; + + readonly value: 0 | 1; + + static contractIdPreimageFromAddress(): ContractIdPreimageType; + + static contractIdPreimageFromAsset(): ContractIdPreimageType; + } + + class SorobanAuthorizedFunctionType { + readonly name: + | 'sorobanAuthorizedFunctionTypeContractFn' + | 'sorobanAuthorizedFunctionTypeCreateContractHostFn'; + + readonly value: 0 | 1; + + static sorobanAuthorizedFunctionTypeContractFn(): SorobanAuthorizedFunctionType; + + static sorobanAuthorizedFunctionTypeCreateContractHostFn(): SorobanAuthorizedFunctionType; + } + + class SorobanCredentialsType { + readonly name: + | 'sorobanCredentialsSourceAccount' + | 'sorobanCredentialsAddress'; + + readonly value: 0 | 1; + + static sorobanCredentialsSourceAccount(): SorobanCredentialsType; + + static sorobanCredentialsAddress(): SorobanCredentialsType; + } + class MemoType { readonly name: - | "memoNone" - | "memoText" - | "memoId" - | "memoHash" - | "memoReturn"; + | 'memoNone' + | 'memoText' + | 'memoId' + | 'memoHash' + | 'memoReturn'; readonly value: 0 | 1 | 2 | 3 | 4; @@ -781,7 +918,7 @@ export namespace xdr { } class PreconditionType { - readonly name: "precondNone" | "precondTime" | "precondV2"; + readonly name: 'precondNone' | 'precondTime' | 'precondV2'; readonly value: 0 | 1 | 2; @@ -794,9 +931,9 @@ export namespace xdr { class ClaimAtomType { readonly name: - | "claimAtomTypeV0" - | "claimAtomTypeOrderBook" - | "claimAtomTypeLiquidityPool"; + | 'claimAtomTypeV0' + | 'claimAtomTypeOrderBook' + | 'claimAtomTypeLiquidityPool'; readonly value: 0 | 1 | 2; @@ -809,11 +946,11 @@ export namespace xdr { class CreateAccountResultCode { readonly name: - | "createAccountSuccess" - | "createAccountMalformed" - | "createAccountUnderfunded" - | "createAccountLowReserve" - | "createAccountAlreadyExist"; + | 'createAccountSuccess' + | 'createAccountMalformed' + | 'createAccountUnderfunded' + | 'createAccountLowReserve' + | 'createAccountAlreadyExist'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -830,16 +967,16 @@ export namespace xdr { class PaymentResultCode { readonly name: - | "paymentSuccess" - | "paymentMalformed" - | "paymentUnderfunded" - | "paymentSrcNoTrust" - | "paymentSrcNotAuthorized" - | "paymentNoDestination" - | "paymentNoTrust" - | "paymentNotAuthorized" - | "paymentLineFull" - | "paymentNoIssuer"; + | 'paymentSuccess' + | 'paymentMalformed' + | 'paymentUnderfunded' + | 'paymentSrcNoTrust' + | 'paymentSrcNotAuthorized' + | 'paymentNoDestination' + | 'paymentNoTrust' + | 'paymentNotAuthorized' + | 'paymentLineFull' + | 'paymentNoIssuer'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9; @@ -866,19 +1003,19 @@ export namespace xdr { class PathPaymentStrictReceiveResultCode { readonly name: - | "pathPaymentStrictReceiveSuccess" - | "pathPaymentStrictReceiveMalformed" - | "pathPaymentStrictReceiveUnderfunded" - | "pathPaymentStrictReceiveSrcNoTrust" - | "pathPaymentStrictReceiveSrcNotAuthorized" - | "pathPaymentStrictReceiveNoDestination" - | "pathPaymentStrictReceiveNoTrust" - | "pathPaymentStrictReceiveNotAuthorized" - | "pathPaymentStrictReceiveLineFull" - | "pathPaymentStrictReceiveNoIssuer" - | "pathPaymentStrictReceiveTooFewOffers" - | "pathPaymentStrictReceiveOfferCrossSelf" - | "pathPaymentStrictReceiveOverSendmax"; + | 'pathPaymentStrictReceiveSuccess' + | 'pathPaymentStrictReceiveMalformed' + | 'pathPaymentStrictReceiveUnderfunded' + | 'pathPaymentStrictReceiveSrcNoTrust' + | 'pathPaymentStrictReceiveSrcNotAuthorized' + | 'pathPaymentStrictReceiveNoDestination' + | 'pathPaymentStrictReceiveNoTrust' + | 'pathPaymentStrictReceiveNotAuthorized' + | 'pathPaymentStrictReceiveLineFull' + | 'pathPaymentStrictReceiveNoIssuer' + | 'pathPaymentStrictReceiveTooFewOffers' + | 'pathPaymentStrictReceiveOfferCrossSelf' + | 'pathPaymentStrictReceiveOverSendmax'; readonly value: | 0 @@ -924,19 +1061,19 @@ export namespace xdr { class PathPaymentStrictSendResultCode { readonly name: - | "pathPaymentStrictSendSuccess" - | "pathPaymentStrictSendMalformed" - | "pathPaymentStrictSendUnderfunded" - | "pathPaymentStrictSendSrcNoTrust" - | "pathPaymentStrictSendSrcNotAuthorized" - | "pathPaymentStrictSendNoDestination" - | "pathPaymentStrictSendNoTrust" - | "pathPaymentStrictSendNotAuthorized" - | "pathPaymentStrictSendLineFull" - | "pathPaymentStrictSendNoIssuer" - | "pathPaymentStrictSendTooFewOffers" - | "pathPaymentStrictSendOfferCrossSelf" - | "pathPaymentStrictSendUnderDestmin"; + | 'pathPaymentStrictSendSuccess' + | 'pathPaymentStrictSendMalformed' + | 'pathPaymentStrictSendUnderfunded' + | 'pathPaymentStrictSendSrcNoTrust' + | 'pathPaymentStrictSendSrcNotAuthorized' + | 'pathPaymentStrictSendNoDestination' + | 'pathPaymentStrictSendNoTrust' + | 'pathPaymentStrictSendNotAuthorized' + | 'pathPaymentStrictSendLineFull' + | 'pathPaymentStrictSendNoIssuer' + | 'pathPaymentStrictSendTooFewOffers' + | 'pathPaymentStrictSendOfferCrossSelf' + | 'pathPaymentStrictSendUnderDestmin'; readonly value: | 0 @@ -982,19 +1119,19 @@ export namespace xdr { class ManageSellOfferResultCode { readonly name: - | "manageSellOfferSuccess" - | "manageSellOfferMalformed" - | "manageSellOfferSellNoTrust" - | "manageSellOfferBuyNoTrust" - | "manageSellOfferSellNotAuthorized" - | "manageSellOfferBuyNotAuthorized" - | "manageSellOfferLineFull" - | "manageSellOfferUnderfunded" - | "manageSellOfferCrossSelf" - | "manageSellOfferSellNoIssuer" - | "manageSellOfferBuyNoIssuer" - | "manageSellOfferNotFound" - | "manageSellOfferLowReserve"; + | 'manageSellOfferSuccess' + | 'manageSellOfferMalformed' + | 'manageSellOfferSellNoTrust' + | 'manageSellOfferBuyNoTrust' + | 'manageSellOfferSellNotAuthorized' + | 'manageSellOfferBuyNotAuthorized' + | 'manageSellOfferLineFull' + | 'manageSellOfferUnderfunded' + | 'manageSellOfferCrossSelf' + | 'manageSellOfferSellNoIssuer' + | 'manageSellOfferBuyNoIssuer' + | 'manageSellOfferNotFound' + | 'manageSellOfferLowReserve'; readonly value: | 0 @@ -1040,9 +1177,9 @@ export namespace xdr { class ManageOfferEffect { readonly name: - | "manageOfferCreated" - | "manageOfferUpdated" - | "manageOfferDeleted"; + | 'manageOfferCreated' + | 'manageOfferUpdated' + | 'manageOfferDeleted'; readonly value: 0 | 1 | 2; @@ -1055,19 +1192,19 @@ export namespace xdr { class ManageBuyOfferResultCode { readonly name: - | "manageBuyOfferSuccess" - | "manageBuyOfferMalformed" - | "manageBuyOfferSellNoTrust" - | "manageBuyOfferBuyNoTrust" - | "manageBuyOfferSellNotAuthorized" - | "manageBuyOfferBuyNotAuthorized" - | "manageBuyOfferLineFull" - | "manageBuyOfferUnderfunded" - | "manageBuyOfferCrossSelf" - | "manageBuyOfferSellNoIssuer" - | "manageBuyOfferBuyNoIssuer" - | "manageBuyOfferNotFound" - | "manageBuyOfferLowReserve"; + | 'manageBuyOfferSuccess' + | 'manageBuyOfferMalformed' + | 'manageBuyOfferSellNoTrust' + | 'manageBuyOfferBuyNoTrust' + | 'manageBuyOfferSellNotAuthorized' + | 'manageBuyOfferBuyNotAuthorized' + | 'manageBuyOfferLineFull' + | 'manageBuyOfferUnderfunded' + | 'manageBuyOfferCrossSelf' + | 'manageBuyOfferSellNoIssuer' + | 'manageBuyOfferBuyNoIssuer' + | 'manageBuyOfferNotFound' + | 'manageBuyOfferLowReserve'; readonly value: | 0 @@ -1113,17 +1250,17 @@ export namespace xdr { class SetOptionsResultCode { readonly name: - | "setOptionsSuccess" - | "setOptionsLowReserve" - | "setOptionsTooManySigners" - | "setOptionsBadFlags" - | "setOptionsInvalidInflation" - | "setOptionsCantChange" - | "setOptionsUnknownFlag" - | "setOptionsThresholdOutOfRange" - | "setOptionsBadSigner" - | "setOptionsInvalidHomeDomain" - | "setOptionsAuthRevocableRequired"; + | 'setOptionsSuccess' + | 'setOptionsLowReserve' + | 'setOptionsTooManySigners' + | 'setOptionsBadFlags' + | 'setOptionsInvalidInflation' + | 'setOptionsCantChange' + | 'setOptionsUnknownFlag' + | 'setOptionsThresholdOutOfRange' + | 'setOptionsBadSigner' + | 'setOptionsInvalidHomeDomain' + | 'setOptionsAuthRevocableRequired'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9 | -10; @@ -1152,15 +1289,15 @@ export namespace xdr { class ChangeTrustResultCode { readonly name: - | "changeTrustSuccess" - | "changeTrustMalformed" - | "changeTrustNoIssuer" - | "changeTrustInvalidLimit" - | "changeTrustLowReserve" - | "changeTrustSelfNotAllowed" - | "changeTrustTrustLineMissing" - | "changeTrustCannotDelete" - | "changeTrustNotAuthMaintainLiabilities"; + | 'changeTrustSuccess' + | 'changeTrustMalformed' + | 'changeTrustNoIssuer' + | 'changeTrustInvalidLimit' + | 'changeTrustLowReserve' + | 'changeTrustSelfNotAllowed' + | 'changeTrustTrustLineMissing' + | 'changeTrustCannotDelete' + | 'changeTrustNotAuthMaintainLiabilities'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8; @@ -1185,13 +1322,13 @@ export namespace xdr { class AllowTrustResultCode { readonly name: - | "allowTrustSuccess" - | "allowTrustMalformed" - | "allowTrustNoTrustLine" - | "allowTrustTrustNotRequired" - | "allowTrustCantRevoke" - | "allowTrustSelfNotAllowed" - | "allowTrustLowReserve"; + | 'allowTrustSuccess' + | 'allowTrustMalformed' + | 'allowTrustNoTrustLine' + | 'allowTrustTrustNotRequired' + | 'allowTrustCantRevoke' + | 'allowTrustSelfNotAllowed' + | 'allowTrustLowReserve'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6; @@ -1212,14 +1349,14 @@ export namespace xdr { class AccountMergeResultCode { readonly name: - | "accountMergeSuccess" - | "accountMergeMalformed" - | "accountMergeNoAccount" - | "accountMergeImmutableSet" - | "accountMergeHasSubEntries" - | "accountMergeSeqnumTooFar" - | "accountMergeDestFull" - | "accountMergeIsSponsor"; + | 'accountMergeSuccess' + | 'accountMergeMalformed' + | 'accountMergeNoAccount' + | 'accountMergeImmutableSet' + | 'accountMergeHasSubEntries' + | 'accountMergeSeqnumTooFar' + | 'accountMergeDestFull' + | 'accountMergeIsSponsor'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7; @@ -1241,7 +1378,7 @@ export namespace xdr { } class InflationResultCode { - readonly name: "inflationSuccess" | "inflationNotTime"; + readonly name: 'inflationSuccess' | 'inflationNotTime'; readonly value: 0 | -1; @@ -1252,11 +1389,11 @@ export namespace xdr { class ManageDataResultCode { readonly name: - | "manageDataSuccess" - | "manageDataNotSupportedYet" - | "manageDataNameNotFound" - | "manageDataLowReserve" - | "manageDataInvalidName"; + | 'manageDataSuccess' + | 'manageDataNotSupportedYet' + | 'manageDataNameNotFound' + | 'manageDataLowReserve' + | 'manageDataInvalidName'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -1272,7 +1409,7 @@ export namespace xdr { } class BumpSequenceResultCode { - readonly name: "bumpSequenceSuccess" | "bumpSequenceBadSeq"; + readonly name: 'bumpSequenceSuccess' | 'bumpSequenceBadSeq'; readonly value: 0 | -1; @@ -1283,12 +1420,12 @@ export namespace xdr { class CreateClaimableBalanceResultCode { readonly name: - | "createClaimableBalanceSuccess" - | "createClaimableBalanceMalformed" - | "createClaimableBalanceLowReserve" - | "createClaimableBalanceNoTrust" - | "createClaimableBalanceNotAuthorized" - | "createClaimableBalanceUnderfunded"; + | 'createClaimableBalanceSuccess' + | 'createClaimableBalanceMalformed' + | 'createClaimableBalanceLowReserve' + | 'createClaimableBalanceNoTrust' + | 'createClaimableBalanceNotAuthorized' + | 'createClaimableBalanceUnderfunded'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1307,12 +1444,12 @@ export namespace xdr { class ClaimClaimableBalanceResultCode { readonly name: - | "claimClaimableBalanceSuccess" - | "claimClaimableBalanceDoesNotExist" - | "claimClaimableBalanceCannotClaim" - | "claimClaimableBalanceLineFull" - | "claimClaimableBalanceNoTrust" - | "claimClaimableBalanceNotAuthorized"; + | 'claimClaimableBalanceSuccess' + | 'claimClaimableBalanceDoesNotExist' + | 'claimClaimableBalanceCannotClaim' + | 'claimClaimableBalanceLineFull' + | 'claimClaimableBalanceNoTrust' + | 'claimClaimableBalanceNotAuthorized'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1331,10 +1468,10 @@ export namespace xdr { class BeginSponsoringFutureReservesResultCode { readonly name: - | "beginSponsoringFutureReservesSuccess" - | "beginSponsoringFutureReservesMalformed" - | "beginSponsoringFutureReservesAlreadySponsored" - | "beginSponsoringFutureReservesRecursive"; + | 'beginSponsoringFutureReservesSuccess' + | 'beginSponsoringFutureReservesMalformed' + | 'beginSponsoringFutureReservesAlreadySponsored' + | 'beginSponsoringFutureReservesRecursive'; readonly value: 0 | -1 | -2 | -3; @@ -1349,8 +1486,8 @@ export namespace xdr { class EndSponsoringFutureReservesResultCode { readonly name: - | "endSponsoringFutureReservesSuccess" - | "endSponsoringFutureReservesNotSponsored"; + | 'endSponsoringFutureReservesSuccess' + | 'endSponsoringFutureReservesNotSponsored'; readonly value: 0 | -1; @@ -1361,12 +1498,12 @@ export namespace xdr { class RevokeSponsorshipResultCode { readonly name: - | "revokeSponsorshipSuccess" - | "revokeSponsorshipDoesNotExist" - | "revokeSponsorshipNotSponsor" - | "revokeSponsorshipLowReserve" - | "revokeSponsorshipOnlyTransferable" - | "revokeSponsorshipMalformed"; + | 'revokeSponsorshipSuccess' + | 'revokeSponsorshipDoesNotExist' + | 'revokeSponsorshipNotSponsor' + | 'revokeSponsorshipLowReserve' + | 'revokeSponsorshipOnlyTransferable' + | 'revokeSponsorshipMalformed'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1385,11 +1522,11 @@ export namespace xdr { class ClawbackResultCode { readonly name: - | "clawbackSuccess" - | "clawbackMalformed" - | "clawbackNotClawbackEnabled" - | "clawbackNoTrust" - | "clawbackUnderfunded"; + | 'clawbackSuccess' + | 'clawbackMalformed' + | 'clawbackNotClawbackEnabled' + | 'clawbackNoTrust' + | 'clawbackUnderfunded'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -1406,10 +1543,10 @@ export namespace xdr { class ClawbackClaimableBalanceResultCode { readonly name: - | "clawbackClaimableBalanceSuccess" - | "clawbackClaimableBalanceDoesNotExist" - | "clawbackClaimableBalanceNotIssuer" - | "clawbackClaimableBalanceNotClawbackEnabled"; + | 'clawbackClaimableBalanceSuccess' + | 'clawbackClaimableBalanceDoesNotExist' + | 'clawbackClaimableBalanceNotIssuer' + | 'clawbackClaimableBalanceNotClawbackEnabled'; readonly value: 0 | -1 | -2 | -3; @@ -1424,12 +1561,12 @@ export namespace xdr { class SetTrustLineFlagsResultCode { readonly name: - | "setTrustLineFlagsSuccess" - | "setTrustLineFlagsMalformed" - | "setTrustLineFlagsNoTrustLine" - | "setTrustLineFlagsCantRevoke" - | "setTrustLineFlagsInvalidState" - | "setTrustLineFlagsLowReserve"; + | 'setTrustLineFlagsSuccess' + | 'setTrustLineFlagsMalformed' + | 'setTrustLineFlagsNoTrustLine' + | 'setTrustLineFlagsCantRevoke' + | 'setTrustLineFlagsInvalidState' + | 'setTrustLineFlagsLowReserve'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1448,14 +1585,14 @@ export namespace xdr { class LiquidityPoolDepositResultCode { readonly name: - | "liquidityPoolDepositSuccess" - | "liquidityPoolDepositMalformed" - | "liquidityPoolDepositNoTrust" - | "liquidityPoolDepositNotAuthorized" - | "liquidityPoolDepositUnderfunded" - | "liquidityPoolDepositLineFull" - | "liquidityPoolDepositBadPrice" - | "liquidityPoolDepositPoolFull"; + | 'liquidityPoolDepositSuccess' + | 'liquidityPoolDepositMalformed' + | 'liquidityPoolDepositNoTrust' + | 'liquidityPoolDepositNotAuthorized' + | 'liquidityPoolDepositUnderfunded' + | 'liquidityPoolDepositLineFull' + | 'liquidityPoolDepositBadPrice' + | 'liquidityPoolDepositPoolFull'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7; @@ -1478,12 +1615,12 @@ export namespace xdr { class LiquidityPoolWithdrawResultCode { readonly name: - | "liquidityPoolWithdrawSuccess" - | "liquidityPoolWithdrawMalformed" - | "liquidityPoolWithdrawNoTrust" - | "liquidityPoolWithdrawUnderfunded" - | "liquidityPoolWithdrawLineFull" - | "liquidityPoolWithdrawUnderMinimum"; + | 'liquidityPoolWithdrawSuccess' + | 'liquidityPoolWithdrawMalformed' + | 'liquidityPoolWithdrawNoTrust' + | 'liquidityPoolWithdrawUnderfunded' + | 'liquidityPoolWithdrawLineFull' + | 'liquidityPoolWithdrawUnderMinimum'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1500,15 +1637,75 @@ export namespace xdr { static liquidityPoolWithdrawUnderMinimum(): LiquidityPoolWithdrawResultCode; } + class InvokeHostFunctionResultCode { + readonly name: + | 'invokeHostFunctionSuccess' + | 'invokeHostFunctionMalformed' + | 'invokeHostFunctionTrapped' + | 'invokeHostFunctionResourceLimitExceeded' + | 'invokeHostFunctionEntryExpired' + | 'invokeHostFunctionInsufficientRefundableFee'; + + readonly value: 0 | -1 | -2 | -3 | -4 | -5; + + static invokeHostFunctionSuccess(): InvokeHostFunctionResultCode; + + static invokeHostFunctionMalformed(): InvokeHostFunctionResultCode; + + static invokeHostFunctionTrapped(): InvokeHostFunctionResultCode; + + static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResultCode; + + static invokeHostFunctionEntryExpired(): InvokeHostFunctionResultCode; + + static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResultCode; + } + + class BumpFootprintExpirationResultCode { + readonly name: + | 'bumpFootprintExpirationSuccess' + | 'bumpFootprintExpirationMalformed' + | 'bumpFootprintExpirationResourceLimitExceeded' + | 'bumpFootprintExpirationInsufficientRefundableFee'; + + readonly value: 0 | -1 | -2 | -3; + + static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResultCode; + } + + class RestoreFootprintResultCode { + readonly name: + | 'restoreFootprintSuccess' + | 'restoreFootprintMalformed' + | 'restoreFootprintResourceLimitExceeded' + | 'restoreFootprintInsufficientRefundableFee'; + + readonly value: 0 | -1 | -2 | -3; + + static restoreFootprintSuccess(): RestoreFootprintResultCode; + + static restoreFootprintMalformed(): RestoreFootprintResultCode; + + static restoreFootprintResourceLimitExceeded(): RestoreFootprintResultCode; + + static restoreFootprintInsufficientRefundableFee(): RestoreFootprintResultCode; + } + class OperationResultCode { readonly name: - | "opInner" - | "opBadAuth" - | "opNoAccount" - | "opNotSupported" - | "opTooManySubentries" - | "opExceededWorkLimit" - | "opTooManySponsoring"; + | 'opInner' + | 'opBadAuth' + | 'opNoAccount' + | 'opNotSupported' + | 'opTooManySubentries' + | 'opExceededWorkLimit' + | 'opTooManySponsoring'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6; @@ -1529,24 +1726,25 @@ export namespace xdr { class TransactionResultCode { readonly name: - | "txFeeBumpInnerSuccess" - | "txSuccess" - | "txFailed" - | "txTooEarly" - | "txTooLate" - | "txMissingOperation" - | "txBadSeq" - | "txBadAuth" - | "txInsufficientBalance" - | "txNoAccount" - | "txInsufficientFee" - | "txBadAuthExtra" - | "txInternalError" - | "txNotSupported" - | "txFeeBumpInnerFailed" - | "txBadSponsorship" - | "txBadMinSeqAgeOrGap" - | "txMalformed"; + | 'txFeeBumpInnerSuccess' + | 'txSuccess' + | 'txFailed' + | 'txTooEarly' + | 'txTooLate' + | 'txMissingOperation' + | 'txBadSeq' + | 'txBadAuth' + | 'txInsufficientBalance' + | 'txNoAccount' + | 'txInsufficientFee' + | 'txBadAuthExtra' + | 'txInternalError' + | 'txNotSupported' + | 'txFeeBumpInnerFailed' + | 'txBadSponsorship' + | 'txBadMinSeqAgeOrGap' + | 'txMalformed' + | 'txSorobanInvalid'; readonly value: | 1 @@ -1566,7 +1764,8 @@ export namespace xdr { | -13 | -14 | -15 - | -16; + | -16 + | -17; static txFeeBumpInnerSuccess(): TransactionResultCode; @@ -1603,15 +1802,17 @@ export namespace xdr { static txBadMinSeqAgeOrGap(): TransactionResultCode; static txMalformed(): TransactionResultCode; + + static txSorobanInvalid(): TransactionResultCode; } class CryptoKeyType { readonly name: - | "keyTypeEd25519" - | "keyTypePreAuthTx" - | "keyTypeHashX" - | "keyTypeEd25519SignedPayload" - | "keyTypeMuxedEd25519"; + | 'keyTypeEd25519' + | 'keyTypePreAuthTx' + | 'keyTypeHashX' + | 'keyTypeEd25519SignedPayload' + | 'keyTypeMuxedEd25519'; readonly value: 0 | 1 | 2 | 3 | 256; @@ -1627,7 +1828,7 @@ export namespace xdr { } class PublicKeyType { - readonly name: "publicKeyTypeEd25519"; + readonly name: 'publicKeyTypeEd25519'; readonly value: 0; @@ -1636,10 +1837,10 @@ export namespace xdr { class SignerKeyType { readonly name: - | "signerKeyTypeEd25519" - | "signerKeyTypePreAuthTx" - | "signerKeyTypeHashX" - | "signerKeyTypeEd25519SignedPayload"; + | 'signerKeyTypeEd25519' + | 'signerKeyTypePreAuthTx' + | 'signerKeyTypeHashX' + | 'signerKeyTypeEd25519SignedPayload'; readonly value: 0 | 1 | 2 | 3; @@ -1652,8352 +1853,12302 @@ export namespace xdr { static signerKeyTypeEd25519SignedPayload(): SignerKeyType; } - const Value: VarOpaque; + class ScValType { + readonly name: + | 'scvBool' + | 'scvVoid' + | 'scvError' + | 'scvU32' + | 'scvI32' + | 'scvU64' + | 'scvI64' + | 'scvTimepoint' + | 'scvDuration' + | 'scvU128' + | 'scvI128' + | 'scvU256' + | 'scvI256' + | 'scvBytes' + | 'scvString' + | 'scvSymbol' + | 'scvVec' + | 'scvMap' + | 'scvAddress' + | 'scvContractInstance' + | 'scvLedgerKeyContractInstance' + | 'scvLedgerKeyNonce'; - type AccountId = PublicKey; + readonly value: + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18 + | 19 + | 20 + | 21; - const Thresholds: Opaque; + static scvBool(): ScValType; - const String32: XDRString; + static scvVoid(): ScValType; - const String64: XDRString; + static scvError(): ScValType; - type SequenceNumber = Int64; + static scvU32(): ScValType; - type TimePoint = Uint64; + static scvI32(): ScValType; - type Duration = Uint64; + static scvU64(): ScValType; - const DataValue: VarOpaque; + static scvI64(): ScValType; - type Hash = Opaque[]; + static scvTimepoint(): ScValType; - type PoolId = Hash; + static scvDuration(): ScValType; - const AssetCode4: Opaque; + static scvU128(): ScValType; - const AssetCode12: Opaque; + static scvI128(): ScValType; - type SponsorshipDescriptor = undefined | AccountId; + static scvU256(): ScValType; - const UpgradeType: VarOpaque; + static scvI256(): ScValType; - const LedgerEntryChanges: XDRArray; + static scvBytes(): ScValType; - const EncryptedBody: VarOpaque; + static scvString(): ScValType; - const PeerStatList: XDRArray; + static scvSymbol(): ScValType; - const TxAdvertVector: XDRArray; + static scvVec(): ScValType; - const TxDemandVector: XDRArray; + static scvMap(): ScValType; - const Hash: Opaque; + static scvAddress(): ScValType; - const Uint256: Opaque; + static scvContractInstance(): ScValType; - const Uint32: UnsignedInt; + static scvLedgerKeyContractInstance(): ScValType; - const Int32: SignedInt; + static scvLedgerKeyNonce(): ScValType; + } - class Uint64 extends UnsignedHyper {} + class ScErrorType { + readonly name: + | 'sceContract' + | 'sceWasmVm' + | 'sceContext' + | 'sceStorage' + | 'sceObject' + | 'sceCrypto' + | 'sceEvents' + | 'sceBudget' + | 'sceValue' + | 'sceAuth'; - class Int64 extends Hyper {} + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; - const Signature: VarOpaque; + static sceContract(): ScErrorType; - const SignatureHint: Opaque; + static sceWasmVm(): ScErrorType; - type NodeId = PublicKey; + static sceContext(): ScErrorType; - class ScpBallot { - constructor(attributes: { counter: number; value: Buffer }); + static sceStorage(): ScErrorType; - counter(value?: number): number; + static sceObject(): ScErrorType; - value(value?: Buffer): Buffer; + static sceCrypto(): ScErrorType; - toXDR(format?: "raw"): Buffer; + static sceEvents(): ScErrorType; - toXDR(format: "hex" | "base64"): string; + static sceBudget(): ScErrorType; - static read(io: Buffer): ScpBallot; + static sceValue(): ScErrorType; - static write(value: ScpBallot, io: Buffer): void; + static sceAuth(): ScErrorType; + } - static isValid(value: ScpBallot): boolean; + class ScErrorCode { + readonly name: + | 'scecArithDomain' + | 'scecIndexBounds' + | 'scecInvalidInput' + | 'scecMissingValue' + | 'scecExistingValue' + | 'scecExceededLimit' + | 'scecInvalidAction' + | 'scecInternalError' + | 'scecUnexpectedType' + | 'scecUnexpectedSize'; - static toXDR(value: ScpBallot): Buffer; + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; - static fromXDR(input: Buffer, format?: "raw"): ScpBallot; + static scecArithDomain(): ScErrorCode; - static fromXDR(input: string, format: "hex" | "base64"): ScpBallot; + static scecIndexBounds(): ScErrorCode; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scecInvalidInput(): ScErrorCode; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static scecMissingValue(): ScErrorCode; - class ScpNomination { - constructor(attributes: { - quorumSetHash: Buffer; - votes: Buffer[]; - accepted: Buffer[]; - }); + static scecExistingValue(): ScErrorCode; - quorumSetHash(value?: Buffer): Buffer; + static scecExceededLimit(): ScErrorCode; - votes(value?: Buffer[]): Buffer[]; + static scecInvalidAction(): ScErrorCode; - accepted(value?: Buffer[]): Buffer[]; + static scecInternalError(): ScErrorCode; - toXDR(format?: "raw"): Buffer; + static scecUnexpectedType(): ScErrorCode; - toXDR(format: "hex" | "base64"): string; + static scecUnexpectedSize(): ScErrorCode; + } - static read(io: Buffer): ScpNomination; + class ContractExecutableType { + readonly name: 'contractExecutableWasm' | 'contractExecutableToken'; - static write(value: ScpNomination, io: Buffer): void; + readonly value: 0 | 1; - static isValid(value: ScpNomination): boolean; + static contractExecutableWasm(): ContractExecutableType; - static toXDR(value: ScpNomination): Buffer; + static contractExecutableToken(): ContractExecutableType; + } - static fromXDR(input: Buffer, format?: "raw"): ScpNomination; + class ScAddressType { + readonly name: 'scAddressTypeAccount' | 'scAddressTypeContract'; - static fromXDR(input: string, format: "hex" | "base64"): ScpNomination; + readonly value: 0 | 1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scAddressTypeAccount(): ScAddressType; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static scAddressTypeContract(): ScAddressType; } - class ScpStatementPrepare { - constructor(attributes: { - quorumSetHash: Buffer; - ballot: ScpBallot; - prepared: null | ScpBallot; - preparedPrime: null | ScpBallot; - nC: number; - nH: number; - }); + class ScEnvMetaKind { + readonly name: 'scEnvMetaKindInterfaceVersion'; - quorumSetHash(value?: Buffer): Buffer; + readonly value: 0; - ballot(value?: ScpBallot): ScpBallot; + static scEnvMetaKindInterfaceVersion(): ScEnvMetaKind; + } - prepared(value?: null | ScpBallot): null | ScpBallot; + class ScMetaKind { + readonly name: 'scMetaV0'; - preparedPrime(value?: null | ScpBallot): null | ScpBallot; + readonly value: 0; - nC(value?: number): number; + static scMetaV0(): ScMetaKind; + } - nH(value?: number): number; + class ScSpecType { + readonly name: + | 'scSpecTypeVal' + | 'scSpecTypeBool' + | 'scSpecTypeVoid' + | 'scSpecTypeError' + | 'scSpecTypeU32' + | 'scSpecTypeI32' + | 'scSpecTypeU64' + | 'scSpecTypeI64' + | 'scSpecTypeTimepoint' + | 'scSpecTypeDuration' + | 'scSpecTypeU128' + | 'scSpecTypeI128' + | 'scSpecTypeU256' + | 'scSpecTypeI256' + | 'scSpecTypeBytes' + | 'scSpecTypeString' + | 'scSpecTypeSymbol' + | 'scSpecTypeAddress' + | 'scSpecTypeOption' + | 'scSpecTypeResult' + | 'scSpecTypeVec' + | 'scSpecTypeMap' + | 'scSpecTypeTuple' + | 'scSpecTypeBytesN' + | 'scSpecTypeUdt'; - toXDR(format?: "raw"): Buffer; + readonly value: + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 16 + | 17 + | 19 + | 1000 + | 1001 + | 1002 + | 1004 + | 1005 + | 1006 + | 2000; - toXDR(format: "hex" | "base64"): string; + static scSpecTypeVal(): ScSpecType; - static read(io: Buffer): ScpStatementPrepare; + static scSpecTypeBool(): ScSpecType; - static write(value: ScpStatementPrepare, io: Buffer): void; + static scSpecTypeVoid(): ScSpecType; - static isValid(value: ScpStatementPrepare): boolean; + static scSpecTypeError(): ScSpecType; - static toXDR(value: ScpStatementPrepare): Buffer; + static scSpecTypeU32(): ScSpecType; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementPrepare; + static scSpecTypeI32(): ScSpecType; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScpStatementPrepare; + static scSpecTypeU64(): ScSpecType; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scSpecTypeI64(): ScSpecType; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static scSpecTypeTimepoint(): ScSpecType; - class ScpStatementConfirm { - constructor(attributes: { - ballot: ScpBallot; - nPrepared: number; - nCommit: number; - nH: number; - quorumSetHash: Buffer; - }); + static scSpecTypeDuration(): ScSpecType; - ballot(value?: ScpBallot): ScpBallot; + static scSpecTypeU128(): ScSpecType; - nPrepared(value?: number): number; + static scSpecTypeI128(): ScSpecType; - nCommit(value?: number): number; + static scSpecTypeU256(): ScSpecType; - nH(value?: number): number; + static scSpecTypeI256(): ScSpecType; - quorumSetHash(value?: Buffer): Buffer; + static scSpecTypeBytes(): ScSpecType; - toXDR(format?: "raw"): Buffer; + static scSpecTypeString(): ScSpecType; - toXDR(format: "hex" | "base64"): string; + static scSpecTypeSymbol(): ScSpecType; - static read(io: Buffer): ScpStatementConfirm; + static scSpecTypeAddress(): ScSpecType; - static write(value: ScpStatementConfirm, io: Buffer): void; + static scSpecTypeOption(): ScSpecType; - static isValid(value: ScpStatementConfirm): boolean; + static scSpecTypeResult(): ScSpecType; - static toXDR(value: ScpStatementConfirm): Buffer; + static scSpecTypeVec(): ScSpecType; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementConfirm; + static scSpecTypeMap(): ScSpecType; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScpStatementConfirm; + static scSpecTypeTuple(): ScSpecType; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scSpecTypeBytesN(): ScSpecType; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static scSpecTypeUdt(): ScSpecType; } - class ScpStatementExternalize { - constructor(attributes: { - commit: ScpBallot; - nH: number; - commitQuorumSetHash: Buffer; - }); + class ScSpecUdtUnionCaseV0Kind { + readonly name: 'scSpecUdtUnionCaseVoidV0' | 'scSpecUdtUnionCaseTupleV0'; - commit(value?: ScpBallot): ScpBallot; + readonly value: 0 | 1; - nH(value?: number): number; + static scSpecUdtUnionCaseVoidV0(): ScSpecUdtUnionCaseV0Kind; - commitQuorumSetHash(value?: Buffer): Buffer; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ScpStatementExternalize; + static scSpecUdtUnionCaseTupleV0(): ScSpecUdtUnionCaseV0Kind; + } - static write(value: ScpStatementExternalize, io: Buffer): void; + class ScSpecEntryKind { + readonly name: + | 'scSpecEntryFunctionV0' + | 'scSpecEntryUdtStructV0' + | 'scSpecEntryUdtUnionV0' + | 'scSpecEntryUdtEnumV0' + | 'scSpecEntryUdtErrorEnumV0'; - static isValid(value: ScpStatementExternalize): boolean; + readonly value: 0 | 1 | 2 | 3 | 4; - static toXDR(value: ScpStatementExternalize): Buffer; + static scSpecEntryFunctionV0(): ScSpecEntryKind; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementExternalize; + static scSpecEntryUdtStructV0(): ScSpecEntryKind; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScpStatementExternalize; + static scSpecEntryUdtUnionV0(): ScSpecEntryKind; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scSpecEntryUdtEnumV0(): ScSpecEntryKind; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static scSpecEntryUdtErrorEnumV0(): ScSpecEntryKind; } - class ScpStatement { - constructor(attributes: { - nodeId: NodeId; - slotIndex: Uint64; - pledges: ScpStatementPledges; - }); + class ContractCostType { + readonly name: + | 'wasmInsnExec' + | 'wasmMemAlloc' + | 'hostMemAlloc' + | 'hostMemCpy' + | 'hostMemCmp' + | 'dispatchHostFunction' + | 'visitObject' + | 'valSer' + | 'valDeser' + | 'computeSha256Hash' + | 'computeEd25519PubKey' + | 'mapEntry' + | 'vecEntry' + | 'verifyEd25519Sig' + | 'vmMemRead' + | 'vmMemWrite' + | 'vmInstantiation' + | 'vmCachedInstantiation' + | 'invokeVmFunction' + | 'computeKeccak256Hash' + | 'computeEcdsaSecp256k1Key' + | 'computeEcdsaSecp256k1Sig' + | 'recoverEcdsaSecp256k1Key' + | 'int256AddSub' + | 'int256Mul' + | 'int256Div' + | 'int256Pow' + | 'int256Shift'; - nodeId(value?: NodeId): NodeId; + readonly value: + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18 + | 19 + | 20 + | 21 + | 22 + | 23 + | 24 + | 25 + | 26 + | 27; - slotIndex(value?: Uint64): Uint64; + static wasmInsnExec(): ContractCostType; - pledges(value?: ScpStatementPledges): ScpStatementPledges; + static wasmMemAlloc(): ContractCostType; - toXDR(format?: "raw"): Buffer; + static hostMemAlloc(): ContractCostType; - toXDR(format: "hex" | "base64"): string; + static hostMemCpy(): ContractCostType; - static read(io: Buffer): ScpStatement; + static hostMemCmp(): ContractCostType; - static write(value: ScpStatement, io: Buffer): void; + static dispatchHostFunction(): ContractCostType; - static isValid(value: ScpStatement): boolean; + static visitObject(): ContractCostType; - static toXDR(value: ScpStatement): Buffer; + static valSer(): ContractCostType; - static fromXDR(input: Buffer, format?: "raw"): ScpStatement; + static valDeser(): ContractCostType; - static fromXDR(input: string, format: "hex" | "base64"): ScpStatement; + static computeSha256Hash(): ContractCostType; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static computeEd25519PubKey(): ContractCostType; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static mapEntry(): ContractCostType; - class ScpEnvelope { - constructor(attributes: { statement: ScpStatement; signature: Buffer }); + static vecEntry(): ContractCostType; - statement(value?: ScpStatement): ScpStatement; + static verifyEd25519Sig(): ContractCostType; - signature(value?: Buffer): Buffer; + static vmMemRead(): ContractCostType; - toXDR(format?: "raw"): Buffer; + static vmMemWrite(): ContractCostType; - toXDR(format: "hex" | "base64"): string; + static vmInstantiation(): ContractCostType; - static read(io: Buffer): ScpEnvelope; + static vmCachedInstantiation(): ContractCostType; - static write(value: ScpEnvelope, io: Buffer): void; + static invokeVmFunction(): ContractCostType; - static isValid(value: ScpEnvelope): boolean; + static computeKeccak256Hash(): ContractCostType; - static toXDR(value: ScpEnvelope): Buffer; + static computeEcdsaSecp256k1Key(): ContractCostType; - static fromXDR(input: Buffer, format?: "raw"): ScpEnvelope; + static computeEcdsaSecp256k1Sig(): ContractCostType; - static fromXDR(input: string, format: "hex" | "base64"): ScpEnvelope; + static recoverEcdsaSecp256k1Key(): ContractCostType; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static int256AddSub(): ContractCostType; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static int256Mul(): ContractCostType; - class ScpQuorumSet { - constructor(attributes: { - threshold: number; - validators: NodeId[]; - innerSets: ScpQuorumSet[]; - }); + static int256Div(): ContractCostType; - threshold(value?: number): number; + static int256Pow(): ContractCostType; - validators(value?: NodeId[]): NodeId[]; + static int256Shift(): ContractCostType; + } - innerSets(value?: ScpQuorumSet[]): ScpQuorumSet[]; + class ConfigSettingId { + readonly name: + | 'configSettingContractMaxSizeBytes' + | 'configSettingContractComputeV0' + | 'configSettingContractLedgerCostV0' + | 'configSettingContractHistoricalDataV0' + | 'configSettingContractEventsV0' + | 'configSettingContractBandwidthV0' + | 'configSettingContractCostParamsCpuInstructions' + | 'configSettingContractCostParamsMemoryBytes' + | 'configSettingContractDataKeySizeBytes' + | 'configSettingContractDataEntrySizeBytes' + | 'configSettingStateExpiration' + | 'configSettingContractExecutionLanes' + | 'configSettingBucketlistSizeWindow' + | 'configSettingEvictionIterator'; - toXDR(format?: "raw"): Buffer; + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; - toXDR(format: "hex" | "base64"): string; + static configSettingContractMaxSizeBytes(): ConfigSettingId; - static read(io: Buffer): ScpQuorumSet; + static configSettingContractComputeV0(): ConfigSettingId; - static write(value: ScpQuorumSet, io: Buffer): void; + static configSettingContractLedgerCostV0(): ConfigSettingId; - static isValid(value: ScpQuorumSet): boolean; + static configSettingContractHistoricalDataV0(): ConfigSettingId; - static toXDR(value: ScpQuorumSet): Buffer; + static configSettingContractEventsV0(): ConfigSettingId; - static fromXDR(input: Buffer, format?: "raw"): ScpQuorumSet; + static configSettingContractBandwidthV0(): ConfigSettingId; - static fromXDR(input: string, format: "hex" | "base64"): ScpQuorumSet; + static configSettingContractCostParamsCpuInstructions(): ConfigSettingId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static configSettingContractCostParamsMemoryBytes(): ConfigSettingId; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static configSettingContractDataKeySizeBytes(): ConfigSettingId; - class AlphaNum4 { - constructor(attributes: { assetCode: Buffer; issuer: AccountId }); + static configSettingContractDataEntrySizeBytes(): ConfigSettingId; - assetCode(value?: Buffer): Buffer; + static configSettingStateExpiration(): ConfigSettingId; - issuer(value?: AccountId): AccountId; + static configSettingContractExecutionLanes(): ConfigSettingId; - toXDR(format?: "raw"): Buffer; + static configSettingBucketlistSizeWindow(): ConfigSettingId; - toXDR(format: "hex" | "base64"): string; + static configSettingEvictionIterator(): ConfigSettingId; + } - static read(io: Buffer): AlphaNum4; + const Value: VarOpaque; - static write(value: AlphaNum4, io: Buffer): void; + const Thresholds: Opaque; - static isValid(value: AlphaNum4): boolean; + const String32: XDRString; - static toXDR(value: AlphaNum4): Buffer; + const String64: XDRString; - static fromXDR(input: Buffer, format?: "raw"): AlphaNum4; + type SequenceNumber = Int64; - static fromXDR(input: string, format: "hex" | "base64"): AlphaNum4; + const DataValue: VarOpaque; - static validateXDR(input: Buffer, format?: "raw"): boolean; + type PoolId = Hash; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + const AssetCode4: Opaque; - class AlphaNum12 { - constructor(attributes: { assetCode: Buffer; issuer: AccountId }); + const AssetCode12: Opaque; - assetCode(value?: Buffer): Buffer; + type SponsorshipDescriptor = undefined | AccountId; - issuer(value?: AccountId): AccountId; + const UpgradeType: VarOpaque; - toXDR(format?: "raw"): Buffer; + const LedgerEntryChanges: XDRArray; - toXDR(format: "hex" | "base64"): string; + const EncryptedBody: VarOpaque; - static read(io: Buffer): AlphaNum12; + const PeerStatList: XDRArray; - static write(value: AlphaNum12, io: Buffer): void; + const TxAdvertVector: XDRArray; - static isValid(value: AlphaNum12): boolean; + const TxDemandVector: XDRArray; - static toXDR(value: AlphaNum12): Buffer; + const Hash: Opaque; - static fromXDR(input: Buffer, format?: "raw"): AlphaNum12; + const Uint256: Opaque; - static fromXDR(input: string, format: "hex" | "base64"): AlphaNum12; + const Uint32: UnsignedInt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + const Int32: SignedInt; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + class Uint64 extends UnsignedHyper {} - class Price { - constructor(attributes: { n: number; d: number }); + class Int64 extends Hyper {} - n(value?: number): number; + type TimePoint = Uint64; - d(value?: number): number; + type Duration = Uint64; - toXDR(format?: "raw"): Buffer; + const Signature: VarOpaque; - toXDR(format: "hex" | "base64"): string; + const SignatureHint: Opaque; - static read(io: Buffer): Price; + type NodeId = PublicKey; - static write(value: Price, io: Buffer): void; + type AccountId = PublicKey; - static isValid(value: Price): boolean; + const ScVec: XDRArray; - static toXDR(value: Price): Buffer; + const ScMap: XDRArray; - static fromXDR(input: Buffer, format?: "raw"): Price; + const ScBytes: VarOpaque; - static fromXDR(input: string, format: "hex" | "base64"): Price; + const ScString: XDRString; - static validateXDR(input: Buffer, format?: "raw"): boolean; + const ScSymbol: XDRString; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + const ContractCostParams: XDRArray; - class Liabilities { - constructor(attributes: { buying: Int64; selling: Int64 }); + class ScpBallot { + constructor(attributes: { counter: number; value: Buffer }); - buying(value?: Int64): Int64; + counter(value?: number): number; - selling(value?: Int64): Int64; + value(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): Liabilities; + static read(io: Buffer): ScpBallot; - static write(value: Liabilities, io: Buffer): void; + static write(value: ScpBallot, io: Buffer): void; - static isValid(value: Liabilities): boolean; + static isValid(value: ScpBallot): boolean; - static toXDR(value: Liabilities): Buffer; + static toXDR(value: ScpBallot): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Liabilities; + static fromXDR(input: Buffer, format?: 'raw'): ScpBallot; - static fromXDR(input: string, format: "hex" | "base64"): Liabilities; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpBallot; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Signer { - constructor(attributes: { key: SignerKey; weight: number }); + class ScpNomination { + constructor(attributes: { + quorumSetHash: Buffer; + votes: Buffer[]; + accepted: Buffer[]; + }); - key(value?: SignerKey): SignerKey; + quorumSetHash(value?: Buffer): Buffer; - weight(value?: number): number; + votes(value?: Buffer[]): Buffer[]; - toXDR(format?: "raw"): Buffer; + accepted(value?: Buffer[]): Buffer[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): Signer; + toXDR(format: 'hex' | 'base64'): string; - static write(value: Signer, io: Buffer): void; + static read(io: Buffer): ScpNomination; - static isValid(value: Signer): boolean; + static write(value: ScpNomination, io: Buffer): void; - static toXDR(value: Signer): Buffer; + static isValid(value: ScpNomination): boolean; + + static toXDR(value: ScpNomination): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Signer; + static fromXDR(input: Buffer, format?: 'raw'): ScpNomination; - static fromXDR(input: string, format: "hex" | "base64"): Signer; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpNomination; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExtensionV3 { + class ScpStatementPrepare { constructor(attributes: { - ext: ExtensionPoint; - seqLedger: number; - seqTime: TimePoint; + quorumSetHash: Buffer; + ballot: ScpBallot; + prepared: null | ScpBallot; + preparedPrime: null | ScpBallot; + nC: number; + nH: number; }); - ext(value?: ExtensionPoint): ExtensionPoint; + quorumSetHash(value?: Buffer): Buffer; - seqLedger(value?: number): number; + ballot(value?: ScpBallot): ScpBallot; - seqTime(value?: TimePoint): TimePoint; + prepared(value?: null | ScpBallot): null | ScpBallot; - toXDR(format?: "raw"): Buffer; + preparedPrime(value?: null | ScpBallot): null | ScpBallot; - toXDR(format: "hex" | "base64"): string; + nC(value?: number): number; - static read(io: Buffer): AccountEntryExtensionV3; + nH(value?: number): number; - static write(value: AccountEntryExtensionV3, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: AccountEntryExtensionV3): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: AccountEntryExtensionV3): Buffer; + static read(io: Buffer): ScpStatementPrepare; + + static write(value: ScpStatementPrepare, io: Buffer): void; + + static isValid(value: ScpStatementPrepare): boolean; + + static toXDR(value: ScpStatementPrepare): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV3; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementPrepare; static fromXDR( input: string, - format: "hex" | "base64" - ): AccountEntryExtensionV3; + format: 'hex' | 'base64', + ): ScpStatementPrepare; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExtensionV2 { + class ScpStatementConfirm { constructor(attributes: { - numSponsored: number; - numSponsoring: number; - signerSponsoringIDs: SponsorshipDescriptor[]; - ext: AccountEntryExtensionV2Ext; + ballot: ScpBallot; + nPrepared: number; + nCommit: number; + nH: number; + quorumSetHash: Buffer; }); - numSponsored(value?: number): number; + ballot(value?: ScpBallot): ScpBallot; - numSponsoring(value?: number): number; + nPrepared(value?: number): number; - signerSponsoringIDs( - value?: SponsorshipDescriptor[] - ): SponsorshipDescriptor[]; + nCommit(value?: number): number; - ext(value?: AccountEntryExtensionV2Ext): AccountEntryExtensionV2Ext; + nH(value?: number): number; - toXDR(format?: "raw"): Buffer; + quorumSetHash(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): AccountEntryExtensionV2; + toXDR(format: 'hex' | 'base64'): string; - static write(value: AccountEntryExtensionV2, io: Buffer): void; + static read(io: Buffer): ScpStatementConfirm; - static isValid(value: AccountEntryExtensionV2): boolean; + static write(value: ScpStatementConfirm, io: Buffer): void; - static toXDR(value: AccountEntryExtensionV2): Buffer; + static isValid(value: ScpStatementConfirm): boolean; + + static toXDR(value: ScpStatementConfirm): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV2; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementConfirm; static fromXDR( input: string, - format: "hex" | "base64" - ): AccountEntryExtensionV2; + format: 'hex' | 'base64', + ): ScpStatementConfirm; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExtensionV1 { + class ScpStatementExternalize { constructor(attributes: { - liabilities: Liabilities; - ext: AccountEntryExtensionV1Ext; + commit: ScpBallot; + nH: number; + commitQuorumSetHash: Buffer; }); - liabilities(value?: Liabilities): Liabilities; + commit(value?: ScpBallot): ScpBallot; - ext(value?: AccountEntryExtensionV1Ext): AccountEntryExtensionV1Ext; + nH(value?: number): number; - toXDR(format?: "raw"): Buffer; + commitQuorumSetHash(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): AccountEntryExtensionV1; + toXDR(format: 'hex' | 'base64'): string; - static write(value: AccountEntryExtensionV1, io: Buffer): void; + static read(io: Buffer): ScpStatementExternalize; - static isValid(value: AccountEntryExtensionV1): boolean; + static write(value: ScpStatementExternalize, io: Buffer): void; - static toXDR(value: AccountEntryExtensionV1): Buffer; + static isValid(value: ScpStatementExternalize): boolean; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV1; + static toXDR(value: ScpStatementExternalize): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementExternalize; static fromXDR( input: string, - format: "hex" | "base64" - ): AccountEntryExtensionV1; + format: 'hex' | 'base64', + ): ScpStatementExternalize; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntry { + class ScpStatement { constructor(attributes: { - accountId: AccountId; - balance: Int64; - seqNum: SequenceNumber; - numSubEntries: number; - inflationDest: null | AccountId; - flags: number; - homeDomain: string | Buffer; - thresholds: Buffer; - signers: Signer[]; - ext: AccountEntryExt; + nodeId: NodeId; + slotIndex: Uint64; + pledges: ScpStatementPledges; }); - accountId(value?: AccountId): AccountId; - - balance(value?: Int64): Int64; - - seqNum(value?: SequenceNumber): SequenceNumber; - - numSubEntries(value?: number): number; - - inflationDest(value?: null | AccountId): null | AccountId; - - flags(value?: number): number; - - homeDomain(value?: string | Buffer): string | Buffer; - - thresholds(value?: Buffer): Buffer; + nodeId(value?: NodeId): NodeId; - signers(value?: Signer[]): Signer[]; + slotIndex(value?: Uint64): Uint64; - ext(value?: AccountEntryExt): AccountEntryExt; + pledges(value?: ScpStatementPledges): ScpStatementPledges; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AccountEntry; + static read(io: Buffer): ScpStatement; - static write(value: AccountEntry, io: Buffer): void; + static write(value: ScpStatement, io: Buffer): void; - static isValid(value: AccountEntry): boolean; + static isValid(value: ScpStatement): boolean; - static toXDR(value: AccountEntry): Buffer; + static toXDR(value: ScpStatement): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatement; - static fromXDR(input: string, format: "hex" | "base64"): AccountEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpStatement; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineEntryExtensionV2 { - constructor(attributes: { - liquidityPoolUseCount: number; - ext: TrustLineEntryExtensionV2Ext; - }); + class ScpEnvelope { + constructor(attributes: { statement: ScpStatement; signature: Buffer }); - liquidityPoolUseCount(value?: number): number; + statement(value?: ScpStatement): ScpStatement; - ext(value?: TrustLineEntryExtensionV2Ext): TrustLineEntryExtensionV2Ext; + signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TrustLineEntryExtensionV2; + static read(io: Buffer): ScpEnvelope; - static write(value: TrustLineEntryExtensionV2, io: Buffer): void; + static write(value: ScpEnvelope, io: Buffer): void; - static isValid(value: TrustLineEntryExtensionV2): boolean; + static isValid(value: ScpEnvelope): boolean; - static toXDR(value: TrustLineEntryExtensionV2): Buffer; + static toXDR(value: ScpEnvelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExtensionV2; + static fromXDR(input: Buffer, format?: 'raw'): ScpEnvelope; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TrustLineEntryExtensionV2; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpEnvelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineEntryV1 { + class ScpQuorumSet { constructor(attributes: { - liabilities: Liabilities; - ext: TrustLineEntryV1Ext; + threshold: number; + validators: NodeId[]; + innerSets: ScpQuorumSet[]; }); - liabilities(value?: Liabilities): Liabilities; + threshold(value?: number): number; - ext(value?: TrustLineEntryV1Ext): TrustLineEntryV1Ext; + validators(value?: NodeId[]): NodeId[]; - toXDR(format?: "raw"): Buffer; + innerSets(value?: ScpQuorumSet[]): ScpQuorumSet[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): TrustLineEntryV1; + toXDR(format: 'hex' | 'base64'): string; - static write(value: TrustLineEntryV1, io: Buffer): void; + static read(io: Buffer): ScpQuorumSet; - static isValid(value: TrustLineEntryV1): boolean; + static write(value: ScpQuorumSet, io: Buffer): void; - static toXDR(value: TrustLineEntryV1): Buffer; + static isValid(value: ScpQuorumSet): boolean; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryV1; + static toXDR(value: ScpQuorumSet): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScpQuorumSet; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntryV1; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpQuorumSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineEntry { - constructor(attributes: { - accountId: AccountId; - asset: TrustLineAsset; - balance: Int64; - limit: Int64; - flags: number; - ext: TrustLineEntryExt; - }); + class AlphaNum4 { + constructor(attributes: { assetCode: Buffer; issuer: AccountId }); - accountId(value?: AccountId): AccountId; + assetCode(value?: Buffer): Buffer; - asset(value?: TrustLineAsset): TrustLineAsset; + issuer(value?: AccountId): AccountId; - balance(value?: Int64): Int64; + toXDR(format?: 'raw'): Buffer; - limit(value?: Int64): Int64; + toXDR(format: 'hex' | 'base64'): string; - flags(value?: number): number; + static read(io: Buffer): AlphaNum4; - ext(value?: TrustLineEntryExt): TrustLineEntryExt; + static write(value: AlphaNum4, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: AlphaNum4): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: AlphaNum4): Buffer; - static read(io: Buffer): TrustLineEntry; + static fromXDR(input: Buffer, format?: 'raw'): AlphaNum4; - static write(value: TrustLineEntry, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): AlphaNum4; - static isValid(value: TrustLineEntry): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: TrustLineEntry): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntry; + class AlphaNum12 { + constructor(attributes: { assetCode: Buffer; issuer: AccountId }); - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntry; + assetCode(value?: Buffer): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + issuer(value?: AccountId): AccountId; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format?: 'raw'): Buffer; - class OfferEntry { - constructor(attributes: { - sellerId: AccountId; - offerId: Int64; - selling: Asset; - buying: Asset; - amount: Int64; - price: Price; - flags: number; - ext: OfferEntryExt; - }); + toXDR(format: 'hex' | 'base64'): string; - sellerId(value?: AccountId): AccountId; + static read(io: Buffer): AlphaNum12; - offerId(value?: Int64): Int64; + static write(value: AlphaNum12, io: Buffer): void; - selling(value?: Asset): Asset; + static isValid(value: AlphaNum12): boolean; - buying(value?: Asset): Asset; + static toXDR(value: AlphaNum12): Buffer; - amount(value?: Int64): Int64; + static fromXDR(input: Buffer, format?: 'raw'): AlphaNum12; - price(value?: Price): Price; + static fromXDR(input: string, format: 'hex' | 'base64'): AlphaNum12; - flags(value?: number): number; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - ext(value?: OfferEntryExt): OfferEntryExt; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format?: "raw"): Buffer; + class Price { + constructor(attributes: { n: number; d: number }); - toXDR(format: "hex" | "base64"): string; + n(value?: number): number; - static read(io: Buffer): OfferEntry; + d(value?: number): number; - static write(value: OfferEntry, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: OfferEntry): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: OfferEntry): Buffer; + static read(io: Buffer): Price; - static fromXDR(input: Buffer, format?: "raw"): OfferEntry; + static write(value: Price, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): OfferEntry; + static isValid(value: Price): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: Price): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: Buffer, format?: 'raw'): Price; - class DataEntry { - constructor(attributes: { - accountId: AccountId; - dataName: string | Buffer; - dataValue: Buffer; - ext: DataEntryExt; - }); + static fromXDR(input: string, format: 'hex' | 'base64'): Price; - accountId(value?: AccountId): AccountId; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - dataName(value?: string | Buffer): string | Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - dataValue(value?: Buffer): Buffer; + class Liabilities { + constructor(attributes: { buying: Int64; selling: Int64 }); - ext(value?: DataEntryExt): DataEntryExt; + buying(value?: Int64): Int64; + + selling(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): DataEntry; + static read(io: Buffer): Liabilities; - static write(value: DataEntry, io: Buffer): void; + static write(value: Liabilities, io: Buffer): void; - static isValid(value: DataEntry): boolean; + static isValid(value: Liabilities): boolean; - static toXDR(value: DataEntry): Buffer; + static toXDR(value: Liabilities): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DataEntry; + static fromXDR(input: Buffer, format?: 'raw'): Liabilities; - static fromXDR(input: string, format: "hex" | "base64"): DataEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): Liabilities; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimantV0 { - constructor(attributes: { - destination: AccountId; - predicate: ClaimPredicate; - }); + class Signer { + constructor(attributes: { key: SignerKey; weight: number }); - destination(value?: AccountId): AccountId; + key(value?: SignerKey): SignerKey; - predicate(value?: ClaimPredicate): ClaimPredicate; + weight(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimantV0; + static read(io: Buffer): Signer; - static write(value: ClaimantV0, io: Buffer): void; + static write(value: Signer, io: Buffer): void; - static isValid(value: ClaimantV0): boolean; + static isValid(value: Signer): boolean; - static toXDR(value: ClaimantV0): Buffer; + static toXDR(value: Signer): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimantV0; + static fromXDR(input: Buffer, format?: 'raw'): Signer; - static fromXDR(input: string, format: "hex" | "base64"): ClaimantV0; + static fromXDR(input: string, format: 'hex' | 'base64'): Signer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimableBalanceEntryExtensionV1 { + class AccountEntryExtensionV3 { constructor(attributes: { - ext: ClaimableBalanceEntryExtensionV1Ext; - flags: number; + ext: ExtensionPoint; + seqLedger: number; + seqTime: TimePoint; }); - ext( - value?: ClaimableBalanceEntryExtensionV1Ext - ): ClaimableBalanceEntryExtensionV1Ext; + ext(value?: ExtensionPoint): ExtensionPoint; - flags(value?: number): number; + seqLedger(value?: number): number; - toXDR(format?: "raw"): Buffer; + seqTime(value?: TimePoint): TimePoint; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): ClaimableBalanceEntryExtensionV1; + toXDR(format: 'hex' | 'base64'): string; - static write(value: ClaimableBalanceEntryExtensionV1, io: Buffer): void; + static read(io: Buffer): AccountEntryExtensionV3; - static isValid(value: ClaimableBalanceEntryExtensionV1): boolean; + static write(value: AccountEntryExtensionV3, io: Buffer): void; - static toXDR(value: ClaimableBalanceEntryExtensionV1): Buffer; + static isValid(value: AccountEntryExtensionV3): boolean; - static fromXDR( - input: Buffer, - format?: "raw" - ): ClaimableBalanceEntryExtensionV1; + static toXDR(value: AccountEntryExtensionV3): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV3; static fromXDR( input: string, - format: "hex" | "base64" - ): ClaimableBalanceEntryExtensionV1; + format: 'hex' | 'base64', + ): AccountEntryExtensionV3; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimableBalanceEntry { + class AccountEntryExtensionV2 { constructor(attributes: { - balanceId: ClaimableBalanceId; - claimants: Claimant[]; - asset: Asset; - amount: Int64; - ext: ClaimableBalanceEntryExt; + numSponsored: number; + numSponsoring: number; + signerSponsoringIDs: SponsorshipDescriptor[]; + ext: AccountEntryExtensionV2Ext; }); - balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + numSponsored(value?: number): number; - claimants(value?: Claimant[]): Claimant[]; + numSponsoring(value?: number): number; - asset(value?: Asset): Asset; + signerSponsoringIDs( + value?: SponsorshipDescriptor[], + ): SponsorshipDescriptor[]; - amount(value?: Int64): Int64; + ext(value?: AccountEntryExtensionV2Ext): AccountEntryExtensionV2Ext; - ext(value?: ClaimableBalanceEntryExt): ClaimableBalanceEntryExt; + toXDR(format?: 'raw'): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format: "hex" | "base64"): string; + static read(io: Buffer): AccountEntryExtensionV2; - static read(io: Buffer): ClaimableBalanceEntry; + static write(value: AccountEntryExtensionV2, io: Buffer): void; - static write(value: ClaimableBalanceEntry, io: Buffer): void; - - static isValid(value: ClaimableBalanceEntry): boolean; + static isValid(value: AccountEntryExtensionV2): boolean; - static toXDR(value: ClaimableBalanceEntry): Buffer; + static toXDR(value: AccountEntryExtensionV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceEntry; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV2; static fromXDR( input: string, - format: "hex" | "base64" - ): ClaimableBalanceEntry; + format: 'hex' | 'base64', + ): AccountEntryExtensionV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolConstantProductParameters { - constructor(attributes: { assetA: Asset; assetB: Asset; fee: number }); - - assetA(value?: Asset): Asset; + class AccountEntryExtensionV1 { + constructor(attributes: { + liabilities: Liabilities; + ext: AccountEntryExtensionV1Ext; + }); - assetB(value?: Asset): Asset; + liabilities(value?: Liabilities): Liabilities; - fee(value?: number): number; + ext(value?: AccountEntryExtensionV1Ext): AccountEntryExtensionV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LiquidityPoolConstantProductParameters; + static read(io: Buffer): AccountEntryExtensionV1; - static write( - value: LiquidityPoolConstantProductParameters, - io: Buffer - ): void; + static write(value: AccountEntryExtensionV1, io: Buffer): void; - static isValid(value: LiquidityPoolConstantProductParameters): boolean; + static isValid(value: AccountEntryExtensionV1): boolean; - static toXDR(value: LiquidityPoolConstantProductParameters): Buffer; + static toXDR(value: AccountEntryExtensionV1): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): LiquidityPoolConstantProductParameters; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" - ): LiquidityPoolConstantProductParameters; + format: 'hex' | 'base64', + ): AccountEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolEntryConstantProduct { + class AccountEntry { constructor(attributes: { - params: LiquidityPoolConstantProductParameters; - reserveA: Int64; - reserveB: Int64; - totalPoolShares: Int64; - poolSharesTrustLineCount: Int64; + accountId: AccountId; + balance: Int64; + seqNum: SequenceNumber; + numSubEntries: number; + inflationDest: null | AccountId; + flags: number; + homeDomain: string | Buffer; + thresholds: Buffer; + signers: Signer[]; + ext: AccountEntryExt; }); - params( - value?: LiquidityPoolConstantProductParameters - ): LiquidityPoolConstantProductParameters; - - reserveA(value?: Int64): Int64; - - reserveB(value?: Int64): Int64; - - totalPoolShares(value?: Int64): Int64; - - poolSharesTrustLineCount(value?: Int64): Int64; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): LiquidityPoolEntryConstantProduct; - - static write(value: LiquidityPoolEntryConstantProduct, io: Buffer): void; + accountId(value?: AccountId): AccountId; - static isValid(value: LiquidityPoolEntryConstantProduct): boolean; + balance(value?: Int64): Int64; - static toXDR(value: LiquidityPoolEntryConstantProduct): Buffer; + seqNum(value?: SequenceNumber): SequenceNumber; - static fromXDR( - input: Buffer, - format?: "raw" - ): LiquidityPoolEntryConstantProduct; + numSubEntries(value?: number): number; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LiquidityPoolEntryConstantProduct; + inflationDest(value?: null | AccountId): null | AccountId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + flags(value?: number): number; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + homeDomain(value?: string | Buffer): string | Buffer; - class LiquidityPoolEntry { - constructor(attributes: { - liquidityPoolId: PoolId; - body: LiquidityPoolEntryBody; - }); + thresholds(value?: Buffer): Buffer; - liquidityPoolId(value?: PoolId): PoolId; + signers(value?: Signer[]): Signer[]; - body(value?: LiquidityPoolEntryBody): LiquidityPoolEntryBody; + ext(value?: AccountEntryExt): AccountEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LiquidityPoolEntry; + static read(io: Buffer): AccountEntry; - static write(value: LiquidityPoolEntry, io: Buffer): void; + static write(value: AccountEntry, io: Buffer): void; - static isValid(value: LiquidityPoolEntry): boolean; + static isValid(value: AccountEntry): boolean; - static toXDR(value: LiquidityPoolEntry): Buffer; + static toXDR(value: AccountEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolEntry; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntry; - static fromXDR(input: string, format: "hex" | "base64"): LiquidityPoolEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): AccountEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntryExtensionV1 { + class TrustLineEntryExtensionV2 { constructor(attributes: { - sponsoringId: SponsorshipDescriptor; - ext: LedgerEntryExtensionV1Ext; + liquidityPoolUseCount: number; + ext: TrustLineEntryExtensionV2Ext; }); - sponsoringId(value?: SponsorshipDescriptor): SponsorshipDescriptor; + liquidityPoolUseCount(value?: number): number; - ext(value?: LedgerEntryExtensionV1Ext): LedgerEntryExtensionV1Ext; + ext(value?: TrustLineEntryExtensionV2Ext): TrustLineEntryExtensionV2Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntryExtensionV1; + static read(io: Buffer): TrustLineEntryExtensionV2; - static write(value: LedgerEntryExtensionV1, io: Buffer): void; + static write(value: TrustLineEntryExtensionV2, io: Buffer): void; - static isValid(value: LedgerEntryExtensionV1): boolean; + static isValid(value: TrustLineEntryExtensionV2): boolean; - static toXDR(value: LedgerEntryExtensionV1): Buffer; + static toXDR(value: TrustLineEntryExtensionV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExtensionV1; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExtensionV2; static fromXDR( input: string, - format: "hex" | "base64" - ): LedgerEntryExtensionV1; + format: 'hex' | 'base64', + ): TrustLineEntryExtensionV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntry { + class TrustLineEntryV1 { constructor(attributes: { - lastModifiedLedgerSeq: number; - data: LedgerEntryData; - ext: LedgerEntryExt; + liabilities: Liabilities; + ext: TrustLineEntryV1Ext; }); - lastModifiedLedgerSeq(value?: number): number; - - data(value?: LedgerEntryData): LedgerEntryData; + liabilities(value?: Liabilities): Liabilities; - ext(value?: LedgerEntryExt): LedgerEntryExt; + ext(value?: TrustLineEntryV1Ext): TrustLineEntryV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntry; + static read(io: Buffer): TrustLineEntryV1; - static write(value: LedgerEntry, io: Buffer): void; + static write(value: TrustLineEntryV1, io: Buffer): void; - static isValid(value: LedgerEntry): boolean; + static isValid(value: TrustLineEntryV1): boolean; - static toXDR(value: LedgerEntry): Buffer; + static toXDR(value: TrustLineEntryV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntry; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryV1; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntryV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKeyAccount { - constructor(attributes: { accountId: AccountId }); + class TrustLineEntry { + constructor(attributes: { + accountId: AccountId; + asset: TrustLineAsset; + balance: Int64; + limit: Int64; + flags: number; + ext: TrustLineEntryExt; + }); accountId(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): LedgerKeyAccount; + asset(value?: TrustLineAsset): TrustLineAsset; - static write(value: LedgerKeyAccount, io: Buffer): void; + balance(value?: Int64): Int64; - static isValid(value: LedgerKeyAccount): boolean; + limit(value?: Int64): Int64; - static toXDR(value: LedgerKeyAccount): Buffer; + flags(value?: number): number; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyAccount; + ext(value?: TrustLineEntryExt): TrustLineEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyAccount; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static read(io: Buffer): TrustLineEntry; - class LedgerKeyTrustLine { - constructor(attributes: { accountId: AccountId; asset: TrustLineAsset }); + static write(value: TrustLineEntry, io: Buffer): void; - accountId(value?: AccountId): AccountId; + static isValid(value: TrustLineEntry): boolean; - asset(value?: TrustLineAsset): TrustLineAsset; + static toXDR(value: TrustLineEntry): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntry; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntry; - static read(io: Buffer): LedgerKeyTrustLine; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: LedgerKeyTrustLine, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: LedgerKeyTrustLine): boolean; + class OfferEntry { + constructor(attributes: { + sellerId: AccountId; + offerId: Int64; + selling: Asset; + buying: Asset; + amount: Int64; + price: Price; + flags: number; + ext: OfferEntryExt; + }); - static toXDR(value: LedgerKeyTrustLine): Buffer; + sellerId(value?: AccountId): AccountId; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyTrustLine; + offerId(value?: Int64): Int64; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyTrustLine; + selling(value?: Asset): Asset; - static validateXDR(input: Buffer, format?: "raw"): boolean; + buying(value?: Asset): Asset; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + amount(value?: Int64): Int64; - class LedgerKeyOffer { - constructor(attributes: { sellerId: AccountId; offerId: Int64 }); + price(value?: Price): Price; - sellerId(value?: AccountId): AccountId; + flags(value?: number): number; - offerId(value?: Int64): Int64; + ext(value?: OfferEntryExt): OfferEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerKeyOffer; + static read(io: Buffer): OfferEntry; - static write(value: LedgerKeyOffer, io: Buffer): void; + static write(value: OfferEntry, io: Buffer): void; - static isValid(value: LedgerKeyOffer): boolean; + static isValid(value: OfferEntry): boolean; - static toXDR(value: LedgerKeyOffer): Buffer; + static toXDR(value: OfferEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyOffer; + static fromXDR(input: Buffer, format?: 'raw'): OfferEntry; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyOffer; + static fromXDR(input: string, format: 'hex' | 'base64'): OfferEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKeyData { + class DataEntry { constructor(attributes: { accountId: AccountId; dataName: string | Buffer; + dataValue: Buffer; + ext: DataEntryExt; }); accountId(value?: AccountId): AccountId; dataName(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): LedgerKeyData; + dataValue(value?: Buffer): Buffer; - static write(value: LedgerKeyData, io: Buffer): void; + ext(value?: DataEntryExt): DataEntryExt; - static isValid(value: LedgerKeyData): boolean; + toXDR(format?: 'raw'): Buffer; - static toXDR(value: LedgerKeyData): Buffer; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyData; + static read(io: Buffer): DataEntry; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyData; + static write(value: DataEntry, io: Buffer): void; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static isValid(value: DataEntry): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static toXDR(value: DataEntry): Buffer; - class LedgerKeyClaimableBalance { - constructor(attributes: { balanceId: ClaimableBalanceId }); + static fromXDR(input: Buffer, format?: 'raw'): DataEntry; - balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + static fromXDR(input: string, format: 'hex' | 'base64'): DataEntry; - toXDR(format?: "raw"): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static read(io: Buffer): LedgerKeyClaimableBalance; + class ClaimantV0 { + constructor(attributes: { + destination: AccountId; + predicate: ClaimPredicate; + }); - static write(value: LedgerKeyClaimableBalance, io: Buffer): void; + destination(value?: AccountId): AccountId; - static isValid(value: LedgerKeyClaimableBalance): boolean; + predicate(value?: ClaimPredicate): ClaimPredicate; - static toXDR(value: LedgerKeyClaimableBalance): Buffer; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyClaimableBalance; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LedgerKeyClaimableBalance; + static read(io: Buffer): ClaimantV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static write(value: ClaimantV0, io: Buffer): void; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static isValid(value: ClaimantV0): boolean; - class LedgerKeyLiquidityPool { - constructor(attributes: { liquidityPoolId: PoolId }); + static toXDR(value: ClaimantV0): Buffer; - liquidityPoolId(value?: PoolId): PoolId; + static fromXDR(input: Buffer, format?: 'raw'): ClaimantV0; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimantV0; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static read(io: Buffer): LedgerKeyLiquidityPool; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static write(value: LedgerKeyLiquidityPool, io: Buffer): void; - - static isValid(value: LedgerKeyLiquidityPool): boolean; - - static toXDR(value: LedgerKeyLiquidityPool): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyLiquidityPool; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): LedgerKeyLiquidityPool; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class LedgerCloseValueSignature { - constructor(attributes: { nodeId: NodeId; signature: Buffer }); + class ClaimableBalanceEntryExtensionV1 { + constructor(attributes: { + ext: ClaimableBalanceEntryExtensionV1Ext; + flags: number; + }); - nodeId(value?: NodeId): NodeId; + ext( + value?: ClaimableBalanceEntryExtensionV1Ext, + ): ClaimableBalanceEntryExtensionV1Ext; - signature(value?: Buffer): Buffer; + flags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerCloseValueSignature; + static read(io: Buffer): ClaimableBalanceEntryExtensionV1; - static write(value: LedgerCloseValueSignature, io: Buffer): void; + static write(value: ClaimableBalanceEntryExtensionV1, io: Buffer): void; - static isValid(value: LedgerCloseValueSignature): boolean; + static isValid(value: ClaimableBalanceEntryExtensionV1): boolean; - static toXDR(value: LedgerCloseValueSignature): Buffer; + static toXDR(value: ClaimableBalanceEntryExtensionV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseValueSignature; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ClaimableBalanceEntryExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" - ): LedgerCloseValueSignature; + format: 'hex' | 'base64', + ): ClaimableBalanceEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class StellarValue { + class ClaimableBalanceEntry { constructor(attributes: { - txSetHash: Buffer; - closeTime: TimePoint; - upgrades: Buffer[]; - ext: StellarValueExt; + balanceId: ClaimableBalanceId; + claimants: Claimant[]; + asset: Asset; + amount: Int64; + ext: ClaimableBalanceEntryExt; }); - txSetHash(value?: Buffer): Buffer; + balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - closeTime(value?: TimePoint): TimePoint; + claimants(value?: Claimant[]): Claimant[]; - upgrades(value?: Buffer[]): Buffer[]; + asset(value?: Asset): Asset; - ext(value?: StellarValueExt): StellarValueExt; + amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + ext(value?: ClaimableBalanceEntryExt): ClaimableBalanceEntryExt; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): StellarValue; + toXDR(format: 'hex' | 'base64'): string; - static write(value: StellarValue, io: Buffer): void; + static read(io: Buffer): ClaimableBalanceEntry; - static isValid(value: StellarValue): boolean; + static write(value: ClaimableBalanceEntry, io: Buffer): void; - static toXDR(value: StellarValue): Buffer; + static isValid(value: ClaimableBalanceEntry): boolean; + + static toXDR(value: ClaimableBalanceEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): StellarValue; + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceEntry; - static fromXDR(input: string, format: "hex" | "base64"): StellarValue; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ClaimableBalanceEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeaderExtensionV1 { - constructor(attributes: { flags: number; ext: LedgerHeaderExtensionV1Ext }); + class LiquidityPoolConstantProductParameters { + constructor(attributes: { assetA: Asset; assetB: Asset; fee: number }); - flags(value?: number): number; + assetA(value?: Asset): Asset; - ext(value?: LedgerHeaderExtensionV1Ext): LedgerHeaderExtensionV1Ext; + assetB(value?: Asset): Asset; + + fee(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerHeaderExtensionV1; + static read(io: Buffer): LiquidityPoolConstantProductParameters; - static write(value: LedgerHeaderExtensionV1, io: Buffer): void; + static write( + value: LiquidityPoolConstantProductParameters, + io: Buffer, + ): void; - static isValid(value: LedgerHeaderExtensionV1): boolean; + static isValid(value: LiquidityPoolConstantProductParameters): boolean; - static toXDR(value: LedgerHeaderExtensionV1): Buffer; + static toXDR(value: LiquidityPoolConstantProductParameters): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExtensionV1; + static fromXDR( + input: Buffer, + format?: 'raw', + ): LiquidityPoolConstantProductParameters; static fromXDR( input: string, - format: "hex" | "base64" - ): LedgerHeaderExtensionV1; + format: 'hex' | 'base64', + ): LiquidityPoolConstantProductParameters; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeader { + class LiquidityPoolEntryConstantProduct { constructor(attributes: { - ledgerVersion: number; - previousLedgerHash: Buffer; - scpValue: StellarValue; - txSetResultHash: Buffer; - bucketListHash: Buffer; - ledgerSeq: number; - totalCoins: Int64; - feePool: Int64; - inflationSeq: number; - idPool: Uint64; - baseFee: number; - baseReserve: number; - maxTxSetSize: number; - skipList: Buffer[]; - ext: LedgerHeaderExt; + params: LiquidityPoolConstantProductParameters; + reserveA: Int64; + reserveB: Int64; + totalPoolShares: Int64; + poolSharesTrustLineCount: Int64; }); - ledgerVersion(value?: number): number; + params( + value?: LiquidityPoolConstantProductParameters, + ): LiquidityPoolConstantProductParameters; - previousLedgerHash(value?: Buffer): Buffer; + reserveA(value?: Int64): Int64; - scpValue(value?: StellarValue): StellarValue; + reserveB(value?: Int64): Int64; - txSetResultHash(value?: Buffer): Buffer; + totalPoolShares(value?: Int64): Int64; - bucketListHash(value?: Buffer): Buffer; + poolSharesTrustLineCount(value?: Int64): Int64; - ledgerSeq(value?: number): number; + toXDR(format?: 'raw'): Buffer; - totalCoins(value?: Int64): Int64; + toXDR(format: 'hex' | 'base64'): string; - feePool(value?: Int64): Int64; + static read(io: Buffer): LiquidityPoolEntryConstantProduct; - inflationSeq(value?: number): number; + static write(value: LiquidityPoolEntryConstantProduct, io: Buffer): void; - idPool(value?: Uint64): Uint64; + static isValid(value: LiquidityPoolEntryConstantProduct): boolean; - baseFee(value?: number): number; + static toXDR(value: LiquidityPoolEntryConstantProduct): Buffer; - baseReserve(value?: number): number; + static fromXDR( + input: Buffer, + format?: 'raw', + ): LiquidityPoolEntryConstantProduct; - maxTxSetSize(value?: number): number; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolEntryConstantProduct; - skipList(value?: Buffer[]): Buffer[]; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - ext(value?: LedgerHeaderExt): LedgerHeaderExt; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format?: "raw"): Buffer; + class LiquidityPoolEntry { + constructor(attributes: { + liquidityPoolId: PoolId; + body: LiquidityPoolEntryBody; + }); - toXDR(format: "hex" | "base64"): string; + liquidityPoolId(value?: PoolId): PoolId; - static read(io: Buffer): LedgerHeader; + body(value?: LiquidityPoolEntryBody): LiquidityPoolEntryBody; - static write(value: LedgerHeader, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: LedgerHeader): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: LedgerHeader): Buffer; + static read(io: Buffer): LiquidityPoolEntry; + + static write(value: LiquidityPoolEntry, io: Buffer): void; + + static isValid(value: LiquidityPoolEntry): boolean; + + static toXDR(value: LiquidityPoolEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeader; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolEntry; - static fromXDR(input: string, format: "hex" | "base64"): LedgerHeader; + static fromXDR(input: string, format: 'hex' | 'base64'): LiquidityPoolEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BucketMetadata { - constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); + class ContractDataEntry { + constructor(attributes: { + ext: ExtensionPoint; + contract: ScAddress; + key: ScVal; + durability: ContractDataDurability; + val: ScVal; + }); - ledgerVersion(value?: number): number; + ext(value?: ExtensionPoint): ExtensionPoint; - ext(value?: BucketMetadataExt): BucketMetadataExt; + contract(value?: ScAddress): ScAddress; - toXDR(format?: "raw"): Buffer; + key(value?: ScVal): ScVal; - toXDR(format: "hex" | "base64"): string; + durability(value?: ContractDataDurability): ContractDataDurability; - static read(io: Buffer): BucketMetadata; + val(value?: ScVal): ScVal; - static write(value: BucketMetadata, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: BucketMetadata): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: BucketMetadata): Buffer; + static read(io: Buffer): ContractDataEntry; - static fromXDR(input: Buffer, format?: "raw"): BucketMetadata; + static write(value: ContractDataEntry, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): BucketMetadata; + static isValid(value: ContractDataEntry): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: ContractDataEntry): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ContractDataEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ContractDataEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TxSetComponentTxsMaybeDiscountedFee { + class ContractCodeEntry { constructor(attributes: { - baseFee: null | Int64; - txes: TransactionEnvelope[]; + ext: ExtensionPoint; + hash: Buffer; + code: Buffer; }); - baseFee(value?: null | Int64): null | Int64; + ext(value?: ExtensionPoint): ExtensionPoint; - txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; + hash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + code(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): TxSetComponentTxsMaybeDiscountedFee; + toXDR(format: 'hex' | 'base64'): string; - static write(value: TxSetComponentTxsMaybeDiscountedFee, io: Buffer): void; + static read(io: Buffer): ContractCodeEntry; - static isValid(value: TxSetComponentTxsMaybeDiscountedFee): boolean; + static write(value: ContractCodeEntry, io: Buffer): void; - static toXDR(value: TxSetComponentTxsMaybeDiscountedFee): Buffer; + static isValid(value: ContractCodeEntry): boolean; - static fromXDR( - input: Buffer, - format?: "raw" - ): TxSetComponentTxsMaybeDiscountedFee; + static toXDR(value: ContractCodeEntry): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TxSetComponentTxsMaybeDiscountedFee; + static fromXDR(input: Buffer, format?: 'raw'): ContractCodeEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractCodeEntry; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionSet { - constructor(attributes: { - previousLedgerHash: Buffer; - txes: TransactionEnvelope[]; - }); + class ExpirationEntry { + constructor(attributes: { keyHash: Buffer; expirationLedgerSeq: number }); - previousLedgerHash(value?: Buffer): Buffer; + keyHash(value?: Buffer): Buffer; - txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; + expirationLedgerSeq(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionSet; + static read(io: Buffer): ExpirationEntry; - static write(value: TransactionSet, io: Buffer): void; + static write(value: ExpirationEntry, io: Buffer): void; - static isValid(value: TransactionSet): boolean; + static isValid(value: ExpirationEntry): boolean; - static toXDR(value: TransactionSet): Buffer; + static toXDR(value: ExpirationEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionSet; + static fromXDR(input: Buffer, format?: 'raw'): ExpirationEntry; - static fromXDR(input: string, format: "hex" | "base64"): TransactionSet; + static fromXDR(input: string, format: 'hex' | 'base64'): ExpirationEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionSetV1 { + class LedgerEntryExtensionV1 { constructor(attributes: { - previousLedgerHash: Buffer; - phases: TransactionPhase[]; + sponsoringId: SponsorshipDescriptor; + ext: LedgerEntryExtensionV1Ext; }); - previousLedgerHash(value?: Buffer): Buffer; + sponsoringId(value?: SponsorshipDescriptor): SponsorshipDescriptor; - phases(value?: TransactionPhase[]): TransactionPhase[]; + ext(value?: LedgerEntryExtensionV1Ext): LedgerEntryExtensionV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionSetV1; + static read(io: Buffer): LedgerEntryExtensionV1; - static write(value: TransactionSetV1, io: Buffer): void; + static write(value: LedgerEntryExtensionV1, io: Buffer): void; - static isValid(value: TransactionSetV1): boolean; + static isValid(value: LedgerEntryExtensionV1): boolean; - static toXDR(value: TransactionSetV1): Buffer; + static toXDR(value: LedgerEntryExtensionV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionSetV1; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExtensionV1; - static fromXDR(input: string, format: "hex" | "base64"): TransactionSetV1; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultPair { + class LedgerEntry { constructor(attributes: { - transactionHash: Buffer; - result: TransactionResult; + lastModifiedLedgerSeq: number; + data: LedgerEntryData; + ext: LedgerEntryExt; }); - transactionHash(value?: Buffer): Buffer; + lastModifiedLedgerSeq(value?: number): number; - result(value?: TransactionResult): TransactionResult; + data(value?: LedgerEntryData): LedgerEntryData; - toXDR(format?: "raw"): Buffer; + ext(value?: LedgerEntryExt): LedgerEntryExt; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): TransactionResultPair; + toXDR(format: 'hex' | 'base64'): string; - static write(value: TransactionResultPair, io: Buffer): void; + static read(io: Buffer): LedgerEntry; - static isValid(value: TransactionResultPair): boolean; + static write(value: LedgerEntry, io: Buffer): void; - static toXDR(value: TransactionResultPair): Buffer; + static isValid(value: LedgerEntry): boolean; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultPair; + static toXDR(value: LedgerEntry): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionResultPair; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntry; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultSet { - constructor(attributes: { results: TransactionResultPair[] }); + class LedgerKeyAccount { + constructor(attributes: { accountId: AccountId }); - results(value?: TransactionResultPair[]): TransactionResultPair[]; + accountId(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultSet; + static read(io: Buffer): LedgerKeyAccount; - static write(value: TransactionResultSet, io: Buffer): void; + static write(value: LedgerKeyAccount, io: Buffer): void; - static isValid(value: TransactionResultSet): boolean; + static isValid(value: LedgerKeyAccount): boolean; - static toXDR(value: TransactionResultSet): Buffer; + static toXDR(value: LedgerKeyAccount): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultSet; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyAccount; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionResultSet; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyAccount; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionHistoryEntry { - constructor(attributes: { - ledgerSeq: number; - txSet: TransactionSet; - ext: TransactionHistoryEntryExt; - }); - - ledgerSeq(value?: number): number; + class LedgerKeyTrustLine { + constructor(attributes: { accountId: AccountId; asset: TrustLineAsset }); - txSet(value?: TransactionSet): TransactionSet; + accountId(value?: AccountId): AccountId; - ext(value?: TransactionHistoryEntryExt): TransactionHistoryEntryExt; + asset(value?: TrustLineAsset): TrustLineAsset; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionHistoryEntry; + static read(io: Buffer): LedgerKeyTrustLine; - static write(value: TransactionHistoryEntry, io: Buffer): void; + static write(value: LedgerKeyTrustLine, io: Buffer): void; - static isValid(value: TransactionHistoryEntry): boolean; + static isValid(value: LedgerKeyTrustLine): boolean; - static toXDR(value: TransactionHistoryEntry): Buffer; + static toXDR(value: LedgerKeyTrustLine): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyTrustLine; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionHistoryEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyTrustLine; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionHistoryResultEntry { - constructor(attributes: { - ledgerSeq: number; - txResultSet: TransactionResultSet; - ext: TransactionHistoryResultEntryExt; - }); - - ledgerSeq(value?: number): number; + class LedgerKeyOffer { + constructor(attributes: { sellerId: AccountId; offerId: Int64 }); - txResultSet(value?: TransactionResultSet): TransactionResultSet; + sellerId(value?: AccountId): AccountId; - ext( - value?: TransactionHistoryResultEntryExt - ): TransactionHistoryResultEntryExt; + offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionHistoryResultEntry; + static read(io: Buffer): LedgerKeyOffer; - static write(value: TransactionHistoryResultEntry, io: Buffer): void; + static write(value: LedgerKeyOffer, io: Buffer): void; - static isValid(value: TransactionHistoryResultEntry): boolean; + static isValid(value: LedgerKeyOffer): boolean; - static toXDR(value: TransactionHistoryResultEntry): Buffer; + static toXDR(value: LedgerKeyOffer): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): TransactionHistoryResultEntry; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyOffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionHistoryResultEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyOffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeaderHistoryEntry { + class LedgerKeyData { constructor(attributes: { - hash: Buffer; - header: LedgerHeader; - ext: LedgerHeaderHistoryEntryExt; + accountId: AccountId; + dataName: string | Buffer; }); - hash(value?: Buffer): Buffer; - - header(value?: LedgerHeader): LedgerHeader; + accountId(value?: AccountId): AccountId; - ext(value?: LedgerHeaderHistoryEntryExt): LedgerHeaderHistoryEntryExt; + dataName(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerHeaderHistoryEntry; + static read(io: Buffer): LedgerKeyData; - static write(value: LedgerHeaderHistoryEntry, io: Buffer): void; + static write(value: LedgerKeyData, io: Buffer): void; - static isValid(value: LedgerHeaderHistoryEntry): boolean; + static isValid(value: LedgerKeyData): boolean; - static toXDR(value: LedgerHeaderHistoryEntry): Buffer; + static toXDR(value: LedgerKeyData): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyData; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LedgerHeaderHistoryEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyData; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerScpMessages { - constructor(attributes: { ledgerSeq: number; messages: ScpEnvelope[] }); - - ledgerSeq(value?: number): number; + class LedgerKeyClaimableBalance { + constructor(attributes: { balanceId: ClaimableBalanceId }); - messages(value?: ScpEnvelope[]): ScpEnvelope[]; + balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerScpMessages; + static read(io: Buffer): LedgerKeyClaimableBalance; - static write(value: LedgerScpMessages, io: Buffer): void; + static write(value: LedgerKeyClaimableBalance, io: Buffer): void; - static isValid(value: LedgerScpMessages): boolean; + static isValid(value: LedgerKeyClaimableBalance): boolean; - static toXDR(value: LedgerScpMessages): Buffer; + static toXDR(value: LedgerKeyClaimableBalance): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerScpMessages; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyClaimableBalance; - static fromXDR(input: string, format: "hex" | "base64"): LedgerScpMessages; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyClaimableBalance; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScpHistoryEntryV0 { - constructor(attributes: { - quorumSets: ScpQuorumSet[]; - ledgerMessages: LedgerScpMessages; - }); - - quorumSets(value?: ScpQuorumSet[]): ScpQuorumSet[]; + class LedgerKeyLiquidityPool { + constructor(attributes: { liquidityPoolId: PoolId }); - ledgerMessages(value?: LedgerScpMessages): LedgerScpMessages; + liquidityPoolId(value?: PoolId): PoolId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScpHistoryEntryV0; + static read(io: Buffer): LedgerKeyLiquidityPool; - static write(value: ScpHistoryEntryV0, io: Buffer): void; + static write(value: LedgerKeyLiquidityPool, io: Buffer): void; - static isValid(value: ScpHistoryEntryV0): boolean; + static isValid(value: LedgerKeyLiquidityPool): boolean; - static toXDR(value: ScpHistoryEntryV0): Buffer; + static toXDR(value: LedgerKeyLiquidityPool): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpHistoryEntryV0; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyLiquidityPool; - static fromXDR(input: string, format: "hex" | "base64"): ScpHistoryEntryV0; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyLiquidityPool; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class OperationMeta { - constructor(attributes: { changes: LedgerEntryChange[] }); - - changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; + class LedgerKeyContractData { + constructor(attributes: { + contract: ScAddress; + key: ScVal; + durability: ContractDataDurability; + }); - toXDR(format?: "raw"): Buffer; + contract(value?: ScAddress): ScAddress; - toXDR(format: "hex" | "base64"): string; + key(value?: ScVal): ScVal; - static read(io: Buffer): OperationMeta; + durability(value?: ContractDataDurability): ContractDataDurability; - static write(value: OperationMeta, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: OperationMeta): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: OperationMeta): Buffer; + static read(io: Buffer): LedgerKeyContractData; - static fromXDR(input: Buffer, format?: "raw"): OperationMeta; + static write(value: LedgerKeyContractData, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): OperationMeta; + static isValid(value: LedgerKeyContractData): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: LedgerKeyContractData): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyContractData; - class TransactionMetaV1 { - constructor(attributes: { - txChanges: LedgerEntryChange[]; - operations: OperationMeta[]; - }); + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyContractData; - txChanges(value?: LedgerEntryChange[]): LedgerEntryChange[]; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - operations(value?: OperationMeta[]): OperationMeta[]; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format?: "raw"): Buffer; + class LedgerKeyContractCode { + constructor(attributes: { hash: Buffer }); - toXDR(format: "hex" | "base64"): string; + hash(value?: Buffer): Buffer; - static read(io: Buffer): TransactionMetaV1; + toXDR(format?: 'raw'): Buffer; - static write(value: TransactionMetaV1, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: TransactionMetaV1): boolean; + static read(io: Buffer): LedgerKeyContractCode; - static toXDR(value: TransactionMetaV1): Buffer; + static write(value: LedgerKeyContractCode, io: Buffer): void; - static fromXDR(input: Buffer, format?: "raw"): TransactionMetaV1; + static isValid(value: LedgerKeyContractCode): boolean; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMetaV1; + static toXDR(value: LedgerKeyContractCode): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyContractCode; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyContractCode; - class TransactionMetaV2 { - constructor(attributes: { - txChangesBefore: LedgerEntryChange[]; - operations: OperationMeta[]; - txChangesAfter: LedgerEntryChange[]; - }); + static validateXDR(input: Buffer, format?: 'raw'): boolean; - txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - operations(value?: OperationMeta[]): OperationMeta[]; + class LedgerKeyConfigSetting { + constructor(attributes: { configSettingId: ConfigSettingId }); - txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; + configSettingId(value?: ConfigSettingId): ConfigSettingId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionMetaV2; + static read(io: Buffer): LedgerKeyConfigSetting; - static write(value: TransactionMetaV2, io: Buffer): void; + static write(value: LedgerKeyConfigSetting, io: Buffer): void; - static isValid(value: TransactionMetaV2): boolean; + static isValid(value: LedgerKeyConfigSetting): boolean; - static toXDR(value: TransactionMetaV2): Buffer; + static toXDR(value: LedgerKeyConfigSetting): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyConfigSetting; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMetaV2; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyConfigSetting; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultMeta { - constructor(attributes: { - result: TransactionResultPair; - feeProcessing: LedgerEntryChange[]; - txApplyProcessing: TransactionMeta; - }); - - result(value?: TransactionResultPair): TransactionResultPair; - - feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + class LedgerKeyExpiration { + constructor(attributes: { keyHash: Buffer }); - txApplyProcessing(value?: TransactionMeta): TransactionMeta; + keyHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultMeta; + static read(io: Buffer): LedgerKeyExpiration; - static write(value: TransactionResultMeta, io: Buffer): void; + static write(value: LedgerKeyExpiration, io: Buffer): void; - static isValid(value: TransactionResultMeta): boolean; + static isValid(value: LedgerKeyExpiration): boolean; - static toXDR(value: TransactionResultMeta): Buffer; + static toXDR(value: LedgerKeyExpiration): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultMeta; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyExpiration; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionResultMeta; + format: 'hex' | 'base64', + ): LedgerKeyExpiration; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class UpgradeEntryMeta { - constructor(attributes: { - upgrade: LedgerUpgrade; - changes: LedgerEntryChange[]; - }); + class LedgerCloseValueSignature { + constructor(attributes: { nodeId: NodeId; signature: Buffer }); - upgrade(value?: LedgerUpgrade): LedgerUpgrade; + nodeId(value?: NodeId): NodeId; - changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; + signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): UpgradeEntryMeta; + static read(io: Buffer): LedgerCloseValueSignature; - static write(value: UpgradeEntryMeta, io: Buffer): void; + static write(value: LedgerCloseValueSignature, io: Buffer): void; - static isValid(value: UpgradeEntryMeta): boolean; + static isValid(value: LedgerCloseValueSignature): boolean; - static toXDR(value: UpgradeEntryMeta): Buffer; + static toXDR(value: LedgerCloseValueSignature): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UpgradeEntryMeta; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseValueSignature; - static fromXDR(input: string, format: "hex" | "base64"): UpgradeEntryMeta; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerCloseValueSignature; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerCloseMetaV0 { + class StellarValue { constructor(attributes: { - ledgerHeader: LedgerHeaderHistoryEntry; - txSet: TransactionSet; - txProcessing: TransactionResultMeta[]; - upgradesProcessing: UpgradeEntryMeta[]; - scpInfo: ScpHistoryEntry[]; + txSetHash: Buffer; + closeTime: TimePoint; + upgrades: Buffer[]; + ext: StellarValueExt; }); - ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - - txSet(value?: TransactionSet): TransactionSet; + txSetHash(value?: Buffer): Buffer; - txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; + closeTime(value?: TimePoint): TimePoint; - upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + upgrades(value?: Buffer[]): Buffer[]; - scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + ext(value?: StellarValueExt): StellarValueExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerCloseMetaV0; + static read(io: Buffer): StellarValue; - static write(value: LedgerCloseMetaV0, io: Buffer): void; + static write(value: StellarValue, io: Buffer): void; - static isValid(value: LedgerCloseMetaV0): boolean; + static isValid(value: StellarValue): boolean; - static toXDR(value: LedgerCloseMetaV0): Buffer; + static toXDR(value: StellarValue): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMetaV0; + static fromXDR(input: Buffer, format?: 'raw'): StellarValue; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMetaV0; + static fromXDR(input: string, format: 'hex' | 'base64'): StellarValue; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerCloseMetaV1 { - constructor(attributes: { - ledgerHeader: LedgerHeaderHistoryEntry; - txSet: GeneralizedTransactionSet; - txProcessing: TransactionResultMeta[]; - upgradesProcessing: UpgradeEntryMeta[]; - scpInfo: ScpHistoryEntry[]; - }); + class LedgerHeaderExtensionV1 { + constructor(attributes: { flags: number; ext: LedgerHeaderExtensionV1Ext }); - ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; + flags(value?: number): number; - txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; + ext(value?: LedgerHeaderExtensionV1Ext): LedgerHeaderExtensionV1Ext; - txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; + toXDR(format?: 'raw'): Buffer; - upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; + toXDR(format: 'hex' | 'base64'): string; - scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; + static read(io: Buffer): LedgerHeaderExtensionV1; - toXDR(format?: "raw"): Buffer; + static write(value: LedgerHeaderExtensionV1, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: LedgerHeaderExtensionV1): boolean; - static read(io: Buffer): LedgerCloseMetaV1; + static toXDR(value: LedgerHeaderExtensionV1): Buffer; - static write(value: LedgerCloseMetaV1, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExtensionV1; - static isValid(value: LedgerCloseMetaV1): boolean; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerHeaderExtensionV1; - static toXDR(value: LedgerCloseMetaV1): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMetaV1; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMetaV1; + class LedgerHeader { + constructor(attributes: { + ledgerVersion: number; + previousLedgerHash: Buffer; + scpValue: StellarValue; + txSetResultHash: Buffer; + bucketListHash: Buffer; + ledgerSeq: number; + totalCoins: Int64; + feePool: Int64; + inflationSeq: number; + idPool: Uint64; + baseFee: number; + baseReserve: number; + maxTxSetSize: number; + skipList: Buffer[]; + ext: LedgerHeaderExt; + }); - static validateXDR(input: Buffer, format?: "raw"): boolean; + ledgerVersion(value?: number): number; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + previousLedgerHash(value?: Buffer): Buffer; - class Error { - constructor(attributes: { code: ErrorCode; msg: string | Buffer }); + scpValue(value?: StellarValue): StellarValue; - code(value?: ErrorCode): ErrorCode; + txSetResultHash(value?: Buffer): Buffer; - msg(value?: string | Buffer): string | Buffer; + bucketListHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + ledgerSeq(value?: number): number; - toXDR(format: "hex" | "base64"): string; + totalCoins(value?: Int64): Int64; - static read(io: Buffer): Error; + feePool(value?: Int64): Int64; - static write(value: Error, io: Buffer): void; + inflationSeq(value?: number): number; - static isValid(value: Error): boolean; + idPool(value?: Uint64): Uint64; - static toXDR(value: Error): Buffer; + baseFee(value?: number): number; - static fromXDR(input: Buffer, format?: "raw"): Error; + baseReserve(value?: number): number; - static fromXDR(input: string, format: "hex" | "base64"): Error; + maxTxSetSize(value?: number): number; - static validateXDR(input: Buffer, format?: "raw"): boolean; + skipList(value?: Buffer[]): Buffer[]; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + ext(value?: LedgerHeaderExt): LedgerHeaderExt; - class SendMore { - constructor(attributes: { numMessages: number }); + toXDR(format?: 'raw'): Buffer; - numMessages(value?: number): number; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): LedgerHeader; - toXDR(format: "hex" | "base64"): string; + static write(value: LedgerHeader, io: Buffer): void; - static read(io: Buffer): SendMore; + static isValid(value: LedgerHeader): boolean; - static write(value: SendMore, io: Buffer): void; + static toXDR(value: LedgerHeader): Buffer; - static isValid(value: SendMore): boolean; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeader; - static toXDR(value: SendMore): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerHeader; - static fromXDR(input: Buffer, format?: "raw"): SendMore; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): SendMore; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static validateXDR(input: Buffer, format?: "raw"): boolean; + class ConfigUpgradeSetKey { + constructor(attributes: { contractId: Buffer; contentHash: Buffer }); - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + contractId(value?: Buffer): Buffer; - class AuthCert { - constructor(attributes: { - pubkey: Curve25519Public; - expiration: Uint64; - sig: Buffer; - }); + contentHash(value?: Buffer): Buffer; - pubkey(value?: Curve25519Public): Curve25519Public; + toXDR(format?: 'raw'): Buffer; - expiration(value?: Uint64): Uint64; + toXDR(format: 'hex' | 'base64'): string; - sig(value?: Buffer): Buffer; + static read(io: Buffer): ConfigUpgradeSetKey; - toXDR(format?: "raw"): Buffer; + static write(value: ConfigUpgradeSetKey, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: ConfigUpgradeSetKey): boolean; - static read(io: Buffer): AuthCert; + static toXDR(value: ConfigUpgradeSetKey): Buffer; - static write(value: AuthCert, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): ConfigUpgradeSetKey; - static isValid(value: AuthCert): boolean; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigUpgradeSetKey; - static toXDR(value: AuthCert): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): AuthCert; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: string, format: "hex" | "base64"): AuthCert; + class ConfigUpgradeSet { + constructor(attributes: { updatedEntry: ConfigSettingEntry[] }); - static validateXDR(input: Buffer, format?: "raw"): boolean; + updatedEntry(value?: ConfigSettingEntry[]): ConfigSettingEntry[]; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format?: 'raw'): Buffer; - class Hello { - constructor(attributes: { - ledgerVersion: number; - overlayVersion: number; - overlayMinVersion: number; - networkId: Buffer; - versionStr: string | Buffer; - listeningPort: number; - peerId: NodeId; - cert: AuthCert; - nonce: Buffer; - }); + toXDR(format: 'hex' | 'base64'): string; - ledgerVersion(value?: number): number; + static read(io: Buffer): ConfigUpgradeSet; - overlayVersion(value?: number): number; + static write(value: ConfigUpgradeSet, io: Buffer): void; - overlayMinVersion(value?: number): number; + static isValid(value: ConfigUpgradeSet): boolean; - networkId(value?: Buffer): Buffer; + static toXDR(value: ConfigUpgradeSet): Buffer; - versionStr(value?: string | Buffer): string | Buffer; + static fromXDR(input: Buffer, format?: 'raw'): ConfigUpgradeSet; - listeningPort(value?: number): number; + static fromXDR(input: string, format: 'hex' | 'base64'): ConfigUpgradeSet; - peerId(value?: NodeId): NodeId; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - cert(value?: AuthCert): AuthCert; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - nonce(value?: Buffer): Buffer; + class BucketMetadata { + constructor(attributes: { ledgerVersion: number; ext: BucketMetadataExt }); - toXDR(format?: "raw"): Buffer; + ledgerVersion(value?: number): number; - toXDR(format: "hex" | "base64"): string; + ext(value?: BucketMetadataExt): BucketMetadataExt; - static read(io: Buffer): Hello; + toXDR(format?: 'raw'): Buffer; - static write(value: Hello, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: Hello): boolean; + static read(io: Buffer): BucketMetadata; - static toXDR(value: Hello): Buffer; + static write(value: BucketMetadata, io: Buffer): void; + + static isValid(value: BucketMetadata): boolean; + + static toXDR(value: BucketMetadata): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Hello; + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; - static fromXDR(input: string, format: "hex" | "base64"): Hello; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Auth { - constructor(attributes: { flags: number }); + class TxSetComponentTxsMaybeDiscountedFee { + constructor(attributes: { + baseFee: null | Int64; + txes: TransactionEnvelope[]; + }); - flags(value?: number): number; + baseFee(value?: null | Int64): null | Int64; - toXDR(format?: "raw"): Buffer; + txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): Auth; + toXDR(format: 'hex' | 'base64'): string; - static write(value: Auth, io: Buffer): void; + static read(io: Buffer): TxSetComponentTxsMaybeDiscountedFee; - static isValid(value: Auth): boolean; + static write(value: TxSetComponentTxsMaybeDiscountedFee, io: Buffer): void; - static toXDR(value: Auth): Buffer; + static isValid(value: TxSetComponentTxsMaybeDiscountedFee): boolean; + + static toXDR(value: TxSetComponentTxsMaybeDiscountedFee): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Auth; + static fromXDR( + input: Buffer, + format?: 'raw', + ): TxSetComponentTxsMaybeDiscountedFee; - static fromXDR(input: string, format: "hex" | "base64"): Auth; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TxSetComponentTxsMaybeDiscountedFee; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PeerAddress { + class TransactionSet { constructor(attributes: { - ip: PeerAddressIp; - port: number; - numFailures: number; + previousLedgerHash: Buffer; + txes: TransactionEnvelope[]; }); - ip(value?: PeerAddressIp): PeerAddressIp; - - port(value?: number): number; + previousLedgerHash(value?: Buffer): Buffer; - numFailures(value?: number): number; + txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PeerAddress; + static read(io: Buffer): TransactionSet; - static write(value: PeerAddress, io: Buffer): void; + static write(value: TransactionSet, io: Buffer): void; - static isValid(value: PeerAddress): boolean; + static isValid(value: TransactionSet): boolean; - static toXDR(value: PeerAddress): Buffer; + static toXDR(value: TransactionSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PeerAddress; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSet; - static fromXDR(input: string, format: "hex" | "base64"): PeerAddress; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class DontHave { - constructor(attributes: { type: MessageType; reqHash: Buffer }); + class TransactionSetV1 { + constructor(attributes: { + previousLedgerHash: Buffer; + phases: TransactionPhase[]; + }); - type(value?: MessageType): MessageType; + previousLedgerHash(value?: Buffer): Buffer; - reqHash(value?: Buffer): Buffer; + phases(value?: TransactionPhase[]): TransactionPhase[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): DontHave; + static read(io: Buffer): TransactionSetV1; - static write(value: DontHave, io: Buffer): void; + static write(value: TransactionSetV1, io: Buffer): void; - static isValid(value: DontHave): boolean; + static isValid(value: TransactionSetV1): boolean; - static toXDR(value: DontHave): Buffer; + static toXDR(value: TransactionSetV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DontHave; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSetV1; - static fromXDR(input: string, format: "hex" | "base64"): DontHave; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionSetV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SurveyRequestMessage { + class TransactionResultPair { constructor(attributes: { - surveyorPeerId: NodeId; - surveyedPeerId: NodeId; - ledgerNum: number; - encryptionKey: Curve25519Public; - commandType: SurveyMessageCommandType; + transactionHash: Buffer; + result: TransactionResult; }); - surveyorPeerId(value?: NodeId): NodeId; - - surveyedPeerId(value?: NodeId): NodeId; - - ledgerNum(value?: number): number; - - encryptionKey(value?: Curve25519Public): Curve25519Public; + transactionHash(value?: Buffer): Buffer; - commandType(value?: SurveyMessageCommandType): SurveyMessageCommandType; + result(value?: TransactionResult): TransactionResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SurveyRequestMessage; + static read(io: Buffer): TransactionResultPair; - static write(value: SurveyRequestMessage, io: Buffer): void; + static write(value: TransactionResultPair, io: Buffer): void; - static isValid(value: SurveyRequestMessage): boolean; + static isValid(value: TransactionResultPair): boolean; - static toXDR(value: SurveyRequestMessage): Buffer; + static toXDR(value: TransactionResultPair): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SurveyRequestMessage; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultPair; static fromXDR( input: string, - format: "hex" | "base64" - ): SurveyRequestMessage; + format: 'hex' | 'base64', + ): TransactionResultPair; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyRequestMessage { - constructor(attributes: { - requestSignature: Buffer; - request: SurveyRequestMessage; - }); - - requestSignature(value?: Buffer): Buffer; + class TransactionResultSet { + constructor(attributes: { results: TransactionResultPair[] }); - request(value?: SurveyRequestMessage): SurveyRequestMessage; + results(value?: TransactionResultPair[]): TransactionResultPair[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SignedSurveyRequestMessage; + static read(io: Buffer): TransactionResultSet; - static write(value: SignedSurveyRequestMessage, io: Buffer): void; + static write(value: TransactionResultSet, io: Buffer): void; - static isValid(value: SignedSurveyRequestMessage): boolean; + static isValid(value: TransactionResultSet): boolean; - static toXDR(value: SignedSurveyRequestMessage): Buffer; + static toXDR(value: TransactionResultSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SignedSurveyRequestMessage; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultSet; static fromXDR( input: string, - format: "hex" | "base64" - ): SignedSurveyRequestMessage; + format: 'hex' | 'base64', + ): TransactionResultSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SurveyResponseMessage { + class TransactionHistoryEntry { constructor(attributes: { - surveyorPeerId: NodeId; - surveyedPeerId: NodeId; - ledgerNum: number; - commandType: SurveyMessageCommandType; - encryptedBody: Buffer; - }); - - surveyorPeerId(value?: NodeId): NodeId; - - surveyedPeerId(value?: NodeId): NodeId; + ledgerSeq: number; + txSet: TransactionSet; + ext: TransactionHistoryEntryExt; + }); - ledgerNum(value?: number): number; + ledgerSeq(value?: number): number; - commandType(value?: SurveyMessageCommandType): SurveyMessageCommandType; + txSet(value?: TransactionSet): TransactionSet; - encryptedBody(value?: Buffer): Buffer; + ext(value?: TransactionHistoryEntryExt): TransactionHistoryEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SurveyResponseMessage; + static read(io: Buffer): TransactionHistoryEntry; - static write(value: SurveyResponseMessage, io: Buffer): void; + static write(value: TransactionHistoryEntry, io: Buffer): void; - static isValid(value: SurveyResponseMessage): boolean; + static isValid(value: TransactionHistoryEntry): boolean; - static toXDR(value: SurveyResponseMessage): Buffer; + static toXDR(value: TransactionHistoryEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SurveyResponseMessage; + static fromXDR(input: Buffer, format?: 'raw'): TransactionHistoryEntry; static fromXDR( input: string, - format: "hex" | "base64" - ): SurveyResponseMessage; + format: 'hex' | 'base64', + ): TransactionHistoryEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignedSurveyResponseMessage { + class TransactionHistoryResultEntry { constructor(attributes: { - responseSignature: Buffer; - response: SurveyResponseMessage; + ledgerSeq: number; + txResultSet: TransactionResultSet; + ext: TransactionHistoryResultEntryExt; }); - responseSignature(value?: Buffer): Buffer; + ledgerSeq(value?: number): number; - response(value?: SurveyResponseMessage): SurveyResponseMessage; + txResultSet(value?: TransactionResultSet): TransactionResultSet; - toXDR(format?: "raw"): Buffer; + ext( + value?: TransactionHistoryResultEntryExt, + ): TransactionHistoryResultEntryExt; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): SignedSurveyResponseMessage; + toXDR(format: 'hex' | 'base64'): string; - static write(value: SignedSurveyResponseMessage, io: Buffer): void; + static read(io: Buffer): TransactionHistoryResultEntry; - static isValid(value: SignedSurveyResponseMessage): boolean; + static write(value: TransactionHistoryResultEntry, io: Buffer): void; - static toXDR(value: SignedSurveyResponseMessage): Buffer; + static isValid(value: TransactionHistoryResultEntry): boolean; - static fromXDR(input: Buffer, format?: "raw"): SignedSurveyResponseMessage; + static toXDR(value: TransactionHistoryResultEntry): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TransactionHistoryResultEntry; static fromXDR( input: string, - format: "hex" | "base64" - ): SignedSurveyResponseMessage; + format: 'hex' | 'base64', + ): TransactionHistoryResultEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PeerStats { + class LedgerHeaderHistoryEntry { constructor(attributes: { - id: NodeId; - versionStr: string | Buffer; - messagesRead: Uint64; - messagesWritten: Uint64; - bytesRead: Uint64; - bytesWritten: Uint64; - secondsConnected: Uint64; - uniqueFloodBytesRecv: Uint64; - duplicateFloodBytesRecv: Uint64; - uniqueFetchBytesRecv: Uint64; - duplicateFetchBytesRecv: Uint64; - uniqueFloodMessageRecv: Uint64; - duplicateFloodMessageRecv: Uint64; - uniqueFetchMessageRecv: Uint64; - duplicateFetchMessageRecv: Uint64; + hash: Buffer; + header: LedgerHeader; + ext: LedgerHeaderHistoryEntryExt; }); - id(value?: NodeId): NodeId; + hash(value?: Buffer): Buffer; - versionStr(value?: string | Buffer): string | Buffer; + header(value?: LedgerHeader): LedgerHeader; - messagesRead(value?: Uint64): Uint64; + ext(value?: LedgerHeaderHistoryEntryExt): LedgerHeaderHistoryEntryExt; - messagesWritten(value?: Uint64): Uint64; + toXDR(format?: 'raw'): Buffer; - bytesRead(value?: Uint64): Uint64; + toXDR(format: 'hex' | 'base64'): string; - bytesWritten(value?: Uint64): Uint64; + static read(io: Buffer): LedgerHeaderHistoryEntry; - secondsConnected(value?: Uint64): Uint64; + static write(value: LedgerHeaderHistoryEntry, io: Buffer): void; - uniqueFloodBytesRecv(value?: Uint64): Uint64; + static isValid(value: LedgerHeaderHistoryEntry): boolean; - duplicateFloodBytesRecv(value?: Uint64): Uint64; + static toXDR(value: LedgerHeaderHistoryEntry): Buffer; - uniqueFetchBytesRecv(value?: Uint64): Uint64; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderHistoryEntry; - duplicateFetchBytesRecv(value?: Uint64): Uint64; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerHeaderHistoryEntry; - uniqueFloodMessageRecv(value?: Uint64): Uint64; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - duplicateFloodMessageRecv(value?: Uint64): Uint64; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - uniqueFetchMessageRecv(value?: Uint64): Uint64; + class LedgerScpMessages { + constructor(attributes: { ledgerSeq: number; messages: ScpEnvelope[] }); - duplicateFetchMessageRecv(value?: Uint64): Uint64; + ledgerSeq(value?: number): number; - toXDR(format?: "raw"): Buffer; + messages(value?: ScpEnvelope[]): ScpEnvelope[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): PeerStats; + toXDR(format: 'hex' | 'base64'): string; - static write(value: PeerStats, io: Buffer): void; + static read(io: Buffer): LedgerScpMessages; - static isValid(value: PeerStats): boolean; + static write(value: LedgerScpMessages, io: Buffer): void; - static toXDR(value: PeerStats): Buffer; + static isValid(value: LedgerScpMessages): boolean; - static fromXDR(input: Buffer, format?: "raw"): PeerStats; + static toXDR(value: LedgerScpMessages): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerScpMessages; - static fromXDR(input: string, format: "hex" | "base64"): PeerStats; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerScpMessages; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TopologyResponseBody { + class ScpHistoryEntryV0 { constructor(attributes: { - inboundPeers: PeerStats[]; - outboundPeers: PeerStats[]; - totalInboundPeerCount: number; - totalOutboundPeerCount: number; + quorumSets: ScpQuorumSet[]; + ledgerMessages: LedgerScpMessages; }); - inboundPeers(value?: PeerStats[]): PeerStats[]; - - outboundPeers(value?: PeerStats[]): PeerStats[]; - - totalInboundPeerCount(value?: number): number; + quorumSets(value?: ScpQuorumSet[]): ScpQuorumSet[]; - totalOutboundPeerCount(value?: number): number; + ledgerMessages(value?: LedgerScpMessages): LedgerScpMessages; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TopologyResponseBody; + static read(io: Buffer): ScpHistoryEntryV0; - static write(value: TopologyResponseBody, io: Buffer): void; + static write(value: ScpHistoryEntryV0, io: Buffer): void; - static isValid(value: TopologyResponseBody): boolean; + static isValid(value: ScpHistoryEntryV0): boolean; - static toXDR(value: TopologyResponseBody): Buffer; + static toXDR(value: ScpHistoryEntryV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TopologyResponseBody; + static fromXDR(input: Buffer, format?: 'raw'): ScpHistoryEntryV0; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TopologyResponseBody; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpHistoryEntryV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class FloodAdvert { - constructor(attributes: { txHashes: Hash[] }); + class OperationMeta { + constructor(attributes: { changes: LedgerEntryChange[] }); - txHashes(value?: Hash[]): Hash[]; + changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): FloodAdvert; + static read(io: Buffer): OperationMeta; - static write(value: FloodAdvert, io: Buffer): void; + static write(value: OperationMeta, io: Buffer): void; - static isValid(value: FloodAdvert): boolean; + static isValid(value: OperationMeta): boolean; - static toXDR(value: FloodAdvert): Buffer; + static toXDR(value: OperationMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FloodAdvert; + static fromXDR(input: Buffer, format?: 'raw'): OperationMeta; - static fromXDR(input: string, format: "hex" | "base64"): FloodAdvert; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class FloodDemand { - constructor(attributes: { txHashes: Hash[] }); + class TransactionMetaV1 { + constructor(attributes: { + txChanges: LedgerEntryChange[]; + operations: OperationMeta[]; + }); - txHashes(value?: Hash[]): Hash[]; + txChanges(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + operations(value?: OperationMeta[]): OperationMeta[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): FloodDemand; + toXDR(format: 'hex' | 'base64'): string; - static write(value: FloodDemand, io: Buffer): void; + static read(io: Buffer): TransactionMetaV1; - static isValid(value: FloodDemand): boolean; + static write(value: TransactionMetaV1, io: Buffer): void; - static toXDR(value: FloodDemand): Buffer; + static isValid(value: TransactionMetaV1): boolean; + + static toXDR(value: TransactionMetaV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FloodDemand; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV1; - static fromXDR(input: string, format: "hex" | "base64"): FloodDemand; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AuthenticatedMessageV0 { + class TransactionMetaV2 { constructor(attributes: { - sequence: Uint64; - message: StellarMessage; - mac: HmacSha256Mac; + txChangesBefore: LedgerEntryChange[]; + operations: OperationMeta[]; + txChangesAfter: LedgerEntryChange[]; }); - sequence(value?: Uint64): Uint64; + txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; - message(value?: StellarMessage): StellarMessage; + operations(value?: OperationMeta[]): OperationMeta[]; - mac(value?: HmacSha256Mac): HmacSha256Mac; + txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AuthenticatedMessageV0; + static read(io: Buffer): TransactionMetaV2; - static write(value: AuthenticatedMessageV0, io: Buffer): void; + static write(value: TransactionMetaV2, io: Buffer): void; - static isValid(value: AuthenticatedMessageV0): boolean; + static isValid(value: TransactionMetaV2): boolean; - static toXDR(value: AuthenticatedMessageV0): Buffer; + static toXDR(value: TransactionMetaV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AuthenticatedMessageV0; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV2; - static fromXDR( - input: string, - format: "hex" | "base64" - ): AuthenticatedMessageV0; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class MuxedAccountMed25519 { - constructor(attributes: { id: Uint64; ed25519: Buffer }); + class ContractEventV0 { + constructor(attributes: { topics: ScVal[]; data: ScVal }); - id(value?: Uint64): Uint64; + topics(value?: ScVal[]): ScVal[]; - ed25519(value?: Buffer): Buffer; + data(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): MuxedAccountMed25519; + static read(io: Buffer): ContractEventV0; - static write(value: MuxedAccountMed25519, io: Buffer): void; + static write(value: ContractEventV0, io: Buffer): void; - static isValid(value: MuxedAccountMed25519): boolean; + static isValid(value: ContractEventV0): boolean; - static toXDR(value: MuxedAccountMed25519): Buffer; + static toXDR(value: ContractEventV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): MuxedAccountMed25519; + static fromXDR(input: Buffer, format?: 'raw'): ContractEventV0; - static fromXDR( - input: string, - format: "hex" | "base64" - ): MuxedAccountMed25519; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEventV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class DecoratedSignature { - constructor(attributes: { hint: Buffer; signature: Buffer }); + class ContractEvent { + constructor(attributes: { + ext: ExtensionPoint; + contractId: null | Buffer; + type: ContractEventType; + body: ContractEventBody; + }); - hint(value?: Buffer): Buffer; + ext(value?: ExtensionPoint): ExtensionPoint; - signature(value?: Buffer): Buffer; + contractId(value?: null | Buffer): null | Buffer; - toXDR(format?: "raw"): Buffer; + type(value?: ContractEventType): ContractEventType; - toXDR(format: "hex" | "base64"): string; + body(value?: ContractEventBody): ContractEventBody; - static read(io: Buffer): DecoratedSignature; + toXDR(format?: 'raw'): Buffer; - static write(value: DecoratedSignature, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: DecoratedSignature): boolean; + static read(io: Buffer): ContractEvent; - static toXDR(value: DecoratedSignature): Buffer; + static write(value: ContractEvent, io: Buffer): void; - static fromXDR(input: Buffer, format?: "raw"): DecoratedSignature; + static isValid(value: ContractEvent): boolean; - static fromXDR(input: string, format: "hex" | "base64"): DecoratedSignature; + static toXDR(value: ContractEvent): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ContractEvent; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEvent; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class CreateAccountOp { - constructor(attributes: { destination: AccountId; startingBalance: Int64 }); + class DiagnosticEvent { + constructor(attributes: { + inSuccessfulContractCall: boolean; + event: ContractEvent; + }); - destination(value?: AccountId): AccountId; + inSuccessfulContractCall(value?: boolean): boolean; - startingBalance(value?: Int64): Int64; + event(value?: ContractEvent): ContractEvent; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): CreateAccountOp; + static read(io: Buffer): DiagnosticEvent; - static write(value: CreateAccountOp, io: Buffer): void; + static write(value: DiagnosticEvent, io: Buffer): void; - static isValid(value: CreateAccountOp): boolean; + static isValid(value: DiagnosticEvent): boolean; - static toXDR(value: CreateAccountOp): Buffer; + static toXDR(value: DiagnosticEvent): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateAccountOp; + static fromXDR(input: Buffer, format?: 'raw'): DiagnosticEvent; - static fromXDR(input: string, format: "hex" | "base64"): CreateAccountOp; + static fromXDR(input: string, format: 'hex' | 'base64'): DiagnosticEvent; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PaymentOp { + class SorobanTransactionMeta { constructor(attributes: { - destination: MuxedAccount; - asset: Asset; - amount: Int64; + ext: ExtensionPoint; + events: ContractEvent[]; + returnValue: ScVal; + diagnosticEvents: DiagnosticEvent[]; }); - destination(value?: MuxedAccount): MuxedAccount; + ext(value?: ExtensionPoint): ExtensionPoint; - asset(value?: Asset): Asset; + events(value?: ContractEvent[]): ContractEvent[]; - amount(value?: Int64): Int64; + returnValue(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + diagnosticEvents(value?: DiagnosticEvent[]): DiagnosticEvent[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): PaymentOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: PaymentOp, io: Buffer): void; + static read(io: Buffer): SorobanTransactionMeta; - static isValid(value: PaymentOp): boolean; + static write(value: SorobanTransactionMeta, io: Buffer): void; - static toXDR(value: PaymentOp): Buffer; + static isValid(value: SorobanTransactionMeta): boolean; + + static toXDR(value: SorobanTransactionMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PaymentOp; + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionMeta; - static fromXDR(input: string, format: "hex" | "base64"): PaymentOp; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PathPaymentStrictReceiveOp { + class TransactionMetaV3 { constructor(attributes: { - sendAsset: Asset; - sendMax: Int64; - destination: MuxedAccount; - destAsset: Asset; - destAmount: Int64; - path: Asset[]; + ext: ExtensionPoint; + txChangesBefore: LedgerEntryChange[]; + operations: OperationMeta[]; + txChangesAfter: LedgerEntryChange[]; + sorobanMeta: null | SorobanTransactionMeta; }); - sendAsset(value?: Asset): Asset; + ext(value?: ExtensionPoint): ExtensionPoint; - sendMax(value?: Int64): Int64; + txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; - destination(value?: MuxedAccount): MuxedAccount; + operations(value?: OperationMeta[]): OperationMeta[]; - destAsset(value?: Asset): Asset; + txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; - destAmount(value?: Int64): Int64; + sorobanMeta( + value?: null | SorobanTransactionMeta, + ): null | SorobanTransactionMeta; - path(value?: Asset[]): Asset[]; + toXDR(format?: 'raw'): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format: "hex" | "base64"): string; + static read(io: Buffer): TransactionMetaV3; - static read(io: Buffer): PathPaymentStrictReceiveOp; + static write(value: TransactionMetaV3, io: Buffer): void; - static write(value: PathPaymentStrictReceiveOp, io: Buffer): void; + static isValid(value: TransactionMetaV3): boolean; - static isValid(value: PathPaymentStrictReceiveOp): boolean; + static toXDR(value: TransactionMetaV3): Buffer; - static toXDR(value: PathPaymentStrictReceiveOp): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV3; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV3; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class InvokeHostFunctionSuccessPreImage { + constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); + + returnValue(value?: ScVal): ScVal; + + events(value?: ContractEvent[]): ContractEvent[]; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictReceiveOp; + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): InvokeHostFunctionSuccessPreImage; + + static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; + + static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; + + static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): InvokeHostFunctionSuccessPreImage; static fromXDR( input: string, - format: "hex" | "base64" - ): PathPaymentStrictReceiveOp; + format: 'hex' | 'base64', + ): InvokeHostFunctionSuccessPreImage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PathPaymentStrictSendOp { + class TransactionResultMeta { constructor(attributes: { - sendAsset: Asset; - sendAmount: Int64; - destination: MuxedAccount; - destAsset: Asset; - destMin: Int64; - path: Asset[]; + result: TransactionResultPair; + feeProcessing: LedgerEntryChange[]; + txApplyProcessing: TransactionMeta; }); - sendAsset(value?: Asset): Asset; - - sendAmount(value?: Int64): Int64; - - destination(value?: MuxedAccount): MuxedAccount; - - destAsset(value?: Asset): Asset; + result(value?: TransactionResultPair): TransactionResultPair; - destMin(value?: Int64): Int64; + feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; - path(value?: Asset[]): Asset[]; + txApplyProcessing(value?: TransactionMeta): TransactionMeta; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PathPaymentStrictSendOp; + static read(io: Buffer): TransactionResultMeta; - static write(value: PathPaymentStrictSendOp, io: Buffer): void; + static write(value: TransactionResultMeta, io: Buffer): void; - static isValid(value: PathPaymentStrictSendOp): boolean; + static isValid(value: TransactionResultMeta): boolean; - static toXDR(value: PathPaymentStrictSendOp): Buffer; + static toXDR(value: TransactionResultMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictSendOp; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMeta; static fromXDR( input: string, - format: "hex" | "base64" - ): PathPaymentStrictSendOp; + format: 'hex' | 'base64', + ): TransactionResultMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageSellOfferOp { + class UpgradeEntryMeta { constructor(attributes: { - selling: Asset; - buying: Asset; - amount: Int64; - price: Price; - offerId: Int64; + upgrade: LedgerUpgrade; + changes: LedgerEntryChange[]; }); - selling(value?: Asset): Asset; - - buying(value?: Asset): Asset; - - amount(value?: Int64): Int64; - - price(value?: Price): Price; + upgrade(value?: LedgerUpgrade): LedgerUpgrade; - offerId(value?: Int64): Int64; + changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ManageSellOfferOp; + static read(io: Buffer): UpgradeEntryMeta; - static write(value: ManageSellOfferOp, io: Buffer): void; + static write(value: UpgradeEntryMeta, io: Buffer): void; - static isValid(value: ManageSellOfferOp): boolean; + static isValid(value: UpgradeEntryMeta): boolean; - static toXDR(value: ManageSellOfferOp): Buffer; + static toXDR(value: UpgradeEntryMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageSellOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): UpgradeEntryMeta; - static fromXDR(input: string, format: "hex" | "base64"): ManageSellOfferOp; + static fromXDR(input: string, format: 'hex' | 'base64'): UpgradeEntryMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageBuyOfferOp { + class LedgerCloseMetaV0 { constructor(attributes: { - selling: Asset; - buying: Asset; - buyAmount: Int64; - price: Price; - offerId: Int64; + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: TransactionSet; + txProcessing: TransactionResultMeta[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; }); - selling(value?: Asset): Asset; + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - buying(value?: Asset): Asset; + txSet(value?: TransactionSet): TransactionSet; - buyAmount(value?: Int64): Int64; + txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; - price(value?: Price): Price; + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; - offerId(value?: Int64): Int64; + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ManageBuyOfferOp; + static read(io: Buffer): LedgerCloseMetaV0; - static write(value: ManageBuyOfferOp, io: Buffer): void; + static write(value: LedgerCloseMetaV0, io: Buffer): void; - static isValid(value: ManageBuyOfferOp): boolean; + static isValid(value: LedgerCloseMetaV0): boolean; - static toXDR(value: ManageBuyOfferOp): Buffer; + static toXDR(value: LedgerCloseMetaV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageBuyOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV0; - static fromXDR(input: string, format: "hex" | "base64"): ManageBuyOfferOp; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class CreatePassiveSellOfferOp { + class LedgerCloseMetaV1 { constructor(attributes: { - selling: Asset; - buying: Asset; - amount: Int64; - price: Price; + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: GeneralizedTransactionSet; + txProcessing: TransactionResultMeta[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; }); - selling(value?: Asset): Asset; + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - buying(value?: Asset): Asset; + txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; - amount(value?: Int64): Int64; + txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; - price(value?: Price): Price; + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; - toXDR(format?: "raw"): Buffer; + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): CreatePassiveSellOfferOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: CreatePassiveSellOfferOp, io: Buffer): void; + static read(io: Buffer): LedgerCloseMetaV1; - static isValid(value: CreatePassiveSellOfferOp): boolean; + static write(value: LedgerCloseMetaV1, io: Buffer): void; - static toXDR(value: CreatePassiveSellOfferOp): Buffer; + static isValid(value: LedgerCloseMetaV1): boolean; - static fromXDR(input: Buffer, format?: "raw"): CreatePassiveSellOfferOp; + static toXDR(value: LedgerCloseMetaV1): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): CreatePassiveSellOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SetOptionsOp { + class LedgerCloseMetaV2 { constructor(attributes: { - inflationDest: null | AccountId; - clearFlags: null | number; - setFlags: null | number; - masterWeight: null | number; - lowThreshold: null | number; - medThreshold: null | number; - highThreshold: null | number; - homeDomain: null | string | Buffer; - signer: null | Signer; + ext: ExtensionPoint; + ledgerHeader: LedgerHeaderHistoryEntry; + txSet: GeneralizedTransactionSet; + txProcessing: TransactionResultMeta[]; + upgradesProcessing: UpgradeEntryMeta[]; + scpInfo: ScpHistoryEntry[]; + totalByteSizeOfBucketList: Uint64; + evictedTemporaryLedgerKeys: LedgerKey[]; + evictedPersistentLedgerEntries: LedgerEntry[]; }); - inflationDest(value?: null | AccountId): null | AccountId; + ext(value?: ExtensionPoint): ExtensionPoint; - clearFlags(value?: null | number): null | number; + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - setFlags(value?: null | number): null | number; + txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; - masterWeight(value?: null | number): null | number; + txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; - lowThreshold(value?: null | number): null | number; + upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; - medThreshold(value?: null | number): null | number; + scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - highThreshold(value?: null | number): null | number; + totalByteSizeOfBucketList(value?: Uint64): Uint64; - homeDomain(value?: null | string | Buffer): null | string | Buffer; + evictedTemporaryLedgerKeys(value?: LedgerKey[]): LedgerKey[]; - signer(value?: null | Signer): null | Signer; + evictedPersistentLedgerEntries(value?: LedgerEntry[]): LedgerEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SetOptionsOp; + static read(io: Buffer): LedgerCloseMetaV2; - static write(value: SetOptionsOp, io: Buffer): void; + static write(value: LedgerCloseMetaV2, io: Buffer): void; - static isValid(value: SetOptionsOp): boolean; + static isValid(value: LedgerCloseMetaV2): boolean; - static toXDR(value: SetOptionsOp): Buffer; + static toXDR(value: LedgerCloseMetaV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetOptionsOp; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; - static fromXDR(input: string, format: "hex" | "base64"): SetOptionsOp; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ChangeTrustOp { - constructor(attributes: { line: ChangeTrustAsset; limit: Int64 }); + class Error { + constructor(attributes: { code: ErrorCode; msg: string | Buffer }); - line(value?: ChangeTrustAsset): ChangeTrustAsset; + code(value?: ErrorCode): ErrorCode; - limit(value?: Int64): Int64; + msg(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ChangeTrustOp; + static read(io: Buffer): Error; - static write(value: ChangeTrustOp, io: Buffer): void; + static write(value: Error, io: Buffer): void; - static isValid(value: ChangeTrustOp): boolean; + static isValid(value: Error): boolean; - static toXDR(value: ChangeTrustOp): Buffer; + static toXDR(value: Error): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustOp; + static fromXDR(input: Buffer, format?: 'raw'): Error; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustOp; + static fromXDR(input: string, format: 'hex' | 'base64'): Error; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AllowTrustOp { - constructor(attributes: { - trustor: AccountId; - asset: AssetCode; - authorize: number; - }); - - trustor(value?: AccountId): AccountId; - - asset(value?: AssetCode): AssetCode; + class SendMore { + constructor(attributes: { numMessages: number }); - authorize(value?: number): number; + numMessages(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AllowTrustOp; + static read(io: Buffer): SendMore; - static write(value: AllowTrustOp, io: Buffer): void; + static write(value: SendMore, io: Buffer): void; - static isValid(value: AllowTrustOp): boolean; + static isValid(value: SendMore): boolean; - static toXDR(value: AllowTrustOp): Buffer; + static toXDR(value: SendMore): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AllowTrustOp; + static fromXDR(input: Buffer, format?: 'raw'): SendMore; - static fromXDR(input: string, format: "hex" | "base64"): AllowTrustOp; + static fromXDR(input: string, format: 'hex' | 'base64'): SendMore; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageDataOp { - constructor(attributes: { - dataName: string | Buffer; - dataValue: null | Buffer; - }); + class SendMoreExtended { + constructor(attributes: { numMessages: number; numBytes: number }); - dataName(value?: string | Buffer): string | Buffer; + numMessages(value?: number): number; - dataValue(value?: null | Buffer): null | Buffer; + numBytes(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ManageDataOp; + static read(io: Buffer): SendMoreExtended; - static write(value: ManageDataOp, io: Buffer): void; + static write(value: SendMoreExtended, io: Buffer): void; - static isValid(value: ManageDataOp): boolean; + static isValid(value: SendMoreExtended): boolean; - static toXDR(value: ManageDataOp): Buffer; + static toXDR(value: SendMoreExtended): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageDataOp; + static fromXDR(input: Buffer, format?: 'raw'): SendMoreExtended; - static fromXDR(input: string, format: "hex" | "base64"): ManageDataOp; + static fromXDR(input: string, format: 'hex' | 'base64'): SendMoreExtended; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BumpSequenceOp { - constructor(attributes: { bumpTo: SequenceNumber }); + class AuthCert { + constructor(attributes: { + pubkey: Curve25519Public; + expiration: Uint64; + sig: Buffer; + }); - bumpTo(value?: SequenceNumber): SequenceNumber; + pubkey(value?: Curve25519Public): Curve25519Public; - toXDR(format?: "raw"): Buffer; + expiration(value?: Uint64): Uint64; - toXDR(format: "hex" | "base64"): string; + sig(value?: Buffer): Buffer; - static read(io: Buffer): BumpSequenceOp; + toXDR(format?: 'raw'): Buffer; - static write(value: BumpSequenceOp, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: BumpSequenceOp): boolean; + static read(io: Buffer): AuthCert; - static toXDR(value: BumpSequenceOp): Buffer; + static write(value: AuthCert, io: Buffer): void; + + static isValid(value: AuthCert): boolean; - static fromXDR(input: Buffer, format?: "raw"): BumpSequenceOp; + static toXDR(value: AuthCert): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AuthCert; - static fromXDR(input: string, format: "hex" | "base64"): BumpSequenceOp; + static fromXDR(input: string, format: 'hex' | 'base64'): AuthCert; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class CreateClaimableBalanceOp { + class Hello { constructor(attributes: { - asset: Asset; - amount: Int64; - claimants: Claimant[]; + ledgerVersion: number; + overlayVersion: number; + overlayMinVersion: number; + networkId: Buffer; + versionStr: string | Buffer; + listeningPort: number; + peerId: NodeId; + cert: AuthCert; + nonce: Buffer; }); - asset(value?: Asset): Asset; - - amount(value?: Int64): Int64; - - claimants(value?: Claimant[]): Claimant[]; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): CreateClaimableBalanceOp; - - static write(value: CreateClaimableBalanceOp, io: Buffer): void; - - static isValid(value: CreateClaimableBalanceOp): boolean; - - static toXDR(value: CreateClaimableBalanceOp): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): CreateClaimableBalanceOp; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): CreateClaimableBalanceOp; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ClaimClaimableBalanceOp { - constructor(attributes: { balanceId: ClaimableBalanceId }); - - balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ClaimClaimableBalanceOp; - - static write(value: ClaimClaimableBalanceOp, io: Buffer): void; + ledgerVersion(value?: number): number; - static isValid(value: ClaimClaimableBalanceOp): boolean; + overlayVersion(value?: number): number; - static toXDR(value: ClaimClaimableBalanceOp): Buffer; + overlayMinVersion(value?: number): number; - static fromXDR(input: Buffer, format?: "raw"): ClaimClaimableBalanceOp; + networkId(value?: Buffer): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ClaimClaimableBalanceOp; + versionStr(value?: string | Buffer): string | Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + listeningPort(value?: number): number; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + peerId(value?: NodeId): NodeId; - class BeginSponsoringFutureReservesOp { - constructor(attributes: { sponsoredId: AccountId }); + cert(value?: AuthCert): AuthCert; - sponsoredId(value?: AccountId): AccountId; + nonce(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BeginSponsoringFutureReservesOp; + static read(io: Buffer): Hello; - static write(value: BeginSponsoringFutureReservesOp, io: Buffer): void; + static write(value: Hello, io: Buffer): void; - static isValid(value: BeginSponsoringFutureReservesOp): boolean; + static isValid(value: Hello): boolean; - static toXDR(value: BeginSponsoringFutureReservesOp): Buffer; + static toXDR(value: Hello): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): BeginSponsoringFutureReservesOp; + static fromXDR(input: Buffer, format?: 'raw'): Hello; - static fromXDR( - input: string, - format: "hex" | "base64" - ): BeginSponsoringFutureReservesOp; + static fromXDR(input: string, format: 'hex' | 'base64'): Hello; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class RevokeSponsorshipOpSigner { - constructor(attributes: { accountId: AccountId; signerKey: SignerKey }); - - accountId(value?: AccountId): AccountId; + class Auth { + constructor(attributes: { flags: number }); - signerKey(value?: SignerKey): SignerKey; + flags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): RevokeSponsorshipOpSigner; + static read(io: Buffer): Auth; - static write(value: RevokeSponsorshipOpSigner, io: Buffer): void; + static write(value: Auth, io: Buffer): void; - static isValid(value: RevokeSponsorshipOpSigner): boolean; + static isValid(value: Auth): boolean; - static toXDR(value: RevokeSponsorshipOpSigner): Buffer; + static toXDR(value: Auth): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipOpSigner; + static fromXDR(input: Buffer, format?: 'raw'): Auth; - static fromXDR( - input: string, - format: "hex" | "base64" - ): RevokeSponsorshipOpSigner; + static fromXDR(input: string, format: 'hex' | 'base64'): Auth; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClawbackOp { + class PeerAddress { constructor(attributes: { - asset: Asset; - from: MuxedAccount; - amount: Int64; + ip: PeerAddressIp; + port: number; + numFailures: number; }); - asset(value?: Asset): Asset; + ip(value?: PeerAddressIp): PeerAddressIp; - from(value?: MuxedAccount): MuxedAccount; + port(value?: number): number; - amount(value?: Int64): Int64; + numFailures(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClawbackOp; + static read(io: Buffer): PeerAddress; - static write(value: ClawbackOp, io: Buffer): void; + static write(value: PeerAddress, io: Buffer): void; - static isValid(value: ClawbackOp): boolean; + static isValid(value: PeerAddress): boolean; - static toXDR(value: ClawbackOp): Buffer; + static toXDR(value: PeerAddress): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClawbackOp; + static fromXDR(input: Buffer, format?: 'raw'): PeerAddress; - static fromXDR(input: string, format: "hex" | "base64"): ClawbackOp; + static fromXDR(input: string, format: 'hex' | 'base64'): PeerAddress; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClawbackClaimableBalanceOp { - constructor(attributes: { balanceId: ClaimableBalanceId }); + class DontHave { + constructor(attributes: { type: MessageType; reqHash: Buffer }); - balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + type(value?: MessageType): MessageType; - toXDR(format?: "raw"): Buffer; + reqHash(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): ClawbackClaimableBalanceOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: ClawbackClaimableBalanceOp, io: Buffer): void; + static read(io: Buffer): DontHave; - static isValid(value: ClawbackClaimableBalanceOp): boolean; + static write(value: DontHave, io: Buffer): void; - static toXDR(value: ClawbackClaimableBalanceOp): Buffer; + static isValid(value: DontHave): boolean; - static fromXDR(input: Buffer, format?: "raw"): ClawbackClaimableBalanceOp; + static toXDR(value: DontHave): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ClawbackClaimableBalanceOp; + static fromXDR(input: Buffer, format?: 'raw'): DontHave; + + static fromXDR(input: string, format: 'hex' | 'base64'): DontHave; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SetTrustLineFlagsOp { + class SurveyRequestMessage { constructor(attributes: { - trustor: AccountId; - asset: Asset; - clearFlags: number; - setFlags: number; + surveyorPeerId: NodeId; + surveyedPeerId: NodeId; + ledgerNum: number; + encryptionKey: Curve25519Public; + commandType: SurveyMessageCommandType; }); - trustor(value?: AccountId): AccountId; + surveyorPeerId(value?: NodeId): NodeId; - asset(value?: Asset): Asset; + surveyedPeerId(value?: NodeId): NodeId; - clearFlags(value?: number): number; + ledgerNum(value?: number): number; - setFlags(value?: number): number; + encryptionKey(value?: Curve25519Public): Curve25519Public; - toXDR(format?: "raw"): Buffer; + commandType(value?: SurveyMessageCommandType): SurveyMessageCommandType; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): SetTrustLineFlagsOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: SetTrustLineFlagsOp, io: Buffer): void; + static read(io: Buffer): SurveyRequestMessage; - static isValid(value: SetTrustLineFlagsOp): boolean; + static write(value: SurveyRequestMessage, io: Buffer): void; - static toXDR(value: SetTrustLineFlagsOp): Buffer; + static isValid(value: SurveyRequestMessage): boolean; + + static toXDR(value: SurveyRequestMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetTrustLineFlagsOp; + static fromXDR(input: Buffer, format?: 'raw'): SurveyRequestMessage; static fromXDR( input: string, - format: "hex" | "base64" - ): SetTrustLineFlagsOp; + format: 'hex' | 'base64', + ): SurveyRequestMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolDepositOp { + class SignedSurveyRequestMessage { constructor(attributes: { - liquidityPoolId: PoolId; - maxAmountA: Int64; - maxAmountB: Int64; - minPrice: Price; - maxPrice: Price; + requestSignature: Buffer; + request: SurveyRequestMessage; }); - liquidityPoolId(value?: PoolId): PoolId; - - maxAmountA(value?: Int64): Int64; - - maxAmountB(value?: Int64): Int64; - - minPrice(value?: Price): Price; + requestSignature(value?: Buffer): Buffer; - maxPrice(value?: Price): Price; + request(value?: SurveyRequestMessage): SurveyRequestMessage; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LiquidityPoolDepositOp; + static read(io: Buffer): SignedSurveyRequestMessage; - static write(value: LiquidityPoolDepositOp, io: Buffer): void; + static write(value: SignedSurveyRequestMessage, io: Buffer): void; - static isValid(value: LiquidityPoolDepositOp): boolean; + static isValid(value: SignedSurveyRequestMessage): boolean; - static toXDR(value: LiquidityPoolDepositOp): Buffer; + static toXDR(value: SignedSurveyRequestMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolDepositOp; + static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyRequestMessage; static fromXDR( input: string, - format: "hex" | "base64" - ): LiquidityPoolDepositOp; + format: 'hex' | 'base64', + ): SignedSurveyRequestMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolWithdrawOp { + class SurveyResponseMessage { constructor(attributes: { - liquidityPoolId: PoolId; - amount: Int64; - minAmountA: Int64; - minAmountB: Int64; + surveyorPeerId: NodeId; + surveyedPeerId: NodeId; + ledgerNum: number; + commandType: SurveyMessageCommandType; + encryptedBody: Buffer; }); - liquidityPoolId(value?: PoolId): PoolId; + surveyorPeerId(value?: NodeId): NodeId; - amount(value?: Int64): Int64; + surveyedPeerId(value?: NodeId): NodeId; - minAmountA(value?: Int64): Int64; + ledgerNum(value?: number): number; - minAmountB(value?: Int64): Int64; + commandType(value?: SurveyMessageCommandType): SurveyMessageCommandType; - toXDR(format?: "raw"): Buffer; + encryptedBody(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): LiquidityPoolWithdrawOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: LiquidityPoolWithdrawOp, io: Buffer): void; + static read(io: Buffer): SurveyResponseMessage; - static isValid(value: LiquidityPoolWithdrawOp): boolean; + static write(value: SurveyResponseMessage, io: Buffer): void; - static toXDR(value: LiquidityPoolWithdrawOp): Buffer; + static isValid(value: SurveyResponseMessage): boolean; + + static toXDR(value: SurveyResponseMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolWithdrawOp; + static fromXDR(input: Buffer, format?: 'raw'): SurveyResponseMessage; static fromXDR( input: string, - format: "hex" | "base64" - ): LiquidityPoolWithdrawOp; + format: 'hex' | 'base64', + ): SurveyResponseMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageOperationId { + class SignedSurveyResponseMessage { constructor(attributes: { - sourceAccount: AccountId; - seqNum: SequenceNumber; - opNum: number; + responseSignature: Buffer; + response: SurveyResponseMessage; }); - sourceAccount(value?: AccountId): AccountId; - - seqNum(value?: SequenceNumber): SequenceNumber; + responseSignature(value?: Buffer): Buffer; - opNum(value?: number): number; + response(value?: SurveyResponseMessage): SurveyResponseMessage; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageOperationId; + static read(io: Buffer): SignedSurveyResponseMessage; - static write(value: HashIdPreimageOperationId, io: Buffer): void; + static write(value: SignedSurveyResponseMessage, io: Buffer): void; - static isValid(value: HashIdPreimageOperationId): boolean; + static isValid(value: SignedSurveyResponseMessage): boolean; - static toXDR(value: HashIdPreimageOperationId): Buffer; + static toXDR(value: SignedSurveyResponseMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageOperationId; + static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyResponseMessage; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageOperationId; + format: 'hex' | 'base64', + ): SignedSurveyResponseMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageRevokeId { + class PeerStats { constructor(attributes: { - sourceAccount: AccountId; - seqNum: SequenceNumber; - opNum: number; - liquidityPoolId: PoolId; - asset: Asset; + id: NodeId; + versionStr: string | Buffer; + messagesRead: Uint64; + messagesWritten: Uint64; + bytesRead: Uint64; + bytesWritten: Uint64; + secondsConnected: Uint64; + uniqueFloodBytesRecv: Uint64; + duplicateFloodBytesRecv: Uint64; + uniqueFetchBytesRecv: Uint64; + duplicateFetchBytesRecv: Uint64; + uniqueFloodMessageRecv: Uint64; + duplicateFloodMessageRecv: Uint64; + uniqueFetchMessageRecv: Uint64; + duplicateFetchMessageRecv: Uint64; }); - sourceAccount(value?: AccountId): AccountId; - - seqNum(value?: SequenceNumber): SequenceNumber; + id(value?: NodeId): NodeId; - opNum(value?: number): number; + versionStr(value?: string | Buffer): string | Buffer; - liquidityPoolId(value?: PoolId): PoolId; + messagesRead(value?: Uint64): Uint64; - asset(value?: Asset): Asset; + messagesWritten(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + bytesRead(value?: Uint64): Uint64; - toXDR(format: "hex" | "base64"): string; + bytesWritten(value?: Uint64): Uint64; - static read(io: Buffer): HashIdPreimageRevokeId; + secondsConnected(value?: Uint64): Uint64; - static write(value: HashIdPreimageRevokeId, io: Buffer): void; + uniqueFloodBytesRecv(value?: Uint64): Uint64; - static isValid(value: HashIdPreimageRevokeId): boolean; + duplicateFloodBytesRecv(value?: Uint64): Uint64; - static toXDR(value: HashIdPreimageRevokeId): Buffer; + uniqueFetchBytesRecv(value?: Uint64): Uint64; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageRevokeId; + duplicateFetchBytesRecv(value?: Uint64): Uint64; - static fromXDR( - input: string, - format: "hex" | "base64" - ): HashIdPreimageRevokeId; + uniqueFloodMessageRecv(value?: Uint64): Uint64; - static validateXDR(input: Buffer, format?: "raw"): boolean; + duplicateFloodMessageRecv(value?: Uint64): Uint64; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + uniqueFetchMessageRecv(value?: Uint64): Uint64; - class TimeBounds { - constructor(attributes: { minTime: TimePoint; maxTime: TimePoint }); + duplicateFetchMessageRecv(value?: Uint64): Uint64; - minTime(value?: TimePoint): TimePoint; + toXDR(format?: 'raw'): Buffer; - maxTime(value?: TimePoint): TimePoint; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): PeerStats; - toXDR(format: "hex" | "base64"): string; + static write(value: PeerStats, io: Buffer): void; - static read(io: Buffer): TimeBounds; + static isValid(value: PeerStats): boolean; - static write(value: TimeBounds, io: Buffer): void; + static toXDR(value: PeerStats): Buffer; - static isValid(value: TimeBounds): boolean; + static fromXDR(input: Buffer, format?: 'raw'): PeerStats; - static toXDR(value: TimeBounds): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): PeerStats; - static fromXDR(input: Buffer, format?: "raw"): TimeBounds; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): TimeBounds; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static validateXDR(input: Buffer, format?: "raw"): boolean; + class TopologyResponseBodyV0 { + constructor(attributes: { + inboundPeers: PeerStats[]; + outboundPeers: PeerStats[]; + totalInboundPeerCount: number; + totalOutboundPeerCount: number; + }); - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + inboundPeers(value?: PeerStats[]): PeerStats[]; - class LedgerBounds { - constructor(attributes: { minLedger: number; maxLedger: number }); + outboundPeers(value?: PeerStats[]): PeerStats[]; - minLedger(value?: number): number; + totalInboundPeerCount(value?: number): number; - maxLedger(value?: number): number; + totalOutboundPeerCount(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerBounds; + static read(io: Buffer): TopologyResponseBodyV0; - static write(value: LedgerBounds, io: Buffer): void; + static write(value: TopologyResponseBodyV0, io: Buffer): void; - static isValid(value: LedgerBounds): boolean; + static isValid(value: TopologyResponseBodyV0): boolean; - static toXDR(value: LedgerBounds): Buffer; + static toXDR(value: TopologyResponseBodyV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerBounds; + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV0; - static fromXDR(input: string, format: "hex" | "base64"): LedgerBounds; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TopologyResponseBodyV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PreconditionsV2 { + class TopologyResponseBodyV1 { constructor(attributes: { - timeBounds: null | TimeBounds; - ledgerBounds: null | LedgerBounds; - minSeqNum: null | SequenceNumber; - minSeqAge: Duration; - minSeqLedgerGap: number; - extraSigners: SignerKey[]; + inboundPeers: PeerStats[]; + outboundPeers: PeerStats[]; + totalInboundPeerCount: number; + totalOutboundPeerCount: number; + maxInboundPeerCount: number; + maxOutboundPeerCount: number; }); - timeBounds(value?: null | TimeBounds): null | TimeBounds; + inboundPeers(value?: PeerStats[]): PeerStats[]; - ledgerBounds(value?: null | LedgerBounds): null | LedgerBounds; + outboundPeers(value?: PeerStats[]): PeerStats[]; - minSeqNum(value?: null | SequenceNumber): null | SequenceNumber; + totalInboundPeerCount(value?: number): number; - minSeqAge(value?: Duration): Duration; + totalOutboundPeerCount(value?: number): number; - minSeqLedgerGap(value?: number): number; + maxInboundPeerCount(value?: number): number; - extraSigners(value?: SignerKey[]): SignerKey[]; + maxOutboundPeerCount(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PreconditionsV2; + static read(io: Buffer): TopologyResponseBodyV1; - static write(value: PreconditionsV2, io: Buffer): void; + static write(value: TopologyResponseBodyV1, io: Buffer): void; - static isValid(value: PreconditionsV2): boolean; + static isValid(value: TopologyResponseBodyV1): boolean; - static toXDR(value: PreconditionsV2): Buffer; + static toXDR(value: TopologyResponseBodyV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PreconditionsV2; + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV1; - static fromXDR(input: string, format: "hex" | "base64"): PreconditionsV2; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TopologyResponseBodyV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionV0 { - constructor(attributes: { - sourceAccountEd25519: Buffer; - fee: number; - seqNum: SequenceNumber; - timeBounds: null | TimeBounds; - memo: Memo; - operations: Operation[]; - ext: TransactionV0Ext; - }); + class FloodAdvert { + constructor(attributes: { txHashes: Hash[] }); - sourceAccountEd25519(value?: Buffer): Buffer; + txHashes(value?: Hash[]): Hash[]; - fee(value?: number): number; + toXDR(format?: 'raw'): Buffer; - seqNum(value?: SequenceNumber): SequenceNumber; + toXDR(format: 'hex' | 'base64'): string; - timeBounds(value?: null | TimeBounds): null | TimeBounds; + static read(io: Buffer): FloodAdvert; - memo(value?: Memo): Memo; + static write(value: FloodAdvert, io: Buffer): void; - operations(value?: Operation[]): Operation[]; + static isValid(value: FloodAdvert): boolean; - ext(value?: TransactionV0Ext): TransactionV0Ext; + static toXDR(value: FloodAdvert): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): FloodAdvert; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: string, format: 'hex' | 'base64'): FloodAdvert; - static read(io: Buffer): TransactionV0; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: TransactionV0, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: TransactionV0): boolean; + class FloodDemand { + constructor(attributes: { txHashes: Hash[] }); - static toXDR(value: TransactionV0): Buffer; + txHashes(value?: Hash[]): Hash[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): FloodDemand; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0; + static write(value: FloodDemand, io: Buffer): void; + + static isValid(value: FloodDemand): boolean; + + static toXDR(value: FloodDemand): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): FloodDemand; - static fromXDR(input: string, format: "hex" | "base64"): TransactionV0; + static fromXDR(input: string, format: 'hex' | 'base64'): FloodDemand; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionV0Envelope { + class AuthenticatedMessageV0 { constructor(attributes: { - tx: TransactionV0; - signatures: DecoratedSignature[]; + sequence: Uint64; + message: StellarMessage; + mac: HmacSha256Mac; }); - tx(value?: TransactionV0): TransactionV0; + sequence(value?: Uint64): Uint64; - signatures(value?: DecoratedSignature[]): DecoratedSignature[]; + message(value?: StellarMessage): StellarMessage; - toXDR(format?: "raw"): Buffer; + mac(value?: HmacSha256Mac): HmacSha256Mac; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): TransactionV0Envelope; + toXDR(format: 'hex' | 'base64'): string; - static write(value: TransactionV0Envelope, io: Buffer): void; + static read(io: Buffer): AuthenticatedMessageV0; - static isValid(value: TransactionV0Envelope): boolean; + static write(value: AuthenticatedMessageV0, io: Buffer): void; - static toXDR(value: TransactionV0Envelope): Buffer; + static isValid(value: AuthenticatedMessageV0): boolean; + + static toXDR(value: AuthenticatedMessageV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0Envelope; + static fromXDR(input: Buffer, format?: 'raw'): AuthenticatedMessageV0; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionV0Envelope; + format: 'hex' | 'base64', + ): AuthenticatedMessageV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Transaction { - constructor(attributes: { - sourceAccount: MuxedAccount; - fee: number; - seqNum: SequenceNumber; - cond: Preconditions; - memo: Memo; - operations: Operation[]; - ext: TransactionExt; - }); - - sourceAccount(value?: MuxedAccount): MuxedAccount; - - fee(value?: number): number; - - seqNum(value?: SequenceNumber): SequenceNumber; - - cond(value?: Preconditions): Preconditions; - - memo(value?: Memo): Memo; + class MuxedAccountMed25519 { + constructor(attributes: { id: Uint64; ed25519: Buffer }); - operations(value?: Operation[]): Operation[]; + id(value?: Uint64): Uint64; - ext(value?: TransactionExt): TransactionExt; + ed25519(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): Transaction; + static read(io: Buffer): MuxedAccountMed25519; - static write(value: Transaction, io: Buffer): void; + static write(value: MuxedAccountMed25519, io: Buffer): void; - static isValid(value: Transaction): boolean; + static isValid(value: MuxedAccountMed25519): boolean; - static toXDR(value: Transaction): Buffer; + static toXDR(value: MuxedAccountMed25519): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Transaction; + static fromXDR(input: Buffer, format?: 'raw'): MuxedAccountMed25519; - static fromXDR(input: string, format: "hex" | "base64"): Transaction; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): MuxedAccountMed25519; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionV1Envelope { - constructor(attributes: { - tx: Transaction; - signatures: DecoratedSignature[]; - }); + class DecoratedSignature { + constructor(attributes: { hint: Buffer; signature: Buffer }); - tx(value?: Transaction): Transaction; + hint(value?: Buffer): Buffer; - signatures(value?: DecoratedSignature[]): DecoratedSignature[]; + signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionV1Envelope; + static read(io: Buffer): DecoratedSignature; - static write(value: TransactionV1Envelope, io: Buffer): void; + static write(value: DecoratedSignature, io: Buffer): void; - static isValid(value: TransactionV1Envelope): boolean; + static isValid(value: DecoratedSignature): boolean; - static toXDR(value: TransactionV1Envelope): Buffer; + static toXDR(value: DecoratedSignature): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV1Envelope; + static fromXDR(input: Buffer, format?: 'raw'): DecoratedSignature; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionV1Envelope; + static fromXDR(input: string, format: 'hex' | 'base64'): DecoratedSignature; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class FeeBumpTransaction { - constructor(attributes: { - feeSource: MuxedAccount; - fee: Int64; - innerTx: FeeBumpTransactionInnerTx; - ext: FeeBumpTransactionExt; - }); + class CreateAccountOp { + constructor(attributes: { destination: AccountId; startingBalance: Int64 }); - feeSource(value?: MuxedAccount): MuxedAccount; + destination(value?: AccountId): AccountId; - fee(value?: Int64): Int64; + startingBalance(value?: Int64): Int64; - innerTx(value?: FeeBumpTransactionInnerTx): FeeBumpTransactionInnerTx; + toXDR(format?: 'raw'): Buffer; - ext(value?: FeeBumpTransactionExt): FeeBumpTransactionExt; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): CreateAccountOp; - toXDR(format: "hex" | "base64"): string; + static write(value: CreateAccountOp, io: Buffer): void; - static read(io: Buffer): FeeBumpTransaction; + static isValid(value: CreateAccountOp): boolean; - static write(value: FeeBumpTransaction, io: Buffer): void; + static toXDR(value: CreateAccountOp): Buffer; - static isValid(value: FeeBumpTransaction): boolean; + static fromXDR(input: Buffer, format?: 'raw'): CreateAccountOp; - static toXDR(value: FeeBumpTransaction): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): CreateAccountOp; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransaction; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): FeeBumpTransaction; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class FeeBumpTransactionEnvelope { + class PaymentOp { constructor(attributes: { - tx: FeeBumpTransaction; - signatures: DecoratedSignature[]; + destination: MuxedAccount; + asset: Asset; + amount: Int64; }); - tx(value?: FeeBumpTransaction): FeeBumpTransaction; + destination(value?: MuxedAccount): MuxedAccount; - signatures(value?: DecoratedSignature[]): DecoratedSignature[]; + asset(value?: Asset): Asset; - toXDR(format?: "raw"): Buffer; + amount(value?: Int64): Int64; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): FeeBumpTransactionEnvelope; + toXDR(format: 'hex' | 'base64'): string; - static write(value: FeeBumpTransactionEnvelope, io: Buffer): void; + static read(io: Buffer): PaymentOp; - static isValid(value: FeeBumpTransactionEnvelope): boolean; + static write(value: PaymentOp, io: Buffer): void; - static toXDR(value: FeeBumpTransactionEnvelope): Buffer; + static isValid(value: PaymentOp): boolean; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionEnvelope; + static toXDR(value: PaymentOp): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): FeeBumpTransactionEnvelope; + static fromXDR(input: Buffer, format?: 'raw'): PaymentOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): PaymentOp; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionSignaturePayload { + class PathPaymentStrictReceiveOp { constructor(attributes: { - networkId: Buffer; - taggedTransaction: TransactionSignaturePayloadTaggedTransaction; + sendAsset: Asset; + sendMax: Int64; + destination: MuxedAccount; + destAsset: Asset; + destAmount: Int64; + path: Asset[]; }); - networkId(value?: Buffer): Buffer; + sendAsset(value?: Asset): Asset; - taggedTransaction( - value?: TransactionSignaturePayloadTaggedTransaction - ): TransactionSignaturePayloadTaggedTransaction; + sendMax(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + destination(value?: MuxedAccount): MuxedAccount; - toXDR(format: "hex" | "base64"): string; + destAsset(value?: Asset): Asset; - static read(io: Buffer): TransactionSignaturePayload; + destAmount(value?: Int64): Int64; - static write(value: TransactionSignaturePayload, io: Buffer): void; + path(value?: Asset[]): Asset[]; - static isValid(value: TransactionSignaturePayload): boolean; + toXDR(format?: 'raw'): Buffer; - static toXDR(value: TransactionSignaturePayload): Buffer; + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PathPaymentStrictReceiveOp; + + static write(value: PathPaymentStrictReceiveOp, io: Buffer): void; + + static isValid(value: PathPaymentStrictReceiveOp): boolean; - static fromXDR(input: Buffer, format?: "raw"): TransactionSignaturePayload; + static toXDR(value: PathPaymentStrictReceiveOp): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictReceiveOp; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionSignaturePayload; + format: 'hex' | 'base64', + ): PathPaymentStrictReceiveOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimOfferAtomV0 { + class PathPaymentStrictSendOp { constructor(attributes: { - sellerEd25519: Buffer; - offerId: Int64; - assetSold: Asset; - amountSold: Int64; - assetBought: Asset; - amountBought: Int64; + sendAsset: Asset; + sendAmount: Int64; + destination: MuxedAccount; + destAsset: Asset; + destMin: Int64; + path: Asset[]; }); - sellerEd25519(value?: Buffer): Buffer; + sendAsset(value?: Asset): Asset; - offerId(value?: Int64): Int64; + sendAmount(value?: Int64): Int64; - assetSold(value?: Asset): Asset; + destination(value?: MuxedAccount): MuxedAccount; - amountSold(value?: Int64): Int64; + destAsset(value?: Asset): Asset; - assetBought(value?: Asset): Asset; + destMin(value?: Int64): Int64; - amountBought(value?: Int64): Int64; + path(value?: Asset[]): Asset[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimOfferAtomV0; + static read(io: Buffer): PathPaymentStrictSendOp; - static write(value: ClaimOfferAtomV0, io: Buffer): void; + static write(value: PathPaymentStrictSendOp, io: Buffer): void; - static isValid(value: ClaimOfferAtomV0): boolean; + static isValid(value: PathPaymentStrictSendOp): boolean; - static toXDR(value: ClaimOfferAtomV0): Buffer; + static toXDR(value: PathPaymentStrictSendOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimOfferAtomV0; + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictSendOp; - static fromXDR(input: string, format: "hex" | "base64"): ClaimOfferAtomV0; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): PathPaymentStrictSendOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimOfferAtom { + class ManageSellOfferOp { constructor(attributes: { - sellerId: AccountId; + selling: Asset; + buying: Asset; + amount: Int64; + price: Price; offerId: Int64; - assetSold: Asset; - amountSold: Int64; - assetBought: Asset; - amountBought: Int64; }); - sellerId(value?: AccountId): AccountId; - - offerId(value?: Int64): Int64; + selling(value?: Asset): Asset; - assetSold(value?: Asset): Asset; + buying(value?: Asset): Asset; - amountSold(value?: Int64): Int64; + amount(value?: Int64): Int64; - assetBought(value?: Asset): Asset; + price(value?: Price): Price; - amountBought(value?: Int64): Int64; + offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimOfferAtom; + static read(io: Buffer): ManageSellOfferOp; - static write(value: ClaimOfferAtom, io: Buffer): void; + static write(value: ManageSellOfferOp, io: Buffer): void; - static isValid(value: ClaimOfferAtom): boolean; + static isValid(value: ManageSellOfferOp): boolean; - static toXDR(value: ClaimOfferAtom): Buffer; + static toXDR(value: ManageSellOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimOfferAtom; + static fromXDR(input: Buffer, format?: 'raw'): ManageSellOfferOp; - static fromXDR(input: string, format: "hex" | "base64"): ClaimOfferAtom; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageSellOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimLiquidityAtom { + class ManageBuyOfferOp { constructor(attributes: { - liquidityPoolId: PoolId; - assetSold: Asset; - amountSold: Int64; - assetBought: Asset; - amountBought: Int64; + selling: Asset; + buying: Asset; + buyAmount: Int64; + price: Price; + offerId: Int64; }); - liquidityPoolId(value?: PoolId): PoolId; + selling(value?: Asset): Asset; - assetSold(value?: Asset): Asset; + buying(value?: Asset): Asset; - amountSold(value?: Int64): Int64; + buyAmount(value?: Int64): Int64; - assetBought(value?: Asset): Asset; + price(value?: Price): Price; - amountBought(value?: Int64): Int64; + offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimLiquidityAtom; + static read(io: Buffer): ManageBuyOfferOp; - static write(value: ClaimLiquidityAtom, io: Buffer): void; + static write(value: ManageBuyOfferOp, io: Buffer): void; - static isValid(value: ClaimLiquidityAtom): boolean; + static isValid(value: ManageBuyOfferOp): boolean; - static toXDR(value: ClaimLiquidityAtom): Buffer; + static toXDR(value: ManageBuyOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimLiquidityAtom; + static fromXDR(input: Buffer, format?: 'raw'): ManageBuyOfferOp; - static fromXDR(input: string, format: "hex" | "base64"): ClaimLiquidityAtom; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageBuyOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SimplePaymentResult { + class CreatePassiveSellOfferOp { constructor(attributes: { - destination: AccountId; - asset: Asset; + selling: Asset; + buying: Asset; amount: Int64; + price: Price; }); - destination(value?: AccountId): AccountId; + selling(value?: Asset): Asset; - asset(value?: Asset): Asset; + buying(value?: Asset): Asset; amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + price(value?: Price): Price; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): SimplePaymentResult; + toXDR(format: 'hex' | 'base64'): string; - static write(value: SimplePaymentResult, io: Buffer): void; + static read(io: Buffer): CreatePassiveSellOfferOp; - static isValid(value: SimplePaymentResult): boolean; + static write(value: CreatePassiveSellOfferOp, io: Buffer): void; - static toXDR(value: SimplePaymentResult): Buffer; + static isValid(value: CreatePassiveSellOfferOp): boolean; + + static toXDR(value: CreatePassiveSellOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SimplePaymentResult; + static fromXDR(input: Buffer, format?: 'raw'): CreatePassiveSellOfferOp; static fromXDR( input: string, - format: "hex" | "base64" - ): SimplePaymentResult; + format: 'hex' | 'base64', + ): CreatePassiveSellOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PathPaymentStrictReceiveResultSuccess { - constructor(attributes: { offers: ClaimAtom[]; last: SimplePaymentResult }); + class SetOptionsOp { + constructor(attributes: { + inflationDest: null | AccountId; + clearFlags: null | number; + setFlags: null | number; + masterWeight: null | number; + lowThreshold: null | number; + medThreshold: null | number; + highThreshold: null | number; + homeDomain: null | string | Buffer; + signer: null | Signer; + }); - offers(value?: ClaimAtom[]): ClaimAtom[]; + inflationDest(value?: null | AccountId): null | AccountId; - last(value?: SimplePaymentResult): SimplePaymentResult; + clearFlags(value?: null | number): null | number; - toXDR(format?: "raw"): Buffer; + setFlags(value?: null | number): null | number; - toXDR(format: "hex" | "base64"): string; + masterWeight(value?: null | number): null | number; - static read(io: Buffer): PathPaymentStrictReceiveResultSuccess; + lowThreshold(value?: null | number): null | number; - static write( - value: PathPaymentStrictReceiveResultSuccess, - io: Buffer - ): void; + medThreshold(value?: null | number): null | number; - static isValid(value: PathPaymentStrictReceiveResultSuccess): boolean; + highThreshold(value?: null | number): null | number; - static toXDR(value: PathPaymentStrictReceiveResultSuccess): Buffer; + homeDomain(value?: null | string | Buffer): null | string | Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): PathPaymentStrictReceiveResultSuccess; + signer(value?: null | Signer): null | Signer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): PathPaymentStrictReceiveResultSuccess; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static read(io: Buffer): SetOptionsOp; - class PathPaymentStrictSendResultSuccess { - constructor(attributes: { offers: ClaimAtom[]; last: SimplePaymentResult }); + static write(value: SetOptionsOp, io: Buffer): void; - offers(value?: ClaimAtom[]): ClaimAtom[]; + static isValid(value: SetOptionsOp): boolean; - last(value?: SimplePaymentResult): SimplePaymentResult; + static toXDR(value: SetOptionsOp): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): SetOptionsOp; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: string, format: 'hex' | 'base64'): SetOptionsOp; - static read(io: Buffer): PathPaymentStrictSendResultSuccess; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: PathPaymentStrictSendResultSuccess, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: PathPaymentStrictSendResultSuccess): boolean; + class ChangeTrustOp { + constructor(attributes: { line: ChangeTrustAsset; limit: Int64 }); - static toXDR(value: PathPaymentStrictSendResultSuccess): Buffer; + line(value?: ChangeTrustAsset): ChangeTrustAsset; - static fromXDR( - input: Buffer, - format?: "raw" - ): PathPaymentStrictSendResultSuccess; + limit(value?: Int64): Int64; - static fromXDR( - input: string, - format: "hex" | "base64" - ): PathPaymentStrictSendResultSuccess; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static read(io: Buffer): ChangeTrustOp; - class ManageOfferSuccessResult { - constructor(attributes: { - offersClaimed: ClaimAtom[]; - offer: ManageOfferSuccessResultOffer; - }); + static write(value: ChangeTrustOp, io: Buffer): void; - offersClaimed(value?: ClaimAtom[]): ClaimAtom[]; + static isValid(value: ChangeTrustOp): boolean; - offer(value?: ManageOfferSuccessResultOffer): ManageOfferSuccessResultOffer; + static toXDR(value: ChangeTrustOp): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustOp; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustOp; - static read(io: Buffer): ManageOfferSuccessResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: ManageOfferSuccessResult, io: Buffer): void; - - static isValid(value: ManageOfferSuccessResult): boolean; - - static toXDR(value: ManageOfferSuccessResult): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): ManageOfferSuccessResult; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): ManageOfferSuccessResult; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InflationPayout { - constructor(attributes: { destination: AccountId; amount: Int64 }); + class AllowTrustOp { + constructor(attributes: { + trustor: AccountId; + asset: AssetCode; + authorize: number; + }); - destination(value?: AccountId): AccountId; + trustor(value?: AccountId): AccountId; - amount(value?: Int64): Int64; + asset(value?: AssetCode): AssetCode; + + authorize(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InflationPayout; + static read(io: Buffer): AllowTrustOp; - static write(value: InflationPayout, io: Buffer): void; + static write(value: AllowTrustOp, io: Buffer): void; - static isValid(value: InflationPayout): boolean; + static isValid(value: AllowTrustOp): boolean; - static toXDR(value: InflationPayout): Buffer; + static toXDR(value: AllowTrustOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InflationPayout; + static fromXDR(input: Buffer, format?: 'raw'): AllowTrustOp; - static fromXDR(input: string, format: "hex" | "base64"): InflationPayout; + static fromXDR(input: string, format: 'hex' | 'base64'): AllowTrustOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InnerTransactionResult { + class ManageDataOp { constructor(attributes: { - feeCharged: Int64; - result: InnerTransactionResultResult; - ext: InnerTransactionResultExt; + dataName: string | Buffer; + dataValue: null | Buffer; }); - feeCharged(value?: Int64): Int64; - - result(value?: InnerTransactionResultResult): InnerTransactionResultResult; + dataName(value?: string | Buffer): string | Buffer; - ext(value?: InnerTransactionResultExt): InnerTransactionResultExt; + dataValue(value?: null | Buffer): null | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InnerTransactionResult; + static read(io: Buffer): ManageDataOp; - static write(value: InnerTransactionResult, io: Buffer): void; + static write(value: ManageDataOp, io: Buffer): void; - static isValid(value: InnerTransactionResult): boolean; + static isValid(value: ManageDataOp): boolean; - static toXDR(value: InnerTransactionResult): Buffer; + static toXDR(value: ManageDataOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResult; + static fromXDR(input: Buffer, format?: 'raw'): ManageDataOp; - static fromXDR( - input: string, - format: "hex" | "base64" - ): InnerTransactionResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageDataOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InnerTransactionResultPair { - constructor(attributes: { - transactionHash: Buffer; - result: InnerTransactionResult; - }); - - transactionHash(value?: Buffer): Buffer; + class BumpSequenceOp { + constructor(attributes: { bumpTo: SequenceNumber }); - result(value?: InnerTransactionResult): InnerTransactionResult; + bumpTo(value?: SequenceNumber): SequenceNumber; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InnerTransactionResultPair; + static read(io: Buffer): BumpSequenceOp; - static write(value: InnerTransactionResultPair, io: Buffer): void; + static write(value: BumpSequenceOp, io: Buffer): void; - static isValid(value: InnerTransactionResultPair): boolean; + static isValid(value: BumpSequenceOp): boolean; - static toXDR(value: InnerTransactionResultPair): Buffer; + static toXDR(value: BumpSequenceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultPair; + static fromXDR(input: Buffer, format?: 'raw'): BumpSequenceOp; - static fromXDR( - input: string, - format: "hex" | "base64" - ): InnerTransactionResultPair; + static fromXDR(input: string, format: 'hex' | 'base64'): BumpSequenceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResult { + class CreateClaimableBalanceOp { constructor(attributes: { - feeCharged: Int64; - result: TransactionResultResult; - ext: TransactionResultExt; + asset: Asset; + amount: Int64; + claimants: Claimant[]; }); - feeCharged(value?: Int64): Int64; + asset(value?: Asset): Asset; - result(value?: TransactionResultResult): TransactionResultResult; + amount(value?: Int64): Int64; - ext(value?: TransactionResultExt): TransactionResultExt; + claimants(value?: Claimant[]): Claimant[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResult; + static read(io: Buffer): CreateClaimableBalanceOp; - static write(value: TransactionResult, io: Buffer): void; + static write(value: CreateClaimableBalanceOp, io: Buffer): void; - static isValid(value: TransactionResult): boolean; + static isValid(value: CreateClaimableBalanceOp): boolean; - static toXDR(value: TransactionResult): Buffer; + static toXDR(value: CreateClaimableBalanceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResult; + static fromXDR(input: Buffer, format?: 'raw'): CreateClaimableBalanceOp; - static fromXDR(input: string, format: "hex" | "base64"): TransactionResult; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): CreateClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class SignerKeyEd25519SignedPayload { - constructor(attributes: { ed25519: Buffer; payload: Buffer }); - - ed25519(value?: Buffer): Buffer; + class ClaimClaimableBalanceOp { + constructor(attributes: { balanceId: ClaimableBalanceId }); - payload(value?: Buffer): Buffer; + balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SignerKeyEd25519SignedPayload; + static read(io: Buffer): ClaimClaimableBalanceOp; - static write(value: SignerKeyEd25519SignedPayload, io: Buffer): void; + static write(value: ClaimClaimableBalanceOp, io: Buffer): void; - static isValid(value: SignerKeyEd25519SignedPayload): boolean; + static isValid(value: ClaimClaimableBalanceOp): boolean; - static toXDR(value: SignerKeyEd25519SignedPayload): Buffer; + static toXDR(value: ClaimClaimableBalanceOp): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): SignerKeyEd25519SignedPayload; + static fromXDR(input: Buffer, format?: 'raw'): ClaimClaimableBalanceOp; static fromXDR( input: string, - format: "hex" | "base64" - ): SignerKeyEd25519SignedPayload; + format: 'hex' | 'base64', + ): ClaimClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Curve25519Secret { - constructor(attributes: { key: Buffer }); + class BeginSponsoringFutureReservesOp { + constructor(attributes: { sponsoredId: AccountId }); - key(value?: Buffer): Buffer; + sponsoredId(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): Curve25519Secret; + static read(io: Buffer): BeginSponsoringFutureReservesOp; - static write(value: Curve25519Secret, io: Buffer): void; + static write(value: BeginSponsoringFutureReservesOp, io: Buffer): void; - static isValid(value: Curve25519Secret): boolean; + static isValid(value: BeginSponsoringFutureReservesOp): boolean; - static toXDR(value: Curve25519Secret): Buffer; + static toXDR(value: BeginSponsoringFutureReservesOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Curve25519Secret; + static fromXDR( + input: Buffer, + format?: 'raw', + ): BeginSponsoringFutureReservesOp; - static fromXDR(input: string, format: "hex" | "base64"): Curve25519Secret; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): BeginSponsoringFutureReservesOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Curve25519Public { - constructor(attributes: { key: Buffer }); - - key(value?: Buffer): Buffer; - - toXDR(format?: "raw"): Buffer; + class RevokeSponsorshipOpSigner { + constructor(attributes: { accountId: AccountId; signerKey: SignerKey }); - toXDR(format: "hex" | "base64"): string; + accountId(value?: AccountId): AccountId; - static read(io: Buffer): Curve25519Public; + signerKey(value?: SignerKey): SignerKey; - static write(value: Curve25519Public, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: Curve25519Public): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: Curve25519Public): Buffer; + static read(io: Buffer): RevokeSponsorshipOpSigner; - static fromXDR(input: Buffer, format?: "raw"): Curve25519Public; + static write(value: RevokeSponsorshipOpSigner, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): Curve25519Public; + static isValid(value: RevokeSponsorshipOpSigner): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: RevokeSponsorshipOpSigner): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipOpSigner; - class HmacSha256Key { - constructor(attributes: { key: Buffer }); + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): RevokeSponsorshipOpSigner; - key(value?: Buffer): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format?: "raw"): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format: "hex" | "base64"): string; + class ClawbackOp { + constructor(attributes: { + asset: Asset; + from: MuxedAccount; + amount: Int64; + }); - static read(io: Buffer): HmacSha256Key; + asset(value?: Asset): Asset; - static write(value: HmacSha256Key, io: Buffer): void; + from(value?: MuxedAccount): MuxedAccount; - static isValid(value: HmacSha256Key): boolean; + amount(value?: Int64): Int64; - static toXDR(value: HmacSha256Key): Buffer; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HmacSha256Key; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR(input: string, format: "hex" | "base64"): HmacSha256Key; + static read(io: Buffer): ClawbackOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static write(value: ClawbackOp, io: Buffer): void; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static isValid(value: ClawbackOp): boolean; - class HmacSha256Mac { - constructor(attributes: { mac: Buffer }); + static toXDR(value: ClawbackOp): Buffer; - mac(value?: Buffer): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackOp; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): ClawbackOp; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static read(io: Buffer): HmacSha256Mac; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static write(value: HmacSha256Mac, io: Buffer): void; + class ClawbackClaimableBalanceOp { + constructor(attributes: { balanceId: ClaimableBalanceId }); - static isValid(value: HmacSha256Mac): boolean; + balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - static toXDR(value: HmacSha256Mac): Buffer; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HmacSha256Mac; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR(input: string, format: "hex" | "base64"): HmacSha256Mac; + static read(io: Buffer): ClawbackClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static write(value: ClawbackClaimableBalanceOp, io: Buffer): void; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static isValid(value: ClawbackClaimableBalanceOp): boolean; - class ScpStatementPledges { - switch(): ScpStatementType; + static toXDR(value: ClawbackClaimableBalanceOp): Buffer; - prepare(value?: ScpStatementPrepare): ScpStatementPrepare; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackClaimableBalanceOp; - confirm(value?: ScpStatementConfirm): ScpStatementConfirm; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ClawbackClaimableBalanceOp; - externalize(value?: ScpStatementExternalize): ScpStatementExternalize; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - nominate(value?: ScpNomination): ScpNomination; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static scpStPrepare(value: ScpStatementPrepare): ScpStatementPledges; + class SetTrustLineFlagsOp { + constructor(attributes: { + trustor: AccountId; + asset: Asset; + clearFlags: number; + setFlags: number; + }); - static scpStConfirm(value: ScpStatementConfirm): ScpStatementPledges; + trustor(value?: AccountId): AccountId; - static scpStExternalize( - value: ScpStatementExternalize - ): ScpStatementPledges; + asset(value?: Asset): Asset; - static scpStNominate(value: ScpNomination): ScpStatementPledges; + clearFlags(value?: number): number; - value(): - | ScpStatementPrepare - | ScpStatementConfirm - | ScpStatementExternalize - | ScpNomination; + setFlags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScpStatementPledges; + static read(io: Buffer): SetTrustLineFlagsOp; - static write(value: ScpStatementPledges, io: Buffer): void; + static write(value: SetTrustLineFlagsOp, io: Buffer): void; - static isValid(value: ScpStatementPledges): boolean; + static isValid(value: SetTrustLineFlagsOp): boolean; - static toXDR(value: ScpStatementPledges): Buffer; + static toXDR(value: SetTrustLineFlagsOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementPledges; + static fromXDR(input: Buffer, format?: 'raw'): SetTrustLineFlagsOp; static fromXDR( input: string, - format: "hex" | "base64" - ): ScpStatementPledges; + format: 'hex' | 'base64', + ): SetTrustLineFlagsOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AssetCode { - switch(): AssetType; + class LiquidityPoolDepositOp { + constructor(attributes: { + liquidityPoolId: PoolId; + maxAmountA: Int64; + maxAmountB: Int64; + minPrice: Price; + maxPrice: Price; + }); - assetCode4(value?: Buffer): Buffer; + liquidityPoolId(value?: PoolId): PoolId; - assetCode12(value?: Buffer): Buffer; + maxAmountA(value?: Int64): Int64; - static assetTypeCreditAlphanum4(value: Buffer): AssetCode; + maxAmountB(value?: Int64): Int64; - static assetTypeCreditAlphanum12(value: Buffer): AssetCode; + minPrice(value?: Price): Price; - value(): Buffer | Buffer; + maxPrice(value?: Price): Price; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AssetCode; + static read(io: Buffer): LiquidityPoolDepositOp; - static write(value: AssetCode, io: Buffer): void; + static write(value: LiquidityPoolDepositOp, io: Buffer): void; - static isValid(value: AssetCode): boolean; + static isValid(value: LiquidityPoolDepositOp): boolean; - static toXDR(value: AssetCode): Buffer; + static toXDR(value: LiquidityPoolDepositOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AssetCode; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolDepositOp; - static fromXDR(input: string, format: "hex" | "base64"): AssetCode; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolDepositOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Asset { - switch(): AssetType; - - alphaNum4(value?: AlphaNum4): AlphaNum4; - - alphaNum12(value?: AlphaNum12): AlphaNum12; + class LiquidityPoolWithdrawOp { + constructor(attributes: { + liquidityPoolId: PoolId; + amount: Int64; + minAmountA: Int64; + minAmountB: Int64; + }); - static assetTypeNative(): Asset; + liquidityPoolId(value?: PoolId): PoolId; - static assetTypeCreditAlphanum4(value: AlphaNum4): Asset; + amount(value?: Int64): Int64; - static assetTypeCreditAlphanum12(value: AlphaNum12): Asset; + minAmountA(value?: Int64): Int64; - value(): AlphaNum4 | AlphaNum12 | void; + minAmountB(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): Asset; + static read(io: Buffer): LiquidityPoolWithdrawOp; - static write(value: Asset, io: Buffer): void; + static write(value: LiquidityPoolWithdrawOp, io: Buffer): void; - static isValid(value: Asset): boolean; + static isValid(value: LiquidityPoolWithdrawOp): boolean; - static toXDR(value: Asset): Buffer; + static toXDR(value: LiquidityPoolWithdrawOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Asset; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolWithdrawOp; - static fromXDR(input: string, format: "hex" | "base64"): Asset; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolWithdrawOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExtensionV2Ext { - switch(): number; - - v3(value?: AccountEntryExtensionV3): AccountEntryExtensionV3; - - static 0(): AccountEntryExtensionV2Ext; + class ContractIdPreimageFromAddress { + constructor(attributes: { address: ScAddress; salt: Buffer }); - static 3(value: AccountEntryExtensionV3): AccountEntryExtensionV2Ext; + address(value?: ScAddress): ScAddress; - value(): AccountEntryExtensionV3 | void; + salt(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AccountEntryExtensionV2Ext; + static read(io: Buffer): ContractIdPreimageFromAddress; - static write(value: AccountEntryExtensionV2Ext, io: Buffer): void; + static write(value: ContractIdPreimageFromAddress, io: Buffer): void; - static isValid(value: AccountEntryExtensionV2Ext): boolean; + static isValid(value: ContractIdPreimageFromAddress): boolean; - static toXDR(value: AccountEntryExtensionV2Ext): Buffer; + static toXDR(value: ContractIdPreimageFromAddress): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV2Ext; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ContractIdPreimageFromAddress; static fromXDR( input: string, - format: "hex" | "base64" - ): AccountEntryExtensionV2Ext; + format: 'hex' | 'base64', + ): ContractIdPreimageFromAddress; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExtensionV1Ext { - switch(): number; - - v2(value?: AccountEntryExtensionV2): AccountEntryExtensionV2; - - static 0(): AccountEntryExtensionV1Ext; + class CreateContractArgs { + constructor(attributes: { + contractIdPreimage: ContractIdPreimage; + executable: ContractExecutable; + }); - static 2(value: AccountEntryExtensionV2): AccountEntryExtensionV1Ext; + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; - value(): AccountEntryExtensionV2 | void; + executable(value?: ContractExecutable): ContractExecutable; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AccountEntryExtensionV1Ext; + static read(io: Buffer): CreateContractArgs; - static write(value: AccountEntryExtensionV1Ext, io: Buffer): void; + static write(value: CreateContractArgs, io: Buffer): void; - static isValid(value: AccountEntryExtensionV1Ext): boolean; + static isValid(value: CreateContractArgs): boolean; - static toXDR(value: AccountEntryExtensionV1Ext): Buffer; + static toXDR(value: CreateContractArgs): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): CreateContractArgs; - static fromXDR( - input: string, - format: "hex" | "base64" - ): AccountEntryExtensionV1Ext; + static fromXDR(input: string, format: 'hex' | 'base64'): CreateContractArgs; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AccountEntryExt { - switch(): number; - - v1(value?: AccountEntryExtensionV1): AccountEntryExtensionV1; + class InvokeContractArgs { + constructor(attributes: { + contractAddress: ScAddress; + functionName: string | Buffer; + args: ScVal[]; + }); - static 0(): AccountEntryExt; + contractAddress(value?: ScAddress): ScAddress; - static 1(value: AccountEntryExtensionV1): AccountEntryExt; + functionName(value?: string | Buffer): string | Buffer; - value(): AccountEntryExtensionV1 | void; + args(value?: ScVal[]): ScVal[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): AccountEntryExt; + static read(io: Buffer): InvokeContractArgs; - static write(value: AccountEntryExt, io: Buffer): void; + static write(value: InvokeContractArgs, io: Buffer): void; - static isValid(value: AccountEntryExt): boolean; + static isValid(value: InvokeContractArgs): boolean; - static toXDR(value: AccountEntryExt): Buffer; + static toXDR(value: InvokeContractArgs): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): InvokeContractArgs; - static fromXDR(input: string, format: "hex" | "base64"): AccountEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): InvokeContractArgs; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineAsset { - switch(): AssetType; - - alphaNum4(value?: AlphaNum4): AlphaNum4; - - alphaNum12(value?: AlphaNum12): AlphaNum12; - - liquidityPoolId(value?: PoolId): PoolId; - - static assetTypeNative(): TrustLineAsset; + class SorobanAuthorizedInvocation { + constructor(attributes: { + function: SorobanAuthorizedFunction; + subInvocations: SorobanAuthorizedInvocation[]; + }); - static assetTypeCreditAlphanum4(value: AlphaNum4): TrustLineAsset; + function(value?: SorobanAuthorizedFunction): SorobanAuthorizedFunction; - static assetTypeCreditAlphanum12(value: AlphaNum12): TrustLineAsset; + subInvocations( + value?: SorobanAuthorizedInvocation[], + ): SorobanAuthorizedInvocation[]; - static assetTypePoolShare(value: PoolId): TrustLineAsset; + toXDR(format?: 'raw'): Buffer; - value(): AlphaNum4 | AlphaNum12 | PoolId | void; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): SorobanAuthorizedInvocation; - toXDR(format: "hex" | "base64"): string; + static write(value: SorobanAuthorizedInvocation, io: Buffer): void; - static read(io: Buffer): TrustLineAsset; + static isValid(value: SorobanAuthorizedInvocation): boolean; - static write(value: TrustLineAsset, io: Buffer): void; + static toXDR(value: SorobanAuthorizedInvocation): Buffer; - static isValid(value: TrustLineAsset): boolean; + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizedInvocation; - static toXDR(value: TrustLineAsset): Buffer; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanAuthorizedInvocation; - static fromXDR(input: Buffer, format?: "raw"): TrustLineAsset; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineAsset; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static validateXDR(input: Buffer, format?: "raw"): boolean; + class SorobanAddressCredentials { + constructor(attributes: { + address: ScAddress; + nonce: Int64; + signatureExpirationLedger: number; + signature: ScVal; + }); - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + address(value?: ScAddress): ScAddress; - class TrustLineEntryExtensionV2Ext { - switch(): number; + nonce(value?: Int64): Int64; - static 0(): TrustLineEntryExtensionV2Ext; + signatureExpirationLedger(value?: number): number; - value(): void; + signature(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TrustLineEntryExtensionV2Ext; + static read(io: Buffer): SorobanAddressCredentials; - static write(value: TrustLineEntryExtensionV2Ext, io: Buffer): void; + static write(value: SorobanAddressCredentials, io: Buffer): void; - static isValid(value: TrustLineEntryExtensionV2Ext): boolean; + static isValid(value: SorobanAddressCredentials): boolean; - static toXDR(value: TrustLineEntryExtensionV2Ext): Buffer; + static toXDR(value: SorobanAddressCredentials): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExtensionV2Ext; + static fromXDR(input: Buffer, format?: 'raw'): SorobanAddressCredentials; static fromXDR( input: string, - format: "hex" | "base64" - ): TrustLineEntryExtensionV2Ext; + format: 'hex' | 'base64', + ): SorobanAddressCredentials; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineEntryV1Ext { - switch(): number; - - v2(value?: TrustLineEntryExtensionV2): TrustLineEntryExtensionV2; - - static 0(): TrustLineEntryV1Ext; + class SorobanAuthorizationEntry { + constructor(attributes: { + credentials: SorobanCredentials; + rootInvocation: SorobanAuthorizedInvocation; + }); - static 2(value: TrustLineEntryExtensionV2): TrustLineEntryV1Ext; + credentials(value?: SorobanCredentials): SorobanCredentials; - value(): TrustLineEntryExtensionV2 | void; + rootInvocation( + value?: SorobanAuthorizedInvocation, + ): SorobanAuthorizedInvocation; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TrustLineEntryV1Ext; + static read(io: Buffer): SorobanAuthorizationEntry; - static write(value: TrustLineEntryV1Ext, io: Buffer): void; + static write(value: SorobanAuthorizationEntry, io: Buffer): void; - static isValid(value: TrustLineEntryV1Ext): boolean; + static isValid(value: SorobanAuthorizationEntry): boolean; - static toXDR(value: TrustLineEntryV1Ext): Buffer; + static toXDR(value: SorobanAuthorizationEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizationEntry; static fromXDR( input: string, - format: "hex" | "base64" - ): TrustLineEntryV1Ext; + format: 'hex' | 'base64', + ): SorobanAuthorizationEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TrustLineEntryExt { - switch(): number; - - v1(value?: TrustLineEntryV1): TrustLineEntryV1; - - static 0(): TrustLineEntryExt; + class InvokeHostFunctionOp { + constructor(attributes: { + hostFunction: HostFunction; + auth: SorobanAuthorizationEntry[]; + }); - static 1(value: TrustLineEntryV1): TrustLineEntryExt; + hostFunction(value?: HostFunction): HostFunction; - value(): TrustLineEntryV1 | void; + auth(value?: SorobanAuthorizationEntry[]): SorobanAuthorizationEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TrustLineEntryExt; + static read(io: Buffer): InvokeHostFunctionOp; - static write(value: TrustLineEntryExt, io: Buffer): void; + static write(value: InvokeHostFunctionOp, io: Buffer): void; - static isValid(value: TrustLineEntryExt): boolean; + static isValid(value: InvokeHostFunctionOp): boolean; - static toXDR(value: TrustLineEntryExt): Buffer; + static toXDR(value: InvokeHostFunctionOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): InvokeHostFunctionOp; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntryExt; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): InvokeHostFunctionOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class OfferEntryExt { - switch(): number; + class BumpFootprintExpirationOp { + constructor(attributes: { ext: ExtensionPoint; ledgersToExpire: number }); - static 0(): OfferEntryExt; + ext(value?: ExtensionPoint): ExtensionPoint; - value(): void; + ledgersToExpire(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): OfferEntryExt; + static read(io: Buffer): BumpFootprintExpirationOp; - static write(value: OfferEntryExt, io: Buffer): void; + static write(value: BumpFootprintExpirationOp, io: Buffer): void; - static isValid(value: OfferEntryExt): boolean; + static isValid(value: BumpFootprintExpirationOp): boolean; - static toXDR(value: OfferEntryExt): Buffer; + static toXDR(value: BumpFootprintExpirationOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OfferEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): BumpFootprintExpirationOp; - static fromXDR(input: string, format: "hex" | "base64"): OfferEntryExt; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): BumpFootprintExpirationOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class DataEntryExt { - switch(): number; - - static 0(): DataEntryExt; + class RestoreFootprintOp { + constructor(attributes: { ext: ExtensionPoint }); - value(): void; + ext(value?: ExtensionPoint): ExtensionPoint; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): DataEntryExt; + static read(io: Buffer): RestoreFootprintOp; - static write(value: DataEntryExt, io: Buffer): void; + static write(value: RestoreFootprintOp, io: Buffer): void; - static isValid(value: DataEntryExt): boolean; + static isValid(value: RestoreFootprintOp): boolean; - static toXDR(value: DataEntryExt): Buffer; + static toXDR(value: RestoreFootprintOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DataEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): RestoreFootprintOp; - static fromXDR(input: string, format: "hex" | "base64"): DataEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): RestoreFootprintOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimPredicate { - switch(): ClaimPredicateType; - - andPredicates(value?: ClaimPredicate[]): ClaimPredicate[]; + class HashIdPreimageOperationId { + constructor(attributes: { + sourceAccount: AccountId; + seqNum: SequenceNumber; + opNum: number; + }); - orPredicates(value?: ClaimPredicate[]): ClaimPredicate[]; + sourceAccount(value?: AccountId): AccountId; - notPredicate(value?: null | ClaimPredicate): null | ClaimPredicate; + seqNum(value?: SequenceNumber): SequenceNumber; - absBefore(value?: Int64): Int64; + opNum(value?: number): number; - relBefore(value?: Int64): Int64; + toXDR(format?: 'raw'): Buffer; - static claimPredicateUnconditional(): ClaimPredicate; + toXDR(format: 'hex' | 'base64'): string; - static claimPredicateAnd(value: ClaimPredicate[]): ClaimPredicate; + static read(io: Buffer): HashIdPreimageOperationId; - static claimPredicateOr(value: ClaimPredicate[]): ClaimPredicate; + static write(value: HashIdPreimageOperationId, io: Buffer): void; - static claimPredicateNot(value: null | ClaimPredicate): ClaimPredicate; + static isValid(value: HashIdPreimageOperationId): boolean; - static claimPredicateBeforeAbsoluteTime(value: Int64): ClaimPredicate; + static toXDR(value: HashIdPreimageOperationId): Buffer; - static claimPredicateBeforeRelativeTime(value: Int64): ClaimPredicate; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageOperationId; - value(): - | ClaimPredicate[] - | ClaimPredicate[] - | null - | ClaimPredicate - | Int64 - | Int64 - | void; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): HashIdPreimageOperationId; - toXDR(format?: "raw"): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static read(io: Buffer): ClaimPredicate; + class HashIdPreimageRevokeId { + constructor(attributes: { + sourceAccount: AccountId; + seqNum: SequenceNumber; + opNum: number; + liquidityPoolId: PoolId; + asset: Asset; + }); - static write(value: ClaimPredicate, io: Buffer): void; + sourceAccount(value?: AccountId): AccountId; - static isValid(value: ClaimPredicate): boolean; + seqNum(value?: SequenceNumber): SequenceNumber; - static toXDR(value: ClaimPredicate): Buffer; + opNum(value?: number): number; - static fromXDR(input: Buffer, format?: "raw"): ClaimPredicate; + liquidityPoolId(value?: PoolId): PoolId; - static fromXDR(input: string, format: "hex" | "base64"): ClaimPredicate; + asset(value?: Asset): Asset; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format: 'hex' | 'base64'): string; - class Claimant { - switch(): ClaimantType; + static read(io: Buffer): HashIdPreimageRevokeId; - v0(value?: ClaimantV0): ClaimantV0; + static write(value: HashIdPreimageRevokeId, io: Buffer): void; - static claimantTypeV0(value: ClaimantV0): Claimant; + static isValid(value: HashIdPreimageRevokeId): boolean; - value(): ClaimantV0; + static toXDR(value: HashIdPreimageRevokeId): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageRevokeId; - toXDR(format: "hex" | "base64"): string; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): HashIdPreimageRevokeId; - static read(io: Buffer): Claimant; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: Claimant, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: Claimant): boolean; - - static toXDR(value: Claimant): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): Claimant; - - static fromXDR(input: string, format: "hex" | "base64"): Claimant; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + class HashIdPreimageContractId { + constructor(attributes: { + networkId: Buffer; + contractIdPreimage: ContractIdPreimage; + }); - class ClaimableBalanceId { - switch(): ClaimableBalanceIdType; + networkId(value?: Buffer): Buffer; - v0(value?: Buffer): Buffer; + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; - static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; + toXDR(format?: 'raw'): Buffer; - value(): Buffer; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): HashIdPreimageContractId; - toXDR(format: "hex" | "base64"): string; + static write(value: HashIdPreimageContractId, io: Buffer): void; - static read(io: Buffer): ClaimableBalanceId; + static isValid(value: HashIdPreimageContractId): boolean; - static write(value: ClaimableBalanceId, io: Buffer): void; + static toXDR(value: HashIdPreimageContractId): Buffer; - static isValid(value: ClaimableBalanceId): boolean; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageContractId; - static toXDR(value: ClaimableBalanceId): Buffer; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): HashIdPreimageContractId; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceId; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): ClaimableBalanceId; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static validateXDR(input: Buffer, format?: "raw"): boolean; + class HashIdPreimageSorobanAuthorization { + constructor(attributes: { + networkId: Buffer; + nonce: Int64; + signatureExpirationLedger: number; + invocation: SorobanAuthorizedInvocation; + }); - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + networkId(value?: Buffer): Buffer; - class ClaimableBalanceEntryExtensionV1Ext { - switch(): number; + nonce(value?: Int64): Int64; - static 0(): ClaimableBalanceEntryExtensionV1Ext; + signatureExpirationLedger(value?: number): number; - value(): void; + invocation( + value?: SorobanAuthorizedInvocation, + ): SorobanAuthorizedInvocation; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimableBalanceEntryExtensionV1Ext; + static read(io: Buffer): HashIdPreimageSorobanAuthorization; - static write(value: ClaimableBalanceEntryExtensionV1Ext, io: Buffer): void; + static write(value: HashIdPreimageSorobanAuthorization, io: Buffer): void; - static isValid(value: ClaimableBalanceEntryExtensionV1Ext): boolean; + static isValid(value: HashIdPreimageSorobanAuthorization): boolean; - static toXDR(value: ClaimableBalanceEntryExtensionV1Ext): Buffer; + static toXDR(value: HashIdPreimageSorobanAuthorization): Buffer; static fromXDR( input: Buffer, - format?: "raw" - ): ClaimableBalanceEntryExtensionV1Ext; + format?: 'raw', + ): HashIdPreimageSorobanAuthorization; static fromXDR( input: string, - format: "hex" | "base64" - ): ClaimableBalanceEntryExtensionV1Ext; + format: 'hex' | 'base64', + ): HashIdPreimageSorobanAuthorization; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimableBalanceEntryExt { - switch(): number; - - v1( - value?: ClaimableBalanceEntryExtensionV1 - ): ClaimableBalanceEntryExtensionV1; - - static 0(): ClaimableBalanceEntryExt; + class TimeBounds { + constructor(attributes: { minTime: TimePoint; maxTime: TimePoint }); - static 1(value: ClaimableBalanceEntryExtensionV1): ClaimableBalanceEntryExt; + minTime(value?: TimePoint): TimePoint; - value(): ClaimableBalanceEntryExtensionV1 | void; + maxTime(value?: TimePoint): TimePoint; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimableBalanceEntryExt; + static read(io: Buffer): TimeBounds; - static write(value: ClaimableBalanceEntryExt, io: Buffer): void; + static write(value: TimeBounds, io: Buffer): void; - static isValid(value: ClaimableBalanceEntryExt): boolean; + static isValid(value: TimeBounds): boolean; - static toXDR(value: ClaimableBalanceEntryExt): Buffer; + static toXDR(value: TimeBounds): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): TimeBounds; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ClaimableBalanceEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeBounds; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolEntryBody { - switch(): LiquidityPoolType; - - constantProduct( - value?: LiquidityPoolEntryConstantProduct - ): LiquidityPoolEntryConstantProduct; + class LedgerBounds { + constructor(attributes: { minLedger: number; maxLedger: number }); - static liquidityPoolConstantProduct( - value: LiquidityPoolEntryConstantProduct - ): LiquidityPoolEntryBody; + minLedger(value?: number): number; - value(): LiquidityPoolEntryConstantProduct; + maxLedger(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LiquidityPoolEntryBody; + static read(io: Buffer): LedgerBounds; - static write(value: LiquidityPoolEntryBody, io: Buffer): void; + static write(value: LedgerBounds, io: Buffer): void; - static isValid(value: LiquidityPoolEntryBody): boolean; + static isValid(value: LedgerBounds): boolean; - static toXDR(value: LiquidityPoolEntryBody): Buffer; + static toXDR(value: LedgerBounds): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolEntryBody; + static fromXDR(input: Buffer, format?: 'raw'): LedgerBounds; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LiquidityPoolEntryBody; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerBounds; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntryExtensionV1Ext { - switch(): number; - - static 0(): LedgerEntryExtensionV1Ext; - - value(): void; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): LedgerEntryExtensionV1Ext; - - static write(value: LedgerEntryExtensionV1Ext, io: Buffer): void; - - static isValid(value: LedgerEntryExtensionV1Ext): boolean; + class PreconditionsV2 { + constructor(attributes: { + timeBounds: null | TimeBounds; + ledgerBounds: null | LedgerBounds; + minSeqNum: null | SequenceNumber; + minSeqAge: Duration; + minSeqLedgerGap: number; + extraSigners: SignerKey[]; + }); - static toXDR(value: LedgerEntryExtensionV1Ext): Buffer; + timeBounds(value?: null | TimeBounds): null | TimeBounds; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExtensionV1Ext; + ledgerBounds(value?: null | LedgerBounds): null | LedgerBounds; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LedgerEntryExtensionV1Ext; + minSeqNum(value?: null | SequenceNumber): null | SequenceNumber; - static validateXDR(input: Buffer, format?: "raw"): boolean; + minSeqAge(value?: Duration): Duration; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + minSeqLedgerGap(value?: number): number; - class LedgerEntryData { - switch(): LedgerEntryType; + extraSigners(value?: SignerKey[]): SignerKey[]; - account(value?: AccountEntry): AccountEntry; + toXDR(format?: 'raw'): Buffer; - trustLine(value?: TrustLineEntry): TrustLineEntry; + toXDR(format: 'hex' | 'base64'): string; - offer(value?: OfferEntry): OfferEntry; + static read(io: Buffer): PreconditionsV2; - data(value?: DataEntry): DataEntry; + static write(value: PreconditionsV2, io: Buffer): void; - claimableBalance(value?: ClaimableBalanceEntry): ClaimableBalanceEntry; + static isValid(value: PreconditionsV2): boolean; - liquidityPool(value?: LiquidityPoolEntry): LiquidityPoolEntry; + static toXDR(value: PreconditionsV2): Buffer; - static account(value: AccountEntry): LedgerEntryData; + static fromXDR(input: Buffer, format?: 'raw'): PreconditionsV2; - static trustline(value: TrustLineEntry): LedgerEntryData; + static fromXDR(input: string, format: 'hex' | 'base64'): PreconditionsV2; - static offer(value: OfferEntry): LedgerEntryData; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static data(value: DataEntry): LedgerEntryData; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static claimableBalance(value: ClaimableBalanceEntry): LedgerEntryData; + class LedgerFootprint { + constructor(attributes: { readOnly: LedgerKey[]; readWrite: LedgerKey[] }); - static liquidityPool(value: LiquidityPoolEntry): LedgerEntryData; + readOnly(value?: LedgerKey[]): LedgerKey[]; - value(): - | AccountEntry - | TrustLineEntry - | OfferEntry - | DataEntry - | ClaimableBalanceEntry - | LiquidityPoolEntry; + readWrite(value?: LedgerKey[]): LedgerKey[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntryData; + static read(io: Buffer): LedgerFootprint; - static write(value: LedgerEntryData, io: Buffer): void; + static write(value: LedgerFootprint, io: Buffer): void; - static isValid(value: LedgerEntryData): boolean; + static isValid(value: LedgerFootprint): boolean; - static toXDR(value: LedgerEntryData): Buffer; + static toXDR(value: LedgerFootprint): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryData; + static fromXDR(input: Buffer, format?: 'raw'): LedgerFootprint; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryData; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerFootprint; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntryExt { - switch(): number; + class SorobanResources { + constructor(attributes: { + footprint: LedgerFootprint; + instructions: number; + readBytes: number; + writeBytes: number; + }); - v1(value?: LedgerEntryExtensionV1): LedgerEntryExtensionV1; + footprint(value?: LedgerFootprint): LedgerFootprint; - static 0(): LedgerEntryExt; + instructions(value?: number): number; - static 1(value: LedgerEntryExtensionV1): LedgerEntryExt; + readBytes(value?: number): number; - value(): LedgerEntryExtensionV1 | void; + writeBytes(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerEntryExt; + static read(io: Buffer): SorobanResources; - static write(value: LedgerEntryExt, io: Buffer): void; + static write(value: SorobanResources, io: Buffer): void; - static isValid(value: LedgerEntryExt): boolean; + static isValid(value: SorobanResources): boolean; - static toXDR(value: LedgerEntryExt): Buffer; + static toXDR(value: SorobanResources): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKey { - switch(): LedgerEntryType; - - account(value?: LedgerKeyAccount): LedgerKeyAccount; - - trustLine(value?: LedgerKeyTrustLine): LedgerKeyTrustLine; - - offer(value?: LedgerKeyOffer): LedgerKeyOffer; - - data(value?: LedgerKeyData): LedgerKeyData; - - claimableBalance( - value?: LedgerKeyClaimableBalance - ): LedgerKeyClaimableBalance; - - liquidityPool(value?: LedgerKeyLiquidityPool): LedgerKeyLiquidityPool; - - static account(value: LedgerKeyAccount): LedgerKey; + class SorobanTransactionData { + constructor(attributes: { + ext: ExtensionPoint; + resources: SorobanResources; + refundableFee: Int64; + }); - static trustline(value: LedgerKeyTrustLine): LedgerKey; + ext(value?: ExtensionPoint): ExtensionPoint; - static offer(value: LedgerKeyOffer): LedgerKey; + resources(value?: SorobanResources): SorobanResources; - static data(value: LedgerKeyData): LedgerKey; + refundableFee(value?: Int64): Int64; - static claimableBalance(value: LedgerKeyClaimableBalance): LedgerKey; + toXDR(format?: 'raw'): Buffer; - static liquidityPool(value: LedgerKeyLiquidityPool): LedgerKey; + toXDR(format: 'hex' | 'base64'): string; - value(): - | LedgerKeyAccount - | LedgerKeyTrustLine - | LedgerKeyOffer - | LedgerKeyData - | LedgerKeyClaimableBalance - | LedgerKeyLiquidityPool; + static read(io: Buffer): SorobanTransactionData; - toXDR(format?: "raw"): Buffer; + static write(value: SorobanTransactionData, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: SorobanTransactionData): boolean; - static read(io: Buffer): LedgerKey; + static toXDR(value: SorobanTransactionData): Buffer; - static write(value: LedgerKey, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionData; - static isValid(value: LedgerKey): boolean; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionData; - static toXDR(value: LedgerKey): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): LedgerKey; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: string, format: "hex" | "base64"): LedgerKey; + class TransactionV0 { + constructor(attributes: { + sourceAccountEd25519: Buffer; + fee: number; + seqNum: SequenceNumber; + timeBounds: null | TimeBounds; + memo: Memo; + operations: Operation[]; + ext: TransactionV0Ext; + }); - static validateXDR(input: Buffer, format?: "raw"): boolean; + sourceAccountEd25519(value?: Buffer): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + fee(value?: number): number; - class StellarValueExt { - switch(): StellarValueType; + seqNum(value?: SequenceNumber): SequenceNumber; - lcValueSignature( - value?: LedgerCloseValueSignature - ): LedgerCloseValueSignature; + timeBounds(value?: null | TimeBounds): null | TimeBounds; - static stellarValueBasic(): StellarValueExt; + memo(value?: Memo): Memo; - static stellarValueSigned( - value: LedgerCloseValueSignature - ): StellarValueExt; + operations(value?: Operation[]): Operation[]; - value(): LedgerCloseValueSignature | void; + ext(value?: TransactionV0Ext): TransactionV0Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): StellarValueExt; + static read(io: Buffer): TransactionV0; - static write(value: StellarValueExt, io: Buffer): void; + static write(value: TransactionV0, io: Buffer): void; - static isValid(value: StellarValueExt): boolean; + static isValid(value: TransactionV0): boolean; - static toXDR(value: StellarValueExt): Buffer; + static toXDR(value: TransactionV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): StellarValueExt; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0; - static fromXDR(input: string, format: "hex" | "base64"): StellarValueExt; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeaderExtensionV1Ext { - switch(): number; + class TransactionV0Envelope { + constructor(attributes: { + tx: TransactionV0; + signatures: DecoratedSignature[]; + }); - static 0(): LedgerHeaderExtensionV1Ext; + tx(value?: TransactionV0): TransactionV0; - value(): void; + signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerHeaderExtensionV1Ext; + static read(io: Buffer): TransactionV0Envelope; - static write(value: LedgerHeaderExtensionV1Ext, io: Buffer): void; + static write(value: TransactionV0Envelope, io: Buffer): void; - static isValid(value: LedgerHeaderExtensionV1Ext): boolean; + static isValid(value: TransactionV0Envelope): boolean; - static toXDR(value: LedgerHeaderExtensionV1Ext): Buffer; + static toXDR(value: TransactionV0Envelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExtensionV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0Envelope; static fromXDR( input: string, - format: "hex" | "base64" - ): LedgerHeaderExtensionV1Ext; + format: 'hex' | 'base64', + ): TransactionV0Envelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeaderExt { - switch(): number; + class Transaction { + constructor(attributes: { + sourceAccount: MuxedAccount; + fee: number; + seqNum: SequenceNumber; + cond: Preconditions; + memo: Memo; + operations: Operation[]; + ext: TransactionExt; + }); - v1(value?: LedgerHeaderExtensionV1): LedgerHeaderExtensionV1; + sourceAccount(value?: MuxedAccount): MuxedAccount; - static 0(): LedgerHeaderExt; + fee(value?: number): number; - static 1(value: LedgerHeaderExtensionV1): LedgerHeaderExt; + seqNum(value?: SequenceNumber): SequenceNumber; - value(): LedgerHeaderExtensionV1 | void; + cond(value?: Preconditions): Preconditions; - toXDR(format?: "raw"): Buffer; + memo(value?: Memo): Memo; - toXDR(format: "hex" | "base64"): string; + operations(value?: Operation[]): Operation[]; - static read(io: Buffer): LedgerHeaderExt; + ext(value?: TransactionExt): TransactionExt; - static write(value: LedgerHeaderExt, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: LedgerHeaderExt): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: LedgerHeaderExt): Buffer; + static read(io: Buffer): Transaction; + + static write(value: Transaction, io: Buffer): void; + + static isValid(value: Transaction): boolean; + + static toXDR(value: Transaction): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExt; + static fromXDR(input: Buffer, format?: 'raw'): Transaction; - static fromXDR(input: string, format: "hex" | "base64"): LedgerHeaderExt; + static fromXDR(input: string, format: 'hex' | 'base64'): Transaction; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerUpgrade { - switch(): LedgerUpgradeType; + class TransactionV1Envelope { + constructor(attributes: { + tx: Transaction; + signatures: DecoratedSignature[]; + }); - newLedgerVersion(value?: number): number; + tx(value?: Transaction): Transaction; - newBaseFee(value?: number): number; + signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - newMaxTxSetSize(value?: number): number; + toXDR(format?: 'raw'): Buffer; - newBaseReserve(value?: number): number; + toXDR(format: 'hex' | 'base64'): string; - newFlags(value?: number): number; + static read(io: Buffer): TransactionV1Envelope; - static ledgerUpgradeVersion(value: number): LedgerUpgrade; + static write(value: TransactionV1Envelope, io: Buffer): void; - static ledgerUpgradeBaseFee(value: number): LedgerUpgrade; + static isValid(value: TransactionV1Envelope): boolean; - static ledgerUpgradeMaxTxSetSize(value: number): LedgerUpgrade; + static toXDR(value: TransactionV1Envelope): Buffer; - static ledgerUpgradeBaseReserve(value: number): LedgerUpgrade; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV1Envelope; - static ledgerUpgradeFlags(value: number): LedgerUpgrade; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionV1Envelope; - value(): number | number | number | number | number; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format?: "raw"): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format: "hex" | "base64"): string; + class FeeBumpTransaction { + constructor(attributes: { + feeSource: MuxedAccount; + fee: Int64; + innerTx: FeeBumpTransactionInnerTx; + ext: FeeBumpTransactionExt; + }); - static read(io: Buffer): LedgerUpgrade; + feeSource(value?: MuxedAccount): MuxedAccount; - static write(value: LedgerUpgrade, io: Buffer): void; + fee(value?: Int64): Int64; - static isValid(value: LedgerUpgrade): boolean; + innerTx(value?: FeeBumpTransactionInnerTx): FeeBumpTransactionInnerTx; - static toXDR(value: LedgerUpgrade): Buffer; + ext(value?: FeeBumpTransactionExt): FeeBumpTransactionExt; - static fromXDR(input: Buffer, format?: "raw"): LedgerUpgrade; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): LedgerUpgrade; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static read(io: Buffer): FeeBumpTransaction; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static write(value: FeeBumpTransaction, io: Buffer): void; - class BucketMetadataExt { - switch(): number; + static isValid(value: FeeBumpTransaction): boolean; - static 0(): BucketMetadataExt; + static toXDR(value: FeeBumpTransaction): Buffer; - value(): void; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransaction; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): FeeBumpTransaction; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static read(io: Buffer): BucketMetadataExt; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static write(value: BucketMetadataExt, io: Buffer): void; + class FeeBumpTransactionEnvelope { + constructor(attributes: { + tx: FeeBumpTransaction; + signatures: DecoratedSignature[]; + }); - static isValid(value: BucketMetadataExt): boolean; + tx(value?: FeeBumpTransaction): FeeBumpTransaction; - static toXDR(value: BucketMetadataExt): Buffer; + signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - static fromXDR(input: Buffer, format?: "raw"): BucketMetadataExt; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): BucketMetadataExt; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static read(io: Buffer): FeeBumpTransactionEnvelope; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static write(value: FeeBumpTransactionEnvelope, io: Buffer): void; - class BucketEntry { - switch(): BucketEntryType; + static isValid(value: FeeBumpTransactionEnvelope): boolean; - liveEntry(value?: LedgerEntry): LedgerEntry; + static toXDR(value: FeeBumpTransactionEnvelope): Buffer; - deadEntry(value?: LedgerKey): LedgerKey; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionEnvelope; - metaEntry(value?: BucketMetadata): BucketMetadata; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): FeeBumpTransactionEnvelope; - static liveentry(value: LedgerEntry): BucketEntry; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static initentry(value: LedgerEntry): BucketEntry; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static deadentry(value: LedgerKey): BucketEntry; + class TransactionSignaturePayload { + constructor(attributes: { + networkId: Buffer; + taggedTransaction: TransactionSignaturePayloadTaggedTransaction; + }); - static metaentry(value: BucketMetadata): BucketEntry; + networkId(value?: Buffer): Buffer; - value(): LedgerEntry | LedgerKey | BucketMetadata; + taggedTransaction( + value?: TransactionSignaturePayloadTaggedTransaction, + ): TransactionSignaturePayloadTaggedTransaction; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BucketEntry; + static read(io: Buffer): TransactionSignaturePayload; - static write(value: BucketEntry, io: Buffer): void; + static write(value: TransactionSignaturePayload, io: Buffer): void; - static isValid(value: BucketEntry): boolean; + static isValid(value: TransactionSignaturePayload): boolean; - static toXDR(value: BucketEntry): Buffer; + static toXDR(value: TransactionSignaturePayload): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BucketEntry; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSignaturePayload; - static fromXDR(input: string, format: "hex" | "base64"): BucketEntry; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionSignaturePayload; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TxSetComponent { - switch(): TxSetComponentType; + class ClaimOfferAtomV0 { + constructor(attributes: { + sellerEd25519: Buffer; + offerId: Int64; + assetSold: Asset; + amountSold: Int64; + assetBought: Asset; + amountBought: Int64; + }); - txsMaybeDiscountedFee( - value?: TxSetComponentTxsMaybeDiscountedFee - ): TxSetComponentTxsMaybeDiscountedFee; + sellerEd25519(value?: Buffer): Buffer; - static txsetCompTxsMaybeDiscountedFee( - value: TxSetComponentTxsMaybeDiscountedFee - ): TxSetComponent; + offerId(value?: Int64): Int64; - value(): TxSetComponentTxsMaybeDiscountedFee; + assetSold(value?: Asset): Asset; - toXDR(format?: "raw"): Buffer; + amountSold(value?: Int64): Int64; - toXDR(format: "hex" | "base64"): string; + assetBought(value?: Asset): Asset; - static read(io: Buffer): TxSetComponent; + amountBought(value?: Int64): Int64; - static write(value: TxSetComponent, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: TxSetComponent): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: TxSetComponent): Buffer; + static read(io: Buffer): ClaimOfferAtomV0; + + static write(value: ClaimOfferAtomV0, io: Buffer): void; + + static isValid(value: ClaimOfferAtomV0): boolean; + + static toXDR(value: ClaimOfferAtomV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TxSetComponent; + static fromXDR(input: Buffer, format?: 'raw'): ClaimOfferAtomV0; - static fromXDR(input: string, format: "hex" | "base64"): TxSetComponent; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimOfferAtomV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionPhase { - switch(): number; + class ClaimOfferAtom { + constructor(attributes: { + sellerId: AccountId; + offerId: Int64; + assetSold: Asset; + amountSold: Int64; + assetBought: Asset; + amountBought: Int64; + }); - v0Components(value?: TxSetComponent[]): TxSetComponent[]; + sellerId(value?: AccountId): AccountId; - static 0(value: TxSetComponent[]): TransactionPhase; + offerId(value?: Int64): Int64; - value(): TxSetComponent[]; + assetSold(value?: Asset): Asset; - toXDR(format?: "raw"): Buffer; + amountSold(value?: Int64): Int64; - toXDR(format: "hex" | "base64"): string; + assetBought(value?: Asset): Asset; - static read(io: Buffer): TransactionPhase; + amountBought(value?: Int64): Int64; - static write(value: TransactionPhase, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: TransactionPhase): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: TransactionPhase): Buffer; + static read(io: Buffer): ClaimOfferAtom; - static fromXDR(input: Buffer, format?: "raw"): TransactionPhase; + static write(value: ClaimOfferAtom, io: Buffer): void; + + static isValid(value: ClaimOfferAtom): boolean; + + static toXDR(value: ClaimOfferAtom): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimOfferAtom; - static fromXDR(input: string, format: "hex" | "base64"): TransactionPhase; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimOfferAtom; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class GeneralizedTransactionSet { - switch(): number; + class ClaimLiquidityAtom { + constructor(attributes: { + liquidityPoolId: PoolId; + assetSold: Asset; + amountSold: Int64; + assetBought: Asset; + amountBought: Int64; + }); - v1TxSet(value?: TransactionSetV1): TransactionSetV1; + liquidityPoolId(value?: PoolId): PoolId; - static 1(value: TransactionSetV1): GeneralizedTransactionSet; + assetSold(value?: Asset): Asset; - value(): TransactionSetV1; + amountSold(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + assetBought(value?: Asset): Asset; - toXDR(format: "hex" | "base64"): string; + amountBought(value?: Int64): Int64; - static read(io: Buffer): GeneralizedTransactionSet; + toXDR(format?: 'raw'): Buffer; - static write(value: GeneralizedTransactionSet, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: GeneralizedTransactionSet): boolean; + static read(io: Buffer): ClaimLiquidityAtom; - static toXDR(value: GeneralizedTransactionSet): Buffer; + static write(value: ClaimLiquidityAtom, io: Buffer): void; - static fromXDR(input: Buffer, format?: "raw"): GeneralizedTransactionSet; + static isValid(value: ClaimLiquidityAtom): boolean; - static fromXDR( - input: string, - format: "hex" | "base64" - ): GeneralizedTransactionSet; + static toXDR(value: ClaimLiquidityAtom): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ClaimLiquidityAtom; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimLiquidityAtom; - class TransactionHistoryEntryExt { - switch(): number; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - generalizedTxSet( - value?: GeneralizedTransactionSet - ): GeneralizedTransactionSet; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static 0(): TransactionHistoryEntryExt; + class SimplePaymentResult { + constructor(attributes: { + destination: AccountId; + asset: Asset; + amount: Int64; + }); - static 1(value: GeneralizedTransactionSet): TransactionHistoryEntryExt; + destination(value?: AccountId): AccountId; - value(): GeneralizedTransactionSet | void; + asset(value?: Asset): Asset; - toXDR(format?: "raw"): Buffer; + amount(value?: Int64): Int64; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): TransactionHistoryEntryExt; + toXDR(format: 'hex' | 'base64'): string; - static write(value: TransactionHistoryEntryExt, io: Buffer): void; + static read(io: Buffer): SimplePaymentResult; - static isValid(value: TransactionHistoryEntryExt): boolean; + static write(value: SimplePaymentResult, io: Buffer): void; - static toXDR(value: TransactionHistoryEntryExt): Buffer; + static isValid(value: SimplePaymentResult): boolean; - static fromXDR(input: Buffer, format?: "raw"): TransactionHistoryEntryExt; + static toXDR(value: SimplePaymentResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SimplePaymentResult; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionHistoryEntryExt; + format: 'hex' | 'base64', + ): SimplePaymentResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionHistoryResultEntryExt { - switch(): number; + class PathPaymentStrictReceiveResultSuccess { + constructor(attributes: { offers: ClaimAtom[]; last: SimplePaymentResult }); - static 0(): TransactionHistoryResultEntryExt; + offers(value?: ClaimAtom[]): ClaimAtom[]; - value(): void; + last(value?: SimplePaymentResult): SimplePaymentResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionHistoryResultEntryExt; + static read(io: Buffer): PathPaymentStrictReceiveResultSuccess; - static write(value: TransactionHistoryResultEntryExt, io: Buffer): void; + static write( + value: PathPaymentStrictReceiveResultSuccess, + io: Buffer, + ): void; - static isValid(value: TransactionHistoryResultEntryExt): boolean; + static isValid(value: PathPaymentStrictReceiveResultSuccess): boolean; - static toXDR(value: TransactionHistoryResultEntryExt): Buffer; + static toXDR(value: PathPaymentStrictReceiveResultSuccess): Buffer; static fromXDR( input: Buffer, - format?: "raw" - ): TransactionHistoryResultEntryExt; + format?: 'raw', + ): PathPaymentStrictReceiveResultSuccess; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionHistoryResultEntryExt; + format: 'hex' | 'base64', + ): PathPaymentStrictReceiveResultSuccess; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerHeaderHistoryEntryExt { - switch(): number; + class PathPaymentStrictSendResultSuccess { + constructor(attributes: { offers: ClaimAtom[]; last: SimplePaymentResult }); - static 0(): LedgerHeaderHistoryEntryExt; + offers(value?: ClaimAtom[]): ClaimAtom[]; - value(): void; + last(value?: SimplePaymentResult): SimplePaymentResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerHeaderHistoryEntryExt; + static read(io: Buffer): PathPaymentStrictSendResultSuccess; - static write(value: LedgerHeaderHistoryEntryExt, io: Buffer): void; + static write(value: PathPaymentStrictSendResultSuccess, io: Buffer): void; - static isValid(value: LedgerHeaderHistoryEntryExt): boolean; + static isValid(value: PathPaymentStrictSendResultSuccess): boolean; - static toXDR(value: LedgerHeaderHistoryEntryExt): Buffer; + static toXDR(value: PathPaymentStrictSendResultSuccess): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderHistoryEntryExt; + static fromXDR( + input: Buffer, + format?: 'raw', + ): PathPaymentStrictSendResultSuccess; static fromXDR( input: string, - format: "hex" | "base64" - ): LedgerHeaderHistoryEntryExt; + format: 'hex' | 'base64', + ): PathPaymentStrictSendResultSuccess; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScpHistoryEntry { - switch(): number; - - v0(value?: ScpHistoryEntryV0): ScpHistoryEntryV0; + class ManageOfferSuccessResult { + constructor(attributes: { + offersClaimed: ClaimAtom[]; + offer: ManageOfferSuccessResultOffer; + }); - static 0(value: ScpHistoryEntryV0): ScpHistoryEntry; + offersClaimed(value?: ClaimAtom[]): ClaimAtom[]; - value(): ScpHistoryEntryV0; + offer(value?: ManageOfferSuccessResultOffer): ManageOfferSuccessResultOffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScpHistoryEntry; + static read(io: Buffer): ManageOfferSuccessResult; - static write(value: ScpHistoryEntry, io: Buffer): void; + static write(value: ManageOfferSuccessResult, io: Buffer): void; - static isValid(value: ScpHistoryEntry): boolean; + static isValid(value: ManageOfferSuccessResult): boolean; - static toXDR(value: ScpHistoryEntry): Buffer; + static toXDR(value: ManageOfferSuccessResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): ManageOfferSuccessResult; - static fromXDR(input: string, format: "hex" | "base64"): ScpHistoryEntry; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ManageOfferSuccessResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerEntryChange { - switch(): LedgerEntryChangeType; + class InflationPayout { + constructor(attributes: { destination: AccountId; amount: Int64 }); - created(value?: LedgerEntry): LedgerEntry; + destination(value?: AccountId): AccountId; - updated(value?: LedgerEntry): LedgerEntry; + amount(value?: Int64): Int64; - removed(value?: LedgerKey): LedgerKey; + toXDR(format?: 'raw'): Buffer; - state(value?: LedgerEntry): LedgerEntry; + toXDR(format: 'hex' | 'base64'): string; - static ledgerEntryCreated(value: LedgerEntry): LedgerEntryChange; + static read(io: Buffer): InflationPayout; - static ledgerEntryUpdated(value: LedgerEntry): LedgerEntryChange; + static write(value: InflationPayout, io: Buffer): void; - static ledgerEntryRemoved(value: LedgerKey): LedgerEntryChange; + static isValid(value: InflationPayout): boolean; - static ledgerEntryState(value: LedgerEntry): LedgerEntryChange; + static toXDR(value: InflationPayout): Buffer; - value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry; + static fromXDR(input: Buffer, format?: 'raw'): InflationPayout; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): InflationPayout; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static read(io: Buffer): LedgerEntryChange; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static write(value: LedgerEntryChange, io: Buffer): void; + class InnerTransactionResult { + constructor(attributes: { + feeCharged: Int64; + result: InnerTransactionResultResult; + ext: InnerTransactionResultExt; + }); - static isValid(value: LedgerEntryChange): boolean; + feeCharged(value?: Int64): Int64; - static toXDR(value: LedgerEntryChange): Buffer; + result(value?: InnerTransactionResultResult): InnerTransactionResultResult; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryChange; + ext(value?: InnerTransactionResultExt): InnerTransactionResultExt; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryChange; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static read(io: Buffer): InnerTransactionResult; - class TransactionMeta { - switch(): number; + static write(value: InnerTransactionResult, io: Buffer): void; - operations(value?: OperationMeta[]): OperationMeta[]; + static isValid(value: InnerTransactionResult): boolean; - v1(value?: TransactionMetaV1): TransactionMetaV1; + static toXDR(value: InnerTransactionResult): Buffer; - v2(value?: TransactionMetaV2): TransactionMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResult; - static 0(value: OperationMeta[]): TransactionMeta; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): InnerTransactionResult; - static 1(value: TransactionMetaV1): TransactionMeta; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static 2(value: TransactionMetaV2): TransactionMeta; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - value(): OperationMeta[] | TransactionMetaV1 | TransactionMetaV2; + class InnerTransactionResultPair { + constructor(attributes: { + transactionHash: Buffer; + result: InnerTransactionResult; + }); - toXDR(format?: "raw"): Buffer; + transactionHash(value?: Buffer): Buffer; - toXDR(format: "hex" | "base64"): string; + result(value?: InnerTransactionResult): InnerTransactionResult; - static read(io: Buffer): TransactionMeta; + toXDR(format?: 'raw'): Buffer; - static write(value: TransactionMeta, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: TransactionMeta): boolean; + static read(io: Buffer): InnerTransactionResultPair; - static toXDR(value: TransactionMeta): Buffer; + static write(value: InnerTransactionResultPair, io: Buffer): void; - static fromXDR(input: Buffer, format?: "raw"): TransactionMeta; + static isValid(value: InnerTransactionResultPair): boolean; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMeta; + static toXDR(value: InnerTransactionResultPair): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultPair; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): InnerTransactionResultPair; - class LedgerCloseMeta { - switch(): number; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - v0(value?: LedgerCloseMetaV0): LedgerCloseMetaV0; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; + class TransactionResult { + constructor(attributes: { + feeCharged: Int64; + result: TransactionResultResult; + ext: TransactionResultExt; + }); - static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; + feeCharged(value?: Int64): Int64; - static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; + result(value?: TransactionResultResult): TransactionResultResult; - value(): LedgerCloseMetaV0 | LedgerCloseMetaV1; + ext(value?: TransactionResultExt): TransactionResultExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerCloseMeta; + static read(io: Buffer): TransactionResult; - static write(value: LedgerCloseMeta, io: Buffer): void; + static write(value: TransactionResult, io: Buffer): void; - static isValid(value: LedgerCloseMeta): boolean; + static isValid(value: TransactionResult): boolean; - static toXDR(value: LedgerCloseMeta): Buffer; + static toXDR(value: TransactionResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMeta; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResult; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PeerAddressIp { - switch(): IpAddrType; + class SignerKeyEd25519SignedPayload { + constructor(attributes: { ed25519: Buffer; payload: Buffer }); - ipv4(value?: Buffer): Buffer; + ed25519(value?: Buffer): Buffer; - ipv6(value?: Buffer): Buffer; + payload(value?: Buffer): Buffer; - static iPv4(value: Buffer): PeerAddressIp; + toXDR(format?: 'raw'): Buffer; - static iPv6(value: Buffer): PeerAddressIp; + toXDR(format: 'hex' | 'base64'): string; - value(): Buffer | Buffer; + static read(io: Buffer): SignerKeyEd25519SignedPayload; - toXDR(format?: "raw"): Buffer; + static write(value: SignerKeyEd25519SignedPayload, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: SignerKeyEd25519SignedPayload): boolean; - static read(io: Buffer): PeerAddressIp; + static toXDR(value: SignerKeyEd25519SignedPayload): Buffer; - static write(value: PeerAddressIp, io: Buffer): void; + static fromXDR( + input: Buffer, + format?: 'raw', + ): SignerKeyEd25519SignedPayload; - static isValid(value: PeerAddressIp): boolean; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SignerKeyEd25519SignedPayload; - static toXDR(value: PeerAddressIp): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): PeerAddressIp; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: string, format: "hex" | "base64"): PeerAddressIp; + class Curve25519Secret { + constructor(attributes: { key: Buffer }); - static validateXDR(input: Buffer, format?: "raw"): boolean; + key(value?: Buffer): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format?: 'raw'): Buffer; - class SurveyResponseBody { - switch(): SurveyMessageCommandType; + toXDR(format: 'hex' | 'base64'): string; - topologyResponseBody(value?: TopologyResponseBody): TopologyResponseBody; + static read(io: Buffer): Curve25519Secret; - static surveyTopology(value: TopologyResponseBody): SurveyResponseBody; + static write(value: Curve25519Secret, io: Buffer): void; - value(): TopologyResponseBody; + static isValid(value: Curve25519Secret): boolean; - toXDR(format?: "raw"): Buffer; + static toXDR(value: Curve25519Secret): Buffer; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: Buffer, format?: 'raw'): Curve25519Secret; - static read(io: Buffer): SurveyResponseBody; + static fromXDR(input: string, format: 'hex' | 'base64'): Curve25519Secret; - static write(value: SurveyResponseBody, io: Buffer): void; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static isValid(value: SurveyResponseBody): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static toXDR(value: SurveyResponseBody): Buffer; + class Curve25519Public { + constructor(attributes: { key: Buffer }); - static fromXDR(input: Buffer, format?: "raw"): SurveyResponseBody; + key(value?: Buffer): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): SurveyResponseBody; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static read(io: Buffer): Curve25519Public; - class StellarMessage { - switch(): MessageType; + static write(value: Curve25519Public, io: Buffer): void; - error(value?: Error): Error; + static isValid(value: Curve25519Public): boolean; - hello(value?: Hello): Hello; + static toXDR(value: Curve25519Public): Buffer; - auth(value?: Auth): Auth; + static fromXDR(input: Buffer, format?: 'raw'): Curve25519Public; - dontHave(value?: DontHave): DontHave; + static fromXDR(input: string, format: 'hex' | 'base64'): Curve25519Public; - peers(value?: PeerAddress[]): PeerAddress[]; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - txSetHash(value?: Buffer): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - txSet(value?: TransactionSet): TransactionSet; + class HmacSha256Key { + constructor(attributes: { key: Buffer }); - generalizedTxSet( - value?: GeneralizedTransactionSet - ): GeneralizedTransactionSet; + key(value?: Buffer): Buffer; - transaction(value?: TransactionEnvelope): TransactionEnvelope; + toXDR(format?: 'raw'): Buffer; - signedSurveyRequestMessage( - value?: SignedSurveyRequestMessage - ): SignedSurveyRequestMessage; + toXDR(format: 'hex' | 'base64'): string; - signedSurveyResponseMessage( - value?: SignedSurveyResponseMessage - ): SignedSurveyResponseMessage; + static read(io: Buffer): HmacSha256Key; - qSetHash(value?: Buffer): Buffer; + static write(value: HmacSha256Key, io: Buffer): void; - qSet(value?: ScpQuorumSet): ScpQuorumSet; + static isValid(value: HmacSha256Key): boolean; - envelope(value?: ScpEnvelope): ScpEnvelope; + static toXDR(value: HmacSha256Key): Buffer; - getScpLedgerSeq(value?: number): number; + static fromXDR(input: Buffer, format?: 'raw'): HmacSha256Key; - sendMoreMessage(value?: SendMore): SendMore; + static fromXDR(input: string, format: 'hex' | 'base64'): HmacSha256Key; - floodAdvert(value?: FloodAdvert): FloodAdvert; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - floodDemand(value?: FloodDemand): FloodDemand; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static errorMsg(value: Error): StellarMessage; + class HmacSha256Mac { + constructor(attributes: { mac: Buffer }); - static hello(value: Hello): StellarMessage; + mac(value?: Buffer): Buffer; - static auth(value: Auth): StellarMessage; + toXDR(format?: 'raw'): Buffer; - static dontHave(value: DontHave): StellarMessage; + toXDR(format: 'hex' | 'base64'): string; - static getPeers(): StellarMessage; + static read(io: Buffer): HmacSha256Mac; - static peers(value: PeerAddress[]): StellarMessage; + static write(value: HmacSha256Mac, io: Buffer): void; - static getTxSet(value: Buffer): StellarMessage; + static isValid(value: HmacSha256Mac): boolean; - static txSet(value: TransactionSet): StellarMessage; + static toXDR(value: HmacSha256Mac): Buffer; - static generalizedTxSet(value: GeneralizedTransactionSet): StellarMessage; + static fromXDR(input: Buffer, format?: 'raw'): HmacSha256Mac; - static transaction(value: TransactionEnvelope): StellarMessage; + static fromXDR(input: string, format: 'hex' | 'base64'): HmacSha256Mac; - static surveyRequest(value: SignedSurveyRequestMessage): StellarMessage; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static getScpQuorumset(value: Buffer): StellarMessage; + class UInt128Parts { + constructor(attributes: { hi: Uint64; lo: Uint64 }); - static scpQuorumset(value: ScpQuorumSet): StellarMessage; + hi(value?: Uint64): Uint64; - static scpMessage(value: ScpEnvelope): StellarMessage; + lo(value?: Uint64): Uint64; - static getScpState(value: number): StellarMessage; + toXDR(format?: 'raw'): Buffer; - static sendMore(value: SendMore): StellarMessage; + toXDR(format: 'hex' | 'base64'): string; - static floodAdvert(value: FloodAdvert): StellarMessage; + static read(io: Buffer): UInt128Parts; - static floodDemand(value: FloodDemand): StellarMessage; + static write(value: UInt128Parts, io: Buffer): void; - value(): - | Error - | Hello - | Auth - | DontHave - | PeerAddress[] - | Buffer - | TransactionSet - | GeneralizedTransactionSet - | TransactionEnvelope - | SignedSurveyRequestMessage - | SignedSurveyResponseMessage - | Buffer - | ScpQuorumSet - | ScpEnvelope - | number - | SendMore - | FloodAdvert - | FloodDemand - | void; + static isValid(value: UInt128Parts): boolean; - toXDR(format?: "raw"): Buffer; + static toXDR(value: UInt128Parts): Buffer; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: Buffer, format?: 'raw'): UInt128Parts; - static read(io: Buffer): StellarMessage; + static fromXDR(input: string, format: 'hex' | 'base64'): UInt128Parts; - static write(value: StellarMessage, io: Buffer): void; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static isValid(value: StellarMessage): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static toXDR(value: StellarMessage): Buffer; + class Int128Parts { + constructor(attributes: { hi: Int64; lo: Uint64 }); + + hi(value?: Int64): Int64; + + lo(value?: Uint64): Uint64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; - static fromXDR(input: Buffer, format?: "raw"): StellarMessage; + static read(io: Buffer): Int128Parts; - static fromXDR(input: string, format: "hex" | "base64"): StellarMessage; + static write(value: Int128Parts, io: Buffer): void; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static isValid(value: Int128Parts): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static toXDR(value: Int128Parts): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): Int128Parts; + + static fromXDR(input: string, format: 'hex' | 'base64'): Int128Parts; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AuthenticatedMessage { - switch(): number; + class UInt256Parts { + constructor(attributes: { + hiHi: Uint64; + hiLo: Uint64; + loHi: Uint64; + loLo: Uint64; + }); - v0(value?: AuthenticatedMessageV0): AuthenticatedMessageV0; + hiHi(value?: Uint64): Uint64; - static 0(value: AuthenticatedMessageV0): AuthenticatedMessage; + hiLo(value?: Uint64): Uint64; - value(): AuthenticatedMessageV0; + loHi(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + loLo(value?: Uint64): Uint64; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): AuthenticatedMessage; + toXDR(format: 'hex' | 'base64'): string; - static write(value: AuthenticatedMessage, io: Buffer): void; + static read(io: Buffer): UInt256Parts; - static isValid(value: AuthenticatedMessage): boolean; + static write(value: UInt256Parts, io: Buffer): void; - static toXDR(value: AuthenticatedMessage): Buffer; + static isValid(value: UInt256Parts): boolean; - static fromXDR(input: Buffer, format?: "raw"): AuthenticatedMessage; + static toXDR(value: UInt256Parts): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): AuthenticatedMessage; + static fromXDR(input: Buffer, format?: 'raw'): UInt256Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): UInt256Parts; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolParameters { - switch(): LiquidityPoolType; + class Int256Parts { + constructor(attributes: { + hiHi: Int64; + hiLo: Uint64; + loHi: Uint64; + loLo: Uint64; + }); - constantProduct( - value?: LiquidityPoolConstantProductParameters - ): LiquidityPoolConstantProductParameters; + hiHi(value?: Int64): Int64; - static liquidityPoolConstantProduct( - value: LiquidityPoolConstantProductParameters - ): LiquidityPoolParameters; + hiLo(value?: Uint64): Uint64; - value(): LiquidityPoolConstantProductParameters; + loHi(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + loLo(value?: Uint64): Uint64; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): LiquidityPoolParameters; + toXDR(format: 'hex' | 'base64'): string; - static write(value: LiquidityPoolParameters, io: Buffer): void; + static read(io: Buffer): Int256Parts; - static isValid(value: LiquidityPoolParameters): boolean; + static write(value: Int256Parts, io: Buffer): void; - static toXDR(value: LiquidityPoolParameters): Buffer; + static isValid(value: Int256Parts): boolean; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolParameters; + static toXDR(value: Int256Parts): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LiquidityPoolParameters; + static fromXDR(input: Buffer, format?: 'raw'): Int256Parts; + + static fromXDR(input: string, format: 'hex' | 'base64'): Int256Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class MuxedAccount { - switch(): CryptoKeyType; + class ScNonceKey { + constructor(attributes: { nonce: Int64 }); - ed25519(value?: Buffer): Buffer; + nonce(value?: Int64): Int64; - med25519(value?: MuxedAccountMed25519): MuxedAccountMed25519; + toXDR(format?: 'raw'): Buffer; - static keyTypeEd25519(value: Buffer): MuxedAccount; + toXDR(format: 'hex' | 'base64'): string; - static keyTypeMuxedEd25519(value: MuxedAccountMed25519): MuxedAccount; + static read(io: Buffer): ScNonceKey; - value(): Buffer | MuxedAccountMed25519; + static write(value: ScNonceKey, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: ScNonceKey): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: ScNonceKey): Buffer; - static read(io: Buffer): MuxedAccount; + static fromXDR(input: Buffer, format?: 'raw'): ScNonceKey; - static write(value: MuxedAccount, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): ScNonceKey; - static isValid(value: MuxedAccount): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: MuxedAccount): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): MuxedAccount; + class ScContractInstance { + constructor(attributes: { + executable: ContractExecutable; + storage: null | ScMapEntry[]; + }); - static fromXDR(input: string, format: "hex" | "base64"): MuxedAccount; + executable(value?: ContractExecutable): ContractExecutable; - static validateXDR(input: Buffer, format?: "raw"): boolean; + storage(value?: null | ScMapEntry[]): null | ScMapEntry[]; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format?: 'raw'): Buffer; - class ChangeTrustAsset { - switch(): AssetType; + toXDR(format: 'hex' | 'base64'): string; - alphaNum4(value?: AlphaNum4): AlphaNum4; + static read(io: Buffer): ScContractInstance; - alphaNum12(value?: AlphaNum12): AlphaNum12; + static write(value: ScContractInstance, io: Buffer): void; - liquidityPool(value?: LiquidityPoolParameters): LiquidityPoolParameters; + static isValid(value: ScContractInstance): boolean; - static assetTypeNative(): ChangeTrustAsset; + static toXDR(value: ScContractInstance): Buffer; - static assetTypeCreditAlphanum4(value: AlphaNum4): ChangeTrustAsset; + static fromXDR(input: Buffer, format?: 'raw'): ScContractInstance; - static assetTypeCreditAlphanum12(value: AlphaNum12): ChangeTrustAsset; + static fromXDR(input: string, format: 'hex' | 'base64'): ScContractInstance; - static assetTypePoolShare(value: LiquidityPoolParameters): ChangeTrustAsset; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - value(): AlphaNum4 | AlphaNum12 | LiquidityPoolParameters | void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - toXDR(format?: "raw"): Buffer; + class ScMapEntry { + constructor(attributes: { key: ScVal; val: ScVal }); - toXDR(format: "hex" | "base64"): string; + key(value?: ScVal): ScVal; - static read(io: Buffer): ChangeTrustAsset; + val(value?: ScVal): ScVal; - static write(value: ChangeTrustAsset, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: ChangeTrustAsset): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: ChangeTrustAsset): Buffer; + static read(io: Buffer): ScMapEntry; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustAsset; + static write(value: ScMapEntry, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustAsset; + static isValid(value: ScMapEntry): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: ScMapEntry): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: Buffer, format?: 'raw'): ScMapEntry; - class RevokeSponsorshipOp { - switch(): RevokeSponsorshipType; + static fromXDR(input: string, format: 'hex' | 'base64'): ScMapEntry; - ledgerKey(value?: LedgerKey): LedgerKey; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - signer(value?: RevokeSponsorshipOpSigner): RevokeSponsorshipOpSigner; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static revokeSponsorshipLedgerEntry(value: LedgerKey): RevokeSponsorshipOp; + class ScMetaV0 { + constructor(attributes: { key: string | Buffer; val: string | Buffer }); - static revokeSponsorshipSigner( - value: RevokeSponsorshipOpSigner - ): RevokeSponsorshipOp; + key(value?: string | Buffer): string | Buffer; - value(): LedgerKey | RevokeSponsorshipOpSigner; + val(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): RevokeSponsorshipOp; + static read(io: Buffer): ScMetaV0; - static write(value: RevokeSponsorshipOp, io: Buffer): void; + static write(value: ScMetaV0, io: Buffer): void; - static isValid(value: RevokeSponsorshipOp): boolean; + static isValid(value: ScMetaV0): boolean; - static toXDR(value: RevokeSponsorshipOp): Buffer; + static toXDR(value: ScMetaV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipOp; + static fromXDR(input: Buffer, format?: 'raw'): ScMetaV0; - static fromXDR( - input: string, - format: "hex" | "base64" - ): RevokeSponsorshipOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ScMetaV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class OperationBody { - switch(): OperationType; + class ScSpecTypeOption { + constructor(attributes: { valueType: ScSpecTypeDef }); - createAccountOp(value?: CreateAccountOp): CreateAccountOp; + valueType(value?: ScSpecTypeDef): ScSpecTypeDef; - paymentOp(value?: PaymentOp): PaymentOp; + toXDR(format?: 'raw'): Buffer; - pathPaymentStrictReceiveOp( - value?: PathPaymentStrictReceiveOp - ): PathPaymentStrictReceiveOp; + toXDR(format: 'hex' | 'base64'): string; - manageSellOfferOp(value?: ManageSellOfferOp): ManageSellOfferOp; + static read(io: Buffer): ScSpecTypeOption; - createPassiveSellOfferOp( - value?: CreatePassiveSellOfferOp - ): CreatePassiveSellOfferOp; + static write(value: ScSpecTypeOption, io: Buffer): void; - setOptionsOp(value?: SetOptionsOp): SetOptionsOp; + static isValid(value: ScSpecTypeOption): boolean; - changeTrustOp(value?: ChangeTrustOp): ChangeTrustOp; + static toXDR(value: ScSpecTypeOption): Buffer; - allowTrustOp(value?: AllowTrustOp): AllowTrustOp; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeOption; - destination(value?: MuxedAccount): MuxedAccount; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeOption; - manageDataOp(value?: ManageDataOp): ManageDataOp; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - bumpSequenceOp(value?: BumpSequenceOp): BumpSequenceOp; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - manageBuyOfferOp(value?: ManageBuyOfferOp): ManageBuyOfferOp; + class ScSpecTypeResult { + constructor(attributes: { + okType: ScSpecTypeDef; + errorType: ScSpecTypeDef; + }); - pathPaymentStrictSendOp( - value?: PathPaymentStrictSendOp - ): PathPaymentStrictSendOp; + okType(value?: ScSpecTypeDef): ScSpecTypeDef; - createClaimableBalanceOp( - value?: CreateClaimableBalanceOp - ): CreateClaimableBalanceOp; + errorType(value?: ScSpecTypeDef): ScSpecTypeDef; - claimClaimableBalanceOp( - value?: ClaimClaimableBalanceOp - ): ClaimClaimableBalanceOp; + toXDR(format?: 'raw'): Buffer; - beginSponsoringFutureReservesOp( - value?: BeginSponsoringFutureReservesOp - ): BeginSponsoringFutureReservesOp; + toXDR(format: 'hex' | 'base64'): string; - revokeSponsorshipOp(value?: RevokeSponsorshipOp): RevokeSponsorshipOp; + static read(io: Buffer): ScSpecTypeResult; - clawbackOp(value?: ClawbackOp): ClawbackOp; + static write(value: ScSpecTypeResult, io: Buffer): void; - clawbackClaimableBalanceOp( - value?: ClawbackClaimableBalanceOp - ): ClawbackClaimableBalanceOp; + static isValid(value: ScSpecTypeResult): boolean; - setTrustLineFlagsOp(value?: SetTrustLineFlagsOp): SetTrustLineFlagsOp; + static toXDR(value: ScSpecTypeResult): Buffer; - liquidityPoolDepositOp( - value?: LiquidityPoolDepositOp - ): LiquidityPoolDepositOp; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeResult; - liquidityPoolWithdrawOp( - value?: LiquidityPoolWithdrawOp - ): LiquidityPoolWithdrawOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeResult; - static createAccount(value: CreateAccountOp): OperationBody; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static payment(value: PaymentOp): OperationBody; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static pathPaymentStrictReceive( - value: PathPaymentStrictReceiveOp - ): OperationBody; + class ScSpecTypeVec { + constructor(attributes: { elementType: ScSpecTypeDef }); - static manageSellOffer(value: ManageSellOfferOp): OperationBody; + elementType(value?: ScSpecTypeDef): ScSpecTypeDef; - static createPassiveSellOffer( - value: CreatePassiveSellOfferOp - ): OperationBody; + toXDR(format?: 'raw'): Buffer; - static setOptions(value: SetOptionsOp): OperationBody; + toXDR(format: 'hex' | 'base64'): string; - static changeTrust(value: ChangeTrustOp): OperationBody; + static read(io: Buffer): ScSpecTypeVec; - static allowTrust(value: AllowTrustOp): OperationBody; + static write(value: ScSpecTypeVec, io: Buffer): void; - static accountMerge(value: MuxedAccount): OperationBody; + static isValid(value: ScSpecTypeVec): boolean; - static inflation(): OperationBody; + static toXDR(value: ScSpecTypeVec): Buffer; - static manageData(value: ManageDataOp): OperationBody; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeVec; - static bumpSequence(value: BumpSequenceOp): OperationBody; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeVec; - static manageBuyOffer(value: ManageBuyOfferOp): OperationBody; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static pathPaymentStrictSend(value: PathPaymentStrictSendOp): OperationBody; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static createClaimableBalance( - value: CreateClaimableBalanceOp - ): OperationBody; + class ScSpecTypeMap { + constructor(attributes: { + keyType: ScSpecTypeDef; + valueType: ScSpecTypeDef; + }); - static claimClaimableBalance(value: ClaimClaimableBalanceOp): OperationBody; + keyType(value?: ScSpecTypeDef): ScSpecTypeDef; - static beginSponsoringFutureReserves( - value: BeginSponsoringFutureReservesOp - ): OperationBody; + valueType(value?: ScSpecTypeDef): ScSpecTypeDef; - static endSponsoringFutureReserves(): OperationBody; + toXDR(format?: 'raw'): Buffer; - static revokeSponsorship(value: RevokeSponsorshipOp): OperationBody; + toXDR(format: 'hex' | 'base64'): string; - static clawback(value: ClawbackOp): OperationBody; + static read(io: Buffer): ScSpecTypeMap; - static clawbackClaimableBalance( - value: ClawbackClaimableBalanceOp - ): OperationBody; + static write(value: ScSpecTypeMap, io: Buffer): void; - static setTrustLineFlags(value: SetTrustLineFlagsOp): OperationBody; + static isValid(value: ScSpecTypeMap): boolean; - static liquidityPoolDeposit(value: LiquidityPoolDepositOp): OperationBody; + static toXDR(value: ScSpecTypeMap): Buffer; - static liquidityPoolWithdraw(value: LiquidityPoolWithdrawOp): OperationBody; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeMap; - value(): - | CreateAccountOp - | PaymentOp - | PathPaymentStrictReceiveOp - | ManageSellOfferOp - | CreatePassiveSellOfferOp - | SetOptionsOp - | ChangeTrustOp - | AllowTrustOp - | MuxedAccount - | ManageDataOp - | BumpSequenceOp - | ManageBuyOfferOp - | PathPaymentStrictSendOp - | CreateClaimableBalanceOp - | ClaimClaimableBalanceOp - | BeginSponsoringFutureReservesOp - | RevokeSponsorshipOp - | ClawbackOp - | ClawbackClaimableBalanceOp - | SetTrustLineFlagsOp - | LiquidityPoolDepositOp - | LiquidityPoolWithdrawOp - | void; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeMap; - toXDR(format?: "raw"): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format: "hex" | "base64"): string; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static read(io: Buffer): OperationBody; + class ScSpecTypeTuple { + constructor(attributes: { valueTypes: ScSpecTypeDef[] }); - static write(value: OperationBody, io: Buffer): void; + valueTypes(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; - static isValid(value: OperationBody): boolean; + toXDR(format?: 'raw'): Buffer; - static toXDR(value: OperationBody): Buffer; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR(input: Buffer, format?: "raw"): OperationBody; + static read(io: Buffer): ScSpecTypeTuple; - static fromXDR(input: string, format: "hex" | "base64"): OperationBody; + static write(value: ScSpecTypeTuple, io: Buffer): void; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static isValid(value: ScSpecTypeTuple): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static toXDR(value: ScSpecTypeTuple): Buffer; - class HashIdPreimage { - switch(): EnvelopeType; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeTuple; - operationId(value?: HashIdPreimageOperationId): HashIdPreimageOperationId; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeTuple; - revokeId(value?: HashIdPreimageRevokeId): HashIdPreimageRevokeId; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static envelopeTypeOpId(value: HashIdPreimageOperationId): HashIdPreimage; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static envelopeTypePoolRevokeOpId( - value: HashIdPreimageRevokeId - ): HashIdPreimage; + class ScSpecTypeBytesN { + constructor(attributes: { n: number }); - value(): HashIdPreimageOperationId | HashIdPreimageRevokeId; + n(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimage; + static read(io: Buffer): ScSpecTypeBytesN; - static write(value: HashIdPreimage, io: Buffer): void; + static write(value: ScSpecTypeBytesN, io: Buffer): void; - static isValid(value: HashIdPreimage): boolean; + static isValid(value: ScSpecTypeBytesN): boolean; - static toXDR(value: HashIdPreimage): Buffer; + static toXDR(value: ScSpecTypeBytesN): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimage; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeBytesN; - static fromXDR(input: string, format: "hex" | "base64"): HashIdPreimage; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeBytesN; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Memo { - switch(): MemoType; + class ScSpecTypeUdt { + constructor(attributes: { name: string | Buffer }); - text(value?: string | Buffer): string | Buffer; + name(value?: string | Buffer): string | Buffer; - id(value?: Uint64): Uint64; + toXDR(format?: 'raw'): Buffer; - hash(value?: Buffer): Buffer; + toXDR(format: 'hex' | 'base64'): string; - retHash(value?: Buffer): Buffer; + static read(io: Buffer): ScSpecTypeUdt; - static memoNone(): Memo; + static write(value: ScSpecTypeUdt, io: Buffer): void; - static memoText(value: string | Buffer): Memo; + static isValid(value: ScSpecTypeUdt): boolean; - static memoId(value: Uint64): Memo; + static toXDR(value: ScSpecTypeUdt): Buffer; - static memoHash(value: Buffer): Memo; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeUdt; - static memoReturn(value: Buffer): Memo; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeUdt; - value(): string | Buffer | Uint64 | Buffer | Buffer | void; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtStructFieldV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef): ScSpecTypeDef; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtStructFieldV0; + + static write(value: ScSpecUdtStructFieldV0, io: Buffer): void; + + static isValid(value: ScSpecUdtStructFieldV0): boolean; + + static toXDR(value: ScSpecUdtStructFieldV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtStructFieldV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtStructFieldV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtStructV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + fields: ScSpecUdtStructFieldV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + fields(value?: ScSpecUdtStructFieldV0[]): ScSpecUdtStructFieldV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtStructV0; + + static write(value: ScSpecUdtStructV0, io: Buffer): void; + + static isValid(value: ScSpecUdtStructV0): boolean; + + static toXDR(value: ScSpecUdtStructV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtStructV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtStructV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtUnionCaseVoidV0 { + constructor(attributes: { doc: string | Buffer; name: string | Buffer }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionCaseVoidV0; + + static write(value: ScSpecUdtUnionCaseVoidV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionCaseVoidV0): boolean; + + static toXDR(value: ScSpecUdtUnionCaseVoidV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseVoidV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtUnionCaseVoidV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtUnionCaseTupleV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionCaseTupleV0; + + static write(value: ScSpecUdtUnionCaseTupleV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionCaseTupleV0): boolean; + + static toXDR(value: ScSpecUdtUnionCaseTupleV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseTupleV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtUnionCaseTupleV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtUnionV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtUnionCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtUnionCaseV0[]): ScSpecUdtUnionCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionV0; + + static write(value: ScSpecUdtUnionV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionV0): boolean; + + static toXDR(value: ScSpecUdtUnionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtUnionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtEnumCaseV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + value: number; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + value(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtEnumCaseV0; + + static write(value: ScSpecUdtEnumCaseV0, io: Buffer): void; + + static isValid(value: ScSpecUdtEnumCaseV0): boolean; + + static toXDR(value: ScSpecUdtEnumCaseV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtEnumCaseV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtEnumCaseV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtEnumV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtEnumCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtEnumCaseV0[]): ScSpecUdtEnumCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtEnumV0; + + static write(value: ScSpecUdtEnumV0, io: Buffer): void; + + static isValid(value: ScSpecUdtEnumV0): boolean; + + static toXDR(value: ScSpecUdtEnumV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtEnumV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtEnumV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtErrorEnumCaseV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + value: number; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + value(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtErrorEnumCaseV0; + + static write(value: ScSpecUdtErrorEnumCaseV0, io: Buffer): void; + + static isValid(value: ScSpecUdtErrorEnumCaseV0): boolean; + + static toXDR(value: ScSpecUdtErrorEnumCaseV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtErrorEnumCaseV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtErrorEnumCaseV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtErrorEnumV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtErrorEnumCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtErrorEnumCaseV0[]): ScSpecUdtErrorEnumCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtErrorEnumV0; + + static write(value: ScSpecUdtErrorEnumV0, io: Buffer): void; + + static isValid(value: ScSpecUdtErrorEnumV0): boolean; + + static toXDR(value: ScSpecUdtErrorEnumV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtErrorEnumV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtErrorEnumV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecFunctionInputV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef): ScSpecTypeDef; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecFunctionInputV0; + + static write(value: ScSpecFunctionInputV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionInputV0): boolean; + + static toXDR(value: ScSpecFunctionInputV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionInputV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecFunctionInputV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecFunctionV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + inputs: ScSpecFunctionInputV0[]; + outputs: ScSpecTypeDef[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + inputs(value?: ScSpecFunctionInputV0[]): ScSpecFunctionInputV0[]; + + outputs(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecFunctionV0; + + static write(value: ScSpecFunctionV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionV0): boolean; + + static toXDR(value: ScSpecFunctionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractExecutionLanesV0 { + constructor(attributes: { ledgerMaxTxCount: number }); + + ledgerMaxTxCount(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractExecutionLanesV0; + + static write( + value: ConfigSettingContractExecutionLanesV0, + io: Buffer, + ): void; + + static isValid(value: ConfigSettingContractExecutionLanesV0): boolean; + + static toXDR(value: ConfigSettingContractExecutionLanesV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractExecutionLanesV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractExecutionLanesV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractComputeV0 { + constructor(attributes: { + ledgerMaxInstructions: Int64; + txMaxInstructions: Int64; + feeRatePerInstructionsIncrement: Int64; + txMemoryLimit: number; + }); + + ledgerMaxInstructions(value?: Int64): Int64; + + txMaxInstructions(value?: Int64): Int64; + + feeRatePerInstructionsIncrement(value?: Int64): Int64; + + txMemoryLimit(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractComputeV0; + + static write(value: ConfigSettingContractComputeV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractComputeV0): boolean; + + static toXDR(value: ConfigSettingContractComputeV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractComputeV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractComputeV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractLedgerCostV0 { + constructor(attributes: { + ledgerMaxReadLedgerEntries: number; + ledgerMaxReadBytes: number; + ledgerMaxWriteLedgerEntries: number; + ledgerMaxWriteBytes: number; + txMaxReadLedgerEntries: number; + txMaxReadBytes: number; + txMaxWriteLedgerEntries: number; + txMaxWriteBytes: number; + feeReadLedgerEntry: Int64; + feeWriteLedgerEntry: Int64; + feeRead1Kb: Int64; + bucketListTargetSizeBytes: Int64; + writeFee1KbBucketListLow: Int64; + writeFee1KbBucketListHigh: Int64; + bucketListWriteFeeGrowthFactor: number; + }); + + ledgerMaxReadLedgerEntries(value?: number): number; + + ledgerMaxReadBytes(value?: number): number; + + ledgerMaxWriteLedgerEntries(value?: number): number; + + ledgerMaxWriteBytes(value?: number): number; + + txMaxReadLedgerEntries(value?: number): number; + + txMaxReadBytes(value?: number): number; + + txMaxWriteLedgerEntries(value?: number): number; + + txMaxWriteBytes(value?: number): number; + + feeReadLedgerEntry(value?: Int64): Int64; + + feeWriteLedgerEntry(value?: Int64): Int64; + + feeRead1Kb(value?: Int64): Int64; + + bucketListTargetSizeBytes(value?: Int64): Int64; + + writeFee1KbBucketListLow(value?: Int64): Int64; + + writeFee1KbBucketListHigh(value?: Int64): Int64; + + bucketListWriteFeeGrowthFactor(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractLedgerCostV0; + + static write(value: ConfigSettingContractLedgerCostV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractLedgerCostV0): boolean; + + static toXDR(value: ConfigSettingContractLedgerCostV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractLedgerCostV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractLedgerCostV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractHistoricalDataV0 { + constructor(attributes: { feeHistorical1Kb: Int64 }); + + feeHistorical1Kb(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractHistoricalDataV0; + + static write( + value: ConfigSettingContractHistoricalDataV0, + io: Buffer, + ): void; + + static isValid(value: ConfigSettingContractHistoricalDataV0): boolean; + + static toXDR(value: ConfigSettingContractHistoricalDataV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractHistoricalDataV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractHistoricalDataV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractEventsV0 { + constructor(attributes: { + txMaxContractEventsSizeBytes: number; + feeContractEvents1Kb: Int64; + }); + + txMaxContractEventsSizeBytes(value?: number): number; + + feeContractEvents1Kb(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractEventsV0; + + static write(value: ConfigSettingContractEventsV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractEventsV0): boolean; + + static toXDR(value: ConfigSettingContractEventsV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractEventsV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractEventsV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractBandwidthV0 { + constructor(attributes: { + ledgerMaxTxsSizeBytes: number; + txMaxSizeBytes: number; + feeTxSize1Kb: Int64; + }); + + ledgerMaxTxsSizeBytes(value?: number): number; + + txMaxSizeBytes(value?: number): number; + + feeTxSize1Kb(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractBandwidthV0; + + static write(value: ConfigSettingContractBandwidthV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractBandwidthV0): boolean; + + static toXDR(value: ConfigSettingContractBandwidthV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractBandwidthV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractBandwidthV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ContractCostParamEntry { + constructor(attributes: { + ext: ExtensionPoint; + constTerm: Int64; + linearTerm: Int64; + }); + + ext(value?: ExtensionPoint): ExtensionPoint; + + constTerm(value?: Int64): Int64; + + linearTerm(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ContractCostParamEntry; + + static write(value: ContractCostParamEntry, io: Buffer): void; + + static isValid(value: ContractCostParamEntry): boolean; + + static toXDR(value: ContractCostParamEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ContractCostParamEntry; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ContractCostParamEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class StateExpirationSettings { + constructor(attributes: { + maxEntryExpiration: number; + minTempEntryExpiration: number; + minPersistentEntryExpiration: number; + persistentRentRateDenominator: Int64; + tempRentRateDenominator: Int64; + maxEntriesToExpire: number; + bucketListSizeWindowSampleSize: number; + evictionScanSize: Uint64; + startingEvictionScanLevel: number; + }); + + maxEntryExpiration(value?: number): number; + + minTempEntryExpiration(value?: number): number; + + minPersistentEntryExpiration(value?: number): number; + + persistentRentRateDenominator(value?: Int64): Int64; + + tempRentRateDenominator(value?: Int64): Int64; + + maxEntriesToExpire(value?: number): number; + + bucketListSizeWindowSampleSize(value?: number): number; + + evictionScanSize(value?: Uint64): Uint64; + + startingEvictionScanLevel(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): StateExpirationSettings; + + static write(value: StateExpirationSettings, io: Buffer): void; + + static isValid(value: StateExpirationSettings): boolean; + + static toXDR(value: StateExpirationSettings): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): StateExpirationSettings; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): StateExpirationSettings; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class EvictionIterator { + constructor(attributes: { + bucketListLevel: number; + isCurrBucket: boolean; + bucketFileOffset: Uint64; + }); + + bucketListLevel(value?: number): number; + + isCurrBucket(value?: boolean): boolean; + + bucketFileOffset(value?: Uint64): Uint64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): EvictionIterator; + + static write(value: EvictionIterator, io: Buffer): void; + + static isValid(value: EvictionIterator): boolean; + + static toXDR(value: EvictionIterator): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): EvictionIterator; + + static fromXDR(input: string, format: 'hex' | 'base64'): EvictionIterator; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScpStatementPledges { + switch(): ScpStatementType; + + prepare(value?: ScpStatementPrepare): ScpStatementPrepare; + + confirm(value?: ScpStatementConfirm): ScpStatementConfirm; + + externalize(value?: ScpStatementExternalize): ScpStatementExternalize; + + nominate(value?: ScpNomination): ScpNomination; + + static scpStPrepare(value: ScpStatementPrepare): ScpStatementPledges; + + static scpStConfirm(value: ScpStatementConfirm): ScpStatementPledges; + + static scpStExternalize( + value: ScpStatementExternalize, + ): ScpStatementPledges; + + static scpStNominate(value: ScpNomination): ScpStatementPledges; + + value(): + | ScpStatementPrepare + | ScpStatementConfirm + | ScpStatementExternalize + | ScpNomination; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScpStatementPledges; + + static write(value: ScpStatementPledges, io: Buffer): void; + + static isValid(value: ScpStatementPledges): boolean; + + static toXDR(value: ScpStatementPledges): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementPledges; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScpStatementPledges; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class AssetCode { + switch(): AssetType; + + assetCode4(value?: Buffer): Buffer; + + assetCode12(value?: Buffer): Buffer; + + static assetTypeCreditAlphanum4(value: Buffer): AssetCode; + + static assetTypeCreditAlphanum12(value: Buffer): AssetCode; + + value(): Buffer | Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): AssetCode; + + static write(value: AssetCode, io: Buffer): void; + + static isValid(value: AssetCode): boolean; + + static toXDR(value: AssetCode): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AssetCode; + + static fromXDR(input: string, format: 'hex' | 'base64'): AssetCode; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class Asset { + switch(): AssetType; + + alphaNum4(value?: AlphaNum4): AlphaNum4; + + alphaNum12(value?: AlphaNum12): AlphaNum12; + + static assetTypeNative(): Asset; + + static assetTypeCreditAlphanum4(value: AlphaNum4): Asset; + + static assetTypeCreditAlphanum12(value: AlphaNum12): Asset; + + value(): AlphaNum4 | AlphaNum12 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): Asset; + + static write(value: Asset, io: Buffer): void; + + static isValid(value: Asset): boolean; + + static toXDR(value: Asset): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): Asset; + + static fromXDR(input: string, format: 'hex' | 'base64'): Asset; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class AccountEntryExtensionV2Ext { + switch(): number; + + v3(value?: AccountEntryExtensionV3): AccountEntryExtensionV3; + + static 0(): AccountEntryExtensionV2Ext; + + static 3(value: AccountEntryExtensionV3): AccountEntryExtensionV2Ext; + + value(): AccountEntryExtensionV3 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): AccountEntryExtensionV2Ext; + + static write(value: AccountEntryExtensionV2Ext, io: Buffer): void; + + static isValid(value: AccountEntryExtensionV2Ext): boolean; + + static toXDR(value: AccountEntryExtensionV2Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV2Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): AccountEntryExtensionV2Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class AccountEntryExtensionV1Ext { + switch(): number; + + v2(value?: AccountEntryExtensionV2): AccountEntryExtensionV2; + + static 0(): AccountEntryExtensionV1Ext; + + static 2(value: AccountEntryExtensionV2): AccountEntryExtensionV1Ext; + + value(): AccountEntryExtensionV2 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): AccountEntryExtensionV1Ext; + + static write(value: AccountEntryExtensionV1Ext, io: Buffer): void; + + static isValid(value: AccountEntryExtensionV1Ext): boolean; + + static toXDR(value: AccountEntryExtensionV1Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV1Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): AccountEntryExtensionV1Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class AccountEntryExt { + switch(): number; + + v1(value?: AccountEntryExtensionV1): AccountEntryExtensionV1; + + static 0(): AccountEntryExt; + + static 1(value: AccountEntryExtensionV1): AccountEntryExt; + + value(): AccountEntryExtensionV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): AccountEntryExt; + + static write(value: AccountEntryExt, io: Buffer): void; + + static isValid(value: AccountEntryExt): boolean; + + static toXDR(value: AccountEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): AccountEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TrustLineAsset { + switch(): AssetType; + + alphaNum4(value?: AlphaNum4): AlphaNum4; + + alphaNum12(value?: AlphaNum12): AlphaNum12; + + liquidityPoolId(value?: PoolId): PoolId; + + static assetTypeNative(): TrustLineAsset; + + static assetTypeCreditAlphanum4(value: AlphaNum4): TrustLineAsset; + + static assetTypeCreditAlphanum12(value: AlphaNum12): TrustLineAsset; + + static assetTypePoolShare(value: PoolId): TrustLineAsset; + + value(): AlphaNum4 | AlphaNum12 | PoolId | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TrustLineAsset; + + static write(value: TrustLineAsset, io: Buffer): void; + + static isValid(value: TrustLineAsset): boolean; + + static toXDR(value: TrustLineAsset): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TrustLineAsset; + + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineAsset; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TrustLineEntryExtensionV2Ext { + switch(): number; + + static 0(): TrustLineEntryExtensionV2Ext; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TrustLineEntryExtensionV2Ext; + + static write(value: TrustLineEntryExtensionV2Ext, io: Buffer): void; + + static isValid(value: TrustLineEntryExtensionV2Ext): boolean; + + static toXDR(value: TrustLineEntryExtensionV2Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExtensionV2Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TrustLineEntryExtensionV2Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TrustLineEntryV1Ext { + switch(): number; + + v2(value?: TrustLineEntryExtensionV2): TrustLineEntryExtensionV2; + + static 0(): TrustLineEntryV1Ext; + + static 2(value: TrustLineEntryExtensionV2): TrustLineEntryV1Ext; + + value(): TrustLineEntryExtensionV2 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TrustLineEntryV1Ext; + + static write(value: TrustLineEntryV1Ext, io: Buffer): void; + + static isValid(value: TrustLineEntryV1Ext): boolean; + + static toXDR(value: TrustLineEntryV1Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryV1Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TrustLineEntryV1Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TrustLineEntryExt { + switch(): number; + + v1(value?: TrustLineEntryV1): TrustLineEntryV1; + + static 0(): TrustLineEntryExt; + + static 1(value: TrustLineEntryV1): TrustLineEntryExt; + + value(): TrustLineEntryV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TrustLineEntryExt; + + static write(value: TrustLineEntryExt, io: Buffer): void; + + static isValid(value: TrustLineEntryExt): boolean; + + static toXDR(value: TrustLineEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class OfferEntryExt { + switch(): number; + + static 0(): OfferEntryExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): OfferEntryExt; + + static write(value: OfferEntryExt, io: Buffer): void; + + static isValid(value: OfferEntryExt): boolean; + + static toXDR(value: OfferEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): OfferEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): OfferEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class DataEntryExt { + switch(): number; + + static 0(): DataEntryExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): DataEntryExt; + + static write(value: DataEntryExt, io: Buffer): void; + + static isValid(value: DataEntryExt): boolean; + + static toXDR(value: DataEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): DataEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): DataEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ClaimPredicate { + switch(): ClaimPredicateType; + + andPredicates(value?: ClaimPredicate[]): ClaimPredicate[]; + + orPredicates(value?: ClaimPredicate[]): ClaimPredicate[]; + + notPredicate(value?: null | ClaimPredicate): null | ClaimPredicate; + + absBefore(value?: Int64): Int64; + + relBefore(value?: Int64): Int64; + + static claimPredicateUnconditional(): ClaimPredicate; + + static claimPredicateAnd(value: ClaimPredicate[]): ClaimPredicate; + + static claimPredicateOr(value: ClaimPredicate[]): ClaimPredicate; + + static claimPredicateNot(value: null | ClaimPredicate): ClaimPredicate; + + static claimPredicateBeforeAbsoluteTime(value: Int64): ClaimPredicate; + + static claimPredicateBeforeRelativeTime(value: Int64): ClaimPredicate; + + value(): + | ClaimPredicate[] + | ClaimPredicate[] + | null + | ClaimPredicate + | Int64 + | Int64 + | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimPredicate; + + static write(value: ClaimPredicate, io: Buffer): void; + + static isValid(value: ClaimPredicate): boolean; + + static toXDR(value: ClaimPredicate): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimPredicate; + + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimPredicate; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class Claimant { + switch(): ClaimantType; + + v0(value?: ClaimantV0): ClaimantV0; + + static claimantTypeV0(value: ClaimantV0): Claimant; + + value(): ClaimantV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): Claimant; + + static write(value: Claimant, io: Buffer): void; + + static isValid(value: Claimant): boolean; + + static toXDR(value: Claimant): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): Claimant; + + static fromXDR(input: string, format: 'hex' | 'base64'): Claimant; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ClaimableBalanceId { + switch(): ClaimableBalanceIdType; + + v0(value?: Buffer): Buffer; + + static claimableBalanceIdTypeV0(value: Buffer): ClaimableBalanceId; + + value(): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimableBalanceId; + + static write(value: ClaimableBalanceId, io: Buffer): void; + + static isValid(value: ClaimableBalanceId): boolean; + + static toXDR(value: ClaimableBalanceId): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; + + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ClaimableBalanceEntryExtensionV1Ext { + switch(): number; + + static 0(): ClaimableBalanceEntryExtensionV1Ext; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimableBalanceEntryExtensionV1Ext; + + static write(value: ClaimableBalanceEntryExtensionV1Ext, io: Buffer): void; + + static isValid(value: ClaimableBalanceEntryExtensionV1Ext): boolean; + + static toXDR(value: ClaimableBalanceEntryExtensionV1Ext): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ClaimableBalanceEntryExtensionV1Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ClaimableBalanceEntryExtensionV1Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ClaimableBalanceEntryExt { + switch(): number; + + v1( + value?: ClaimableBalanceEntryExtensionV1, + ): ClaimableBalanceEntryExtensionV1; + + static 0(): ClaimableBalanceEntryExt; + + static 1(value: ClaimableBalanceEntryExtensionV1): ClaimableBalanceEntryExt; + + value(): ClaimableBalanceEntryExtensionV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimableBalanceEntryExt; + + static write(value: ClaimableBalanceEntryExt, io: Buffer): void; + + static isValid(value: ClaimableBalanceEntryExt): boolean; + + static toXDR(value: ClaimableBalanceEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceEntryExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ClaimableBalanceEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LiquidityPoolEntryBody { + switch(): LiquidityPoolType; + + constantProduct( + value?: LiquidityPoolEntryConstantProduct, + ): LiquidityPoolEntryConstantProduct; + + static liquidityPoolConstantProduct( + value: LiquidityPoolEntryConstantProduct, + ): LiquidityPoolEntryBody; + + value(): LiquidityPoolEntryConstantProduct; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LiquidityPoolEntryBody; + + static write(value: LiquidityPoolEntryBody, io: Buffer): void; + + static isValid(value: LiquidityPoolEntryBody): boolean; + + static toXDR(value: LiquidityPoolEntryBody): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolEntryBody; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolEntryBody; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerEntryExtensionV1Ext { + switch(): number; + + static 0(): LedgerEntryExtensionV1Ext; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryExtensionV1Ext; + + static write(value: LedgerEntryExtensionV1Ext, io: Buffer): void; + + static isValid(value: LedgerEntryExtensionV1Ext): boolean; + + static toXDR(value: LedgerEntryExtensionV1Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExtensionV1Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerEntryExtensionV1Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerEntryData { + switch(): LedgerEntryType; + + account(value?: AccountEntry): AccountEntry; + + trustLine(value?: TrustLineEntry): TrustLineEntry; + + offer(value?: OfferEntry): OfferEntry; + + data(value?: DataEntry): DataEntry; + + claimableBalance(value?: ClaimableBalanceEntry): ClaimableBalanceEntry; + + liquidityPool(value?: LiquidityPoolEntry): LiquidityPoolEntry; + + contractData(value?: ContractDataEntry): ContractDataEntry; + + contractCode(value?: ContractCodeEntry): ContractCodeEntry; + + configSetting(value?: ConfigSettingEntry): ConfigSettingEntry; + + expiration(value?: ExpirationEntry): ExpirationEntry; + + static account(value: AccountEntry): LedgerEntryData; + + static trustline(value: TrustLineEntry): LedgerEntryData; + + static offer(value: OfferEntry): LedgerEntryData; + + static data(value: DataEntry): LedgerEntryData; + + static claimableBalance(value: ClaimableBalanceEntry): LedgerEntryData; + + static liquidityPool(value: LiquidityPoolEntry): LedgerEntryData; + + static contractData(value: ContractDataEntry): LedgerEntryData; + + static contractCode(value: ContractCodeEntry): LedgerEntryData; + + static configSetting(value: ConfigSettingEntry): LedgerEntryData; + + static expiration(value: ExpirationEntry): LedgerEntryData; + + value(): + | AccountEntry + | TrustLineEntry + | OfferEntry + | DataEntry + | ClaimableBalanceEntry + | LiquidityPoolEntry + | ContractDataEntry + | ContractCodeEntry + | ConfigSettingEntry + | ExpirationEntry; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryData; + + static write(value: LedgerEntryData, io: Buffer): void; + + static isValid(value: LedgerEntryData): boolean; + + static toXDR(value: LedgerEntryData): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryData; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryData; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerEntryExt { + switch(): number; + + v1(value?: LedgerEntryExtensionV1): LedgerEntryExtensionV1; + + static 0(): LedgerEntryExt; + + static 1(value: LedgerEntryExtensionV1): LedgerEntryExt; + + value(): LedgerEntryExtensionV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryExt; + + static write(value: LedgerEntryExt, io: Buffer): void; + + static isValid(value: LedgerEntryExt): boolean; + + static toXDR(value: LedgerEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerKey { + switch(): LedgerEntryType; + + account(value?: LedgerKeyAccount): LedgerKeyAccount; + + trustLine(value?: LedgerKeyTrustLine): LedgerKeyTrustLine; + + offer(value?: LedgerKeyOffer): LedgerKeyOffer; + + data(value?: LedgerKeyData): LedgerKeyData; + + claimableBalance( + value?: LedgerKeyClaimableBalance, + ): LedgerKeyClaimableBalance; + + liquidityPool(value?: LedgerKeyLiquidityPool): LedgerKeyLiquidityPool; + + contractData(value?: LedgerKeyContractData): LedgerKeyContractData; + + contractCode(value?: LedgerKeyContractCode): LedgerKeyContractCode; + + configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; + + expiration(value?: LedgerKeyExpiration): LedgerKeyExpiration; + + static account(value: LedgerKeyAccount): LedgerKey; + + static trustline(value: LedgerKeyTrustLine): LedgerKey; + + static offer(value: LedgerKeyOffer): LedgerKey; + + static data(value: LedgerKeyData): LedgerKey; + + static claimableBalance(value: LedgerKeyClaimableBalance): LedgerKey; + + static liquidityPool(value: LedgerKeyLiquidityPool): LedgerKey; + + static contractData(value: LedgerKeyContractData): LedgerKey; + + static contractCode(value: LedgerKeyContractCode): LedgerKey; + + static configSetting(value: LedgerKeyConfigSetting): LedgerKey; + + static expiration(value: LedgerKeyExpiration): LedgerKey; + + value(): + | LedgerKeyAccount + | LedgerKeyTrustLine + | LedgerKeyOffer + | LedgerKeyData + | LedgerKeyClaimableBalance + | LedgerKeyLiquidityPool + | LedgerKeyContractData + | LedgerKeyContractCode + | LedgerKeyConfigSetting + | LedgerKeyExpiration; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerKey; + + static write(value: LedgerKey, io: Buffer): void; + + static isValid(value: LedgerKey): boolean; + + static toXDR(value: LedgerKey): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerKey; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKey; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class StellarValueExt { + switch(): StellarValueType; + + lcValueSignature( + value?: LedgerCloseValueSignature, + ): LedgerCloseValueSignature; + + static stellarValueBasic(): StellarValueExt; + + static stellarValueSigned( + value: LedgerCloseValueSignature, + ): StellarValueExt; + + value(): LedgerCloseValueSignature | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): StellarValueExt; + + static write(value: StellarValueExt, io: Buffer): void; + + static isValid(value: StellarValueExt): boolean; + + static toXDR(value: StellarValueExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): StellarValueExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): StellarValueExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerHeaderExtensionV1Ext { + switch(): number; + + static 0(): LedgerHeaderExtensionV1Ext; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerHeaderExtensionV1Ext; + + static write(value: LedgerHeaderExtensionV1Ext, io: Buffer): void; + + static isValid(value: LedgerHeaderExtensionV1Ext): boolean; + + static toXDR(value: LedgerHeaderExtensionV1Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExtensionV1Ext; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerHeaderExtensionV1Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerHeaderExt { + switch(): number; + + v1(value?: LedgerHeaderExtensionV1): LedgerHeaderExtensionV1; + + static 0(): LedgerHeaderExt; + + static 1(value: LedgerHeaderExtensionV1): LedgerHeaderExt; + + value(): LedgerHeaderExtensionV1 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerHeaderExt; + + static write(value: LedgerHeaderExt, io: Buffer): void; + + static isValid(value: LedgerHeaderExt): boolean; + + static toXDR(value: LedgerHeaderExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerHeaderExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerUpgrade { + switch(): LedgerUpgradeType; + + newLedgerVersion(value?: number): number; + + newBaseFee(value?: number): number; + + newMaxTxSetSize(value?: number): number; + + newBaseReserve(value?: number): number; + + newFlags(value?: number): number; + + newConfig(value?: ConfigUpgradeSetKey): ConfigUpgradeSetKey; + + newMaxSorobanTxSetSize(value?: number): number; + + static ledgerUpgradeVersion(value: number): LedgerUpgrade; + + static ledgerUpgradeBaseFee(value: number): LedgerUpgrade; + + static ledgerUpgradeMaxTxSetSize(value: number): LedgerUpgrade; + + static ledgerUpgradeBaseReserve(value: number): LedgerUpgrade; + + static ledgerUpgradeFlags(value: number): LedgerUpgrade; + + static ledgerUpgradeConfig(value: ConfigUpgradeSetKey): LedgerUpgrade; + + static ledgerUpgradeMaxSorobanTxSetSize(value: number): LedgerUpgrade; + + value(): + | number + | number + | number + | number + | number + | ConfigUpgradeSetKey + | number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerUpgrade; + + static write(value: LedgerUpgrade, io: Buffer): void; + + static isValid(value: LedgerUpgrade): boolean; + + static toXDR(value: LedgerUpgrade): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerUpgrade; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerUpgrade; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class BucketMetadataExt { + switch(): number; + + static 0(): BucketMetadataExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketMetadataExt; + + static write(value: BucketMetadataExt, io: Buffer): void; + + static isValid(value: BucketMetadataExt): boolean; + + static toXDR(value: BucketMetadataExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class BucketEntry { + switch(): BucketEntryType; + + liveEntry(value?: LedgerEntry): LedgerEntry; + + deadEntry(value?: LedgerKey): LedgerKey; + + metaEntry(value?: BucketMetadata): BucketMetadata; + + static liveentry(value: LedgerEntry): BucketEntry; + + static initentry(value: LedgerEntry): BucketEntry; + + static deadentry(value: LedgerKey): BucketEntry; + + static metaentry(value: BucketMetadata): BucketEntry; + + value(): LedgerEntry | LedgerKey | BucketMetadata; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BucketEntry; + + static write(value: BucketEntry, io: Buffer): void; + + static isValid(value: BucketEntry): boolean; + + static toXDR(value: BucketEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TxSetComponent { + switch(): TxSetComponentType; + + txsMaybeDiscountedFee( + value?: TxSetComponentTxsMaybeDiscountedFee, + ): TxSetComponentTxsMaybeDiscountedFee; + + static txsetCompTxsMaybeDiscountedFee( + value: TxSetComponentTxsMaybeDiscountedFee, + ): TxSetComponent; + + value(): TxSetComponentTxsMaybeDiscountedFee; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TxSetComponent; + + static write(value: TxSetComponent, io: Buffer): void; + + static isValid(value: TxSetComponent): boolean; + + static toXDR(value: TxSetComponent): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TxSetComponent; + + static fromXDR(input: string, format: 'hex' | 'base64'): TxSetComponent; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionPhase { + switch(): number; + + v0Components(value?: TxSetComponent[]): TxSetComponent[]; + + static 0(value: TxSetComponent[]): TransactionPhase; + + value(): TxSetComponent[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionPhase; + + static write(value: TransactionPhase, io: Buffer): void; + + static isValid(value: TransactionPhase): boolean; + + static toXDR(value: TransactionPhase): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionPhase; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionPhase; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class GeneralizedTransactionSet { + switch(): number; + + v1TxSet(value?: TransactionSetV1): TransactionSetV1; + + static 1(value: TransactionSetV1): GeneralizedTransactionSet; + + value(): TransactionSetV1; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): GeneralizedTransactionSet; + + static write(value: GeneralizedTransactionSet, io: Buffer): void; + + static isValid(value: GeneralizedTransactionSet): boolean; + + static toXDR(value: GeneralizedTransactionSet): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): GeneralizedTransactionSet; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): GeneralizedTransactionSet; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionHistoryEntryExt { + switch(): number; + + generalizedTxSet( + value?: GeneralizedTransactionSet, + ): GeneralizedTransactionSet; + + static 0(): TransactionHistoryEntryExt; + + static 1(value: GeneralizedTransactionSet): TransactionHistoryEntryExt; + + value(): GeneralizedTransactionSet | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionHistoryEntryExt; + + static write(value: TransactionHistoryEntryExt, io: Buffer): void; + + static isValid(value: TransactionHistoryEntryExt): boolean; + + static toXDR(value: TransactionHistoryEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionHistoryEntryExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionHistoryEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionHistoryResultEntryExt { + switch(): number; + + static 0(): TransactionHistoryResultEntryExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionHistoryResultEntryExt; + + static write(value: TransactionHistoryResultEntryExt, io: Buffer): void; + + static isValid(value: TransactionHistoryResultEntryExt): boolean; + + static toXDR(value: TransactionHistoryResultEntryExt): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TransactionHistoryResultEntryExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionHistoryResultEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerHeaderHistoryEntryExt { + switch(): number; + + static 0(): LedgerHeaderHistoryEntryExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerHeaderHistoryEntryExt; + + static write(value: LedgerHeaderHistoryEntryExt, io: Buffer): void; + + static isValid(value: LedgerHeaderHistoryEntryExt): boolean; + + static toXDR(value: LedgerHeaderHistoryEntryExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderHistoryEntryExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerHeaderHistoryEntryExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScpHistoryEntry { + switch(): number; + + v0(value?: ScpHistoryEntryV0): ScpHistoryEntryV0; + + static 0(value: ScpHistoryEntryV0): ScpHistoryEntry; + + value(): ScpHistoryEntryV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScpHistoryEntry; + + static write(value: ScpHistoryEntry, io: Buffer): void; + + static isValid(value: ScpHistoryEntry): boolean; + + static toXDR(value: ScpHistoryEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScpHistoryEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScpHistoryEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerEntryChange { + switch(): LedgerEntryChangeType; + + created(value?: LedgerEntry): LedgerEntry; + + updated(value?: LedgerEntry): LedgerEntry; + + removed(value?: LedgerKey): LedgerKey; + + state(value?: LedgerEntry): LedgerEntry; + + static ledgerEntryCreated(value: LedgerEntry): LedgerEntryChange; + + static ledgerEntryUpdated(value: LedgerEntry): LedgerEntryChange; + + static ledgerEntryRemoved(value: LedgerKey): LedgerEntryChange; + + static ledgerEntryState(value: LedgerEntry): LedgerEntryChange; + + value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerEntryChange; + + static write(value: LedgerEntryChange, io: Buffer): void; + + static isValid(value: LedgerEntryChange): boolean; + + static toXDR(value: LedgerEntryChange): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryChange; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryChange; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ContractEventBody { + switch(): number; + + v0(value?: ContractEventV0): ContractEventV0; + + static 0(value: ContractEventV0): ContractEventBody; + + value(): ContractEventV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ContractEventBody; + + static write(value: ContractEventBody, io: Buffer): void; + + static isValid(value: ContractEventBody): boolean; + + static toXDR(value: ContractEventBody): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ContractEventBody; + + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEventBody; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionMeta { + switch(): number; + + operations(value?: OperationMeta[]): OperationMeta[]; + + v1(value?: TransactionMetaV1): TransactionMetaV1; + + v2(value?: TransactionMetaV2): TransactionMetaV2; + + v3(value?: TransactionMetaV3): TransactionMetaV3; + + static 0(value: OperationMeta[]): TransactionMeta; + + static 1(value: TransactionMetaV1): TransactionMeta; + + static 2(value: TransactionMetaV2): TransactionMeta; + + static 3(value: TransactionMetaV3): TransactionMeta; + + value(): + | OperationMeta[] + | TransactionMetaV1 + | TransactionMetaV2 + | TransactionMetaV3; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionMeta; + + static write(value: TransactionMeta, io: Buffer): void; + + static isValid(value: TransactionMeta): boolean; + + static toXDR(value: TransactionMeta): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionMeta; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMeta; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerCloseMeta { + switch(): number; + + v0(value?: LedgerCloseMetaV0): LedgerCloseMetaV0; + + v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; + + v2(value?: LedgerCloseMetaV2): LedgerCloseMetaV2; + + static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; + + static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; + + static 2(value: LedgerCloseMetaV2): LedgerCloseMeta; + + value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerCloseMeta; + + static write(value: LedgerCloseMeta, io: Buffer): void; + + static isValid(value: LedgerCloseMeta): boolean; + + static toXDR(value: LedgerCloseMeta): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMeta; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMeta; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class PeerAddressIp { + switch(): IpAddrType; + + ipv4(value?: Buffer): Buffer; + + ipv6(value?: Buffer): Buffer; + + static iPv4(value: Buffer): PeerAddressIp; + + static iPv6(value: Buffer): PeerAddressIp; + + value(): Buffer | Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PeerAddressIp; + + static write(value: PeerAddressIp, io: Buffer): void; + + static isValid(value: PeerAddressIp): boolean; + + static toXDR(value: PeerAddressIp): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): PeerAddressIp; + + static fromXDR(input: string, format: 'hex' | 'base64'): PeerAddressIp; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SurveyResponseBody { + switch(): SurveyMessageResponseType; + + topologyResponseBodyV0( + value?: TopologyResponseBodyV0, + ): TopologyResponseBodyV0; + + topologyResponseBodyV1( + value?: TopologyResponseBodyV1, + ): TopologyResponseBodyV1; + + static surveyTopologyResponseV0( + value: TopologyResponseBodyV0, + ): SurveyResponseBody; + + static surveyTopologyResponseV1( + value: TopologyResponseBodyV1, + ): SurveyResponseBody; + + value(): TopologyResponseBodyV0 | TopologyResponseBodyV1; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SurveyResponseBody; + + static write(value: SurveyResponseBody, io: Buffer): void; + + static isValid(value: SurveyResponseBody): boolean; + + static toXDR(value: SurveyResponseBody): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SurveyResponseBody; + + static fromXDR(input: string, format: 'hex' | 'base64'): SurveyResponseBody; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class StellarMessage { + switch(): MessageType; + + error(value?: Error): Error; + + hello(value?: Hello): Hello; + + auth(value?: Auth): Auth; + + dontHave(value?: DontHave): DontHave; + + peers(value?: PeerAddress[]): PeerAddress[]; + + txSetHash(value?: Buffer): Buffer; + + txSet(value?: TransactionSet): TransactionSet; + + generalizedTxSet( + value?: GeneralizedTransactionSet, + ): GeneralizedTransactionSet; + + transaction(value?: TransactionEnvelope): TransactionEnvelope; + + signedSurveyRequestMessage( + value?: SignedSurveyRequestMessage, + ): SignedSurveyRequestMessage; + + signedSurveyResponseMessage( + value?: SignedSurveyResponseMessage, + ): SignedSurveyResponseMessage; + + qSetHash(value?: Buffer): Buffer; + + qSet(value?: ScpQuorumSet): ScpQuorumSet; + + envelope(value?: ScpEnvelope): ScpEnvelope; + + getScpLedgerSeq(value?: number): number; + + sendMoreMessage(value?: SendMore): SendMore; + + sendMoreExtendedMessage(value?: SendMoreExtended): SendMoreExtended; + + floodAdvert(value?: FloodAdvert): FloodAdvert; + + floodDemand(value?: FloodDemand): FloodDemand; + + static errorMsg(value: Error): StellarMessage; + + static hello(value: Hello): StellarMessage; + + static auth(value: Auth): StellarMessage; + + static dontHave(value: DontHave): StellarMessage; + + static getPeers(): StellarMessage; + + static peers(value: PeerAddress[]): StellarMessage; + + static getTxSet(value: Buffer): StellarMessage; + + static txSet(value: TransactionSet): StellarMessage; + + static generalizedTxSet(value: GeneralizedTransactionSet): StellarMessage; + + static transaction(value: TransactionEnvelope): StellarMessage; + + static surveyRequest(value: SignedSurveyRequestMessage): StellarMessage; + + static surveyResponse(value: SignedSurveyResponseMessage): StellarMessage; + + static getScpQuorumset(value: Buffer): StellarMessage; + + static scpQuorumset(value: ScpQuorumSet): StellarMessage; + + static scpMessage(value: ScpEnvelope): StellarMessage; + + static getScpState(value: number): StellarMessage; + + static sendMore(value: SendMore): StellarMessage; + + static sendMoreExtended(value: SendMoreExtended): StellarMessage; + + static floodAdvert(value: FloodAdvert): StellarMessage; + + static floodDemand(value: FloodDemand): StellarMessage; + + value(): + | Error + | Hello + | Auth + | DontHave + | PeerAddress[] + | Buffer + | TransactionSet + | GeneralizedTransactionSet + | TransactionEnvelope + | SignedSurveyRequestMessage + | SignedSurveyResponseMessage + | Buffer + | ScpQuorumSet + | ScpEnvelope + | number + | SendMore + | SendMoreExtended + | FloodAdvert + | FloodDemand + | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): StellarMessage; + + static write(value: StellarMessage, io: Buffer): void; + + static isValid(value: StellarMessage): boolean; + + static toXDR(value: StellarMessage): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): StellarMessage; + + static fromXDR(input: string, format: 'hex' | 'base64'): StellarMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class AuthenticatedMessage { + switch(): number; + + v0(value?: AuthenticatedMessageV0): AuthenticatedMessageV0; + + static 0(value: AuthenticatedMessageV0): AuthenticatedMessage; + + value(): AuthenticatedMessageV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): AuthenticatedMessage; + + static write(value: AuthenticatedMessage, io: Buffer): void; + + static isValid(value: AuthenticatedMessage): boolean; + + static toXDR(value: AuthenticatedMessage): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AuthenticatedMessage; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): AuthenticatedMessage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LiquidityPoolParameters { + switch(): LiquidityPoolType; + + constantProduct( + value?: LiquidityPoolConstantProductParameters, + ): LiquidityPoolConstantProductParameters; + + static liquidityPoolConstantProduct( + value: LiquidityPoolConstantProductParameters, + ): LiquidityPoolParameters; + + value(): LiquidityPoolConstantProductParameters; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LiquidityPoolParameters; + + static write(value: LiquidityPoolParameters, io: Buffer): void; + + static isValid(value: LiquidityPoolParameters): boolean; + + static toXDR(value: LiquidityPoolParameters): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolParameters; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolParameters; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class MuxedAccount { + switch(): CryptoKeyType; + + ed25519(value?: Buffer): Buffer; + + med25519(value?: MuxedAccountMed25519): MuxedAccountMed25519; + + static keyTypeEd25519(value: Buffer): MuxedAccount; + + static keyTypeMuxedEd25519(value: MuxedAccountMed25519): MuxedAccount; + + value(): Buffer | MuxedAccountMed25519; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): MuxedAccount; + + static write(value: MuxedAccount, io: Buffer): void; + + static isValid(value: MuxedAccount): boolean; + + static toXDR(value: MuxedAccount): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): MuxedAccount; + + static fromXDR(input: string, format: 'hex' | 'base64'): MuxedAccount; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ChangeTrustAsset { + switch(): AssetType; + + alphaNum4(value?: AlphaNum4): AlphaNum4; + + alphaNum12(value?: AlphaNum12): AlphaNum12; + + liquidityPool(value?: LiquidityPoolParameters): LiquidityPoolParameters; + + static assetTypeNative(): ChangeTrustAsset; + + static assetTypeCreditAlphanum4(value: AlphaNum4): ChangeTrustAsset; + + static assetTypeCreditAlphanum12(value: AlphaNum12): ChangeTrustAsset; + + static assetTypePoolShare(value: LiquidityPoolParameters): ChangeTrustAsset; + + value(): AlphaNum4 | AlphaNum12 | LiquidityPoolParameters | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ChangeTrustAsset; + + static write(value: ChangeTrustAsset, io: Buffer): void; + + static isValid(value: ChangeTrustAsset): boolean; + + static toXDR(value: ChangeTrustAsset): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustAsset; + + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustAsset; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class RevokeSponsorshipOp { + switch(): RevokeSponsorshipType; + + ledgerKey(value?: LedgerKey): LedgerKey; + + signer(value?: RevokeSponsorshipOpSigner): RevokeSponsorshipOpSigner; + + static revokeSponsorshipLedgerEntry(value: LedgerKey): RevokeSponsorshipOp; + + static revokeSponsorshipSigner( + value: RevokeSponsorshipOpSigner, + ): RevokeSponsorshipOp; + + value(): LedgerKey | RevokeSponsorshipOpSigner; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): RevokeSponsorshipOp; + + static write(value: RevokeSponsorshipOp, io: Buffer): void; + + static isValid(value: RevokeSponsorshipOp): boolean; + + static toXDR(value: RevokeSponsorshipOp): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipOp; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): RevokeSponsorshipOp; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ContractIdPreimage { + switch(): ContractIdPreimageType; + + fromAddress( + value?: ContractIdPreimageFromAddress, + ): ContractIdPreimageFromAddress; + + fromAsset(value?: Asset): Asset; + + static contractIdPreimageFromAddress( + value: ContractIdPreimageFromAddress, + ): ContractIdPreimage; + + static contractIdPreimageFromAsset(value: Asset): ContractIdPreimage; + + value(): ContractIdPreimageFromAddress | Asset; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ContractIdPreimage; + + static write(value: ContractIdPreimage, io: Buffer): void; + + static isValid(value: ContractIdPreimage): boolean; + + static toXDR(value: ContractIdPreimage): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ContractIdPreimage; + + static fromXDR(input: string, format: 'hex' | 'base64'): ContractIdPreimage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class HostFunction { + switch(): HostFunctionType; + + invokeContract(value?: InvokeContractArgs): InvokeContractArgs; + + createContract(value?: CreateContractArgs): CreateContractArgs; + + wasm(value?: Buffer): Buffer; + + static hostFunctionTypeInvokeContract( + value: InvokeContractArgs, + ): HostFunction; + + static hostFunctionTypeCreateContract( + value: CreateContractArgs, + ): HostFunction; + + static hostFunctionTypeUploadContractWasm(value: Buffer): HostFunction; + + value(): InvokeContractArgs | CreateContractArgs | Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): HostFunction; + + static write(value: HostFunction, io: Buffer): void; + + static isValid(value: HostFunction): boolean; + + static toXDR(value: HostFunction): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): HostFunction; + + static fromXDR(input: string, format: 'hex' | 'base64'): HostFunction; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanAuthorizedFunction { + switch(): SorobanAuthorizedFunctionType; + + contractFn(value?: InvokeContractArgs): InvokeContractArgs; + + createContractHostFn(value?: CreateContractArgs): CreateContractArgs; + + static sorobanAuthorizedFunctionTypeContractFn( + value: InvokeContractArgs, + ): SorobanAuthorizedFunction; + + static sorobanAuthorizedFunctionTypeCreateContractHostFn( + value: CreateContractArgs, + ): SorobanAuthorizedFunction; + + value(): InvokeContractArgs | CreateContractArgs; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanAuthorizedFunction; + + static write(value: SorobanAuthorizedFunction, io: Buffer): void; + + static isValid(value: SorobanAuthorizedFunction): boolean; + + static toXDR(value: SorobanAuthorizedFunction): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizedFunction; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanAuthorizedFunction; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanCredentials { + switch(): SorobanCredentialsType; + + address(value?: SorobanAddressCredentials): SorobanAddressCredentials; + + static sorobanCredentialsSourceAccount(): SorobanCredentials; + + static sorobanCredentialsAddress( + value: SorobanAddressCredentials, + ): SorobanCredentials; + + value(): SorobanAddressCredentials | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanCredentials; + + static write(value: SorobanCredentials, io: Buffer): void; + + static isValid(value: SorobanCredentials): boolean; + + static toXDR(value: SorobanCredentials): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanCredentials; + + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanCredentials; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class OperationBody { + switch(): OperationType; + + createAccountOp(value?: CreateAccountOp): CreateAccountOp; + + paymentOp(value?: PaymentOp): PaymentOp; + + pathPaymentStrictReceiveOp( + value?: PathPaymentStrictReceiveOp, + ): PathPaymentStrictReceiveOp; + + manageSellOfferOp(value?: ManageSellOfferOp): ManageSellOfferOp; + + createPassiveSellOfferOp( + value?: CreatePassiveSellOfferOp, + ): CreatePassiveSellOfferOp; + + setOptionsOp(value?: SetOptionsOp): SetOptionsOp; + + changeTrustOp(value?: ChangeTrustOp): ChangeTrustOp; + + allowTrustOp(value?: AllowTrustOp): AllowTrustOp; + + destination(value?: MuxedAccount): MuxedAccount; + + manageDataOp(value?: ManageDataOp): ManageDataOp; + + bumpSequenceOp(value?: BumpSequenceOp): BumpSequenceOp; + + manageBuyOfferOp(value?: ManageBuyOfferOp): ManageBuyOfferOp; + + pathPaymentStrictSendOp( + value?: PathPaymentStrictSendOp, + ): PathPaymentStrictSendOp; + + createClaimableBalanceOp( + value?: CreateClaimableBalanceOp, + ): CreateClaimableBalanceOp; + + claimClaimableBalanceOp( + value?: ClaimClaimableBalanceOp, + ): ClaimClaimableBalanceOp; + + beginSponsoringFutureReservesOp( + value?: BeginSponsoringFutureReservesOp, + ): BeginSponsoringFutureReservesOp; + + revokeSponsorshipOp(value?: RevokeSponsorshipOp): RevokeSponsorshipOp; + + clawbackOp(value?: ClawbackOp): ClawbackOp; + + clawbackClaimableBalanceOp( + value?: ClawbackClaimableBalanceOp, + ): ClawbackClaimableBalanceOp; + + setTrustLineFlagsOp(value?: SetTrustLineFlagsOp): SetTrustLineFlagsOp; + + liquidityPoolDepositOp( + value?: LiquidityPoolDepositOp, + ): LiquidityPoolDepositOp; + + liquidityPoolWithdrawOp( + value?: LiquidityPoolWithdrawOp, + ): LiquidityPoolWithdrawOp; + + invokeHostFunctionOp(value?: InvokeHostFunctionOp): InvokeHostFunctionOp; + + bumpFootprintExpirationOp( + value?: BumpFootprintExpirationOp, + ): BumpFootprintExpirationOp; + + restoreFootprintOp(value?: RestoreFootprintOp): RestoreFootprintOp; + + static createAccount(value: CreateAccountOp): OperationBody; + + static payment(value: PaymentOp): OperationBody; + + static pathPaymentStrictReceive( + value: PathPaymentStrictReceiveOp, + ): OperationBody; + + static manageSellOffer(value: ManageSellOfferOp): OperationBody; + + static createPassiveSellOffer( + value: CreatePassiveSellOfferOp, + ): OperationBody; + + static setOptions(value: SetOptionsOp): OperationBody; + + static changeTrust(value: ChangeTrustOp): OperationBody; + + static allowTrust(value: AllowTrustOp): OperationBody; + + static accountMerge(value: MuxedAccount): OperationBody; + + static inflation(): OperationBody; + + static manageData(value: ManageDataOp): OperationBody; + + static bumpSequence(value: BumpSequenceOp): OperationBody; + + static manageBuyOffer(value: ManageBuyOfferOp): OperationBody; + + static pathPaymentStrictSend(value: PathPaymentStrictSendOp): OperationBody; + + static createClaimableBalance( + value: CreateClaimableBalanceOp, + ): OperationBody; + + static claimClaimableBalance(value: ClaimClaimableBalanceOp): OperationBody; + + static beginSponsoringFutureReserves( + value: BeginSponsoringFutureReservesOp, + ): OperationBody; + + static endSponsoringFutureReserves(): OperationBody; + + static revokeSponsorship(value: RevokeSponsorshipOp): OperationBody; + + static clawback(value: ClawbackOp): OperationBody; + + static clawbackClaimableBalance( + value: ClawbackClaimableBalanceOp, + ): OperationBody; + + static setTrustLineFlags(value: SetTrustLineFlagsOp): OperationBody; + + static liquidityPoolDeposit(value: LiquidityPoolDepositOp): OperationBody; + + static liquidityPoolWithdraw(value: LiquidityPoolWithdrawOp): OperationBody; + + static invokeHostFunction(value: InvokeHostFunctionOp): OperationBody; + + static bumpFootprintExpiration( + value: BumpFootprintExpirationOp, + ): OperationBody; + + static restoreFootprint(value: RestoreFootprintOp): OperationBody; + + value(): + | CreateAccountOp + | PaymentOp + | PathPaymentStrictReceiveOp + | ManageSellOfferOp + | CreatePassiveSellOfferOp + | SetOptionsOp + | ChangeTrustOp + | AllowTrustOp + | MuxedAccount + | ManageDataOp + | BumpSequenceOp + | ManageBuyOfferOp + | PathPaymentStrictSendOp + | CreateClaimableBalanceOp + | ClaimClaimableBalanceOp + | BeginSponsoringFutureReservesOp + | RevokeSponsorshipOp + | ClawbackOp + | ClawbackClaimableBalanceOp + | SetTrustLineFlagsOp + | LiquidityPoolDepositOp + | LiquidityPoolWithdrawOp + | InvokeHostFunctionOp + | BumpFootprintExpirationOp + | RestoreFootprintOp + | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): OperationBody; + + static write(value: OperationBody, io: Buffer): void; + + static isValid(value: OperationBody): boolean; + + static toXDR(value: OperationBody): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): OperationBody; + + static fromXDR(input: string, format: 'hex' | 'base64'): OperationBody; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class HashIdPreimage { + switch(): EnvelopeType; + + operationId(value?: HashIdPreimageOperationId): HashIdPreimageOperationId; + + revokeId(value?: HashIdPreimageRevokeId): HashIdPreimageRevokeId; + + contractId(value?: HashIdPreimageContractId): HashIdPreimageContractId; + + sorobanAuthorization( + value?: HashIdPreimageSorobanAuthorization, + ): HashIdPreimageSorobanAuthorization; + + static envelopeTypeOpId(value: HashIdPreimageOperationId): HashIdPreimage; + + static envelopeTypePoolRevokeOpId( + value: HashIdPreimageRevokeId, + ): HashIdPreimage; + + static envelopeTypeContractId( + value: HashIdPreimageContractId, + ): HashIdPreimage; + + static envelopeTypeSorobanAuthorization( + value: HashIdPreimageSorobanAuthorization, + ): HashIdPreimage; + + value(): + | HashIdPreimageOperationId + | HashIdPreimageRevokeId + | HashIdPreimageContractId + | HashIdPreimageSorobanAuthorization; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): HashIdPreimage; + + static write(value: HashIdPreimage, io: Buffer): void; + + static isValid(value: HashIdPreimage): boolean; + + static toXDR(value: HashIdPreimage): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimage; + + static fromXDR(input: string, format: 'hex' | 'base64'): HashIdPreimage; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class Memo { + switch(): MemoType; + + text(value?: string | Buffer): string | Buffer; + + id(value?: Uint64): Uint64; + + hash(value?: Buffer): Buffer; + + retHash(value?: Buffer): Buffer; + + static memoNone(): Memo; + + static memoText(value: string | Buffer): Memo; + + static memoId(value: Uint64): Memo; + + static memoHash(value: Buffer): Memo; + + static memoReturn(value: Buffer): Memo; + + value(): string | Buffer | Uint64 | Buffer | Buffer | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): Memo; + + static write(value: Memo, io: Buffer): void; + + static isValid(value: Memo): boolean; + + static toXDR(value: Memo): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): Memo; + + static fromXDR(input: string, format: 'hex' | 'base64'): Memo; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class Preconditions { + switch(): PreconditionType; + + timeBounds(value?: TimeBounds): TimeBounds; + + v2(value?: PreconditionsV2): PreconditionsV2; + + static precondNone(): Preconditions; + + static precondTime(value: TimeBounds): Preconditions; + + static precondV2(value: PreconditionsV2): Preconditions; + + value(): TimeBounds | PreconditionsV2 | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): Preconditions; + + static write(value: Preconditions, io: Buffer): void; + + static isValid(value: Preconditions): boolean; + + static toXDR(value: Preconditions): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): Preconditions; + + static fromXDR(input: string, format: 'hex' | 'base64'): Preconditions; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionV0Ext { + switch(): number; + + static 0(): TransactionV0Ext; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionV0Ext; + + static write(value: TransactionV0Ext, io: Buffer): void; + + static isValid(value: TransactionV0Ext): boolean; + + static toXDR(value: TransactionV0Ext): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0Ext; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionV0Ext; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionExt { + switch(): number; + + sorobanData(value?: SorobanTransactionData): SorobanTransactionData; + + static 0(): TransactionExt; + + static 1(value: SorobanTransactionData): TransactionExt; + + value(): SorobanTransactionData | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionExt; + + static write(value: TransactionExt, io: Buffer): void; + + static isValid(value: TransactionExt): boolean; + + static toXDR(value: TransactionExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionExt; + + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class FeeBumpTransactionInnerTx { + switch(): EnvelopeType; + + v1(value?: TransactionV1Envelope): TransactionV1Envelope; + + static envelopeTypeTx( + value: TransactionV1Envelope, + ): FeeBumpTransactionInnerTx; + + value(): TransactionV1Envelope; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): FeeBumpTransactionInnerTx; + + static write(value: FeeBumpTransactionInnerTx, io: Buffer): void; + + static isValid(value: FeeBumpTransactionInnerTx): boolean; + + static toXDR(value: FeeBumpTransactionInnerTx): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionInnerTx; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): FeeBumpTransactionInnerTx; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class FeeBumpTransactionExt { + switch(): number; + + static 0(): FeeBumpTransactionExt; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): FeeBumpTransactionExt; + + static write(value: FeeBumpTransactionExt, io: Buffer): void; + + static isValid(value: FeeBumpTransactionExt): boolean; + + static toXDR(value: FeeBumpTransactionExt): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionExt; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): FeeBumpTransactionExt; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionEnvelope { + switch(): EnvelopeType; + + v0(value?: TransactionV0Envelope): TransactionV0Envelope; + + v1(value?: TransactionV1Envelope): TransactionV1Envelope; + + feeBump(value?: FeeBumpTransactionEnvelope): FeeBumpTransactionEnvelope; + + static envelopeTypeTxV0(value: TransactionV0Envelope): TransactionEnvelope; + + static envelopeTypeTx(value: TransactionV1Envelope): TransactionEnvelope; + + static envelopeTypeTxFeeBump( + value: FeeBumpTransactionEnvelope, + ): TransactionEnvelope; + + value(): + | TransactionV0Envelope + | TransactionV1Envelope + | FeeBumpTransactionEnvelope; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionEnvelope; + + static write(value: TransactionEnvelope, io: Buffer): void; + + static isValid(value: TransactionEnvelope): boolean; + + static toXDR(value: TransactionEnvelope): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): TransactionEnvelope; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionEnvelope; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionSignaturePayloadTaggedTransaction { + switch(): EnvelopeType; + + tx(value?: Transaction): Transaction; + + feeBump(value?: FeeBumpTransaction): FeeBumpTransaction; + + static envelopeTypeTx( + value: Transaction, + ): TransactionSignaturePayloadTaggedTransaction; + + static envelopeTypeTxFeeBump( + value: FeeBumpTransaction, + ): TransactionSignaturePayloadTaggedTransaction; + + value(): Transaction | FeeBumpTransaction; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): TransactionSignaturePayloadTaggedTransaction; + + static write( + value: TransactionSignaturePayloadTaggedTransaction, + io: Buffer, + ): void; + + static isValid( + value: TransactionSignaturePayloadTaggedTransaction, + ): boolean; + + static toXDR(value: TransactionSignaturePayloadTaggedTransaction): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): TransactionSignaturePayloadTaggedTransaction; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionSignaturePayloadTaggedTransaction; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ClaimAtom { + switch(): ClaimAtomType; + + v0(value?: ClaimOfferAtomV0): ClaimOfferAtomV0; + + orderBook(value?: ClaimOfferAtom): ClaimOfferAtom; + + liquidityPool(value?: ClaimLiquidityAtom): ClaimLiquidityAtom; + + static claimAtomTypeV0(value: ClaimOfferAtomV0): ClaimAtom; + + static claimAtomTypeOrderBook(value: ClaimOfferAtom): ClaimAtom; + + static claimAtomTypeLiquidityPool(value: ClaimLiquidityAtom): ClaimAtom; + + value(): ClaimOfferAtomV0 | ClaimOfferAtom | ClaimLiquidityAtom; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ClaimAtom; + + static write(value: ClaimAtom, io: Buffer): void; + + static isValid(value: ClaimAtom): boolean; + + static toXDR(value: ClaimAtom): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ClaimAtom; + + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimAtom; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class CreateAccountResult { + switch(): CreateAccountResultCode; + + static createAccountSuccess(): CreateAccountResult; + + static createAccountMalformed(): CreateAccountResult; + + static createAccountUnderfunded(): CreateAccountResult; + + static createAccountLowReserve(): CreateAccountResult; + + static createAccountAlreadyExist(): CreateAccountResult; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): CreateAccountResult; + + static write(value: CreateAccountResult, io: Buffer): void; + + static isValid(value: CreateAccountResult): boolean; + + static toXDR(value: CreateAccountResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): CreateAccountResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): CreateAccountResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class PaymentResult { + switch(): PaymentResultCode; + + static paymentSuccess(): PaymentResult; + + static paymentMalformed(): PaymentResult; + + static paymentUnderfunded(): PaymentResult; + + static paymentSrcNoTrust(): PaymentResult; + + static paymentSrcNotAuthorized(): PaymentResult; + + static paymentNoDestination(): PaymentResult; + + static paymentNoTrust(): PaymentResult; + + static paymentNotAuthorized(): PaymentResult; + + static paymentLineFull(): PaymentResult; + + static paymentNoIssuer(): PaymentResult; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PaymentResult; + + static write(value: PaymentResult, io: Buffer): void; + + static isValid(value: PaymentResult): boolean; + + static toXDR(value: PaymentResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): PaymentResult; + + static fromXDR(input: string, format: 'hex' | 'base64'): PaymentResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class PathPaymentStrictReceiveResult { + switch(): PathPaymentStrictReceiveResultCode; + + success( + value?: PathPaymentStrictReceiveResultSuccess, + ): PathPaymentStrictReceiveResultSuccess; + + noIssuer(value?: Asset): Asset; + + static pathPaymentStrictReceiveSuccess( + value: PathPaymentStrictReceiveResultSuccess, + ): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveMalformed(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveUnderfunded(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveSrcNoTrust(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveSrcNotAuthorized(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveNoDestination(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveNoTrust(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveNotAuthorized(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveLineFull(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveNoIssuer( + value: Asset, + ): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveTooFewOffers(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveOfferCrossSelf(): PathPaymentStrictReceiveResult; + + static pathPaymentStrictReceiveOverSendmax(): PathPaymentStrictReceiveResult; + + value(): PathPaymentStrictReceiveResultSuccess | Asset | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PathPaymentStrictReceiveResult; + + static write(value: PathPaymentStrictReceiveResult, io: Buffer): void; + + static isValid(value: PathPaymentStrictReceiveResult): boolean; + + static toXDR(value: PathPaymentStrictReceiveResult): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): PathPaymentStrictReceiveResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): PathPaymentStrictReceiveResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class PathPaymentStrictSendResult { + switch(): PathPaymentStrictSendResultCode; + + success( + value?: PathPaymentStrictSendResultSuccess, + ): PathPaymentStrictSendResultSuccess; + + noIssuer(value?: Asset): Asset; + + static pathPaymentStrictSendSuccess( + value: PathPaymentStrictSendResultSuccess, + ): PathPaymentStrictSendResult; + + static pathPaymentStrictSendMalformed(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendUnderfunded(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendSrcNoTrust(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendSrcNotAuthorized(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendNoDestination(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendNoTrust(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendNotAuthorized(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendLineFull(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendNoIssuer( + value: Asset, + ): PathPaymentStrictSendResult; + + static pathPaymentStrictSendTooFewOffers(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendOfferCrossSelf(): PathPaymentStrictSendResult; + + static pathPaymentStrictSendUnderDestmin(): PathPaymentStrictSendResult; + + value(): PathPaymentStrictSendResultSuccess | Asset | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): PathPaymentStrictSendResult; + + static write(value: PathPaymentStrictSendResult, io: Buffer): void; + + static isValid(value: PathPaymentStrictSendResult): boolean; + + static toXDR(value: PathPaymentStrictSendResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictSendResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): PathPaymentStrictSendResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ManageOfferSuccessResultOffer { + switch(): ManageOfferEffect; + + offer(value?: OfferEntry): OfferEntry; + + static manageOfferCreated(value: OfferEntry): ManageOfferSuccessResultOffer; + + static manageOfferUpdated(value: OfferEntry): ManageOfferSuccessResultOffer; + + static manageOfferDeleted(): ManageOfferSuccessResultOffer; + + value(): OfferEntry | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ManageOfferSuccessResultOffer; + + static write(value: ManageOfferSuccessResultOffer, io: Buffer): void; + + static isValid(value: ManageOfferSuccessResultOffer): boolean; + + static toXDR(value: ManageOfferSuccessResultOffer): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ManageOfferSuccessResultOffer; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ManageOfferSuccessResultOffer; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ManageSellOfferResult { + switch(): ManageSellOfferResultCode; + + success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; + + static manageSellOfferSuccess( + value: ManageOfferSuccessResult, + ): ManageSellOfferResult; + + static manageSellOfferMalformed(): ManageSellOfferResult; + + static manageSellOfferSellNoTrust(): ManageSellOfferResult; + + static manageSellOfferBuyNoTrust(): ManageSellOfferResult; + + static manageSellOfferSellNotAuthorized(): ManageSellOfferResult; + + static manageSellOfferBuyNotAuthorized(): ManageSellOfferResult; + + static manageSellOfferLineFull(): ManageSellOfferResult; + + static manageSellOfferUnderfunded(): ManageSellOfferResult; + + static manageSellOfferCrossSelf(): ManageSellOfferResult; + + static manageSellOfferSellNoIssuer(): ManageSellOfferResult; + + static manageSellOfferBuyNoIssuer(): ManageSellOfferResult; + + static manageSellOfferNotFound(): ManageSellOfferResult; + + static manageSellOfferLowReserve(): ManageSellOfferResult; + + value(): ManageOfferSuccessResult | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ManageSellOfferResult; + + static write(value: ManageSellOfferResult, io: Buffer): void; + + static isValid(value: ManageSellOfferResult): boolean; + + static toXDR(value: ManageSellOfferResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ManageSellOfferResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ManageSellOfferResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ManageBuyOfferResult { + switch(): ManageBuyOfferResultCode; + + success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; + + static manageBuyOfferSuccess( + value: ManageOfferSuccessResult, + ): ManageBuyOfferResult; + + static manageBuyOfferMalformed(): ManageBuyOfferResult; + + static manageBuyOfferSellNoTrust(): ManageBuyOfferResult; + + static manageBuyOfferBuyNoTrust(): ManageBuyOfferResult; + + static manageBuyOfferSellNotAuthorized(): ManageBuyOfferResult; + + static manageBuyOfferBuyNotAuthorized(): ManageBuyOfferResult; + + static manageBuyOfferLineFull(): ManageBuyOfferResult; + + static manageBuyOfferUnderfunded(): ManageBuyOfferResult; + + static manageBuyOfferCrossSelf(): ManageBuyOfferResult; + + static manageBuyOfferSellNoIssuer(): ManageBuyOfferResult; + + static manageBuyOfferBuyNoIssuer(): ManageBuyOfferResult; + + static manageBuyOfferNotFound(): ManageBuyOfferResult; + + static manageBuyOfferLowReserve(): ManageBuyOfferResult; + + value(): ManageOfferSuccessResult | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ManageBuyOfferResult; + + static write(value: ManageBuyOfferResult, io: Buffer): void; + + static isValid(value: ManageBuyOfferResult): boolean; + + static toXDR(value: ManageBuyOfferResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ManageBuyOfferResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ManageBuyOfferResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SetOptionsResult { + switch(): SetOptionsResultCode; + + static setOptionsSuccess(): SetOptionsResult; + + static setOptionsLowReserve(): SetOptionsResult; + + static setOptionsTooManySigners(): SetOptionsResult; + + static setOptionsBadFlags(): SetOptionsResult; + + static setOptionsInvalidInflation(): SetOptionsResult; + + static setOptionsCantChange(): SetOptionsResult; + + static setOptionsUnknownFlag(): SetOptionsResult; + + static setOptionsThresholdOutOfRange(): SetOptionsResult; + + static setOptionsBadSigner(): SetOptionsResult; + + static setOptionsInvalidHomeDomain(): SetOptionsResult; + + static setOptionsAuthRevocableRequired(): SetOptionsResult; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SetOptionsResult; + + static write(value: SetOptionsResult, io: Buffer): void; + + static isValid(value: SetOptionsResult): boolean; + + static toXDR(value: SetOptionsResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SetOptionsResult; + + static fromXDR(input: string, format: 'hex' | 'base64'): SetOptionsResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ChangeTrustResult { + switch(): ChangeTrustResultCode; + + static changeTrustSuccess(): ChangeTrustResult; + + static changeTrustMalformed(): ChangeTrustResult; + + static changeTrustNoIssuer(): ChangeTrustResult; + + static changeTrustInvalidLimit(): ChangeTrustResult; + + static changeTrustLowReserve(): ChangeTrustResult; + + static changeTrustSelfNotAllowed(): ChangeTrustResult; + + static changeTrustTrustLineMissing(): ChangeTrustResult; + + static changeTrustCannotDelete(): ChangeTrustResult; + + static changeTrustNotAuthMaintainLiabilities(): ChangeTrustResult; + + value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): Memo; + static read(io: Buffer): ChangeTrustResult; - static write(value: Memo, io: Buffer): void; + static write(value: ChangeTrustResult, io: Buffer): void; - static isValid(value: Memo): boolean; + static isValid(value: ChangeTrustResult): boolean; - static toXDR(value: Memo): Buffer; + static toXDR(value: ChangeTrustResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Memo; + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustResult; - static fromXDR(input: string, format: "hex" | "base64"): Memo; + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class Preconditions { - switch(): PreconditionType; + class AllowTrustResult { + switch(): AllowTrustResultCode; - timeBounds(value?: TimeBounds): TimeBounds; + static allowTrustSuccess(): AllowTrustResult; - v2(value?: PreconditionsV2): PreconditionsV2; + static allowTrustMalformed(): AllowTrustResult; - static precondNone(): Preconditions; + static allowTrustNoTrustLine(): AllowTrustResult; - static precondTime(value: TimeBounds): Preconditions; + static allowTrustTrustNotRequired(): AllowTrustResult; - static precondV2(value: PreconditionsV2): Preconditions; + static allowTrustCantRevoke(): AllowTrustResult; - value(): TimeBounds | PreconditionsV2 | void; + static allowTrustSelfNotAllowed(): AllowTrustResult; - toXDR(format?: "raw"): Buffer; + static allowTrustLowReserve(): AllowTrustResult; - toXDR(format: "hex" | "base64"): string; + value(): void; - static read(io: Buffer): Preconditions; + toXDR(format?: 'raw'): Buffer; - static write(value: Preconditions, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: Preconditions): boolean; + static read(io: Buffer): AllowTrustResult; - static toXDR(value: Preconditions): Buffer; + static write(value: AllowTrustResult, io: Buffer): void; - static fromXDR(input: Buffer, format?: "raw"): Preconditions; + static isValid(value: AllowTrustResult): boolean; + + static toXDR(value: AllowTrustResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): AllowTrustResult; - static fromXDR(input: string, format: "hex" | "base64"): Preconditions; + static fromXDR(input: string, format: 'hex' | 'base64'): AllowTrustResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionV0Ext { - switch(): number; + class AccountMergeResult { + switch(): AccountMergeResultCode; - static 0(): TransactionV0Ext; + sourceAccountBalance(value?: Int64): Int64; - value(): void; + static accountMergeSuccess(value: Int64): AccountMergeResult; - toXDR(format?: "raw"): Buffer; + static accountMergeMalformed(): AccountMergeResult; - toXDR(format: "hex" | "base64"): string; + static accountMergeNoAccount(): AccountMergeResult; - static read(io: Buffer): TransactionV0Ext; + static accountMergeImmutableSet(): AccountMergeResult; - static write(value: TransactionV0Ext, io: Buffer): void; + static accountMergeHasSubEntries(): AccountMergeResult; - static isValid(value: TransactionV0Ext): boolean; + static accountMergeSeqnumTooFar(): AccountMergeResult; - static toXDR(value: TransactionV0Ext): Buffer; + static accountMergeDestFull(): AccountMergeResult; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0Ext; + static accountMergeIsSponsor(): AccountMergeResult; - static fromXDR(input: string, format: "hex" | "base64"): TransactionV0Ext; + value(): Int64 | void; - static validateXDR(input: Buffer, format?: "raw"): boolean; + toXDR(format?: 'raw'): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format: 'hex' | 'base64'): string; - class TransactionExt { - switch(): number; + static read(io: Buffer): AccountMergeResult; - static 0(): TransactionExt; + static write(value: AccountMergeResult, io: Buffer): void; - value(): void; + static isValid(value: AccountMergeResult): boolean; - toXDR(format?: "raw"): Buffer; + static toXDR(value: AccountMergeResult): Buffer; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: Buffer, format?: 'raw'): AccountMergeResult; - static read(io: Buffer): TransactionExt; + static fromXDR(input: string, format: 'hex' | 'base64'): AccountMergeResult; - static write(value: TransactionExt, io: Buffer): void; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static isValid(value: TransactionExt): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static toXDR(value: TransactionExt): Buffer; + class InflationResult { + switch(): InflationResultCode; - static fromXDR(input: Buffer, format?: "raw"): TransactionExt; + payouts(value?: InflationPayout[]): InflationPayout[]; - static fromXDR(input: string, format: "hex" | "base64"): TransactionExt; + static inflationSuccess(value: InflationPayout[]): InflationResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static inflationNotTime(): InflationResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + value(): InflationPayout[] | void; - class FeeBumpTransactionInnerTx { - switch(): EnvelopeType; + toXDR(format?: 'raw'): Buffer; - v1(value?: TransactionV1Envelope): TransactionV1Envelope; + toXDR(format: 'hex' | 'base64'): string; - static envelopeTypeTx( - value: TransactionV1Envelope - ): FeeBumpTransactionInnerTx; + static read(io: Buffer): InflationResult; - value(): TransactionV1Envelope; + static write(value: InflationResult, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: InflationResult): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: InflationResult): Buffer; - static read(io: Buffer): FeeBumpTransactionInnerTx; + static fromXDR(input: Buffer, format?: 'raw'): InflationResult; - static write(value: FeeBumpTransactionInnerTx, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): InflationResult; - static isValid(value: FeeBumpTransactionInnerTx): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: FeeBumpTransactionInnerTx): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionInnerTx; + class ManageDataResult { + switch(): ManageDataResultCode; - static fromXDR( - input: string, - format: "hex" | "base64" - ): FeeBumpTransactionInnerTx; + static manageDataSuccess(): ManageDataResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static manageDataNotSupportedYet(): ManageDataResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static manageDataNameNotFound(): ManageDataResult; - class FeeBumpTransactionExt { - switch(): number; + static manageDataLowReserve(): ManageDataResult; - static 0(): FeeBumpTransactionExt; + static manageDataInvalidName(): ManageDataResult; value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): FeeBumpTransactionExt; + static read(io: Buffer): ManageDataResult; - static write(value: FeeBumpTransactionExt, io: Buffer): void; + static write(value: ManageDataResult, io: Buffer): void; - static isValid(value: FeeBumpTransactionExt): boolean; + static isValid(value: ManageDataResult): boolean; - static toXDR(value: FeeBumpTransactionExt): Buffer; + static toXDR(value: ManageDataResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionExt; + static fromXDR(input: Buffer, format?: 'raw'): ManageDataResult; - static fromXDR( - input: string, - format: "hex" | "base64" - ): FeeBumpTransactionExt; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageDataResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionEnvelope { - switch(): EnvelopeType; - - v0(value?: TransactionV0Envelope): TransactionV0Envelope; + class BumpSequenceResult { + switch(): BumpSequenceResultCode; - v1(value?: TransactionV1Envelope): TransactionV1Envelope; + static bumpSequenceSuccess(): BumpSequenceResult; - feeBump(value?: FeeBumpTransactionEnvelope): FeeBumpTransactionEnvelope; + static bumpSequenceBadSeq(): BumpSequenceResult; - static envelopeTypeTxV0(value: TransactionV0Envelope): TransactionEnvelope; + value(): void; - static envelopeTypeTx(value: TransactionV1Envelope): TransactionEnvelope; + toXDR(format?: 'raw'): Buffer; - static envelopeTypeTxFeeBump( - value: FeeBumpTransactionEnvelope - ): TransactionEnvelope; + toXDR(format: 'hex' | 'base64'): string; - value(): - | TransactionV0Envelope - | TransactionV1Envelope - | FeeBumpTransactionEnvelope; + static read(io: Buffer): BumpSequenceResult; - toXDR(format?: "raw"): Buffer; + static write(value: BumpSequenceResult, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: BumpSequenceResult): boolean; - static read(io: Buffer): TransactionEnvelope; + static toXDR(value: BumpSequenceResult): Buffer; - static write(value: TransactionEnvelope, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): BumpSequenceResult; - static isValid(value: TransactionEnvelope): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): BumpSequenceResult; - static toXDR(value: TransactionEnvelope): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): TransactionEnvelope; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionEnvelope; + class CreateClaimableBalanceResult { + switch(): CreateClaimableBalanceResultCode; - static validateXDR(input: Buffer, format?: "raw"): boolean; + balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static createClaimableBalanceSuccess( + value: ClaimableBalanceId, + ): CreateClaimableBalanceResult; - class TransactionSignaturePayloadTaggedTransaction { - switch(): EnvelopeType; + static createClaimableBalanceMalformed(): CreateClaimableBalanceResult; - tx(value?: Transaction): Transaction; + static createClaimableBalanceLowReserve(): CreateClaimableBalanceResult; - feeBump(value?: FeeBumpTransaction): FeeBumpTransaction; + static createClaimableBalanceNoTrust(): CreateClaimableBalanceResult; - static envelopeTypeTx( - value: Transaction - ): TransactionSignaturePayloadTaggedTransaction; + static createClaimableBalanceNotAuthorized(): CreateClaimableBalanceResult; - static envelopeTypeTxFeeBump( - value: FeeBumpTransaction - ): TransactionSignaturePayloadTaggedTransaction; + static createClaimableBalanceUnderfunded(): CreateClaimableBalanceResult; - value(): Transaction | FeeBumpTransaction; + value(): ClaimableBalanceId | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionSignaturePayloadTaggedTransaction; + static read(io: Buffer): CreateClaimableBalanceResult; - static write( - value: TransactionSignaturePayloadTaggedTransaction, - io: Buffer - ): void; + static write(value: CreateClaimableBalanceResult, io: Buffer): void; - static isValid( - value: TransactionSignaturePayloadTaggedTransaction - ): boolean; + static isValid(value: CreateClaimableBalanceResult): boolean; - static toXDR(value: TransactionSignaturePayloadTaggedTransaction): Buffer; + static toXDR(value: CreateClaimableBalanceResult): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): TransactionSignaturePayloadTaggedTransaction; + static fromXDR(input: Buffer, format?: 'raw'): CreateClaimableBalanceResult; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionSignaturePayloadTaggedTransaction; + format: 'hex' | 'base64', + ): CreateClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimAtom { - switch(): ClaimAtomType; + class ClaimClaimableBalanceResult { + switch(): ClaimClaimableBalanceResultCode; - v0(value?: ClaimOfferAtomV0): ClaimOfferAtomV0; + static claimClaimableBalanceSuccess(): ClaimClaimableBalanceResult; - orderBook(value?: ClaimOfferAtom): ClaimOfferAtom; + static claimClaimableBalanceDoesNotExist(): ClaimClaimableBalanceResult; - liquidityPool(value?: ClaimLiquidityAtom): ClaimLiquidityAtom; + static claimClaimableBalanceCannotClaim(): ClaimClaimableBalanceResult; - static claimAtomTypeV0(value: ClaimOfferAtomV0): ClaimAtom; + static claimClaimableBalanceLineFull(): ClaimClaimableBalanceResult; - static claimAtomTypeOrderBook(value: ClaimOfferAtom): ClaimAtom; + static claimClaimableBalanceNoTrust(): ClaimClaimableBalanceResult; - static claimAtomTypeLiquidityPool(value: ClaimLiquidityAtom): ClaimAtom; + static claimClaimableBalanceNotAuthorized(): ClaimClaimableBalanceResult; - value(): ClaimOfferAtomV0 | ClaimOfferAtom | ClaimLiquidityAtom; + value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimAtom; + static read(io: Buffer): ClaimClaimableBalanceResult; - static write(value: ClaimAtom, io: Buffer): void; + static write(value: ClaimClaimableBalanceResult, io: Buffer): void; - static isValid(value: ClaimAtom): boolean; + static isValid(value: ClaimClaimableBalanceResult): boolean; - static toXDR(value: ClaimAtom): Buffer; + static toXDR(value: ClaimClaimableBalanceResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimAtom; + static fromXDR(input: Buffer, format?: 'raw'): ClaimClaimableBalanceResult; - static fromXDR(input: string, format: "hex" | "base64"): ClaimAtom; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ClaimClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class CreateAccountResult { - switch(): CreateAccountResultCode; - - static createAccountSuccess(): CreateAccountResult; + class BeginSponsoringFutureReservesResult { + switch(): BeginSponsoringFutureReservesResultCode; - static createAccountMalformed(): CreateAccountResult; + static beginSponsoringFutureReservesSuccess(): BeginSponsoringFutureReservesResult; - static createAccountUnderfunded(): CreateAccountResult; + static beginSponsoringFutureReservesMalformed(): BeginSponsoringFutureReservesResult; - static createAccountLowReserve(): CreateAccountResult; + static beginSponsoringFutureReservesAlreadySponsored(): BeginSponsoringFutureReservesResult; - static createAccountAlreadyExist(): CreateAccountResult; + static beginSponsoringFutureReservesRecursive(): BeginSponsoringFutureReservesResult; value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): CreateAccountResult; + static read(io: Buffer): BeginSponsoringFutureReservesResult; - static write(value: CreateAccountResult, io: Buffer): void; + static write(value: BeginSponsoringFutureReservesResult, io: Buffer): void; - static isValid(value: CreateAccountResult): boolean; + static isValid(value: BeginSponsoringFutureReservesResult): boolean; - static toXDR(value: CreateAccountResult): Buffer; + static toXDR(value: BeginSponsoringFutureReservesResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateAccountResult; + static fromXDR( + input: Buffer, + format?: 'raw', + ): BeginSponsoringFutureReservesResult; static fromXDR( input: string, - format: "hex" | "base64" - ): CreateAccountResult; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class PaymentResult { - switch(): PaymentResultCode; - - static paymentSuccess(): PaymentResult; - - static paymentMalformed(): PaymentResult; - - static paymentUnderfunded(): PaymentResult; - - static paymentSrcNoTrust(): PaymentResult; - - static paymentSrcNotAuthorized(): PaymentResult; + format: 'hex' | 'base64', + ): BeginSponsoringFutureReservesResult; - static paymentNoDestination(): PaymentResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static paymentNoTrust(): PaymentResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static paymentNotAuthorized(): PaymentResult; + class EndSponsoringFutureReservesResult { + switch(): EndSponsoringFutureReservesResultCode; - static paymentLineFull(): PaymentResult; + static endSponsoringFutureReservesSuccess(): EndSponsoringFutureReservesResult; - static paymentNoIssuer(): PaymentResult; + static endSponsoringFutureReservesNotSponsored(): EndSponsoringFutureReservesResult; value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PaymentResult; + static read(io: Buffer): EndSponsoringFutureReservesResult; - static write(value: PaymentResult, io: Buffer): void; + static write(value: EndSponsoringFutureReservesResult, io: Buffer): void; - static isValid(value: PaymentResult): boolean; + static isValid(value: EndSponsoringFutureReservesResult): boolean; - static toXDR(value: PaymentResult): Buffer; + static toXDR(value: EndSponsoringFutureReservesResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PaymentResult; + static fromXDR( + input: Buffer, + format?: 'raw', + ): EndSponsoringFutureReservesResult; - static fromXDR(input: string, format: "hex" | "base64"): PaymentResult; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): EndSponsoringFutureReservesResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class PathPaymentStrictReceiveResult { - switch(): PathPaymentStrictReceiveResultCode; - - success( - value?: PathPaymentStrictReceiveResultSuccess - ): PathPaymentStrictReceiveResultSuccess; - - noIssuer(value?: Asset): Asset; - - static pathPaymentStrictReceiveSuccess( - value: PathPaymentStrictReceiveResultSuccess - ): PathPaymentStrictReceiveResult; + class RevokeSponsorshipResult { + switch(): RevokeSponsorshipResultCode; - static pathPaymentStrictReceiveMalformed(): PathPaymentStrictReceiveResult; + static revokeSponsorshipSuccess(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveUnderfunded(): PathPaymentStrictReceiveResult; + static revokeSponsorshipDoesNotExist(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveSrcNoTrust(): PathPaymentStrictReceiveResult; + static revokeSponsorshipNotSponsor(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveSrcNotAuthorized(): PathPaymentStrictReceiveResult; + static revokeSponsorshipLowReserve(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveNoDestination(): PathPaymentStrictReceiveResult; + static revokeSponsorshipOnlyTransferable(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveNoTrust(): PathPaymentStrictReceiveResult; + static revokeSponsorshipMalformed(): RevokeSponsorshipResult; - static pathPaymentStrictReceiveNotAuthorized(): PathPaymentStrictReceiveResult; + value(): void; - static pathPaymentStrictReceiveLineFull(): PathPaymentStrictReceiveResult; + toXDR(format?: 'raw'): Buffer; - static pathPaymentStrictReceiveNoIssuer( - value: Asset - ): PathPaymentStrictReceiveResult; + toXDR(format: 'hex' | 'base64'): string; - static pathPaymentStrictReceiveTooFewOffers(): PathPaymentStrictReceiveResult; + static read(io: Buffer): RevokeSponsorshipResult; - static pathPaymentStrictReceiveOfferCrossSelf(): PathPaymentStrictReceiveResult; + static write(value: RevokeSponsorshipResult, io: Buffer): void; - static pathPaymentStrictReceiveOverSendmax(): PathPaymentStrictReceiveResult; + static isValid(value: RevokeSponsorshipResult): boolean; - value(): PathPaymentStrictReceiveResultSuccess | Asset | void; + static toXDR(value: RevokeSponsorshipResult): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipResult; - toXDR(format: "hex" | "base64"): string; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): RevokeSponsorshipResult; - static read(io: Buffer): PathPaymentStrictReceiveResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: PathPaymentStrictReceiveResult, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: PathPaymentStrictReceiveResult): boolean; + class ClawbackResult { + switch(): ClawbackResultCode; - static toXDR(value: PathPaymentStrictReceiveResult): Buffer; + static clawbackSuccess(): ClawbackResult; - static fromXDR( - input: Buffer, - format?: "raw" - ): PathPaymentStrictReceiveResult; + static clawbackMalformed(): ClawbackResult; - static fromXDR( - input: string, - format: "hex" | "base64" - ): PathPaymentStrictReceiveResult; + static clawbackNotClawbackEnabled(): ClawbackResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static clawbackNoTrust(): ClawbackResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static clawbackUnderfunded(): ClawbackResult; - class PathPaymentStrictSendResult { - switch(): PathPaymentStrictSendResultCode; + value(): void; - success( - value?: PathPaymentStrictSendResultSuccess - ): PathPaymentStrictSendResultSuccess; + toXDR(format?: 'raw'): Buffer; - noIssuer(value?: Asset): Asset; + toXDR(format: 'hex' | 'base64'): string; - static pathPaymentStrictSendSuccess( - value: PathPaymentStrictSendResultSuccess - ): PathPaymentStrictSendResult; + static read(io: Buffer): ClawbackResult; - static pathPaymentStrictSendMalformed(): PathPaymentStrictSendResult; + static write(value: ClawbackResult, io: Buffer): void; - static pathPaymentStrictSendUnderfunded(): PathPaymentStrictSendResult; + static isValid(value: ClawbackResult): boolean; - static pathPaymentStrictSendSrcNoTrust(): PathPaymentStrictSendResult; + static toXDR(value: ClawbackResult): Buffer; - static pathPaymentStrictSendSrcNotAuthorized(): PathPaymentStrictSendResult; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackResult; - static pathPaymentStrictSendNoDestination(): PathPaymentStrictSendResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ClawbackResult; - static pathPaymentStrictSendNoTrust(): PathPaymentStrictSendResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static pathPaymentStrictSendNotAuthorized(): PathPaymentStrictSendResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static pathPaymentStrictSendLineFull(): PathPaymentStrictSendResult; + class ClawbackClaimableBalanceResult { + switch(): ClawbackClaimableBalanceResultCode; - static pathPaymentStrictSendNoIssuer( - value: Asset - ): PathPaymentStrictSendResult; + static clawbackClaimableBalanceSuccess(): ClawbackClaimableBalanceResult; - static pathPaymentStrictSendTooFewOffers(): PathPaymentStrictSendResult; + static clawbackClaimableBalanceDoesNotExist(): ClawbackClaimableBalanceResult; - static pathPaymentStrictSendOfferCrossSelf(): PathPaymentStrictSendResult; + static clawbackClaimableBalanceNotIssuer(): ClawbackClaimableBalanceResult; - static pathPaymentStrictSendUnderDestmin(): PathPaymentStrictSendResult; + static clawbackClaimableBalanceNotClawbackEnabled(): ClawbackClaimableBalanceResult; - value(): PathPaymentStrictSendResultSuccess | Asset | void; + value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): PathPaymentStrictSendResult; + static read(io: Buffer): ClawbackClaimableBalanceResult; - static write(value: PathPaymentStrictSendResult, io: Buffer): void; + static write(value: ClawbackClaimableBalanceResult, io: Buffer): void; - static isValid(value: PathPaymentStrictSendResult): boolean; + static isValid(value: ClawbackClaimableBalanceResult): boolean; - static toXDR(value: PathPaymentStrictSendResult): Buffer; + static toXDR(value: ClawbackClaimableBalanceResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictSendResult; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ClawbackClaimableBalanceResult; static fromXDR( input: string, - format: "hex" | "base64" - ): PathPaymentStrictSendResult; + format: 'hex' | 'base64', + ): ClawbackClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageOfferSuccessResultOffer { - switch(): ManageOfferEffect; + class SetTrustLineFlagsResult { + switch(): SetTrustLineFlagsResultCode; - offer(value?: OfferEntry): OfferEntry; + static setTrustLineFlagsSuccess(): SetTrustLineFlagsResult; - static manageOfferCreated(value: OfferEntry): ManageOfferSuccessResultOffer; + static setTrustLineFlagsMalformed(): SetTrustLineFlagsResult; - static manageOfferUpdated(value: OfferEntry): ManageOfferSuccessResultOffer; + static setTrustLineFlagsNoTrustLine(): SetTrustLineFlagsResult; - static manageOfferDeleted(): ManageOfferSuccessResultOffer; + static setTrustLineFlagsCantRevoke(): SetTrustLineFlagsResult; - value(): OfferEntry | void; + static setTrustLineFlagsInvalidState(): SetTrustLineFlagsResult; - toXDR(format?: "raw"): Buffer; + static setTrustLineFlagsLowReserve(): SetTrustLineFlagsResult; - toXDR(format: "hex" | "base64"): string; + value(): void; - static read(io: Buffer): ManageOfferSuccessResultOffer; + toXDR(format?: 'raw'): Buffer; - static write(value: ManageOfferSuccessResultOffer, io: Buffer): void; + toXDR(format: 'hex' | 'base64'): string; - static isValid(value: ManageOfferSuccessResultOffer): boolean; + static read(io: Buffer): SetTrustLineFlagsResult; - static toXDR(value: ManageOfferSuccessResultOffer): Buffer; + static write(value: SetTrustLineFlagsResult, io: Buffer): void; - static fromXDR( - input: Buffer, - format?: "raw" - ): ManageOfferSuccessResultOffer; + static isValid(value: SetTrustLineFlagsResult): boolean; + + static toXDR(value: SetTrustLineFlagsResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SetTrustLineFlagsResult; static fromXDR( input: string, - format: "hex" | "base64" - ): ManageOfferSuccessResultOffer; + format: 'hex' | 'base64', + ): SetTrustLineFlagsResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageSellOfferResult { - switch(): ManageSellOfferResultCode; + class LiquidityPoolDepositResult { + switch(): LiquidityPoolDepositResultCode; - success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; + static liquidityPoolDepositSuccess(): LiquidityPoolDepositResult; - static manageSellOfferSuccess( - value: ManageOfferSuccessResult - ): ManageSellOfferResult; + static liquidityPoolDepositMalformed(): LiquidityPoolDepositResult; - static manageSellOfferMalformed(): ManageSellOfferResult; + static liquidityPoolDepositNoTrust(): LiquidityPoolDepositResult; - static manageSellOfferSellNoTrust(): ManageSellOfferResult; + static liquidityPoolDepositNotAuthorized(): LiquidityPoolDepositResult; - static manageSellOfferBuyNoTrust(): ManageSellOfferResult; + static liquidityPoolDepositUnderfunded(): LiquidityPoolDepositResult; - static manageSellOfferSellNotAuthorized(): ManageSellOfferResult; + static liquidityPoolDepositLineFull(): LiquidityPoolDepositResult; - static manageSellOfferBuyNotAuthorized(): ManageSellOfferResult; + static liquidityPoolDepositBadPrice(): LiquidityPoolDepositResult; - static manageSellOfferLineFull(): ManageSellOfferResult; + static liquidityPoolDepositPoolFull(): LiquidityPoolDepositResult; - static manageSellOfferUnderfunded(): ManageSellOfferResult; + value(): void; - static manageSellOfferCrossSelf(): ManageSellOfferResult; + toXDR(format?: 'raw'): Buffer; - static manageSellOfferSellNoIssuer(): ManageSellOfferResult; + toXDR(format: 'hex' | 'base64'): string; - static manageSellOfferBuyNoIssuer(): ManageSellOfferResult; + static read(io: Buffer): LiquidityPoolDepositResult; - static manageSellOfferNotFound(): ManageSellOfferResult; + static write(value: LiquidityPoolDepositResult, io: Buffer): void; - static manageSellOfferLowReserve(): ManageSellOfferResult; + static isValid(value: LiquidityPoolDepositResult): boolean; - value(): ManageOfferSuccessResult | void; + static toXDR(value: LiquidityPoolDepositResult): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolDepositResult; - toXDR(format: "hex" | "base64"): string; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolDepositResult; - static read(io: Buffer): ManageSellOfferResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: ManageSellOfferResult, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: ManageSellOfferResult): boolean; + class LiquidityPoolWithdrawResult { + switch(): LiquidityPoolWithdrawResultCode; - static toXDR(value: ManageSellOfferResult): Buffer; + static liquidityPoolWithdrawSuccess(): LiquidityPoolWithdrawResult; - static fromXDR(input: Buffer, format?: "raw"): ManageSellOfferResult; + static liquidityPoolWithdrawMalformed(): LiquidityPoolWithdrawResult; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ManageSellOfferResult; + static liquidityPoolWithdrawNoTrust(): LiquidityPoolWithdrawResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static liquidityPoolWithdrawUnderfunded(): LiquidityPoolWithdrawResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static liquidityPoolWithdrawLineFull(): LiquidityPoolWithdrawResult; - class ManageBuyOfferResult { - switch(): ManageBuyOfferResultCode; + static liquidityPoolWithdrawUnderMinimum(): LiquidityPoolWithdrawResult; - success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; + value(): void; - static manageBuyOfferSuccess( - value: ManageOfferSuccessResult - ): ManageBuyOfferResult; + toXDR(format?: 'raw'): Buffer; - static manageBuyOfferMalformed(): ManageBuyOfferResult; + toXDR(format: 'hex' | 'base64'): string; - static manageBuyOfferSellNoTrust(): ManageBuyOfferResult; + static read(io: Buffer): LiquidityPoolWithdrawResult; - static manageBuyOfferBuyNoTrust(): ManageBuyOfferResult; + static write(value: LiquidityPoolWithdrawResult, io: Buffer): void; - static manageBuyOfferSellNotAuthorized(): ManageBuyOfferResult; + static isValid(value: LiquidityPoolWithdrawResult): boolean; - static manageBuyOfferBuyNotAuthorized(): ManageBuyOfferResult; + static toXDR(value: LiquidityPoolWithdrawResult): Buffer; - static manageBuyOfferLineFull(): ManageBuyOfferResult; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolWithdrawResult; - static manageBuyOfferUnderfunded(): ManageBuyOfferResult; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LiquidityPoolWithdrawResult; - static manageBuyOfferCrossSelf(): ManageBuyOfferResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static manageBuyOfferSellNoIssuer(): ManageBuyOfferResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static manageBuyOfferBuyNoIssuer(): ManageBuyOfferResult; + class InvokeHostFunctionResult { + switch(): InvokeHostFunctionResultCode; - static manageBuyOfferNotFound(): ManageBuyOfferResult; + success(value?: Buffer): Buffer; - static manageBuyOfferLowReserve(): ManageBuyOfferResult; + static invokeHostFunctionSuccess(value: Buffer): InvokeHostFunctionResult; - value(): ManageOfferSuccessResult | void; + static invokeHostFunctionMalformed(): InvokeHostFunctionResult; - toXDR(format?: "raw"): Buffer; + static invokeHostFunctionTrapped(): InvokeHostFunctionResult; - toXDR(format: "hex" | "base64"): string; + static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResult; - static read(io: Buffer): ManageBuyOfferResult; + static invokeHostFunctionEntryExpired(): InvokeHostFunctionResult; - static write(value: ManageBuyOfferResult, io: Buffer): void; + static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResult; - static isValid(value: ManageBuyOfferResult): boolean; + value(): Buffer | void; - static toXDR(value: ManageBuyOfferResult): Buffer; + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): InvokeHostFunctionResult; - static fromXDR(input: Buffer, format?: "raw"): ManageBuyOfferResult; + static write(value: InvokeHostFunctionResult, io: Buffer): void; + + static isValid(value: InvokeHostFunctionResult): boolean; + + static toXDR(value: InvokeHostFunctionResult): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): InvokeHostFunctionResult; static fromXDR( input: string, - format: "hex" | "base64" - ): ManageBuyOfferResult; + format: 'hex' | 'base64', + ): InvokeHostFunctionResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class SetOptionsResult { - switch(): SetOptionsResultCode; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static setOptionsSuccess(): SetOptionsResult; + class BumpFootprintExpirationResult { + switch(): BumpFootprintExpirationResultCode; - static setOptionsLowReserve(): SetOptionsResult; + static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResult; - static setOptionsTooManySigners(): SetOptionsResult; + static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResult; - static setOptionsBadFlags(): SetOptionsResult; + static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResult; - static setOptionsInvalidInflation(): SetOptionsResult; + static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResult; - static setOptionsCantChange(): SetOptionsResult; + value(): void; - static setOptionsUnknownFlag(): SetOptionsResult; + toXDR(format?: 'raw'): Buffer; - static setOptionsThresholdOutOfRange(): SetOptionsResult; + toXDR(format: 'hex' | 'base64'): string; - static setOptionsBadSigner(): SetOptionsResult; + static read(io: Buffer): BumpFootprintExpirationResult; - static setOptionsInvalidHomeDomain(): SetOptionsResult; + static write(value: BumpFootprintExpirationResult, io: Buffer): void; - static setOptionsAuthRevocableRequired(): SetOptionsResult; + static isValid(value: BumpFootprintExpirationResult): boolean; - value(): void; + static toXDR(value: BumpFootprintExpirationResult): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR( + input: Buffer, + format?: 'raw', + ): BumpFootprintExpirationResult; - toXDR(format: "hex" | "base64"): string; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): BumpFootprintExpirationResult; - static read(io: Buffer): SetOptionsResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: SetOptionsResult, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: SetOptionsResult): boolean; + class RestoreFootprintResult { + switch(): RestoreFootprintResultCode; - static toXDR(value: SetOptionsResult): Buffer; + static restoreFootprintSuccess(): RestoreFootprintResult; - static fromXDR(input: Buffer, format?: "raw"): SetOptionsResult; + static restoreFootprintMalformed(): RestoreFootprintResult; - static fromXDR(input: string, format: "hex" | "base64"): SetOptionsResult; + static restoreFootprintResourceLimitExceeded(): RestoreFootprintResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static restoreFootprintInsufficientRefundableFee(): RestoreFootprintResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + value(): void; - class ChangeTrustResult { - switch(): ChangeTrustResultCode; + toXDR(format?: 'raw'): Buffer; - static changeTrustSuccess(): ChangeTrustResult; + toXDR(format: 'hex' | 'base64'): string; - static changeTrustMalformed(): ChangeTrustResult; + static read(io: Buffer): RestoreFootprintResult; - static changeTrustNoIssuer(): ChangeTrustResult; + static write(value: RestoreFootprintResult, io: Buffer): void; - static changeTrustInvalidLimit(): ChangeTrustResult; + static isValid(value: RestoreFootprintResult): boolean; - static changeTrustLowReserve(): ChangeTrustResult; + static toXDR(value: RestoreFootprintResult): Buffer; - static changeTrustSelfNotAllowed(): ChangeTrustResult; + static fromXDR(input: Buffer, format?: 'raw'): RestoreFootprintResult; - static changeTrustTrustLineMissing(): ChangeTrustResult; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): RestoreFootprintResult; - static changeTrustCannotDelete(): ChangeTrustResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static changeTrustNotAuthMaintainLiabilities(): ChangeTrustResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - value(): void; + class OperationResultTr { + switch(): OperationType; - toXDR(format?: "raw"): Buffer; + createAccountResult(value?: CreateAccountResult): CreateAccountResult; - toXDR(format: "hex" | "base64"): string; + paymentResult(value?: PaymentResult): PaymentResult; - static read(io: Buffer): ChangeTrustResult; + pathPaymentStrictReceiveResult( + value?: PathPaymentStrictReceiveResult, + ): PathPaymentStrictReceiveResult; - static write(value: ChangeTrustResult, io: Buffer): void; + manageSellOfferResult(value?: ManageSellOfferResult): ManageSellOfferResult; - static isValid(value: ChangeTrustResult): boolean; + createPassiveSellOfferResult( + value?: ManageSellOfferResult, + ): ManageSellOfferResult; - static toXDR(value: ChangeTrustResult): Buffer; + setOptionsResult(value?: SetOptionsResult): SetOptionsResult; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustResult; + changeTrustResult(value?: ChangeTrustResult): ChangeTrustResult; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustResult; + allowTrustResult(value?: AllowTrustResult): AllowTrustResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + accountMergeResult(value?: AccountMergeResult): AccountMergeResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + inflationResult(value?: InflationResult): InflationResult; - class AllowTrustResult { - switch(): AllowTrustResultCode; + manageDataResult(value?: ManageDataResult): ManageDataResult; - static allowTrustSuccess(): AllowTrustResult; + bumpSeqResult(value?: BumpSequenceResult): BumpSequenceResult; - static allowTrustMalformed(): AllowTrustResult; + manageBuyOfferResult(value?: ManageBuyOfferResult): ManageBuyOfferResult; - static allowTrustNoTrustLine(): AllowTrustResult; + pathPaymentStrictSendResult( + value?: PathPaymentStrictSendResult, + ): PathPaymentStrictSendResult; - static allowTrustTrustNotRequired(): AllowTrustResult; + createClaimableBalanceResult( + value?: CreateClaimableBalanceResult, + ): CreateClaimableBalanceResult; - static allowTrustCantRevoke(): AllowTrustResult; + claimClaimableBalanceResult( + value?: ClaimClaimableBalanceResult, + ): ClaimClaimableBalanceResult; - static allowTrustSelfNotAllowed(): AllowTrustResult; + beginSponsoringFutureReservesResult( + value?: BeginSponsoringFutureReservesResult, + ): BeginSponsoringFutureReservesResult; - static allowTrustLowReserve(): AllowTrustResult; + endSponsoringFutureReservesResult( + value?: EndSponsoringFutureReservesResult, + ): EndSponsoringFutureReservesResult; - value(): void; + revokeSponsorshipResult( + value?: RevokeSponsorshipResult, + ): RevokeSponsorshipResult; - toXDR(format?: "raw"): Buffer; + clawbackResult(value?: ClawbackResult): ClawbackResult; - toXDR(format: "hex" | "base64"): string; + clawbackClaimableBalanceResult( + value?: ClawbackClaimableBalanceResult, + ): ClawbackClaimableBalanceResult; - static read(io: Buffer): AllowTrustResult; + setTrustLineFlagsResult( + value?: SetTrustLineFlagsResult, + ): SetTrustLineFlagsResult; - static write(value: AllowTrustResult, io: Buffer): void; + liquidityPoolDepositResult( + value?: LiquidityPoolDepositResult, + ): LiquidityPoolDepositResult; - static isValid(value: AllowTrustResult): boolean; + liquidityPoolWithdrawResult( + value?: LiquidityPoolWithdrawResult, + ): LiquidityPoolWithdrawResult; - static toXDR(value: AllowTrustResult): Buffer; + invokeHostFunctionResult( + value?: InvokeHostFunctionResult, + ): InvokeHostFunctionResult; - static fromXDR(input: Buffer, format?: "raw"): AllowTrustResult; + bumpFootprintExpirationResult( + value?: BumpFootprintExpirationResult, + ): BumpFootprintExpirationResult; - static fromXDR(input: string, format: "hex" | "base64"): AllowTrustResult; + restoreFootprintResult( + value?: RestoreFootprintResult, + ): RestoreFootprintResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static createAccount(value: CreateAccountResult): OperationResultTr; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static payment(value: PaymentResult): OperationResultTr; - class AccountMergeResult { - switch(): AccountMergeResultCode; + static pathPaymentStrictReceive( + value: PathPaymentStrictReceiveResult, + ): OperationResultTr; - sourceAccountBalance(value?: Int64): Int64; + static manageSellOffer(value: ManageSellOfferResult): OperationResultTr; - static accountMergeSuccess(value: Int64): AccountMergeResult; + static createPassiveSellOffer( + value: ManageSellOfferResult, + ): OperationResultTr; - static accountMergeMalformed(): AccountMergeResult; + static setOptions(value: SetOptionsResult): OperationResultTr; - static accountMergeNoAccount(): AccountMergeResult; + static changeTrust(value: ChangeTrustResult): OperationResultTr; - static accountMergeImmutableSet(): AccountMergeResult; + static allowTrust(value: AllowTrustResult): OperationResultTr; - static accountMergeHasSubEntries(): AccountMergeResult; + static accountMerge(value: AccountMergeResult): OperationResultTr; - static accountMergeSeqnumTooFar(): AccountMergeResult; + static inflation(value: InflationResult): OperationResultTr; - static accountMergeDestFull(): AccountMergeResult; + static manageData(value: ManageDataResult): OperationResultTr; - static accountMergeIsSponsor(): AccountMergeResult; + static bumpSequence(value: BumpSequenceResult): OperationResultTr; - value(): Int64 | void; + static manageBuyOffer(value: ManageBuyOfferResult): OperationResultTr; - toXDR(format?: "raw"): Buffer; + static pathPaymentStrictSend( + value: PathPaymentStrictSendResult, + ): OperationResultTr; - toXDR(format: "hex" | "base64"): string; + static createClaimableBalance( + value: CreateClaimableBalanceResult, + ): OperationResultTr; - static read(io: Buffer): AccountMergeResult; + static claimClaimableBalance( + value: ClaimClaimableBalanceResult, + ): OperationResultTr; - static write(value: AccountMergeResult, io: Buffer): void; + static beginSponsoringFutureReserves( + value: BeginSponsoringFutureReservesResult, + ): OperationResultTr; - static isValid(value: AccountMergeResult): boolean; + static endSponsoringFutureReserves( + value: EndSponsoringFutureReservesResult, + ): OperationResultTr; - static toXDR(value: AccountMergeResult): Buffer; + static revokeSponsorship(value: RevokeSponsorshipResult): OperationResultTr; - static fromXDR(input: Buffer, format?: "raw"): AccountMergeResult; + static clawback(value: ClawbackResult): OperationResultTr; - static fromXDR(input: string, format: "hex" | "base64"): AccountMergeResult; + static clawbackClaimableBalance( + value: ClawbackClaimableBalanceResult, + ): OperationResultTr; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static setTrustLineFlags(value: SetTrustLineFlagsResult): OperationResultTr; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static liquidityPoolDeposit( + value: LiquidityPoolDepositResult, + ): OperationResultTr; - class InflationResult { - switch(): InflationResultCode; + static liquidityPoolWithdraw( + value: LiquidityPoolWithdrawResult, + ): OperationResultTr; - payouts(value?: InflationPayout[]): InflationPayout[]; + static invokeHostFunction( + value: InvokeHostFunctionResult, + ): OperationResultTr; - static inflationSuccess(value: InflationPayout[]): InflationResult; + static bumpFootprintExpiration( + value: BumpFootprintExpirationResult, + ): OperationResultTr; - static inflationNotTime(): InflationResult; + static restoreFootprint(value: RestoreFootprintResult): OperationResultTr; - value(): InflationPayout[] | void; + value(): + | CreateAccountResult + | PaymentResult + | PathPaymentStrictReceiveResult + | ManageSellOfferResult + | ManageSellOfferResult + | SetOptionsResult + | ChangeTrustResult + | AllowTrustResult + | AccountMergeResult + | InflationResult + | ManageDataResult + | BumpSequenceResult + | ManageBuyOfferResult + | PathPaymentStrictSendResult + | CreateClaimableBalanceResult + | ClaimClaimableBalanceResult + | BeginSponsoringFutureReservesResult + | EndSponsoringFutureReservesResult + | RevokeSponsorshipResult + | ClawbackResult + | ClawbackClaimableBalanceResult + | SetTrustLineFlagsResult + | LiquidityPoolDepositResult + | LiquidityPoolWithdrawResult + | InvokeHostFunctionResult + | BumpFootprintExpirationResult + | RestoreFootprintResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): InflationResult; + static read(io: Buffer): OperationResultTr; - static write(value: InflationResult, io: Buffer): void; + static write(value: OperationResultTr, io: Buffer): void; - static isValid(value: InflationResult): boolean; + static isValid(value: OperationResultTr): boolean; - static toXDR(value: InflationResult): Buffer; + static toXDR(value: OperationResultTr): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InflationResult; + static fromXDR(input: Buffer, format?: 'raw'): OperationResultTr; - static fromXDR(input: string, format: "hex" | "base64"): InflationResult; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationResultTr; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ManageDataResult { - switch(): ManageDataResultCode; + class OperationResult { + switch(): OperationResultCode; - static manageDataSuccess(): ManageDataResult; + tr(value?: OperationResultTr): OperationResultTr; - static manageDataNotSupportedYet(): ManageDataResult; + static opInner(value: OperationResultTr): OperationResult; - static manageDataNameNotFound(): ManageDataResult; + static opBadAuth(): OperationResult; - static manageDataLowReserve(): ManageDataResult; + static opNoAccount(): OperationResult; - static manageDataInvalidName(): ManageDataResult; + static opNotSupported(): OperationResult; - value(): void; + static opTooManySubentries(): OperationResult; - toXDR(format?: "raw"): Buffer; + static opExceededWorkLimit(): OperationResult; - toXDR(format: "hex" | "base64"): string; + static opTooManySponsoring(): OperationResult; - static read(io: Buffer): ManageDataResult; + value(): OperationResultTr | void; - static write(value: ManageDataResult, io: Buffer): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: ManageDataResult): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: ManageDataResult): Buffer; + static read(io: Buffer): OperationResult; - static fromXDR(input: Buffer, format?: "raw"): ManageDataResult; + static write(value: OperationResult, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): ManageDataResult; + static isValid(value: OperationResult): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: OperationResult): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static fromXDR(input: Buffer, format?: 'raw'): OperationResult; - class BumpSequenceResult { - switch(): BumpSequenceResultCode; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationResult; - static bumpSequenceSuccess(): BumpSequenceResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static bumpSequenceBadSeq(): BumpSequenceResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - value(): void; + class InnerTransactionResultResult { + switch(): TransactionResultCode; - toXDR(format?: "raw"): Buffer; + results(value?: OperationResult[]): OperationResult[]; - toXDR(format: "hex" | "base64"): string; + static txSuccess(value: OperationResult[]): InnerTransactionResultResult; - static read(io: Buffer): BumpSequenceResult; + static txFailed(value: OperationResult[]): InnerTransactionResultResult; - static write(value: BumpSequenceResult, io: Buffer): void; + static txTooEarly(): InnerTransactionResultResult; - static isValid(value: BumpSequenceResult): boolean; + static txTooLate(): InnerTransactionResultResult; - static toXDR(value: BumpSequenceResult): Buffer; + static txMissingOperation(): InnerTransactionResultResult; - static fromXDR(input: Buffer, format?: "raw"): BumpSequenceResult; + static txBadSeq(): InnerTransactionResultResult; - static fromXDR(input: string, format: "hex" | "base64"): BumpSequenceResult; + static txBadAuth(): InnerTransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static txInsufficientBalance(): InnerTransactionResultResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static txNoAccount(): InnerTransactionResultResult; - class CreateClaimableBalanceResult { - switch(): CreateClaimableBalanceResultCode; + static txInsufficientFee(): InnerTransactionResultResult; - balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; + static txBadAuthExtra(): InnerTransactionResultResult; - static createClaimableBalanceSuccess( - value: ClaimableBalanceId - ): CreateClaimableBalanceResult; + static txInternalError(): InnerTransactionResultResult; - static createClaimableBalanceMalformed(): CreateClaimableBalanceResult; + static txNotSupported(): InnerTransactionResultResult; - static createClaimableBalanceLowReserve(): CreateClaimableBalanceResult; + static txBadSponsorship(): InnerTransactionResultResult; - static createClaimableBalanceNoTrust(): CreateClaimableBalanceResult; + static txBadMinSeqAgeOrGap(): InnerTransactionResultResult; - static createClaimableBalanceNotAuthorized(): CreateClaimableBalanceResult; + static txMalformed(): InnerTransactionResultResult; - static createClaimableBalanceUnderfunded(): CreateClaimableBalanceResult; + static txSorobanInvalid(): InnerTransactionResultResult; - value(): ClaimableBalanceId | void; + value(): OperationResult[] | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): CreateClaimableBalanceResult; + static read(io: Buffer): InnerTransactionResultResult; - static write(value: CreateClaimableBalanceResult, io: Buffer): void; + static write(value: InnerTransactionResultResult, io: Buffer): void; - static isValid(value: CreateClaimableBalanceResult): boolean; + static isValid(value: InnerTransactionResultResult): boolean; - static toXDR(value: CreateClaimableBalanceResult): Buffer; + static toXDR(value: InnerTransactionResultResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateClaimableBalanceResult; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultResult; static fromXDR( input: string, - format: "hex" | "base64" - ): CreateClaimableBalanceResult; + format: 'hex' | 'base64', + ): InnerTransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClaimClaimableBalanceResult { - switch(): ClaimClaimableBalanceResultCode; - - static claimClaimableBalanceSuccess(): ClaimClaimableBalanceResult; - - static claimClaimableBalanceDoesNotExist(): ClaimClaimableBalanceResult; - - static claimClaimableBalanceCannotClaim(): ClaimClaimableBalanceResult; - - static claimClaimableBalanceLineFull(): ClaimClaimableBalanceResult; - - static claimClaimableBalanceNoTrust(): ClaimClaimableBalanceResult; + class InnerTransactionResultExt { + switch(): number; - static claimClaimableBalanceNotAuthorized(): ClaimClaimableBalanceResult; + static 0(): InnerTransactionResultExt; value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ClaimClaimableBalanceResult; + static read(io: Buffer): InnerTransactionResultExt; - static write(value: ClaimClaimableBalanceResult, io: Buffer): void; + static write(value: InnerTransactionResultExt, io: Buffer): void; - static isValid(value: ClaimClaimableBalanceResult): boolean; + static isValid(value: InnerTransactionResultExt): boolean; - static toXDR(value: ClaimClaimableBalanceResult): Buffer; + static toXDR(value: InnerTransactionResultExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimClaimableBalanceResult; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultExt; static fromXDR( input: string, - format: "hex" | "base64" - ): ClaimClaimableBalanceResult; + format: 'hex' | 'base64', + ): InnerTransactionResultExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BeginSponsoringFutureReservesResult { - switch(): BeginSponsoringFutureReservesResultCode; - - static beginSponsoringFutureReservesSuccess(): BeginSponsoringFutureReservesResult; - - static beginSponsoringFutureReservesMalformed(): BeginSponsoringFutureReservesResult; + class TransactionResultResult { + switch(): TransactionResultCode; - static beginSponsoringFutureReservesAlreadySponsored(): BeginSponsoringFutureReservesResult; + innerResultPair( + value?: InnerTransactionResultPair, + ): InnerTransactionResultPair; - static beginSponsoringFutureReservesRecursive(): BeginSponsoringFutureReservesResult; + results(value?: OperationResult[]): OperationResult[]; - value(): void; + static txFeeBumpInnerSuccess( + value: InnerTransactionResultPair, + ): TransactionResultResult; - toXDR(format?: "raw"): Buffer; + static txFeeBumpInnerFailed( + value: InnerTransactionResultPair, + ): TransactionResultResult; - toXDR(format: "hex" | "base64"): string; + static txSuccess(value: OperationResult[]): TransactionResultResult; - static read(io: Buffer): BeginSponsoringFutureReservesResult; + static txFailed(value: OperationResult[]): TransactionResultResult; - static write(value: BeginSponsoringFutureReservesResult, io: Buffer): void; + static txTooEarly(): TransactionResultResult; - static isValid(value: BeginSponsoringFutureReservesResult): boolean; + static txTooLate(): TransactionResultResult; - static toXDR(value: BeginSponsoringFutureReservesResult): Buffer; + static txMissingOperation(): TransactionResultResult; - static fromXDR( - input: Buffer, - format?: "raw" - ): BeginSponsoringFutureReservesResult; + static txBadSeq(): TransactionResultResult; - static fromXDR( - input: string, - format: "hex" | "base64" - ): BeginSponsoringFutureReservesResult; + static txBadAuth(): TransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static txInsufficientBalance(): TransactionResultResult; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static txNoAccount(): TransactionResultResult; - class EndSponsoringFutureReservesResult { - switch(): EndSponsoringFutureReservesResultCode; + static txInsufficientFee(): TransactionResultResult; - static endSponsoringFutureReservesSuccess(): EndSponsoringFutureReservesResult; + static txBadAuthExtra(): TransactionResultResult; - static endSponsoringFutureReservesNotSponsored(): EndSponsoringFutureReservesResult; + static txInternalError(): TransactionResultResult; - value(): void; + static txNotSupported(): TransactionResultResult; - toXDR(format?: "raw"): Buffer; + static txBadSponsorship(): TransactionResultResult; - toXDR(format: "hex" | "base64"): string; + static txBadMinSeqAgeOrGap(): TransactionResultResult; - static read(io: Buffer): EndSponsoringFutureReservesResult; + static txMalformed(): TransactionResultResult; - static write(value: EndSponsoringFutureReservesResult, io: Buffer): void; + static txSorobanInvalid(): TransactionResultResult; - static isValid(value: EndSponsoringFutureReservesResult): boolean; + value(): InnerTransactionResultPair | OperationResult[] | void; - static toXDR(value: EndSponsoringFutureReservesResult): Buffer; + toXDR(format?: 'raw'): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): EndSponsoringFutureReservesResult; + toXDR(format: 'hex' | 'base64'): string; - static fromXDR( - input: string, - format: "hex" | "base64" - ): EndSponsoringFutureReservesResult; + static read(io: Buffer): TransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static write(value: TransactionResultResult, io: Buffer): void; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static isValid(value: TransactionResultResult): boolean; - class RevokeSponsorshipResult { - switch(): RevokeSponsorshipResultCode; + static toXDR(value: TransactionResultResult): Buffer; - static revokeSponsorshipSuccess(): RevokeSponsorshipResult; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultResult; - static revokeSponsorshipDoesNotExist(): RevokeSponsorshipResult; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): TransactionResultResult; - static revokeSponsorshipNotSponsor(): RevokeSponsorshipResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static revokeSponsorshipLowReserve(): RevokeSponsorshipResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static revokeSponsorshipOnlyTransferable(): RevokeSponsorshipResult; + class TransactionResultExt { + switch(): number; - static revokeSponsorshipMalformed(): RevokeSponsorshipResult; + static 0(): TransactionResultExt; value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): RevokeSponsorshipResult; + static read(io: Buffer): TransactionResultExt; - static write(value: RevokeSponsorshipResult, io: Buffer): void; + static write(value: TransactionResultExt, io: Buffer): void; - static isValid(value: RevokeSponsorshipResult): boolean; + static isValid(value: TransactionResultExt): boolean; - static toXDR(value: RevokeSponsorshipResult): Buffer; + static toXDR(value: TransactionResultExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipResult; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultExt; static fromXDR( input: string, - format: "hex" | "base64" - ): RevokeSponsorshipResult; + format: 'hex' | 'base64', + ): TransactionResultExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ClawbackResult { - switch(): ClawbackResultCode; + class ExtensionPoint { + switch(): number; - static clawbackSuccess(): ClawbackResult; + static 0(): ExtensionPoint; - static clawbackMalformed(): ClawbackResult; + value(): void; - static clawbackNotClawbackEnabled(): ClawbackResult; + toXDR(format?: 'raw'): Buffer; - static clawbackNoTrust(): ClawbackResult; + toXDR(format: 'hex' | 'base64'): string; - static clawbackUnderfunded(): ClawbackResult; + static read(io: Buffer): ExtensionPoint; - value(): void; + static write(value: ExtensionPoint, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: ExtensionPoint): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: ExtensionPoint): Buffer; - static read(io: Buffer): ClawbackResult; + static fromXDR(input: Buffer, format?: 'raw'): ExtensionPoint; - static write(value: ClawbackResult, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): ExtensionPoint; - static isValid(value: ClawbackResult): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: ClawbackResult): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): ClawbackResult; + class PublicKey { + switch(): PublicKeyType; - static fromXDR(input: string, format: "hex" | "base64"): ClawbackResult; + ed25519(value?: Buffer): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static publicKeyTypeEd25519(value: Buffer): PublicKey; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + value(): Buffer; - class ClawbackClaimableBalanceResult { - switch(): ClawbackClaimableBalanceResultCode; + toXDR(format?: 'raw'): Buffer; - static clawbackClaimableBalanceSuccess(): ClawbackClaimableBalanceResult; + toXDR(format: 'hex' | 'base64'): string; - static clawbackClaimableBalanceDoesNotExist(): ClawbackClaimableBalanceResult; + static read(io: Buffer): PublicKey; - static clawbackClaimableBalanceNotIssuer(): ClawbackClaimableBalanceResult; + static write(value: PublicKey, io: Buffer): void; - static clawbackClaimableBalanceNotClawbackEnabled(): ClawbackClaimableBalanceResult; + static isValid(value: PublicKey): boolean; - value(): void; + static toXDR(value: PublicKey): Buffer; - toXDR(format?: "raw"): Buffer; + static fromXDR(input: Buffer, format?: 'raw'): PublicKey; - toXDR(format: "hex" | "base64"): string; + static fromXDR(input: string, format: 'hex' | 'base64'): PublicKey; - static read(io: Buffer): ClawbackClaimableBalanceResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static write(value: ClawbackClaimableBalanceResult, io: Buffer): void; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static isValid(value: ClawbackClaimableBalanceResult): boolean; + class SignerKey { + switch(): SignerKeyType; - static toXDR(value: ClawbackClaimableBalanceResult): Buffer; + ed25519(value?: Buffer): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): ClawbackClaimableBalanceResult; + preAuthTx(value?: Buffer): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ClawbackClaimableBalanceResult; + hashX(value?: Buffer): Buffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + ed25519SignedPayload( + value?: SignerKeyEd25519SignedPayload, + ): SignerKeyEd25519SignedPayload; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static signerKeyTypeEd25519(value: Buffer): SignerKey; - class SetTrustLineFlagsResult { - switch(): SetTrustLineFlagsResultCode; + static signerKeyTypePreAuthTx(value: Buffer): SignerKey; - static setTrustLineFlagsSuccess(): SetTrustLineFlagsResult; + static signerKeyTypeHashX(value: Buffer): SignerKey; - static setTrustLineFlagsMalformed(): SetTrustLineFlagsResult; + static signerKeyTypeEd25519SignedPayload( + value: SignerKeyEd25519SignedPayload, + ): SignerKey; - static setTrustLineFlagsNoTrustLine(): SetTrustLineFlagsResult; + value(): Buffer | Buffer | Buffer | SignerKeyEd25519SignedPayload; - static setTrustLineFlagsCantRevoke(): SetTrustLineFlagsResult; + toXDR(format?: 'raw'): Buffer; - static setTrustLineFlagsInvalidState(): SetTrustLineFlagsResult; + toXDR(format: 'hex' | 'base64'): string; - static setTrustLineFlagsLowReserve(): SetTrustLineFlagsResult; + static read(io: Buffer): SignerKey; - value(): void; + static write(value: SignerKey, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: SignerKey): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: SignerKey): Buffer; - static read(io: Buffer): SetTrustLineFlagsResult; + static fromXDR(input: Buffer, format?: 'raw'): SignerKey; - static write(value: SetTrustLineFlagsResult, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): SignerKey; - static isValid(value: SetTrustLineFlagsResult): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: SetTrustLineFlagsResult): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): SetTrustLineFlagsResult; + class ScError { + switch(): ScErrorType; - static fromXDR( - input: string, - format: "hex" | "base64" - ): SetTrustLineFlagsResult; + contractCode(value?: number): number; - static validateXDR(input: Buffer, format?: "raw"): boolean; + code(value?: ScErrorCode): ScErrorCode; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static sceContract(value: number): ScError; - class LiquidityPoolDepositResult { - switch(): LiquidityPoolDepositResultCode; + static sceWasmVm(value: ScErrorCode): ScError; - static liquidityPoolDepositSuccess(): LiquidityPoolDepositResult; + static sceContext(value: ScErrorCode): ScError; - static liquidityPoolDepositMalformed(): LiquidityPoolDepositResult; + static sceStorage(value: ScErrorCode): ScError; - static liquidityPoolDepositNoTrust(): LiquidityPoolDepositResult; + static sceObject(value: ScErrorCode): ScError; - static liquidityPoolDepositNotAuthorized(): LiquidityPoolDepositResult; + static sceCrypto(value: ScErrorCode): ScError; - static liquidityPoolDepositUnderfunded(): LiquidityPoolDepositResult; + static sceEvents(value: ScErrorCode): ScError; - static liquidityPoolDepositLineFull(): LiquidityPoolDepositResult; + static sceBudget(value: ScErrorCode): ScError; - static liquidityPoolDepositBadPrice(): LiquidityPoolDepositResult; + static sceValue(value: ScErrorCode): ScError; - static liquidityPoolDepositPoolFull(): LiquidityPoolDepositResult; + static sceAuth(value: ScErrorCode): ScError; - value(): void; + value(): number | ScErrorCode; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LiquidityPoolDepositResult; + static read(io: Buffer): ScError; - static write(value: LiquidityPoolDepositResult, io: Buffer): void; + static write(value: ScError, io: Buffer): void; - static isValid(value: LiquidityPoolDepositResult): boolean; + static isValid(value: ScError): boolean; - static toXDR(value: LiquidityPoolDepositResult): Buffer; + static toXDR(value: ScError): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolDepositResult; + static fromXDR(input: Buffer, format?: 'raw'): ScError; - static fromXDR( - input: string, - format: "hex" | "base64" - ): LiquidityPoolDepositResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScError; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LiquidityPoolWithdrawResult { - switch(): LiquidityPoolWithdrawResultCode; + class ContractExecutable { + switch(): ContractExecutableType; - static liquidityPoolWithdrawSuccess(): LiquidityPoolWithdrawResult; + wasmHash(value?: Buffer): Buffer; - static liquidityPoolWithdrawMalformed(): LiquidityPoolWithdrawResult; + static contractExecutableWasm(value: Buffer): ContractExecutable; - static liquidityPoolWithdrawNoTrust(): LiquidityPoolWithdrawResult; + static contractExecutableToken(): ContractExecutable; - static liquidityPoolWithdrawUnderfunded(): LiquidityPoolWithdrawResult; + value(): Buffer | void; - static liquidityPoolWithdrawLineFull(): LiquidityPoolWithdrawResult; + toXDR(format?: 'raw'): Buffer; - static liquidityPoolWithdrawUnderMinimum(): LiquidityPoolWithdrawResult; + toXDR(format: 'hex' | 'base64'): string; - value(): void; + static read(io: Buffer): ContractExecutable; - toXDR(format?: "raw"): Buffer; + static write(value: ContractExecutable, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: ContractExecutable): boolean; - static read(io: Buffer): LiquidityPoolWithdrawResult; + static toXDR(value: ContractExecutable): Buffer; - static write(value: LiquidityPoolWithdrawResult, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): ContractExecutable; - static isValid(value: LiquidityPoolWithdrawResult): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractExecutable; - static toXDR(value: LiquidityPoolWithdrawResult): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolWithdrawResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR( - input: string, - format: "hex" | "base64" - ): LiquidityPoolWithdrawResult; + class ScAddress { + switch(): ScAddressType; - static validateXDR(input: Buffer, format?: "raw"): boolean; + accountId(value?: AccountId): AccountId; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + contractId(value?: Buffer): Buffer; - class OperationResultTr { - switch(): OperationType; + static scAddressTypeAccount(value: AccountId): ScAddress; - createAccountResult(value?: CreateAccountResult): CreateAccountResult; + static scAddressTypeContract(value: Buffer): ScAddress; + + value(): AccountId | Buffer; - paymentResult(value?: PaymentResult): PaymentResult; + toXDR(format?: 'raw'): Buffer; - pathPaymentStrictReceiveResult( - value?: PathPaymentStrictReceiveResult - ): PathPaymentStrictReceiveResult; + toXDR(format: 'hex' | 'base64'): string; - manageSellOfferResult(value?: ManageSellOfferResult): ManageSellOfferResult; + static read(io: Buffer): ScAddress; - createPassiveSellOfferResult( - value?: ManageSellOfferResult - ): ManageSellOfferResult; + static write(value: ScAddress, io: Buffer): void; - setOptionsResult(value?: SetOptionsResult): SetOptionsResult; + static isValid(value: ScAddress): boolean; - changeTrustResult(value?: ChangeTrustResult): ChangeTrustResult; + static toXDR(value: ScAddress): Buffer; - allowTrustResult(value?: AllowTrustResult): AllowTrustResult; + static fromXDR(input: Buffer, format?: 'raw'): ScAddress; - accountMergeResult(value?: AccountMergeResult): AccountMergeResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScAddress; - inflationResult(value?: InflationResult): InflationResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - manageDataResult(value?: ManageDataResult): ManageDataResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - bumpSeqResult(value?: BumpSequenceResult): BumpSequenceResult; + class ScVal { + switch(): ScValType; - manageBuyOfferResult(value?: ManageBuyOfferResult): ManageBuyOfferResult; + b(value?: boolean): boolean; - pathPaymentStrictSendResult( - value?: PathPaymentStrictSendResult - ): PathPaymentStrictSendResult; + error(value?: ScError): ScError; - createClaimableBalanceResult( - value?: CreateClaimableBalanceResult - ): CreateClaimableBalanceResult; + u32(value?: number): number; - claimClaimableBalanceResult( - value?: ClaimClaimableBalanceResult - ): ClaimClaimableBalanceResult; + i32(value?: number): number; - beginSponsoringFutureReservesResult( - value?: BeginSponsoringFutureReservesResult - ): BeginSponsoringFutureReservesResult; + u64(value?: Uint64): Uint64; - endSponsoringFutureReservesResult( - value?: EndSponsoringFutureReservesResult - ): EndSponsoringFutureReservesResult; + i64(value?: Int64): Int64; - revokeSponsorshipResult( - value?: RevokeSponsorshipResult - ): RevokeSponsorshipResult; + timepoint(value?: TimePoint): TimePoint; - clawbackResult(value?: ClawbackResult): ClawbackResult; + duration(value?: Duration): Duration; - clawbackClaimableBalanceResult( - value?: ClawbackClaimableBalanceResult - ): ClawbackClaimableBalanceResult; + u128(value?: UInt128Parts): UInt128Parts; - setTrustLineFlagsResult( - value?: SetTrustLineFlagsResult - ): SetTrustLineFlagsResult; + i128(value?: Int128Parts): Int128Parts; - liquidityPoolDepositResult( - value?: LiquidityPoolDepositResult - ): LiquidityPoolDepositResult; + u256(value?: UInt256Parts): UInt256Parts; - liquidityPoolWithdrawResult( - value?: LiquidityPoolWithdrawResult - ): LiquidityPoolWithdrawResult; + i256(value?: Int256Parts): Int256Parts; - static createAccount(value: CreateAccountResult): OperationResultTr; + bytes(value?: Buffer): Buffer; - static payment(value: PaymentResult): OperationResultTr; + str(value?: string | Buffer): string | Buffer; - static pathPaymentStrictReceive( - value: PathPaymentStrictReceiveResult - ): OperationResultTr; + sym(value?: string | Buffer): string | Buffer; - static manageSellOffer(value: ManageSellOfferResult): OperationResultTr; + vec(value?: null | ScVal[]): null | ScVal[]; - static createPassiveSellOffer( - value: ManageSellOfferResult - ): OperationResultTr; + map(value?: null | ScMapEntry[]): null | ScMapEntry[]; - static setOptions(value: SetOptionsResult): OperationResultTr; + address(value?: ScAddress): ScAddress; - static changeTrust(value: ChangeTrustResult): OperationResultTr; + nonceKey(value?: ScNonceKey): ScNonceKey; - static allowTrust(value: AllowTrustResult): OperationResultTr; + instance(value?: ScContractInstance): ScContractInstance; - static accountMerge(value: AccountMergeResult): OperationResultTr; + static scvBool(value: boolean): ScVal; - static inflation(value: InflationResult): OperationResultTr; + static scvVoid(): ScVal; - static manageData(value: ManageDataResult): OperationResultTr; + static scvError(value: ScError): ScVal; - static bumpSequence(value: BumpSequenceResult): OperationResultTr; + static scvU32(value: number): ScVal; - static manageBuyOffer(value: ManageBuyOfferResult): OperationResultTr; + static scvI32(value: number): ScVal; - static pathPaymentStrictSend( - value: PathPaymentStrictSendResult - ): OperationResultTr; + static scvU64(value: Uint64): ScVal; - static createClaimableBalance( - value: CreateClaimableBalanceResult - ): OperationResultTr; + static scvI64(value: Int64): ScVal; - static claimClaimableBalance( - value: ClaimClaimableBalanceResult - ): OperationResultTr; + static scvTimepoint(value: TimePoint): ScVal; - static beginSponsoringFutureReserves( - value: BeginSponsoringFutureReservesResult - ): OperationResultTr; + static scvDuration(value: Duration): ScVal; - static endSponsoringFutureReserves( - value: EndSponsoringFutureReservesResult - ): OperationResultTr; + static scvU128(value: UInt128Parts): ScVal; - static revokeSponsorship(value: RevokeSponsorshipResult): OperationResultTr; + static scvI128(value: Int128Parts): ScVal; - static clawback(value: ClawbackResult): OperationResultTr; + static scvU256(value: UInt256Parts): ScVal; - static clawbackClaimableBalance( - value: ClawbackClaimableBalanceResult - ): OperationResultTr; + static scvI256(value: Int256Parts): ScVal; - static setTrustLineFlags(value: SetTrustLineFlagsResult): OperationResultTr; + static scvBytes(value: Buffer): ScVal; - static liquidityPoolDeposit( - value: LiquidityPoolDepositResult - ): OperationResultTr; + static scvString(value: string | Buffer): ScVal; - static liquidityPoolWithdraw( - value: LiquidityPoolWithdrawResult - ): OperationResultTr; + static scvSymbol(value: string | Buffer): ScVal; - value(): - | CreateAccountResult - | PaymentResult - | PathPaymentStrictReceiveResult - | ManageSellOfferResult - | ManageSellOfferResult - | SetOptionsResult - | ChangeTrustResult - | AllowTrustResult - | AccountMergeResult - | InflationResult - | ManageDataResult - | BumpSequenceResult - | ManageBuyOfferResult - | PathPaymentStrictSendResult - | CreateClaimableBalanceResult - | ClaimClaimableBalanceResult - | BeginSponsoringFutureReservesResult - | EndSponsoringFutureReservesResult - | RevokeSponsorshipResult - | ClawbackResult - | ClawbackClaimableBalanceResult - | SetTrustLineFlagsResult - | LiquidityPoolDepositResult - | LiquidityPoolWithdrawResult; + static scvVec(value: null | ScVal[]): ScVal; - toXDR(format?: "raw"): Buffer; + static scvMap(value: null | ScMapEntry[]): ScVal; - toXDR(format: "hex" | "base64"): string; + static scvAddress(value: ScAddress): ScVal; - static read(io: Buffer): OperationResultTr; + static scvLedgerKeyContractInstance(): ScVal; - static write(value: OperationResultTr, io: Buffer): void; + static scvLedgerKeyNonce(value: ScNonceKey): ScVal; - static isValid(value: OperationResultTr): boolean; + static scvContractInstance(value: ScContractInstance): ScVal; - static toXDR(value: OperationResultTr): Buffer; + value(): + | boolean + | ScError + | number + | number + | Uint64 + | Int64 + | TimePoint + | Duration + | UInt128Parts + | Int128Parts + | UInt256Parts + | Int256Parts + | Buffer + | string + | Buffer + | string + | Buffer + | null + | ScVal[] + | null + | ScMapEntry[] + | ScAddress + | ScNonceKey + | ScContractInstance + | void; - static fromXDR(input: Buffer, format?: "raw"): OperationResultTr; + toXDR(format?: 'raw'): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): OperationResultTr; + toXDR(format: 'hex' | 'base64'): string; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static read(io: Buffer): ScVal; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static write(value: ScVal, io: Buffer): void; - class OperationResult { - switch(): OperationResultCode; + static isValid(value: ScVal): boolean; - tr(value?: OperationResultTr): OperationResultTr; + static toXDR(value: ScVal): Buffer; - static opInner(value: OperationResultTr): OperationResult; + static fromXDR(input: Buffer, format?: 'raw'): ScVal; - static opBadAuth(): OperationResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScVal; - static opNoAccount(): OperationResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static opNotSupported(): OperationResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static opTooManySubentries(): OperationResult; + class ScEnvMetaEntry { + switch(): ScEnvMetaKind; - static opExceededWorkLimit(): OperationResult; + interfaceVersion(value?: Uint64): Uint64; - static opTooManySponsoring(): OperationResult; + static scEnvMetaKindInterfaceVersion(value: Uint64): ScEnvMetaEntry; - value(): OperationResultTr | void; + value(): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): OperationResult; + static read(io: Buffer): ScEnvMetaEntry; - static write(value: OperationResult, io: Buffer): void; + static write(value: ScEnvMetaEntry, io: Buffer): void; - static isValid(value: OperationResult): boolean; + static isValid(value: ScEnvMetaEntry): boolean; - static toXDR(value: OperationResult): Buffer; + static toXDR(value: ScEnvMetaEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationResult; + static fromXDR(input: Buffer, format?: 'raw'): ScEnvMetaEntry; - static fromXDR(input: string, format: "hex" | "base64"): OperationResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScEnvMetaEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InnerTransactionResultResult { - switch(): TransactionResultCode; + class ScMetaEntry { + switch(): ScMetaKind; - results(value?: OperationResult[]): OperationResult[]; + v0(value?: ScMetaV0): ScMetaV0; - static txSuccess(value: OperationResult[]): InnerTransactionResultResult; + static scMetaV0(value: ScMetaV0): ScMetaEntry; - static txFailed(value: OperationResult[]): InnerTransactionResultResult; + value(): ScMetaV0; - static txTooEarly(): InnerTransactionResultResult; + toXDR(format?: 'raw'): Buffer; - static txTooLate(): InnerTransactionResultResult; + toXDR(format: 'hex' | 'base64'): string; - static txMissingOperation(): InnerTransactionResultResult; + static read(io: Buffer): ScMetaEntry; - static txBadSeq(): InnerTransactionResultResult; + static write(value: ScMetaEntry, io: Buffer): void; - static txBadAuth(): InnerTransactionResultResult; + static isValid(value: ScMetaEntry): boolean; - static txInsufficientBalance(): InnerTransactionResultResult; + static toXDR(value: ScMetaEntry): Buffer; - static txNoAccount(): InnerTransactionResultResult; + static fromXDR(input: Buffer, format?: 'raw'): ScMetaEntry; - static txInsufficientFee(): InnerTransactionResultResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScMetaEntry; - static txBadAuthExtra(): InnerTransactionResultResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static txInternalError(): InnerTransactionResultResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static txNotSupported(): InnerTransactionResultResult; + class ScSpecTypeDef { + switch(): ScSpecType; - static txBadSponsorship(): InnerTransactionResultResult; + option(value?: ScSpecTypeOption): ScSpecTypeOption; - static txBadMinSeqAgeOrGap(): InnerTransactionResultResult; + result(value?: ScSpecTypeResult): ScSpecTypeResult; - static txMalformed(): InnerTransactionResultResult; + vec(value?: ScSpecTypeVec): ScSpecTypeVec; - value(): OperationResult[] | void; + map(value?: ScSpecTypeMap): ScSpecTypeMap; - toXDR(format?: "raw"): Buffer; + tuple(value?: ScSpecTypeTuple): ScSpecTypeTuple; - toXDR(format: "hex" | "base64"): string; + bytesN(value?: ScSpecTypeBytesN): ScSpecTypeBytesN; - static read(io: Buffer): InnerTransactionResultResult; + udt(value?: ScSpecTypeUdt): ScSpecTypeUdt; - static write(value: InnerTransactionResultResult, io: Buffer): void; + static scSpecTypeVal(): ScSpecTypeDef; - static isValid(value: InnerTransactionResultResult): boolean; + static scSpecTypeBool(): ScSpecTypeDef; - static toXDR(value: InnerTransactionResultResult): Buffer; + static scSpecTypeVoid(): ScSpecTypeDef; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultResult; + static scSpecTypeError(): ScSpecTypeDef; - static fromXDR( - input: string, - format: "hex" | "base64" - ): InnerTransactionResultResult; + static scSpecTypeU32(): ScSpecTypeDef; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scSpecTypeI32(): ScSpecTypeDef; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static scSpecTypeU64(): ScSpecTypeDef; - class InnerTransactionResultExt { - switch(): number; + static scSpecTypeI64(): ScSpecTypeDef; - static 0(): InnerTransactionResultExt; + static scSpecTypeTimepoint(): ScSpecTypeDef; - value(): void; + static scSpecTypeDuration(): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + static scSpecTypeU128(): ScSpecTypeDef; - toXDR(format: "hex" | "base64"): string; + static scSpecTypeI128(): ScSpecTypeDef; - static read(io: Buffer): InnerTransactionResultExt; + static scSpecTypeU256(): ScSpecTypeDef; - static write(value: InnerTransactionResultExt, io: Buffer): void; + static scSpecTypeI256(): ScSpecTypeDef; - static isValid(value: InnerTransactionResultExt): boolean; + static scSpecTypeBytes(): ScSpecTypeDef; - static toXDR(value: InnerTransactionResultExt): Buffer; + static scSpecTypeString(): ScSpecTypeDef; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultExt; + static scSpecTypeSymbol(): ScSpecTypeDef; - static fromXDR( - input: string, - format: "hex" | "base64" - ): InnerTransactionResultExt; + static scSpecTypeAddress(): ScSpecTypeDef; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static scSpecTypeOption(value: ScSpecTypeOption): ScSpecTypeDef; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static scSpecTypeResult(value: ScSpecTypeResult): ScSpecTypeDef; - class TransactionResultResult { - switch(): TransactionResultCode; + static scSpecTypeVec(value: ScSpecTypeVec): ScSpecTypeDef; - innerResultPair( - value?: InnerTransactionResultPair - ): InnerTransactionResultPair; + static scSpecTypeMap(value: ScSpecTypeMap): ScSpecTypeDef; - results(value?: OperationResult[]): OperationResult[]; + static scSpecTypeTuple(value: ScSpecTypeTuple): ScSpecTypeDef; - static txFeeBumpInnerSuccess( - value: InnerTransactionResultPair - ): TransactionResultResult; + static scSpecTypeBytesN(value: ScSpecTypeBytesN): ScSpecTypeDef; - static txFeeBumpInnerFailed( - value: InnerTransactionResultPair - ): TransactionResultResult; + static scSpecTypeUdt(value: ScSpecTypeUdt): ScSpecTypeDef; - static txSuccess(value: OperationResult[]): TransactionResultResult; + value(): + | ScSpecTypeOption + | ScSpecTypeResult + | ScSpecTypeVec + | ScSpecTypeMap + | ScSpecTypeTuple + | ScSpecTypeBytesN + | ScSpecTypeUdt + | void; - static txFailed(value: OperationResult[]): TransactionResultResult; + toXDR(format?: 'raw'): Buffer; - static txTooEarly(): TransactionResultResult; + toXDR(format: 'hex' | 'base64'): string; - static txTooLate(): TransactionResultResult; + static read(io: Buffer): ScSpecTypeDef; - static txMissingOperation(): TransactionResultResult; + static write(value: ScSpecTypeDef, io: Buffer): void; - static txBadSeq(): TransactionResultResult; + static isValid(value: ScSpecTypeDef): boolean; - static txBadAuth(): TransactionResultResult; + static toXDR(value: ScSpecTypeDef): Buffer; - static txInsufficientBalance(): TransactionResultResult; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeDef; - static txNoAccount(): TransactionResultResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeDef; - static txInsufficientFee(): TransactionResultResult; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static txBadAuthExtra(): TransactionResultResult; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static txInternalError(): TransactionResultResult; + class ScSpecUdtUnionCaseV0 { + switch(): ScSpecUdtUnionCaseV0Kind; - static txNotSupported(): TransactionResultResult; + voidCase(value?: ScSpecUdtUnionCaseVoidV0): ScSpecUdtUnionCaseVoidV0; - static txBadSponsorship(): TransactionResultResult; + tupleCase(value?: ScSpecUdtUnionCaseTupleV0): ScSpecUdtUnionCaseTupleV0; - static txBadMinSeqAgeOrGap(): TransactionResultResult; + static scSpecUdtUnionCaseVoidV0( + value: ScSpecUdtUnionCaseVoidV0, + ): ScSpecUdtUnionCaseV0; - static txMalformed(): TransactionResultResult; + static scSpecUdtUnionCaseTupleV0( + value: ScSpecUdtUnionCaseTupleV0, + ): ScSpecUdtUnionCaseV0; - value(): InnerTransactionResultPair | OperationResult[] | void; + value(): ScSpecUdtUnionCaseVoidV0 | ScSpecUdtUnionCaseTupleV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultResult; + static read(io: Buffer): ScSpecUdtUnionCaseV0; - static write(value: TransactionResultResult, io: Buffer): void; + static write(value: ScSpecUdtUnionCaseV0, io: Buffer): void; - static isValid(value: TransactionResultResult): boolean; + static isValid(value: ScSpecUdtUnionCaseV0): boolean; - static toXDR(value: TransactionResultResult): Buffer; + static toXDR(value: ScSpecUdtUnionCaseV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultResult; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseV0; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionResultResult; + format: 'hex' | 'base64', + ): ScSpecUdtUnionCaseV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultExt { - switch(): number; + class ScSpecEntry { + switch(): ScSpecEntryKind; - static 0(): TransactionResultExt; + functionV0(value?: ScSpecFunctionV0): ScSpecFunctionV0; - value(): void; + udtStructV0(value?: ScSpecUdtStructV0): ScSpecUdtStructV0; - toXDR(format?: "raw"): Buffer; + udtUnionV0(value?: ScSpecUdtUnionV0): ScSpecUdtUnionV0; - toXDR(format: "hex" | "base64"): string; + udtEnumV0(value?: ScSpecUdtEnumV0): ScSpecUdtEnumV0; - static read(io: Buffer): TransactionResultExt; + udtErrorEnumV0(value?: ScSpecUdtErrorEnumV0): ScSpecUdtErrorEnumV0; - static write(value: TransactionResultExt, io: Buffer): void; + static scSpecEntryFunctionV0(value: ScSpecFunctionV0): ScSpecEntry; - static isValid(value: TransactionResultExt): boolean; + static scSpecEntryUdtStructV0(value: ScSpecUdtStructV0): ScSpecEntry; - static toXDR(value: TransactionResultExt): Buffer; + static scSpecEntryUdtUnionV0(value: ScSpecUdtUnionV0): ScSpecEntry; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultExt; + static scSpecEntryUdtEnumV0(value: ScSpecUdtEnumV0): ScSpecEntry; - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionResultExt; + static scSpecEntryUdtErrorEnumV0(value: ScSpecUdtErrorEnumV0): ScSpecEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + value(): + | ScSpecFunctionV0 + | ScSpecUdtStructV0 + | ScSpecUdtUnionV0 + | ScSpecUdtEnumV0 + | ScSpecUdtErrorEnumV0; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + toXDR(format?: 'raw'): Buffer; - class ExtensionPoint { - switch(): number; + toXDR(format: 'hex' | 'base64'): string; - static 0(): ExtensionPoint; + static read(io: Buffer): ScSpecEntry; - value(): void; + static write(value: ScSpecEntry, io: Buffer): void; - toXDR(format?: "raw"): Buffer; + static isValid(value: ScSpecEntry): boolean; - toXDR(format: "hex" | "base64"): string; + static toXDR(value: ScSpecEntry): Buffer; - static read(io: Buffer): ExtensionPoint; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEntry; - static write(value: ExtensionPoint, io: Buffer): void; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEntry; - static isValid(value: ExtensionPoint): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static toXDR(value: ExtensionPoint): Buffer; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } - static fromXDR(input: Buffer, format?: "raw"): ExtensionPoint; + class ConfigSettingEntry { + switch(): ConfigSettingId; - static fromXDR(input: string, format: "hex" | "base64"): ExtensionPoint; + contractMaxSizeBytes(value?: number): number; - static validateXDR(input: Buffer, format?: "raw"): boolean; + contractCompute( + value?: ConfigSettingContractComputeV0, + ): ConfigSettingContractComputeV0; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + contractLedgerCost( + value?: ConfigSettingContractLedgerCostV0, + ): ConfigSettingContractLedgerCostV0; - class PublicKey { - switch(): PublicKeyType; + contractHistoricalData( + value?: ConfigSettingContractHistoricalDataV0, + ): ConfigSettingContractHistoricalDataV0; - ed25519(value?: Buffer): Buffer; + contractEvents( + value?: ConfigSettingContractEventsV0, + ): ConfigSettingContractEventsV0; - static publicKeyTypeEd25519(value: Buffer): PublicKey; + contractBandwidth( + value?: ConfigSettingContractBandwidthV0, + ): ConfigSettingContractBandwidthV0; - value(): Buffer; + contractCostParamsCpuInsns( + value?: ContractCostParamEntry[], + ): ContractCostParamEntry[]; - toXDR(format?: "raw"): Buffer; + contractCostParamsMemBytes( + value?: ContractCostParamEntry[], + ): ContractCostParamEntry[]; - toXDR(format: "hex" | "base64"): string; + contractDataKeySizeBytes(value?: number): number; - static read(io: Buffer): PublicKey; + contractDataEntrySizeBytes(value?: number): number; - static write(value: PublicKey, io: Buffer): void; + stateExpirationSettings( + value?: StateExpirationSettings, + ): StateExpirationSettings; - static isValid(value: PublicKey): boolean; + contractExecutionLanes( + value?: ConfigSettingContractExecutionLanesV0, + ): ConfigSettingContractExecutionLanesV0; - static toXDR(value: PublicKey): Buffer; + bucketListSizeWindow(value?: Uint64[]): Uint64[]; - static fromXDR(input: Buffer, format?: "raw"): PublicKey; + evictionIterator(value?: EvictionIterator): EvictionIterator; - static fromXDR(input: string, format: "hex" | "base64"): PublicKey; + static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static configSettingContractComputeV0( + value: ConfigSettingContractComputeV0, + ): ConfigSettingEntry; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + static configSettingContractLedgerCostV0( + value: ConfigSettingContractLedgerCostV0, + ): ConfigSettingEntry; - class SignerKey { - switch(): SignerKeyType; + static configSettingContractHistoricalDataV0( + value: ConfigSettingContractHistoricalDataV0, + ): ConfigSettingEntry; - ed25519(value?: Buffer): Buffer; + static configSettingContractEventsV0( + value: ConfigSettingContractEventsV0, + ): ConfigSettingEntry; - preAuthTx(value?: Buffer): Buffer; + static configSettingContractBandwidthV0( + value: ConfigSettingContractBandwidthV0, + ): ConfigSettingEntry; - hashX(value?: Buffer): Buffer; + static configSettingContractCostParamsCpuInstructions( + value: ContractCostParamEntry[], + ): ConfigSettingEntry; - ed25519SignedPayload( - value?: SignerKeyEd25519SignedPayload - ): SignerKeyEd25519SignedPayload; + static configSettingContractCostParamsMemoryBytes( + value: ContractCostParamEntry[], + ): ConfigSettingEntry; - static signerKeyTypeEd25519(value: Buffer): SignerKey; + static configSettingContractDataKeySizeBytes( + value: number, + ): ConfigSettingEntry; - static signerKeyTypePreAuthTx(value: Buffer): SignerKey; + static configSettingContractDataEntrySizeBytes( + value: number, + ): ConfigSettingEntry; - static signerKeyTypeHashX(value: Buffer): SignerKey; + static configSettingStateExpiration( + value: StateExpirationSettings, + ): ConfigSettingEntry; - static signerKeyTypeEd25519SignedPayload( - value: SignerKeyEd25519SignedPayload - ): SignerKey; + static configSettingContractExecutionLanes( + value: ConfigSettingContractExecutionLanesV0, + ): ConfigSettingEntry; - value(): Buffer | Buffer | Buffer | SignerKeyEd25519SignedPayload; + static configSettingBucketlistSizeWindow( + value: Uint64[], + ): ConfigSettingEntry; + + static configSettingEvictionIterator( + value: EvictionIterator, + ): ConfigSettingEntry; + + value(): + | number + | ConfigSettingContractComputeV0 + | ConfigSettingContractLedgerCostV0 + | ConfigSettingContractHistoricalDataV0 + | ConfigSettingContractEventsV0 + | ConfigSettingContractBandwidthV0 + | ContractCostParamEntry[] + | ContractCostParamEntry[] + | number + | number + | StateExpirationSettings + | ConfigSettingContractExecutionLanesV0 + | Uint64[] + | EvictionIterator; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): SignerKey; + static read(io: Buffer): ConfigSettingEntry; - static write(value: SignerKey, io: Buffer): void; + static write(value: ConfigSettingEntry, io: Buffer): void; - static isValid(value: SignerKey): boolean; + static isValid(value: ConfigSettingEntry): boolean; - static toXDR(value: SignerKey): Buffer; + static toXDR(value: ConfigSettingEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SignerKey; + static fromXDR(input: Buffer, format?: 'raw'): ConfigSettingEntry; - static fromXDR(input: string, format: "hex" | "base64"): SignerKey; + static fromXDR(input: string, format: 'hex' | 'base64'): ConfigSettingEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } } diff --git a/types/index.d.ts b/types/index.d.ts index 2bab7819b..d52ad2e1e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -12,6 +12,29 @@ export class Account { incrementSequenceNumber(): void; } +export class Address { + constructor(address: string); + static fromString(address: string): Address; + static account(buffer: Buffer): Address; + static contract(buffer: Buffer): Address; + static fromScVal(scVal: xdr.ScVal): Address; + static fromScAddress(scAddress: xdr.ScAddress): Address; + toString(): string; + toScVal(): xdr.ScVal; + toScAddress(): xdr.ScAddress; + toBuffer(): Buffer; +} + +export class Contract { + constructor(contractId: string); + call(method: string, ...params: xdr.ScVal[]): xdr.Operation; + contractId(): string; + address(): Address; + getFootprint(): xdr.LedgerKey[]; + + toString(): string; +} + export class MuxedAccount { constructor(account: Account, sequence: string); static fromAddress(mAddress: string, sequenceNum: string): MuxedAccount; @@ -56,6 +79,7 @@ export class Asset { toXDRObject(): xdr.Asset; toChangeTrustXDRObject(): xdr.ChangeTrustAsset; toTrustLineXDRObject(): xdr.TrustLineAsset; + contractId(): string; code: string; issuer: string; @@ -219,7 +243,10 @@ export class Memo { export enum Networks { PUBLIC = 'Public Global Stellar Network ; September 2015', - TESTNET = 'Test SDF Network ; September 2015' + TESTNET = 'Test SDF Network ; September 2015', + FUTURENET = 'Test SDF Future Network ; October 2022', + SANDBOX = 'Local Sandbox Stellar Network ; September 2022', + STANDALONE = 'Standalone Network ; February 2017' } export const AuthRequiredFlag: 1; @@ -341,6 +368,9 @@ export namespace OperationType { type SetTrustLineFlags = 'setTrustLineFlags'; type LiquidityPoolDeposit = 'liquidityPoolDeposit'; type LiquidityPoolWithdraw = 'liquidityPoolWithdraw'; + type InvokeHostFunction = 'invokeHostFunction'; + type BumpFootprintExpiration = 'bumpFootprintExpiration'; + type RestoreFootprint = 'restoreFootprint'; } export type OperationType = | OperationType.CreateAccount @@ -366,7 +396,10 @@ export type OperationType = | OperationType.ClawbackClaimableBalance | OperationType.SetTrustLineFlags | OperationType.LiquidityPoolDeposit - | OperationType.LiquidityPoolWithdraw; + | OperationType.LiquidityPoolWithdraw + | OperationType.InvokeHostFunction + | OperationType.BumpFootprintExpiration + | OperationType.RestoreFootprint; export namespace OperationOptions { interface BaseOptions { @@ -513,6 +546,14 @@ export namespace OperationOptions { minAmountA: string; minAmountB: string; } + interface InvokeHostFunction extends BaseOptions { + func: xdr.HostFunction; + auth: xdr.SorobanAuthorizationEntry[]; + } + interface BumpFootprintExpiration extends BaseOptions { + ledgersToExpire: number; + } + type RestoreFootprint = BaseOptions; } export type OperationOptions = | OperationOptions.CreateAccount @@ -543,7 +584,10 @@ export type OperationOptions = | OperationOptions.ClawbackClaimableBalance | OperationOptions.SetTrustLineFlags | OperationOptions.LiquidityPoolDeposit - | OperationOptions.LiquidityPoolWithdraw; + | OperationOptions.LiquidityPoolWithdraw + | OperationOptions.InvokeHostFunction + | OperationOptions.BumpFootprintExpiration + | OperationOptions.RestoreFootprint; export namespace Operation { interface BaseOperation { @@ -824,6 +868,24 @@ export namespace Operation { function liquidityPoolWithdraw( options: OperationOptions.LiquidityPoolWithdraw ): xdr.Operation; + interface InvokeHostFunction extends BaseOperation { + func: xdr.HostFunction; + auth?: xdr.SorobanAuthorizationEntry[]; + } + function invokeHostFunction( + options: OperationOptions.InvokeHostFunction + ): xdr.Operation; + + function bumpFootprintExpiration( + options: OperationOptions.BumpFootprintExpiration + ): xdr.Operation; + interface BumpFootprintExpiration extends BaseOperation { + ledgersToExpire: number; + } + + function restoreFootprint(options: OperationOptions.RestoreFootprint): + xdr.Operation; + interface RestoreFootprint extends BaseOperation {} function fromXDRObject( xdrOperation: xdr.Operation @@ -859,7 +921,10 @@ export type Operation = | Operation.ClawbackClaimableBalance | Operation.SetTrustLineFlags | Operation.LiquidityPoolDeposit - | Operation.LiquidityPoolWithdraw; + | Operation.LiquidityPoolWithdraw + | Operation.InvokeHostFunction + | Operation.BumpFootprintExpiration + | Operation.RestoreFootprint; export namespace StrKey { function encodeEd25519PublicKey(data: Buffer): string; @@ -883,6 +948,9 @@ export namespace StrKey { function encodeSha256Hash(data: Buffer): string; function decodeSha256Hash(address: string): Buffer; + + function encodeContract(data: Buffer): string; + function decodeContract(address: string): Buffer; } export namespace SignerKey { @@ -952,6 +1020,7 @@ export class TransactionBuilder { options?: TransactionBuilder.TransactionBuilderOptions ); addOperation(operation: xdr.Operation): this; + clearOperations(): this; addMemo(memo: Memo): this; setTimeout(timeoutInSeconds: number): this; setTimebounds(min: Date | number, max: Date | number): this; @@ -960,8 +1029,14 @@ export class TransactionBuilder { setMinAccountSequenceAge(durationInSeconds: number): this; setMinAccountSequenceLedgerGap(gap: number): this; setExtraSigners(extraSigners: string[]): this; + setSorobanData(sorobanData: string | xdr.SorobanTransactionData): this; build(): Transaction; setNetworkPassphrase(networkPassphrase: string): this; + + static cloneFrom( + tx: Transaction, + optionOverrides?: TransactionBuilder.TransactionBuilderOptions + ): TransactionBuilder; static buildFeeBumpTransaction( feeSource: Keypair | string, baseFee: string, @@ -992,6 +1067,7 @@ export namespace TransactionBuilder { minAccountSequenceAge?: number; minAccountSequenceLedgerGap?: number; extraSigners?: string[]; + sorobanData?: string | xdr.SorobanTransactionData; } } @@ -1007,3 +1083,154 @@ export function decodeAddressToMuxedAccount(address: string, supportMuxing: bool export function encodeMuxedAccountToAddress(account: xdr.MuxedAccount, supportMuxing: boolean): string; export function encodeMuxedAccount(gAddress: string, id: string): xdr.MuxedAccount; export function extractBaseAddress(address: string): string; + +export type IntLike = string | number | bigint; +export type ScIntType = + | 'i64' + | 'u64' + | 'i128' + | 'u128' + | 'i256' + | 'u256'; + +export class XdrLargeInt { + constructor( + type: ScIntType, + values: IntLike | IntLike[] + ); + + toNumber(): number; + toBigInt(): bigint; + + toI64(): xdr.ScVal; + toU64(): xdr.ScVal; + toI128(): xdr.ScVal; + toU128(): xdr.ScVal; + toI256(): xdr.ScVal; + toU256(): xdr.ScVal; + toScVal(): xdr.ScVal; + + valueOf(): any; // FIXME + toString(): string; + toJSON(): { + value: string; + type: ScIntType; + }; + + static isType(t: string): t is ScIntType; + static getType(scvType: string): ScIntType; +} + +export class ScInt extends XdrLargeInt { + constructor(value: IntLike, opts?: { type: ScIntType }); +} + +export function scValToBigInt(scv: xdr.ScVal): bigint; +export function nativeToScVal(val: any, opts?: { type: ScIntType }): xdr.ScVal; +export function scValToNative(scv: xdr.ScVal): any; + +interface SorobanEvent { + type: 'system'|'contract'|'diagnostic'; // xdr.ContractEventType.name + contractId?: string; // C... encoded strkey + + topics: any[]; // essentially a call of map(event.body.topics, scValToNative) + data: any; // similarly, scValToNative(rawEvent.data); +} + +export function humanizeEvents( + events: xdr.DiagnosticEvent[] | xdr.ContractEvent[] +): SorobanEvent[]; + +export class SorobanDataBuilder { + constructor(data?: string | Uint8Array | Buffer | xdr.SorobanTransactionData); + static fromXDR(data: Uint8Array | Buffer | string): SorobanDataBuilder; + + setRefundableFee(fee: IntLike): SorobanDataBuilder; + setResources( + cpuInstrs: number, + readBytes: number, + writeBytes: number + ): SorobanDataBuilder; + + setFootprint( + readOnly?: xdr.LedgerKey[] | null, + readWrite?: xdr.LedgerKey[] | null + ): SorobanDataBuilder; + appendFootprint( + readOnly: xdr.LedgerKey[], + readWrite: xdr.LedgerKey[] + ): SorobanDataBuilder; + + setReadOnly(keys: xdr.LedgerKey[]): SorobanDataBuilder; + setReadWrite(keys: xdr.LedgerKey[]): SorobanDataBuilder; + + getFootprint(): xdr.LedgerFootprint; + getReadOnly(): xdr.LedgerKey[]; + getReadWrite(): xdr.LedgerKey[]; + + build(): xdr.SorobanTransactionData; +} + +export function authorizeInvocation( + signer: Keypair, + networkPassphrase: string, + validUntil: number, + invocation: xdr.SorobanAuthorizedInvocation +): xdr.SorobanAuthorizationEntry; + +export function authorizeInvocationCallback( + publicKey: string, + signingMethod: (input: Buffer) => Buffer, + networkPassphrase: string, + validUntil: number, + invocation: xdr.SorobanAuthorizedInvocation +): xdr.SorobanAuthorizationEntry; + +export function buildAuthEnvelope( + networkPassphrase: string, + validUntil: number, + invocation: xdr.SorobanAuthorizedInvocation +): xdr.HashIdPreimage; + +export function buildAuthEntry( + envelope: xdr.HashIdPreimage, + signature: Buffer | Uint8Array, + publicKey: string +): xdr.SorobanAuthorizationEntry; + +export interface CreateInvocation { + type: 'wasm' | 'sac'; + token?: string; + wasm?: { + hash: string; + address: string; + salt: string; + }; +} + +export interface ExecuteInvocation { + source: string; + function: string; + args: any[]; +} + +export interface InvocationTree { + type: 'execute' | 'create'; + args: CreateInvocation | ExecuteInvocation; + invocations: InvocationTree[]; +} + +export function buildInvocationTree( + root: xdr.SorobanAuthorizedInvocation +): InvocationTree; + +export type InvocationWalker = ( + node: xdr.SorobanAuthorizedInvocation, + depth: number, + parent?: any +) => boolean|null; + +export function walkInvocationTree( + root: xdr.SorobanAuthorizedInvocation, + callback: InvocationWalker +): void; diff --git a/types/next.d.ts b/types/next.d.ts index 867ad894f..9941c15ee 100644 --- a/types/next.d.ts +++ b/types/next.d.ts @@ -1,4 +1,4 @@ -// Automatically generated on 2023-04-20T14:53:00-08:00 +// Automatically generated on 2023-09-11T12:23:00-08:00 import { Operation } from './index'; export {}; @@ -16,9 +16,9 @@ declare namespace xdrHidden { body(value?: xdr.OperationBody): xdr.OperationBody; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): xdr.Operation; @@ -28,19 +28,21 @@ declare namespace xdrHidden { static toXDR(value: xdr.Operation): Buffer; - static fromXDR(input: Buffer, format?: "raw"): xdr.Operation; + static fromXDR(input: Buffer, format?: 'raw'): xdr.Operation; - static fromXDR(input: string, format: "hex" | "base64"): xdr.Operation; + static fromXDR(input: string, format: 'hex' | 'base64'): xdr.Operation; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } } export namespace xdr { export import Operation = xdrHidden.Operation2; // tslint:disable-line:strict-export-declare-modifiers + type Hash = Opaque[]; // workaround, cause unknown + interface SignedInt { readonly MAX_VALUE: 2147483647; readonly MIN_VALUE: -2147483648; @@ -48,10 +50,10 @@ export namespace xdr { write(value: number, io: Buffer): void; isValid(value: number): boolean; toXDR(value: number): Buffer; - fromXDR(input: Buffer, format?: "raw"): number; - fromXDR(input: string, format: "hex" | "base64"): number; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): number; + fromXDR(input: string, format: 'hex' | 'base64'): number; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } interface UnsignedInt { @@ -61,10 +63,10 @@ export namespace xdr { write(value: number, io: Buffer): void; isValid(value: number): boolean; toXDR(value: number): Buffer; - fromXDR(input: Buffer, format?: "raw"): number; - fromXDR(input: string, format: "hex" | "base64"): number; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): number; + fromXDR(input: string, format: 'hex' | 'base64'): number; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } interface Bool { @@ -72,10 +74,10 @@ export namespace xdr { write(value: boolean, io: Buffer): void; isValid(value: boolean): boolean; toXDR(value: boolean): Buffer; - fromXDR(input: Buffer, format?: "raw"): boolean; - fromXDR(input: string, format: "hex" | "base64"): boolean; - validateXDR(input: Buffer, format?: "raw"): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + fromXDR(input: Buffer, format?: 'raw'): boolean; + fromXDR(input: string, format: 'hex' | 'base64'): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Hyper { @@ -85,21 +87,23 @@ export namespace xdr { unsigned: boolean; - constructor(low: number, high: number); + constructor( + values: string | bigint | number | Array, + ); - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static toXDR(value: Hyper): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Hyper; + static fromXDR(input: Buffer, format?: 'raw'): Hyper; - static fromXDR(input: string, format: "hex" | "base64"): Hyper; + static fromXDR(input: string, format: 'hex' | 'base64'): Hyper; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; static readonly MAX_VALUE: Hyper; @@ -114,6 +118,10 @@ export namespace xdr { static fromBytes(low: number, high: number): Hyper; static isValid(value: Hyper): boolean; + + toBigInt(): bigint; + + toString(): string; } class UnsignedHyper { @@ -123,21 +131,23 @@ export namespace xdr { unsigned: boolean; - constructor(low: number, high: number); + constructor( + values: string | bigint | number | Array, + ); - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static toXDR(value: UnsignedHyper): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UnsignedHyper; + static fromXDR(input: Buffer, format?: 'raw'): UnsignedHyper; - static fromXDR(input: string, format: "hex" | "base64"): UnsignedHyper; + static fromXDR(input: string, format: 'hex' | 'base64'): UnsignedHyper; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; static readonly MAX_VALUE: UnsignedHyper; @@ -152,6 +162,10 @@ export namespace xdr { static fromBytes(low: number, high: number): UnsignedHyper; static isValid(value: UnsignedHyper): boolean; + + toBigInt(): bigint; + + toString(): string; } class XDRString { @@ -167,13 +181,13 @@ export namespace xdr { toXDR(value: string | Buffer): Buffer; - fromXDR(input: Buffer, format?: "raw"): Buffer; + fromXDR(input: Buffer, format?: 'raw'): Buffer; - fromXDR(input: string, format: "hex" | "base64"): Buffer; + fromXDR(input: string, format: 'hex' | 'base64'): Buffer; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class XDRArray { @@ -185,13 +199,13 @@ export namespace xdr { toXDR(value: T[]): Buffer; - fromXDR(input: Buffer, format?: "raw"): T[]; + fromXDR(input: Buffer, format?: 'raw'): T[]; - fromXDR(input: string, format: "hex" | "base64"): T[]; + fromXDR(input: string, format: 'hex' | 'base64'): T[]; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Opaque { @@ -205,13 +219,13 @@ export namespace xdr { toXDR(value: Buffer): Buffer; - fromXDR(input: Buffer, format?: "raw"): Buffer; + fromXDR(input: Buffer, format?: 'raw'): Buffer; - fromXDR(input: string, format: "hex" | "base64"): Buffer; + fromXDR(input: string, format: 'hex' | 'base64'): Buffer; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class VarOpaque extends Opaque {} @@ -231,21 +245,21 @@ export namespace xdr { toXDR(value: any): Buffer; - fromXDR(input: Buffer, format?: "raw"): any; + fromXDR(input: Buffer, format?: 'raw'): any; - fromXDR(input: string, format: "hex" | "base64"): any; + fromXDR(input: string, format: 'hex' | 'base64'): any; - validateXDR(input: Buffer, format?: "raw"): boolean; + validateXDR(input: Buffer, format?: 'raw'): boolean; - validateXDR(input: string, format: "hex" | "base64"): boolean; + validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementType { readonly name: - | "scpStPrepare" - | "scpStConfirm" - | "scpStExternalize" - | "scpStNominate"; + | 'scpStPrepare' + | 'scpStConfirm' + | 'scpStExternalize' + | 'scpStNominate'; readonly value: 0 | 1 | 2 | 3; @@ -260,10 +274,10 @@ export namespace xdr { class AssetType { readonly name: - | "assetTypeNative" - | "assetTypeCreditAlphanum4" - | "assetTypeCreditAlphanum12" - | "assetTypePoolShare"; + | 'assetTypeNative' + | 'assetTypeCreditAlphanum4' + | 'assetTypeCreditAlphanum12' + | 'assetTypePoolShare'; readonly value: 0 | 1 | 2 | 3; @@ -278,10 +292,10 @@ export namespace xdr { class ThresholdIndices { readonly name: - | "thresholdMasterWeight" - | "thresholdLow" - | "thresholdMed" - | "thresholdHigh"; + | 'thresholdMasterWeight' + | 'thresholdLow' + | 'thresholdMed' + | 'thresholdHigh'; readonly value: 0 | 1 | 2 | 3; @@ -296,17 +310,18 @@ export namespace xdr { class LedgerEntryType { readonly name: - | "account" - | "trustline" - | "offer" - | "data" - | "claimableBalance" - | "liquidityPool" - | "contractData" - | "contractCode" - | "configSetting"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + | 'account' + | 'trustline' + | 'offer' + | 'data' + | 'claimableBalance' + | 'liquidityPool' + | 'contractData' + | 'contractCode' + | 'configSetting' + | 'expiration'; + + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; static account(): LedgerEntryType; @@ -325,14 +340,16 @@ export namespace xdr { static contractCode(): LedgerEntryType; static configSetting(): LedgerEntryType; + + static expiration(): LedgerEntryType; } class AccountFlags { readonly name: - | "authRequiredFlag" - | "authRevocableFlag" - | "authImmutableFlag" - | "authClawbackEnabledFlag"; + | 'authRequiredFlag' + | 'authRevocableFlag' + | 'authImmutableFlag' + | 'authClawbackEnabledFlag'; readonly value: 1 | 2 | 4 | 8; @@ -347,9 +364,9 @@ export namespace xdr { class TrustLineFlags { readonly name: - | "authorizedFlag" - | "authorizedToMaintainLiabilitiesFlag" - | "trustlineClawbackEnabledFlag"; + | 'authorizedFlag' + | 'authorizedToMaintainLiabilitiesFlag' + | 'trustlineClawbackEnabledFlag'; readonly value: 1 | 2 | 4; @@ -361,7 +378,7 @@ export namespace xdr { } class LiquidityPoolType { - readonly name: "liquidityPoolConstantProduct"; + readonly name: 'liquidityPoolConstantProduct'; readonly value: 0; @@ -369,7 +386,7 @@ export namespace xdr { } class OfferEntryFlags { - readonly name: "passiveFlag"; + readonly name: 'passiveFlag'; readonly value: 1; @@ -378,12 +395,12 @@ export namespace xdr { class ClaimPredicateType { readonly name: - | "claimPredicateUnconditional" - | "claimPredicateAnd" - | "claimPredicateOr" - | "claimPredicateNot" - | "claimPredicateBeforeAbsoluteTime" - | "claimPredicateBeforeRelativeTime"; + | 'claimPredicateUnconditional' + | 'claimPredicateAnd' + | 'claimPredicateOr' + | 'claimPredicateNot' + | 'claimPredicateBeforeAbsoluteTime' + | 'claimPredicateBeforeRelativeTime'; readonly value: 0 | 1 | 2 | 3 | 4 | 5; @@ -401,7 +418,7 @@ export namespace xdr { } class ClaimantType { - readonly name: "claimantTypeV0"; + readonly name: 'claimantTypeV0'; readonly value: 0; @@ -409,7 +426,7 @@ export namespace xdr { } class ClaimableBalanceIdType { - readonly name: "claimableBalanceIdTypeV0"; + readonly name: 'claimableBalanceIdTypeV0'; readonly value: 0; @@ -417,58 +434,37 @@ export namespace xdr { } class ClaimableBalanceFlags { - readonly name: "claimableBalanceClawbackEnabledFlag"; + readonly name: 'claimableBalanceClawbackEnabledFlag'; readonly value: 1; static claimableBalanceClawbackEnabledFlag(): ClaimableBalanceFlags; } - class ConfigSettingId { - readonly name: - | "configSettingContractMaxSizeBytes" - | "configSettingContractComputeV0" - | "configSettingContractLedgerCostV0" - | "configSettingContractHistoricalDataV0" - | "configSettingContractMetaDataV0" - | "configSettingContractBandwidthV0" - | "configSettingContractHostLogicVersion"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6; - - static configSettingContractMaxSizeBytes(): ConfigSettingId; - - static configSettingContractComputeV0(): ConfigSettingId; - - static configSettingContractLedgerCostV0(): ConfigSettingId; - - static configSettingContractHistoricalDataV0(): ConfigSettingId; + class ContractDataDurability { + readonly name: 'temporary' | 'persistent'; - static configSettingContractMetaDataV0(): ConfigSettingId; + readonly value: 0 | 1; - static configSettingContractBandwidthV0(): ConfigSettingId; + static temporary(): ContractDataDurability; - static configSettingContractHostLogicVersion(): ConfigSettingId; + static persistent(): ContractDataDurability; } class EnvelopeType { readonly name: - | "envelopeTypeTxV0" - | "envelopeTypeScp" - | "envelopeTypeTx" - | "envelopeTypeAuth" - | "envelopeTypeScpvalue" - | "envelopeTypeTxFeeBump" - | "envelopeTypeOpId" - | "envelopeTypePoolRevokeOpId" - | "envelopeTypeContractIdFromEd25519" - | "envelopeTypeContractIdFromContract" - | "envelopeTypeContractIdFromAsset" - | "envelopeTypeContractIdFromSourceAccount" - | "envelopeTypeCreateContractArgs" - | "envelopeTypeContractAuth"; + | 'envelopeTypeTxV0' + | 'envelopeTypeScp' + | 'envelopeTypeTx' + | 'envelopeTypeAuth' + | 'envelopeTypeScpvalue' + | 'envelopeTypeTxFeeBump' + | 'envelopeTypeOpId' + | 'envelopeTypePoolRevokeOpId' + | 'envelopeTypeContractId' + | 'envelopeTypeSorobanAuthorization'; - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; static envelopeTypeTxV0(): EnvelopeType; @@ -486,21 +482,13 @@ export namespace xdr { static envelopeTypePoolRevokeOpId(): EnvelopeType; - static envelopeTypeContractIdFromEd25519(): EnvelopeType; - - static envelopeTypeContractIdFromContract(): EnvelopeType; + static envelopeTypeContractId(): EnvelopeType; - static envelopeTypeContractIdFromAsset(): EnvelopeType; - - static envelopeTypeContractIdFromSourceAccount(): EnvelopeType; - - static envelopeTypeCreateContractArgs(): EnvelopeType; - - static envelopeTypeContractAuth(): EnvelopeType; + static envelopeTypeSorobanAuthorization(): EnvelopeType; } class StellarValueType { - readonly name: "stellarValueBasic" | "stellarValueSigned"; + readonly name: 'stellarValueBasic' | 'stellarValueSigned'; readonly value: 0 | 1; @@ -511,41 +499,30 @@ export namespace xdr { class LedgerHeaderFlags { readonly name: - | "disableLiquidityPoolTradingFlag" - | "disableLiquidityPoolDepositFlag" - | "disableLiquidityPoolWithdrawalFlag" - | "disableContractCreate" - | "disableContractUpdate" - | "disableContractRemove" - | "disableContractInvoke"; + | 'disableLiquidityPoolTradingFlag' + | 'disableLiquidityPoolDepositFlag' + | 'disableLiquidityPoolWithdrawalFlag'; - readonly value: 1 | 2 | 4 | 8 | 16 | 32 | 64; + readonly value: 1 | 2 | 4; static disableLiquidityPoolTradingFlag(): LedgerHeaderFlags; static disableLiquidityPoolDepositFlag(): LedgerHeaderFlags; static disableLiquidityPoolWithdrawalFlag(): LedgerHeaderFlags; - - static disableContractCreate(): LedgerHeaderFlags; - - static disableContractUpdate(): LedgerHeaderFlags; - - static disableContractRemove(): LedgerHeaderFlags; - - static disableContractInvoke(): LedgerHeaderFlags; } class LedgerUpgradeType { readonly name: - | "ledgerUpgradeVersion" - | "ledgerUpgradeBaseFee" - | "ledgerUpgradeMaxTxSetSize" - | "ledgerUpgradeBaseReserve" - | "ledgerUpgradeFlags" - | "ledgerUpgradeConfig"; + | 'ledgerUpgradeVersion' + | 'ledgerUpgradeBaseFee' + | 'ledgerUpgradeMaxTxSetSize' + | 'ledgerUpgradeBaseReserve' + | 'ledgerUpgradeFlags' + | 'ledgerUpgradeConfig' + | 'ledgerUpgradeMaxSorobanTxSetSize'; - readonly value: 1 | 2 | 3 | 4 | 5 | 6; + readonly value: 1 | 2 | 3 | 4 | 5 | 6 | 7; static ledgerUpgradeVersion(): LedgerUpgradeType; @@ -558,10 +535,12 @@ export namespace xdr { static ledgerUpgradeFlags(): LedgerUpgradeType; static ledgerUpgradeConfig(): LedgerUpgradeType; + + static ledgerUpgradeMaxSorobanTxSetSize(): LedgerUpgradeType; } class BucketEntryType { - readonly name: "metaentry" | "liveentry" | "deadentry" | "initentry"; + readonly name: 'metaentry' | 'liveentry' | 'deadentry' | 'initentry'; readonly value: -1 | 0 | 1 | 2; @@ -575,7 +554,7 @@ export namespace xdr { } class TxSetComponentType { - readonly name: "txsetCompTxsMaybeDiscountedFee"; + readonly name: 'txsetCompTxsMaybeDiscountedFee'; readonly value: 0; @@ -584,10 +563,10 @@ export namespace xdr { class LedgerEntryChangeType { readonly name: - | "ledgerEntryCreated" - | "ledgerEntryUpdated" - | "ledgerEntryRemoved" - | "ledgerEntryState"; + | 'ledgerEntryCreated' + | 'ledgerEntryUpdated' + | 'ledgerEntryRemoved' + | 'ledgerEntryState'; readonly value: 0 | 1 | 2 | 3; @@ -601,7 +580,7 @@ export namespace xdr { } class ContractEventType { - readonly name: "system" | "contract" | "diagnostic"; + readonly name: 'system' | 'contract' | 'diagnostic'; readonly value: 0 | 1 | 2; @@ -613,7 +592,7 @@ export namespace xdr { } class ErrorCode { - readonly name: "errMisc" | "errData" | "errConf" | "errAuth" | "errLoad"; + readonly name: 'errMisc' | 'errData' | 'errConf' | 'errAuth' | 'errLoad'; readonly value: 0 | 1 | 2 | 3 | 4; @@ -629,7 +608,7 @@ export namespace xdr { } class IpAddrType { - readonly name: "iPv4" | "iPv6"; + readonly name: 'iPv4' | 'iPv6'; readonly value: 0 | 1; @@ -640,25 +619,26 @@ export namespace xdr { class MessageType { readonly name: - | "errorMsg" - | "auth" - | "dontHave" - | "getPeers" - | "peers" - | "getTxSet" - | "txSet" - | "generalizedTxSet" - | "transaction" - | "getScpQuorumset" - | "scpQuorumset" - | "scpMessage" - | "getScpState" - | "hello" - | "surveyRequest" - | "surveyResponse" - | "sendMore" - | "floodAdvert" - | "floodDemand"; + | 'errorMsg' + | 'auth' + | 'dontHave' + | 'getPeers' + | 'peers' + | 'getTxSet' + | 'txSet' + | 'generalizedTxSet' + | 'transaction' + | 'getScpQuorumset' + | 'scpQuorumset' + | 'scpMessage' + | 'getScpState' + | 'hello' + | 'surveyRequest' + | 'surveyResponse' + | 'sendMore' + | 'sendMoreExtended' + | 'floodAdvert' + | 'floodDemand'; readonly value: | 0 @@ -678,6 +658,7 @@ export namespace xdr { | 14 | 15 | 16 + | 20 | 18 | 19; @@ -715,13 +696,15 @@ export namespace xdr { static sendMore(): MessageType; + static sendMoreExtended(): MessageType; + static floodAdvert(): MessageType; static floodDemand(): MessageType; } class SurveyMessageCommandType { - readonly name: "surveyTopology"; + readonly name: 'surveyTopology'; readonly value: 0; @@ -729,7 +712,7 @@ export namespace xdr { } class SurveyMessageResponseType { - readonly name: "surveyTopologyResponseV0" | "surveyTopologyResponseV1"; + readonly name: 'surveyTopologyResponseV0' | 'surveyTopologyResponseV1'; readonly value: 0 | 1; @@ -740,31 +723,33 @@ export namespace xdr { class OperationType { readonly name: - | "createAccount" - | "payment" - | "pathPaymentStrictReceive" - | "manageSellOffer" - | "createPassiveSellOffer" - | "setOptions" - | "changeTrust" - | "allowTrust" - | "accountMerge" - | "inflation" - | "manageData" - | "bumpSequence" - | "manageBuyOffer" - | "pathPaymentStrictSend" - | "createClaimableBalance" - | "claimClaimableBalance" - | "beginSponsoringFutureReserves" - | "endSponsoringFutureReserves" - | "revokeSponsorship" - | "clawback" - | "clawbackClaimableBalance" - | "setTrustLineFlags" - | "liquidityPoolDeposit" - | "liquidityPoolWithdraw" - | "invokeHostFunction"; + | 'createAccount' + | 'payment' + | 'pathPaymentStrictReceive' + | 'manageSellOffer' + | 'createPassiveSellOffer' + | 'setOptions' + | 'changeTrust' + | 'allowTrust' + | 'accountMerge' + | 'inflation' + | 'manageData' + | 'bumpSequence' + | 'manageBuyOffer' + | 'pathPaymentStrictSend' + | 'createClaimableBalance' + | 'claimClaimableBalance' + | 'beginSponsoringFutureReserves' + | 'endSponsoringFutureReserves' + | 'revokeSponsorship' + | 'clawback' + | 'clawbackClaimableBalance' + | 'setTrustLineFlags' + | 'liquidityPoolDeposit' + | 'liquidityPoolWithdraw' + | 'invokeHostFunction' + | 'bumpFootprintExpiration' + | 'restoreFootprint'; readonly value: | 0 @@ -791,7 +776,9 @@ export namespace xdr { | 21 | 22 | 23 - | 24; + | 24 + | 25 + | 26; static createAccount(): OperationType; @@ -842,10 +829,14 @@ export namespace xdr { static liquidityPoolWithdraw(): OperationType; static invokeHostFunction(): OperationType; + + static bumpFootprintExpiration(): OperationType; + + static restoreFootprint(): OperationType; } class RevokeSponsorshipType { - readonly name: "revokeSponsorshipLedgerEntry" | "revokeSponsorshipSigner"; + readonly name: 'revokeSponsorshipLedgerEntry' | 'revokeSponsorshipSigner'; readonly value: 0 | 1; @@ -856,9 +847,9 @@ export namespace xdr { class HostFunctionType { readonly name: - | "hostFunctionTypeInvokeContract" - | "hostFunctionTypeCreateContract" - | "hostFunctionTypeInstallContractCode"; + | 'hostFunctionTypeInvokeContract' + | 'hostFunctionTypeCreateContract' + | 'hostFunctionTypeUploadContractWasm'; readonly value: 0 | 1 | 2; @@ -866,43 +857,52 @@ export namespace xdr { static hostFunctionTypeCreateContract(): HostFunctionType; - static hostFunctionTypeInstallContractCode(): HostFunctionType; + static hostFunctionTypeUploadContractWasm(): HostFunctionType; } - class ContractIdType { + class ContractIdPreimageType { readonly name: - | "contractIdFromSourceAccount" - | "contractIdFromEd25519PublicKey" - | "contractIdFromAsset"; + | 'contractIdPreimageFromAddress' + | 'contractIdPreimageFromAsset'; - readonly value: 0 | 1 | 2; + readonly value: 0 | 1; + + static contractIdPreimageFromAddress(): ContractIdPreimageType; - static contractIdFromSourceAccount(): ContractIdType; + static contractIdPreimageFromAsset(): ContractIdPreimageType; + } + + class SorobanAuthorizedFunctionType { + readonly name: + | 'sorobanAuthorizedFunctionTypeContractFn' + | 'sorobanAuthorizedFunctionTypeCreateContractHostFn'; + + readonly value: 0 | 1; - static contractIdFromEd25519PublicKey(): ContractIdType; + static sorobanAuthorizedFunctionTypeContractFn(): SorobanAuthorizedFunctionType; - static contractIdFromAsset(): ContractIdType; + static sorobanAuthorizedFunctionTypeCreateContractHostFn(): SorobanAuthorizedFunctionType; } - class ContractIdPublicKeyType { + class SorobanCredentialsType { readonly name: - | "contractIdPublicKeySourceAccount" - | "contractIdPublicKeyEd25519"; + | 'sorobanCredentialsSourceAccount' + | 'sorobanCredentialsAddress'; readonly value: 0 | 1; - static contractIdPublicKeySourceAccount(): ContractIdPublicKeyType; + static sorobanCredentialsSourceAccount(): SorobanCredentialsType; - static contractIdPublicKeyEd25519(): ContractIdPublicKeyType; + static sorobanCredentialsAddress(): SorobanCredentialsType; } class MemoType { readonly name: - | "memoNone" - | "memoText" - | "memoId" - | "memoHash" - | "memoReturn"; + | 'memoNone' + | 'memoText' + | 'memoId' + | 'memoHash' + | 'memoReturn'; readonly value: 0 | 1 | 2 | 3 | 4; @@ -918,7 +918,7 @@ export namespace xdr { } class PreconditionType { - readonly name: "precondNone" | "precondTime" | "precondV2"; + readonly name: 'precondNone' | 'precondTime' | 'precondV2'; readonly value: 0 | 1 | 2; @@ -931,9 +931,9 @@ export namespace xdr { class ClaimAtomType { readonly name: - | "claimAtomTypeV0" - | "claimAtomTypeOrderBook" - | "claimAtomTypeLiquidityPool"; + | 'claimAtomTypeV0' + | 'claimAtomTypeOrderBook' + | 'claimAtomTypeLiquidityPool'; readonly value: 0 | 1 | 2; @@ -946,11 +946,11 @@ export namespace xdr { class CreateAccountResultCode { readonly name: - | "createAccountSuccess" - | "createAccountMalformed" - | "createAccountUnderfunded" - | "createAccountLowReserve" - | "createAccountAlreadyExist"; + | 'createAccountSuccess' + | 'createAccountMalformed' + | 'createAccountUnderfunded' + | 'createAccountLowReserve' + | 'createAccountAlreadyExist'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -967,16 +967,16 @@ export namespace xdr { class PaymentResultCode { readonly name: - | "paymentSuccess" - | "paymentMalformed" - | "paymentUnderfunded" - | "paymentSrcNoTrust" - | "paymentSrcNotAuthorized" - | "paymentNoDestination" - | "paymentNoTrust" - | "paymentNotAuthorized" - | "paymentLineFull" - | "paymentNoIssuer"; + | 'paymentSuccess' + | 'paymentMalformed' + | 'paymentUnderfunded' + | 'paymentSrcNoTrust' + | 'paymentSrcNotAuthorized' + | 'paymentNoDestination' + | 'paymentNoTrust' + | 'paymentNotAuthorized' + | 'paymentLineFull' + | 'paymentNoIssuer'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9; @@ -1003,19 +1003,19 @@ export namespace xdr { class PathPaymentStrictReceiveResultCode { readonly name: - | "pathPaymentStrictReceiveSuccess" - | "pathPaymentStrictReceiveMalformed" - | "pathPaymentStrictReceiveUnderfunded" - | "pathPaymentStrictReceiveSrcNoTrust" - | "pathPaymentStrictReceiveSrcNotAuthorized" - | "pathPaymentStrictReceiveNoDestination" - | "pathPaymentStrictReceiveNoTrust" - | "pathPaymentStrictReceiveNotAuthorized" - | "pathPaymentStrictReceiveLineFull" - | "pathPaymentStrictReceiveNoIssuer" - | "pathPaymentStrictReceiveTooFewOffers" - | "pathPaymentStrictReceiveOfferCrossSelf" - | "pathPaymentStrictReceiveOverSendmax"; + | 'pathPaymentStrictReceiveSuccess' + | 'pathPaymentStrictReceiveMalformed' + | 'pathPaymentStrictReceiveUnderfunded' + | 'pathPaymentStrictReceiveSrcNoTrust' + | 'pathPaymentStrictReceiveSrcNotAuthorized' + | 'pathPaymentStrictReceiveNoDestination' + | 'pathPaymentStrictReceiveNoTrust' + | 'pathPaymentStrictReceiveNotAuthorized' + | 'pathPaymentStrictReceiveLineFull' + | 'pathPaymentStrictReceiveNoIssuer' + | 'pathPaymentStrictReceiveTooFewOffers' + | 'pathPaymentStrictReceiveOfferCrossSelf' + | 'pathPaymentStrictReceiveOverSendmax'; readonly value: | 0 @@ -1061,19 +1061,19 @@ export namespace xdr { class PathPaymentStrictSendResultCode { readonly name: - | "pathPaymentStrictSendSuccess" - | "pathPaymentStrictSendMalformed" - | "pathPaymentStrictSendUnderfunded" - | "pathPaymentStrictSendSrcNoTrust" - | "pathPaymentStrictSendSrcNotAuthorized" - | "pathPaymentStrictSendNoDestination" - | "pathPaymentStrictSendNoTrust" - | "pathPaymentStrictSendNotAuthorized" - | "pathPaymentStrictSendLineFull" - | "pathPaymentStrictSendNoIssuer" - | "pathPaymentStrictSendTooFewOffers" - | "pathPaymentStrictSendOfferCrossSelf" - | "pathPaymentStrictSendUnderDestmin"; + | 'pathPaymentStrictSendSuccess' + | 'pathPaymentStrictSendMalformed' + | 'pathPaymentStrictSendUnderfunded' + | 'pathPaymentStrictSendSrcNoTrust' + | 'pathPaymentStrictSendSrcNotAuthorized' + | 'pathPaymentStrictSendNoDestination' + | 'pathPaymentStrictSendNoTrust' + | 'pathPaymentStrictSendNotAuthorized' + | 'pathPaymentStrictSendLineFull' + | 'pathPaymentStrictSendNoIssuer' + | 'pathPaymentStrictSendTooFewOffers' + | 'pathPaymentStrictSendOfferCrossSelf' + | 'pathPaymentStrictSendUnderDestmin'; readonly value: | 0 @@ -1119,19 +1119,19 @@ export namespace xdr { class ManageSellOfferResultCode { readonly name: - | "manageSellOfferSuccess" - | "manageSellOfferMalformed" - | "manageSellOfferSellNoTrust" - | "manageSellOfferBuyNoTrust" - | "manageSellOfferSellNotAuthorized" - | "manageSellOfferBuyNotAuthorized" - | "manageSellOfferLineFull" - | "manageSellOfferUnderfunded" - | "manageSellOfferCrossSelf" - | "manageSellOfferSellNoIssuer" - | "manageSellOfferBuyNoIssuer" - | "manageSellOfferNotFound" - | "manageSellOfferLowReserve"; + | 'manageSellOfferSuccess' + | 'manageSellOfferMalformed' + | 'manageSellOfferSellNoTrust' + | 'manageSellOfferBuyNoTrust' + | 'manageSellOfferSellNotAuthorized' + | 'manageSellOfferBuyNotAuthorized' + | 'manageSellOfferLineFull' + | 'manageSellOfferUnderfunded' + | 'manageSellOfferCrossSelf' + | 'manageSellOfferSellNoIssuer' + | 'manageSellOfferBuyNoIssuer' + | 'manageSellOfferNotFound' + | 'manageSellOfferLowReserve'; readonly value: | 0 @@ -1177,9 +1177,9 @@ export namespace xdr { class ManageOfferEffect { readonly name: - | "manageOfferCreated" - | "manageOfferUpdated" - | "manageOfferDeleted"; + | 'manageOfferCreated' + | 'manageOfferUpdated' + | 'manageOfferDeleted'; readonly value: 0 | 1 | 2; @@ -1192,19 +1192,19 @@ export namespace xdr { class ManageBuyOfferResultCode { readonly name: - | "manageBuyOfferSuccess" - | "manageBuyOfferMalformed" - | "manageBuyOfferSellNoTrust" - | "manageBuyOfferBuyNoTrust" - | "manageBuyOfferSellNotAuthorized" - | "manageBuyOfferBuyNotAuthorized" - | "manageBuyOfferLineFull" - | "manageBuyOfferUnderfunded" - | "manageBuyOfferCrossSelf" - | "manageBuyOfferSellNoIssuer" - | "manageBuyOfferBuyNoIssuer" - | "manageBuyOfferNotFound" - | "manageBuyOfferLowReserve"; + | 'manageBuyOfferSuccess' + | 'manageBuyOfferMalformed' + | 'manageBuyOfferSellNoTrust' + | 'manageBuyOfferBuyNoTrust' + | 'manageBuyOfferSellNotAuthorized' + | 'manageBuyOfferBuyNotAuthorized' + | 'manageBuyOfferLineFull' + | 'manageBuyOfferUnderfunded' + | 'manageBuyOfferCrossSelf' + | 'manageBuyOfferSellNoIssuer' + | 'manageBuyOfferBuyNoIssuer' + | 'manageBuyOfferNotFound' + | 'manageBuyOfferLowReserve'; readonly value: | 0 @@ -1250,17 +1250,17 @@ export namespace xdr { class SetOptionsResultCode { readonly name: - | "setOptionsSuccess" - | "setOptionsLowReserve" - | "setOptionsTooManySigners" - | "setOptionsBadFlags" - | "setOptionsInvalidInflation" - | "setOptionsCantChange" - | "setOptionsUnknownFlag" - | "setOptionsThresholdOutOfRange" - | "setOptionsBadSigner" - | "setOptionsInvalidHomeDomain" - | "setOptionsAuthRevocableRequired"; + | 'setOptionsSuccess' + | 'setOptionsLowReserve' + | 'setOptionsTooManySigners' + | 'setOptionsBadFlags' + | 'setOptionsInvalidInflation' + | 'setOptionsCantChange' + | 'setOptionsUnknownFlag' + | 'setOptionsThresholdOutOfRange' + | 'setOptionsBadSigner' + | 'setOptionsInvalidHomeDomain' + | 'setOptionsAuthRevocableRequired'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8 | -9 | -10; @@ -1289,15 +1289,15 @@ export namespace xdr { class ChangeTrustResultCode { readonly name: - | "changeTrustSuccess" - | "changeTrustMalformed" - | "changeTrustNoIssuer" - | "changeTrustInvalidLimit" - | "changeTrustLowReserve" - | "changeTrustSelfNotAllowed" - | "changeTrustTrustLineMissing" - | "changeTrustCannotDelete" - | "changeTrustNotAuthMaintainLiabilities"; + | 'changeTrustSuccess' + | 'changeTrustMalformed' + | 'changeTrustNoIssuer' + | 'changeTrustInvalidLimit' + | 'changeTrustLowReserve' + | 'changeTrustSelfNotAllowed' + | 'changeTrustTrustLineMissing' + | 'changeTrustCannotDelete' + | 'changeTrustNotAuthMaintainLiabilities'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7 | -8; @@ -1322,13 +1322,13 @@ export namespace xdr { class AllowTrustResultCode { readonly name: - | "allowTrustSuccess" - | "allowTrustMalformed" - | "allowTrustNoTrustLine" - | "allowTrustTrustNotRequired" - | "allowTrustCantRevoke" - | "allowTrustSelfNotAllowed" - | "allowTrustLowReserve"; + | 'allowTrustSuccess' + | 'allowTrustMalformed' + | 'allowTrustNoTrustLine' + | 'allowTrustTrustNotRequired' + | 'allowTrustCantRevoke' + | 'allowTrustSelfNotAllowed' + | 'allowTrustLowReserve'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6; @@ -1349,14 +1349,14 @@ export namespace xdr { class AccountMergeResultCode { readonly name: - | "accountMergeSuccess" - | "accountMergeMalformed" - | "accountMergeNoAccount" - | "accountMergeImmutableSet" - | "accountMergeHasSubEntries" - | "accountMergeSeqnumTooFar" - | "accountMergeDestFull" - | "accountMergeIsSponsor"; + | 'accountMergeSuccess' + | 'accountMergeMalformed' + | 'accountMergeNoAccount' + | 'accountMergeImmutableSet' + | 'accountMergeHasSubEntries' + | 'accountMergeSeqnumTooFar' + | 'accountMergeDestFull' + | 'accountMergeIsSponsor'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7; @@ -1378,7 +1378,7 @@ export namespace xdr { } class InflationResultCode { - readonly name: "inflationSuccess" | "inflationNotTime"; + readonly name: 'inflationSuccess' | 'inflationNotTime'; readonly value: 0 | -1; @@ -1389,11 +1389,11 @@ export namespace xdr { class ManageDataResultCode { readonly name: - | "manageDataSuccess" - | "manageDataNotSupportedYet" - | "manageDataNameNotFound" - | "manageDataLowReserve" - | "manageDataInvalidName"; + | 'manageDataSuccess' + | 'manageDataNotSupportedYet' + | 'manageDataNameNotFound' + | 'manageDataLowReserve' + | 'manageDataInvalidName'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -1409,7 +1409,7 @@ export namespace xdr { } class BumpSequenceResultCode { - readonly name: "bumpSequenceSuccess" | "bumpSequenceBadSeq"; + readonly name: 'bumpSequenceSuccess' | 'bumpSequenceBadSeq'; readonly value: 0 | -1; @@ -1420,12 +1420,12 @@ export namespace xdr { class CreateClaimableBalanceResultCode { readonly name: - | "createClaimableBalanceSuccess" - | "createClaimableBalanceMalformed" - | "createClaimableBalanceLowReserve" - | "createClaimableBalanceNoTrust" - | "createClaimableBalanceNotAuthorized" - | "createClaimableBalanceUnderfunded"; + | 'createClaimableBalanceSuccess' + | 'createClaimableBalanceMalformed' + | 'createClaimableBalanceLowReserve' + | 'createClaimableBalanceNoTrust' + | 'createClaimableBalanceNotAuthorized' + | 'createClaimableBalanceUnderfunded'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1444,12 +1444,12 @@ export namespace xdr { class ClaimClaimableBalanceResultCode { readonly name: - | "claimClaimableBalanceSuccess" - | "claimClaimableBalanceDoesNotExist" - | "claimClaimableBalanceCannotClaim" - | "claimClaimableBalanceLineFull" - | "claimClaimableBalanceNoTrust" - | "claimClaimableBalanceNotAuthorized"; + | 'claimClaimableBalanceSuccess' + | 'claimClaimableBalanceDoesNotExist' + | 'claimClaimableBalanceCannotClaim' + | 'claimClaimableBalanceLineFull' + | 'claimClaimableBalanceNoTrust' + | 'claimClaimableBalanceNotAuthorized'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1468,10 +1468,10 @@ export namespace xdr { class BeginSponsoringFutureReservesResultCode { readonly name: - | "beginSponsoringFutureReservesSuccess" - | "beginSponsoringFutureReservesMalformed" - | "beginSponsoringFutureReservesAlreadySponsored" - | "beginSponsoringFutureReservesRecursive"; + | 'beginSponsoringFutureReservesSuccess' + | 'beginSponsoringFutureReservesMalformed' + | 'beginSponsoringFutureReservesAlreadySponsored' + | 'beginSponsoringFutureReservesRecursive'; readonly value: 0 | -1 | -2 | -3; @@ -1486,8 +1486,8 @@ export namespace xdr { class EndSponsoringFutureReservesResultCode { readonly name: - | "endSponsoringFutureReservesSuccess" - | "endSponsoringFutureReservesNotSponsored"; + | 'endSponsoringFutureReservesSuccess' + | 'endSponsoringFutureReservesNotSponsored'; readonly value: 0 | -1; @@ -1498,12 +1498,12 @@ export namespace xdr { class RevokeSponsorshipResultCode { readonly name: - | "revokeSponsorshipSuccess" - | "revokeSponsorshipDoesNotExist" - | "revokeSponsorshipNotSponsor" - | "revokeSponsorshipLowReserve" - | "revokeSponsorshipOnlyTransferable" - | "revokeSponsorshipMalformed"; + | 'revokeSponsorshipSuccess' + | 'revokeSponsorshipDoesNotExist' + | 'revokeSponsorshipNotSponsor' + | 'revokeSponsorshipLowReserve' + | 'revokeSponsorshipOnlyTransferable' + | 'revokeSponsorshipMalformed'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1522,11 +1522,11 @@ export namespace xdr { class ClawbackResultCode { readonly name: - | "clawbackSuccess" - | "clawbackMalformed" - | "clawbackNotClawbackEnabled" - | "clawbackNoTrust" - | "clawbackUnderfunded"; + | 'clawbackSuccess' + | 'clawbackMalformed' + | 'clawbackNotClawbackEnabled' + | 'clawbackNoTrust' + | 'clawbackUnderfunded'; readonly value: 0 | -1 | -2 | -3 | -4; @@ -1543,10 +1543,10 @@ export namespace xdr { class ClawbackClaimableBalanceResultCode { readonly name: - | "clawbackClaimableBalanceSuccess" - | "clawbackClaimableBalanceDoesNotExist" - | "clawbackClaimableBalanceNotIssuer" - | "clawbackClaimableBalanceNotClawbackEnabled"; + | 'clawbackClaimableBalanceSuccess' + | 'clawbackClaimableBalanceDoesNotExist' + | 'clawbackClaimableBalanceNotIssuer' + | 'clawbackClaimableBalanceNotClawbackEnabled'; readonly value: 0 | -1 | -2 | -3; @@ -1561,12 +1561,12 @@ export namespace xdr { class SetTrustLineFlagsResultCode { readonly name: - | "setTrustLineFlagsSuccess" - | "setTrustLineFlagsMalformed" - | "setTrustLineFlagsNoTrustLine" - | "setTrustLineFlagsCantRevoke" - | "setTrustLineFlagsInvalidState" - | "setTrustLineFlagsLowReserve"; + | 'setTrustLineFlagsSuccess' + | 'setTrustLineFlagsMalformed' + | 'setTrustLineFlagsNoTrustLine' + | 'setTrustLineFlagsCantRevoke' + | 'setTrustLineFlagsInvalidState' + | 'setTrustLineFlagsLowReserve'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1585,14 +1585,14 @@ export namespace xdr { class LiquidityPoolDepositResultCode { readonly name: - | "liquidityPoolDepositSuccess" - | "liquidityPoolDepositMalformed" - | "liquidityPoolDepositNoTrust" - | "liquidityPoolDepositNotAuthorized" - | "liquidityPoolDepositUnderfunded" - | "liquidityPoolDepositLineFull" - | "liquidityPoolDepositBadPrice" - | "liquidityPoolDepositPoolFull"; + | 'liquidityPoolDepositSuccess' + | 'liquidityPoolDepositMalformed' + | 'liquidityPoolDepositNoTrust' + | 'liquidityPoolDepositNotAuthorized' + | 'liquidityPoolDepositUnderfunded' + | 'liquidityPoolDepositLineFull' + | 'liquidityPoolDepositBadPrice' + | 'liquidityPoolDepositPoolFull'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6 | -7; @@ -1615,12 +1615,12 @@ export namespace xdr { class LiquidityPoolWithdrawResultCode { readonly name: - | "liquidityPoolWithdrawSuccess" - | "liquidityPoolWithdrawMalformed" - | "liquidityPoolWithdrawNoTrust" - | "liquidityPoolWithdrawUnderfunded" - | "liquidityPoolWithdrawLineFull" - | "liquidityPoolWithdrawUnderMinimum"; + | 'liquidityPoolWithdrawSuccess' + | 'liquidityPoolWithdrawMalformed' + | 'liquidityPoolWithdrawNoTrust' + | 'liquidityPoolWithdrawUnderfunded' + | 'liquidityPoolWithdrawLineFull' + | 'liquidityPoolWithdrawUnderMinimum'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1639,28 +1639,73 @@ export namespace xdr { class InvokeHostFunctionResultCode { readonly name: - | "invokeHostFunctionSuccess" - | "invokeHostFunctionMalformed" - | "invokeHostFunctionTrapped"; + | 'invokeHostFunctionSuccess' + | 'invokeHostFunctionMalformed' + | 'invokeHostFunctionTrapped' + | 'invokeHostFunctionResourceLimitExceeded' + | 'invokeHostFunctionEntryExpired' + | 'invokeHostFunctionInsufficientRefundableFee'; - readonly value: 0 | -1 | -2; + readonly value: 0 | -1 | -2 | -3 | -4 | -5; static invokeHostFunctionSuccess(): InvokeHostFunctionResultCode; static invokeHostFunctionMalformed(): InvokeHostFunctionResultCode; static invokeHostFunctionTrapped(): InvokeHostFunctionResultCode; + + static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResultCode; + + static invokeHostFunctionEntryExpired(): InvokeHostFunctionResultCode; + + static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResultCode; + } + + class BumpFootprintExpirationResultCode { + readonly name: + | 'bumpFootprintExpirationSuccess' + | 'bumpFootprintExpirationMalformed' + | 'bumpFootprintExpirationResourceLimitExceeded' + | 'bumpFootprintExpirationInsufficientRefundableFee'; + + readonly value: 0 | -1 | -2 | -3; + + static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResultCode; + } + + class RestoreFootprintResultCode { + readonly name: + | 'restoreFootprintSuccess' + | 'restoreFootprintMalformed' + | 'restoreFootprintResourceLimitExceeded' + | 'restoreFootprintInsufficientRefundableFee'; + + readonly value: 0 | -1 | -2 | -3; + + static restoreFootprintSuccess(): RestoreFootprintResultCode; + + static restoreFootprintMalformed(): RestoreFootprintResultCode; + + static restoreFootprintResourceLimitExceeded(): RestoreFootprintResultCode; + + static restoreFootprintInsufficientRefundableFee(): RestoreFootprintResultCode; } class OperationResultCode { readonly name: - | "opInner" - | "opBadAuth" - | "opNoAccount" - | "opNotSupported" - | "opTooManySubentries" - | "opExceededWorkLimit" - | "opTooManySponsoring"; + | 'opInner' + | 'opBadAuth' + | 'opNoAccount' + | 'opNotSupported' + | 'opTooManySubentries' + | 'opExceededWorkLimit' + | 'opTooManySponsoring'; readonly value: 0 | -1 | -2 | -3 | -4 | -5 | -6; @@ -1681,24 +1726,25 @@ export namespace xdr { class TransactionResultCode { readonly name: - | "txFeeBumpInnerSuccess" - | "txSuccess" - | "txFailed" - | "txTooEarly" - | "txTooLate" - | "txMissingOperation" - | "txBadSeq" - | "txBadAuth" - | "txInsufficientBalance" - | "txNoAccount" - | "txInsufficientFee" - | "txBadAuthExtra" - | "txInternalError" - | "txNotSupported" - | "txFeeBumpInnerFailed" - | "txBadSponsorship" - | "txBadMinSeqAgeOrGap" - | "txMalformed"; + | 'txFeeBumpInnerSuccess' + | 'txSuccess' + | 'txFailed' + | 'txTooEarly' + | 'txTooLate' + | 'txMissingOperation' + | 'txBadSeq' + | 'txBadAuth' + | 'txInsufficientBalance' + | 'txNoAccount' + | 'txInsufficientFee' + | 'txBadAuthExtra' + | 'txInternalError' + | 'txNotSupported' + | 'txFeeBumpInnerFailed' + | 'txBadSponsorship' + | 'txBadMinSeqAgeOrGap' + | 'txMalformed' + | 'txSorobanInvalid'; readonly value: | 1 @@ -1718,7 +1764,8 @@ export namespace xdr { | -13 | -14 | -15 - | -16; + | -16 + | -17; static txFeeBumpInnerSuccess(): TransactionResultCode; @@ -1755,15 +1802,17 @@ export namespace xdr { static txBadMinSeqAgeOrGap(): TransactionResultCode; static txMalformed(): TransactionResultCode; + + static txSorobanInvalid(): TransactionResultCode; } class CryptoKeyType { readonly name: - | "keyTypeEd25519" - | "keyTypePreAuthTx" - | "keyTypeHashX" - | "keyTypeEd25519SignedPayload" - | "keyTypeMuxedEd25519"; + | 'keyTypeEd25519' + | 'keyTypePreAuthTx' + | 'keyTypeHashX' + | 'keyTypeEd25519SignedPayload' + | 'keyTypeMuxedEd25519'; readonly value: 0 | 1 | 2 | 3 | 256; @@ -1779,7 +1828,7 @@ export namespace xdr { } class PublicKeyType { - readonly name: "publicKeyTypeEd25519"; + readonly name: 'publicKeyTypeEd25519'; readonly value: 0; @@ -1788,10 +1837,10 @@ export namespace xdr { class SignerKeyType { readonly name: - | "signerKeyTypeEd25519" - | "signerKeyTypePreAuthTx" - | "signerKeyTypeHashX" - | "signerKeyTypeEd25519SignedPayload"; + | 'signerKeyTypeEd25519' + | 'signerKeyTypePreAuthTx' + | 'signerKeyTypeHashX' + | 'signerKeyTypeEd25519SignedPayload'; readonly value: 0 | 1 | 2 | 3; @@ -1806,28 +1855,28 @@ export namespace xdr { class ScValType { readonly name: - | "scvBool" - | "scvVoid" - | "scvStatus" - | "scvU32" - | "scvI32" - | "scvU64" - | "scvI64" - | "scvTimepoint" - | "scvDuration" - | "scvU128" - | "scvI128" - | "scvU256" - | "scvI256" - | "scvBytes" - | "scvString" - | "scvSymbol" - | "scvVec" - | "scvMap" - | "scvContractExecutable" - | "scvAddress" - | "scvLedgerKeyContractExecutable" - | "scvLedgerKeyNonce"; + | 'scvBool' + | 'scvVoid' + | 'scvError' + | 'scvU32' + | 'scvI32' + | 'scvU64' + | 'scvI64' + | 'scvTimepoint' + | 'scvDuration' + | 'scvU128' + | 'scvI128' + | 'scvU256' + | 'scvI256' + | 'scvBytes' + | 'scvString' + | 'scvSymbol' + | 'scvVec' + | 'scvMap' + | 'scvAddress' + | 'scvContractInstance' + | 'scvLedgerKeyContractInstance' + | 'scvLedgerKeyNonce'; readonly value: | 0 @@ -1857,7 +1906,7 @@ export namespace xdr { static scvVoid(): ScValType; - static scvStatus(): ScValType; + static scvError(): ScValType; static scvU32(): ScValType; @@ -1889,214 +1938,150 @@ export namespace xdr { static scvMap(): ScValType; - static scvContractExecutable(): ScValType; - static scvAddress(): ScValType; - static scvLedgerKeyContractExecutable(): ScValType; + static scvContractInstance(): ScValType; + + static scvLedgerKeyContractInstance(): ScValType; static scvLedgerKeyNonce(): ScValType; } - class ScStatusType { + class ScErrorType { readonly name: - | "sstOk" - | "sstUnknownError" - | "sstHostValueError" - | "sstHostObjectError" - | "sstHostFunctionError" - | "sstHostStorageError" - | "sstHostContextError" - | "sstVmError" - | "sstContractError" - | "sstHostAuthError"; + | 'sceContract' + | 'sceWasmVm' + | 'sceContext' + | 'sceStorage' + | 'sceObject' + | 'sceCrypto' + | 'sceEvents' + | 'sceBudget' + | 'sceValue' + | 'sceAuth'; readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; - static sstOk(): ScStatusType; + static sceContract(): ScErrorType; - static sstUnknownError(): ScStatusType; + static sceWasmVm(): ScErrorType; - static sstHostValueError(): ScStatusType; + static sceContext(): ScErrorType; - static sstHostObjectError(): ScStatusType; + static sceStorage(): ScErrorType; - static sstHostFunctionError(): ScStatusType; + static sceObject(): ScErrorType; - static sstHostStorageError(): ScStatusType; + static sceCrypto(): ScErrorType; - static sstHostContextError(): ScStatusType; + static sceEvents(): ScErrorType; - static sstVmError(): ScStatusType; + static sceBudget(): ScErrorType; - static sstContractError(): ScStatusType; + static sceValue(): ScErrorType; - static sstHostAuthError(): ScStatusType; + static sceAuth(): ScErrorType; } - class ScHostValErrorCode { + class ScErrorCode { readonly name: - | "hostValueUnknownError" - | "hostValueReservedTagValue" - | "hostValueUnexpectedValType" - | "hostValueU63OutOfRange" - | "hostValueU32OutOfRange" - | "hostValueStaticUnknown" - | "hostValueMissingObject" - | "hostValueSymbolTooLong" - | "hostValueSymbolBadChar" - | "hostValueSymbolContainsNonUtf8" - | "hostValueBitsetTooManyBits" - | "hostValueStatusUnknown"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11; - - static hostValueUnknownError(): ScHostValErrorCode; - - static hostValueReservedTagValue(): ScHostValErrorCode; - - static hostValueUnexpectedValType(): ScHostValErrorCode; - - static hostValueU63OutOfRange(): ScHostValErrorCode; - - static hostValueU32OutOfRange(): ScHostValErrorCode; - - static hostValueStaticUnknown(): ScHostValErrorCode; - - static hostValueMissingObject(): ScHostValErrorCode; - - static hostValueSymbolTooLong(): ScHostValErrorCode; - - static hostValueSymbolBadChar(): ScHostValErrorCode; + | 'scecArithDomain' + | 'scecIndexBounds' + | 'scecInvalidInput' + | 'scecMissingValue' + | 'scecExistingValue' + | 'scecExceededLimit' + | 'scecInvalidAction' + | 'scecInternalError' + | 'scecUnexpectedType' + | 'scecUnexpectedSize'; - static hostValueSymbolContainsNonUtf8(): ScHostValErrorCode; - - static hostValueBitsetTooManyBits(): ScHostValErrorCode; + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; - static hostValueStatusUnknown(): ScHostValErrorCode; - } + static scecArithDomain(): ScErrorCode; - class ScHostObjErrorCode { - readonly name: - | "hostObjectUnknownError" - | "hostObjectUnknownReference" - | "hostObjectUnexpectedType" - | "hostObjectObjectCountExceedsU32Max" - | "hostObjectObjectNotExist" - | "hostObjectVecIndexOutOfBound" - | "hostObjectContractHashWrongLength"; + static scecIndexBounds(): ScErrorCode; - readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6; + static scecInvalidInput(): ScErrorCode; - static hostObjectUnknownError(): ScHostObjErrorCode; + static scecMissingValue(): ScErrorCode; - static hostObjectUnknownReference(): ScHostObjErrorCode; + static scecExistingValue(): ScErrorCode; - static hostObjectUnexpectedType(): ScHostObjErrorCode; + static scecExceededLimit(): ScErrorCode; - static hostObjectObjectCountExceedsU32Max(): ScHostObjErrorCode; + static scecInvalidAction(): ScErrorCode; - static hostObjectObjectNotExist(): ScHostObjErrorCode; + static scecInternalError(): ScErrorCode; - static hostObjectVecIndexOutOfBound(): ScHostObjErrorCode; + static scecUnexpectedType(): ScErrorCode; - static hostObjectContractHashWrongLength(): ScHostObjErrorCode; + static scecUnexpectedSize(): ScErrorCode; } - class ScHostFnErrorCode { - readonly name: - | "hostFnUnknownError" - | "hostFnUnexpectedHostFunctionAction" - | "hostFnInputArgsWrongLength" - | "hostFnInputArgsWrongType" - | "hostFnInputArgsInvalid"; - - readonly value: 0 | 1 | 2 | 3 | 4; - - static hostFnUnknownError(): ScHostFnErrorCode; + class ContractExecutableType { + readonly name: 'contractExecutableWasm' | 'contractExecutableToken'; - static hostFnUnexpectedHostFunctionAction(): ScHostFnErrorCode; - - static hostFnInputArgsWrongLength(): ScHostFnErrorCode; + readonly value: 0 | 1; - static hostFnInputArgsWrongType(): ScHostFnErrorCode; + static contractExecutableWasm(): ContractExecutableType; - static hostFnInputArgsInvalid(): ScHostFnErrorCode; + static contractExecutableToken(): ContractExecutableType; } - class ScHostStorageErrorCode { - readonly name: - | "hostStorageUnknownError" - | "hostStorageExpectContractData" - | "hostStorageReadwriteAccessToReadonlyEntry" - | "hostStorageAccessToUnknownEntry" - | "hostStorageMissingKeyInGet" - | "hostStorageGetOnDeletedKey"; - - readonly value: 0 | 1 | 2 | 3 | 4 | 5; - - static hostStorageUnknownError(): ScHostStorageErrorCode; - - static hostStorageExpectContractData(): ScHostStorageErrorCode; - - static hostStorageReadwriteAccessToReadonlyEntry(): ScHostStorageErrorCode; + class ScAddressType { + readonly name: 'scAddressTypeAccount' | 'scAddressTypeContract'; - static hostStorageAccessToUnknownEntry(): ScHostStorageErrorCode; + readonly value: 0 | 1; - static hostStorageMissingKeyInGet(): ScHostStorageErrorCode; + static scAddressTypeAccount(): ScAddressType; - static hostStorageGetOnDeletedKey(): ScHostStorageErrorCode; + static scAddressTypeContract(): ScAddressType; } - class ScHostAuthErrorCode { - readonly name: - | "hostAuthUnknownError" - | "hostAuthNonceError" - | "hostAuthDuplicateAuthorization" - | "hostAuthNotAuthorized"; - - readonly value: 0 | 1 | 2 | 3; - - static hostAuthUnknownError(): ScHostAuthErrorCode; - - static hostAuthNonceError(): ScHostAuthErrorCode; + class ScEnvMetaKind { + readonly name: 'scEnvMetaKindInterfaceVersion'; - static hostAuthDuplicateAuthorization(): ScHostAuthErrorCode; + readonly value: 0; - static hostAuthNotAuthorized(): ScHostAuthErrorCode; + static scEnvMetaKindInterfaceVersion(): ScEnvMetaKind; } - class ScHostContextErrorCode { - readonly name: "hostContextUnknownError" | "hostContextNoContractRunning"; + class ScMetaKind { + readonly name: 'scMetaV0'; - readonly value: 0 | 1; - - static hostContextUnknownError(): ScHostContextErrorCode; + readonly value: 0; - static hostContextNoContractRunning(): ScHostContextErrorCode; + static scMetaV0(): ScMetaKind; } - class ScVmErrorCode { + class ScSpecType { readonly name: - | "vmUnknown" - | "vmValidation" - | "vmInstantiation" - | "vmFunction" - | "vmTable" - | "vmMemory" - | "vmGlobal" - | "vmValue" - | "vmTrapUnreachable" - | "vmTrapMemoryAccessOutOfBounds" - | "vmTrapTableAccessOutOfBounds" - | "vmTrapElemUninitialized" - | "vmTrapDivisionByZero" - | "vmTrapIntegerOverflow" - | "vmTrapInvalidConversionToInt" - | "vmTrapStackOverflow" - | "vmTrapUnexpectedSignature" - | "vmTrapMemLimitExceeded" - | "vmTrapCpuLimitExceeded"; + | 'scSpecTypeVal' + | 'scSpecTypeBool' + | 'scSpecTypeVoid' + | 'scSpecTypeError' + | 'scSpecTypeU32' + | 'scSpecTypeI32' + | 'scSpecTypeU64' + | 'scSpecTypeI64' + | 'scSpecTypeTimepoint' + | 'scSpecTypeDuration' + | 'scSpecTypeU128' + | 'scSpecTypeI128' + | 'scSpecTypeU256' + | 'scSpecTypeI256' + | 'scSpecTypeBytes' + | 'scSpecTypeString' + | 'scSpecTypeSymbol' + | 'scSpecTypeAddress' + | 'scSpecTypeOption' + | 'scSpecTypeResult' + | 'scSpecTypeVec' + | 'scSpecTypeMap' + | 'scSpecTypeTuple' + | 'scSpecTypeBytesN' + | 'scSpecTypeUdt'; readonly value: | 0 @@ -2114,116 +2099,129 @@ export namespace xdr { | 12 | 13 | 14 - | 15 | 16 | 17 - | 18; + | 19 + | 1000 + | 1001 + | 1002 + | 1004 + | 1005 + | 1006 + | 2000; + + static scSpecTypeVal(): ScSpecType; + + static scSpecTypeBool(): ScSpecType; - static vmUnknown(): ScVmErrorCode; + static scSpecTypeVoid(): ScSpecType; - static vmValidation(): ScVmErrorCode; + static scSpecTypeError(): ScSpecType; - static vmInstantiation(): ScVmErrorCode; + static scSpecTypeU32(): ScSpecType; - static vmFunction(): ScVmErrorCode; + static scSpecTypeI32(): ScSpecType; - static vmTable(): ScVmErrorCode; + static scSpecTypeU64(): ScSpecType; - static vmMemory(): ScVmErrorCode; + static scSpecTypeI64(): ScSpecType; - static vmGlobal(): ScVmErrorCode; + static scSpecTypeTimepoint(): ScSpecType; - static vmValue(): ScVmErrorCode; + static scSpecTypeDuration(): ScSpecType; - static vmTrapUnreachable(): ScVmErrorCode; + static scSpecTypeU128(): ScSpecType; - static vmTrapMemoryAccessOutOfBounds(): ScVmErrorCode; + static scSpecTypeI128(): ScSpecType; - static vmTrapTableAccessOutOfBounds(): ScVmErrorCode; + static scSpecTypeU256(): ScSpecType; - static vmTrapElemUninitialized(): ScVmErrorCode; + static scSpecTypeI256(): ScSpecType; - static vmTrapDivisionByZero(): ScVmErrorCode; + static scSpecTypeBytes(): ScSpecType; - static vmTrapIntegerOverflow(): ScVmErrorCode; + static scSpecTypeString(): ScSpecType; - static vmTrapInvalidConversionToInt(): ScVmErrorCode; + static scSpecTypeSymbol(): ScSpecType; - static vmTrapStackOverflow(): ScVmErrorCode; + static scSpecTypeAddress(): ScSpecType; - static vmTrapUnexpectedSignature(): ScVmErrorCode; + static scSpecTypeOption(): ScSpecType; - static vmTrapMemLimitExceeded(): ScVmErrorCode; + static scSpecTypeResult(): ScSpecType; - static vmTrapCpuLimitExceeded(): ScVmErrorCode; - } + static scSpecTypeVec(): ScSpecType; - class ScUnknownErrorCode { - readonly name: "unknownErrorGeneral" | "unknownErrorXdr"; + static scSpecTypeMap(): ScSpecType; - readonly value: 0 | 1; + static scSpecTypeTuple(): ScSpecType; - static unknownErrorGeneral(): ScUnknownErrorCode; + static scSpecTypeBytesN(): ScSpecType; - static unknownErrorXdr(): ScUnknownErrorCode; + static scSpecTypeUdt(): ScSpecType; } - class ScContractExecutableType { - readonly name: "sccontractExecutableWasmRef" | "sccontractExecutableToken"; + class ScSpecUdtUnionCaseV0Kind { + readonly name: 'scSpecUdtUnionCaseVoidV0' | 'scSpecUdtUnionCaseTupleV0'; readonly value: 0 | 1; - static sccontractExecutableWasmRef(): ScContractExecutableType; + static scSpecUdtUnionCaseVoidV0(): ScSpecUdtUnionCaseV0Kind; - static sccontractExecutableToken(): ScContractExecutableType; + static scSpecUdtUnionCaseTupleV0(): ScSpecUdtUnionCaseV0Kind; } - class ScAddressType { - readonly name: "scAddressTypeAccount" | "scAddressTypeContract"; + class ScSpecEntryKind { + readonly name: + | 'scSpecEntryFunctionV0' + | 'scSpecEntryUdtStructV0' + | 'scSpecEntryUdtUnionV0' + | 'scSpecEntryUdtEnumV0' + | 'scSpecEntryUdtErrorEnumV0'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2 | 3 | 4; - static scAddressTypeAccount(): ScAddressType; + static scSpecEntryFunctionV0(): ScSpecEntryKind; - static scAddressTypeContract(): ScAddressType; - } + static scSpecEntryUdtStructV0(): ScSpecEntryKind; - class ScEnvMetaKind { - readonly name: "scEnvMetaKindInterfaceVersion"; + static scSpecEntryUdtUnionV0(): ScSpecEntryKind; - readonly value: 0; + static scSpecEntryUdtEnumV0(): ScSpecEntryKind; - static scEnvMetaKindInterfaceVersion(): ScEnvMetaKind; + static scSpecEntryUdtErrorEnumV0(): ScSpecEntryKind; } - class ScSpecType { + class ContractCostType { readonly name: - | "scSpecTypeVal" - | "scSpecTypeBool" - | "scSpecTypeVoid" - | "scSpecTypeStatus" - | "scSpecTypeU32" - | "scSpecTypeI32" - | "scSpecTypeU64" - | "scSpecTypeI64" - | "scSpecTypeTimepoint" - | "scSpecTypeDuration" - | "scSpecTypeU128" - | "scSpecTypeI128" - | "scSpecTypeU256" - | "scSpecTypeI256" - | "scSpecTypeBytes" - | "scSpecTypeString" - | "scSpecTypeSymbol" - | "scSpecTypeAddress" - | "scSpecTypeOption" - | "scSpecTypeResult" - | "scSpecTypeVec" - | "scSpecTypeSet" - | "scSpecTypeMap" - | "scSpecTypeTuple" - | "scSpecTypeBytesN" - | "scSpecTypeUdt"; + | 'wasmInsnExec' + | 'wasmMemAlloc' + | 'hostMemAlloc' + | 'hostMemCpy' + | 'hostMemCmp' + | 'dispatchHostFunction' + | 'visitObject' + | 'valSer' + | 'valDeser' + | 'computeSha256Hash' + | 'computeEd25519PubKey' + | 'mapEntry' + | 'vecEntry' + | 'verifyEd25519Sig' + | 'vmMemRead' + | 'vmMemWrite' + | 'vmInstantiation' + | 'vmCachedInstantiation' + | 'invokeVmFunction' + | 'computeKeccak256Hash' + | 'computeEcdsaSecp256k1Key' + | 'computeEcdsaSecp256k1Sig' + | 'recoverEcdsaSecp256k1Key' + | 'int256AddSub' + | 'int256Mul' + | 'int256Div' + | 'int256Pow' + | 'int256Shift'; readonly value: | 0 @@ -2241,100 +2239,123 @@ export namespace xdr { | 12 | 13 | 14 + | 15 | 16 | 17 + | 18 | 19 - | 1000 - | 1001 - | 1002 - | 1003 - | 1004 - | 1005 - | 1006 - | 2000; + | 20 + | 21 + | 22 + | 23 + | 24 + | 25 + | 26 + | 27; - static scSpecTypeVal(): ScSpecType; + static wasmInsnExec(): ContractCostType; - static scSpecTypeBool(): ScSpecType; + static wasmMemAlloc(): ContractCostType; - static scSpecTypeVoid(): ScSpecType; + static hostMemAlloc(): ContractCostType; - static scSpecTypeStatus(): ScSpecType; + static hostMemCpy(): ContractCostType; - static scSpecTypeU32(): ScSpecType; + static hostMemCmp(): ContractCostType; - static scSpecTypeI32(): ScSpecType; + static dispatchHostFunction(): ContractCostType; - static scSpecTypeU64(): ScSpecType; + static visitObject(): ContractCostType; - static scSpecTypeI64(): ScSpecType; + static valSer(): ContractCostType; - static scSpecTypeTimepoint(): ScSpecType; + static valDeser(): ContractCostType; - static scSpecTypeDuration(): ScSpecType; + static computeSha256Hash(): ContractCostType; - static scSpecTypeU128(): ScSpecType; + static computeEd25519PubKey(): ContractCostType; - static scSpecTypeI128(): ScSpecType; + static mapEntry(): ContractCostType; - static scSpecTypeU256(): ScSpecType; + static vecEntry(): ContractCostType; - static scSpecTypeI256(): ScSpecType; + static verifyEd25519Sig(): ContractCostType; - static scSpecTypeBytes(): ScSpecType; + static vmMemRead(): ContractCostType; - static scSpecTypeString(): ScSpecType; + static vmMemWrite(): ContractCostType; - static scSpecTypeSymbol(): ScSpecType; + static vmInstantiation(): ContractCostType; - static scSpecTypeAddress(): ScSpecType; + static vmCachedInstantiation(): ContractCostType; - static scSpecTypeOption(): ScSpecType; + static invokeVmFunction(): ContractCostType; - static scSpecTypeResult(): ScSpecType; + static computeKeccak256Hash(): ContractCostType; - static scSpecTypeVec(): ScSpecType; + static computeEcdsaSecp256k1Key(): ContractCostType; - static scSpecTypeSet(): ScSpecType; + static computeEcdsaSecp256k1Sig(): ContractCostType; - static scSpecTypeMap(): ScSpecType; + static recoverEcdsaSecp256k1Key(): ContractCostType; - static scSpecTypeTuple(): ScSpecType; + static int256AddSub(): ContractCostType; - static scSpecTypeBytesN(): ScSpecType; + static int256Mul(): ContractCostType; - static scSpecTypeUdt(): ScSpecType; + static int256Div(): ContractCostType; + + static int256Pow(): ContractCostType; + + static int256Shift(): ContractCostType; } - class ScSpecUdtUnionCaseV0Kind { - readonly name: "scSpecUdtUnionCaseVoidV0" | "scSpecUdtUnionCaseTupleV0"; + class ConfigSettingId { + readonly name: + | 'configSettingContractMaxSizeBytes' + | 'configSettingContractComputeV0' + | 'configSettingContractLedgerCostV0' + | 'configSettingContractHistoricalDataV0' + | 'configSettingContractEventsV0' + | 'configSettingContractBandwidthV0' + | 'configSettingContractCostParamsCpuInstructions' + | 'configSettingContractCostParamsMemoryBytes' + | 'configSettingContractDataKeySizeBytes' + | 'configSettingContractDataEntrySizeBytes' + | 'configSettingStateExpiration' + | 'configSettingContractExecutionLanes' + | 'configSettingBucketlistSizeWindow' + | 'configSettingEvictionIterator'; - readonly value: 0 | 1; + readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; - static scSpecUdtUnionCaseVoidV0(): ScSpecUdtUnionCaseV0Kind; + static configSettingContractMaxSizeBytes(): ConfigSettingId; - static scSpecUdtUnionCaseTupleV0(): ScSpecUdtUnionCaseV0Kind; - } + static configSettingContractComputeV0(): ConfigSettingId; - class ScSpecEntryKind { - readonly name: - | "scSpecEntryFunctionV0" - | "scSpecEntryUdtStructV0" - | "scSpecEntryUdtUnionV0" - | "scSpecEntryUdtEnumV0" - | "scSpecEntryUdtErrorEnumV0"; + static configSettingContractLedgerCostV0(): ConfigSettingId; - readonly value: 0 | 1 | 2 | 3 | 4; + static configSettingContractHistoricalDataV0(): ConfigSettingId; - static scSpecEntryFunctionV0(): ScSpecEntryKind; + static configSettingContractEventsV0(): ConfigSettingId; - static scSpecEntryUdtStructV0(): ScSpecEntryKind; + static configSettingContractBandwidthV0(): ConfigSettingId; - static scSpecEntryUdtUnionV0(): ScSpecEntryKind; + static configSettingContractCostParamsCpuInstructions(): ConfigSettingId; - static scSpecEntryUdtEnumV0(): ScSpecEntryKind; + static configSettingContractCostParamsMemoryBytes(): ConfigSettingId; - static scSpecEntryUdtErrorEnumV0(): ScSpecEntryKind; + static configSettingContractDataKeySizeBytes(): ConfigSettingId; + + static configSettingContractDataEntrySizeBytes(): ConfigSettingId; + + static configSettingStateExpiration(): ConfigSettingId; + + static configSettingContractExecutionLanes(): ConfigSettingId; + + static configSettingBucketlistSizeWindow(): ConfigSettingId; + + static configSettingEvictionIterator(): ConfigSettingId; } const Value: VarOpaque; @@ -2349,8 +2370,6 @@ export namespace xdr { const DataValue: VarOpaque; - type Hash = Opaque[]; - type PoolId = Hash; const AssetCode4: Opaque; @@ -2405,6 +2424,8 @@ export namespace xdr { const ScSymbol: XDRString; + const ContractCostParams: XDRArray; + class ScpBallot { constructor(attributes: { counter: number; value: Buffer }); @@ -2412,9 +2433,9 @@ export namespace xdr { value(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpBallot; @@ -2424,13 +2445,13 @@ export namespace xdr { static toXDR(value: ScpBallot): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpBallot; + static fromXDR(input: Buffer, format?: 'raw'): ScpBallot; - static fromXDR(input: string, format: "hex" | "base64"): ScpBallot; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpBallot; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpNomination { @@ -2446,9 +2467,9 @@ export namespace xdr { accepted(value?: Buffer[]): Buffer[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpNomination; @@ -2458,13 +2479,13 @@ export namespace xdr { static toXDR(value: ScpNomination): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpNomination; + static fromXDR(input: Buffer, format?: 'raw'): ScpNomination; - static fromXDR(input: string, format: "hex" | "base64"): ScpNomination; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpNomination; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementPrepare { @@ -2489,9 +2510,9 @@ export namespace xdr { nH(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpStatementPrepare; @@ -2501,16 +2522,16 @@ export namespace xdr { static toXDR(value: ScpStatementPrepare): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementPrepare; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementPrepare; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScpStatementPrepare; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementConfirm { @@ -2532,9 +2553,9 @@ export namespace xdr { quorumSetHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpStatementConfirm; @@ -2544,16 +2565,16 @@ export namespace xdr { static toXDR(value: ScpStatementConfirm): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementConfirm; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementConfirm; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScpStatementConfirm; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementExternalize { @@ -2569,9 +2590,9 @@ export namespace xdr { commitQuorumSetHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpStatementExternalize; @@ -2581,16 +2602,16 @@ export namespace xdr { static toXDR(value: ScpStatementExternalize): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementExternalize; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementExternalize; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScpStatementExternalize; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatement { @@ -2606,9 +2627,9 @@ export namespace xdr { pledges(value?: ScpStatementPledges): ScpStatementPledges; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpStatement; @@ -2618,13 +2639,13 @@ export namespace xdr { static toXDR(value: ScpStatement): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatement; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatement; - static fromXDR(input: string, format: "hex" | "base64"): ScpStatement; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpStatement; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpEnvelope { @@ -2634,9 +2655,9 @@ export namespace xdr { signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpEnvelope; @@ -2646,13 +2667,13 @@ export namespace xdr { static toXDR(value: ScpEnvelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpEnvelope; + static fromXDR(input: Buffer, format?: 'raw'): ScpEnvelope; - static fromXDR(input: string, format: "hex" | "base64"): ScpEnvelope; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpEnvelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpQuorumSet { @@ -2668,9 +2689,9 @@ export namespace xdr { innerSets(value?: ScpQuorumSet[]): ScpQuorumSet[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpQuorumSet; @@ -2680,13 +2701,13 @@ export namespace xdr { static toXDR(value: ScpQuorumSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpQuorumSet; + static fromXDR(input: Buffer, format?: 'raw'): ScpQuorumSet; - static fromXDR(input: string, format: "hex" | "base64"): ScpQuorumSet; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpQuorumSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AlphaNum4 { @@ -2696,9 +2717,9 @@ export namespace xdr { issuer(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AlphaNum4; @@ -2708,13 +2729,13 @@ export namespace xdr { static toXDR(value: AlphaNum4): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AlphaNum4; + static fromXDR(input: Buffer, format?: 'raw'): AlphaNum4; - static fromXDR(input: string, format: "hex" | "base64"): AlphaNum4; + static fromXDR(input: string, format: 'hex' | 'base64'): AlphaNum4; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AlphaNum12 { @@ -2724,9 +2745,9 @@ export namespace xdr { issuer(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AlphaNum12; @@ -2736,13 +2757,13 @@ export namespace xdr { static toXDR(value: AlphaNum12): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AlphaNum12; + static fromXDR(input: Buffer, format?: 'raw'): AlphaNum12; - static fromXDR(input: string, format: "hex" | "base64"): AlphaNum12; + static fromXDR(input: string, format: 'hex' | 'base64'): AlphaNum12; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Price { @@ -2752,9 +2773,9 @@ export namespace xdr { d(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Price; @@ -2764,13 +2785,13 @@ export namespace xdr { static toXDR(value: Price): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Price; + static fromXDR(input: Buffer, format?: 'raw'): Price; - static fromXDR(input: string, format: "hex" | "base64"): Price; + static fromXDR(input: string, format: 'hex' | 'base64'): Price; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Liabilities { @@ -2780,9 +2801,9 @@ export namespace xdr { selling(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Liabilities; @@ -2792,13 +2813,13 @@ export namespace xdr { static toXDR(value: Liabilities): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Liabilities; + static fromXDR(input: Buffer, format?: 'raw'): Liabilities; - static fromXDR(input: string, format: "hex" | "base64"): Liabilities; + static fromXDR(input: string, format: 'hex' | 'base64'): Liabilities; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Signer { @@ -2808,9 +2829,9 @@ export namespace xdr { weight(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Signer; @@ -2820,13 +2841,13 @@ export namespace xdr { static toXDR(value: Signer): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Signer; + static fromXDR(input: Buffer, format?: 'raw'): Signer; - static fromXDR(input: string, format: "hex" | "base64"): Signer; + static fromXDR(input: string, format: 'hex' | 'base64'): Signer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExtensionV3 { @@ -2842,9 +2863,9 @@ export namespace xdr { seqTime(value?: TimePoint): TimePoint; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExtensionV3; @@ -2854,16 +2875,16 @@ export namespace xdr { static toXDR(value: AccountEntryExtensionV3): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV3; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV3; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AccountEntryExtensionV3; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExtensionV2 { @@ -2879,14 +2900,14 @@ export namespace xdr { numSponsoring(value?: number): number; signerSponsoringIDs( - value?: SponsorshipDescriptor[] + value?: SponsorshipDescriptor[], ): SponsorshipDescriptor[]; ext(value?: AccountEntryExtensionV2Ext): AccountEntryExtensionV2Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExtensionV2; @@ -2896,16 +2917,16 @@ export namespace xdr { static toXDR(value: AccountEntryExtensionV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV2; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV2; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AccountEntryExtensionV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExtensionV1 { @@ -2918,9 +2939,9 @@ export namespace xdr { ext(value?: AccountEntryExtensionV1Ext): AccountEntryExtensionV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExtensionV1; @@ -2930,16 +2951,16 @@ export namespace xdr { static toXDR(value: AccountEntryExtensionV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV1; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AccountEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntry { @@ -2976,9 +2997,9 @@ export namespace xdr { ext(value?: AccountEntryExt): AccountEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntry; @@ -2988,13 +3009,13 @@ export namespace xdr { static toXDR(value: AccountEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntry; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntry; - static fromXDR(input: string, format: "hex" | "base64"): AccountEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): AccountEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntryExtensionV2 { @@ -3007,9 +3028,9 @@ export namespace xdr { ext(value?: TrustLineEntryExtensionV2Ext): TrustLineEntryExtensionV2Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntryExtensionV2; @@ -3019,16 +3040,16 @@ export namespace xdr { static toXDR(value: TrustLineEntryExtensionV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExtensionV2; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExtensionV2; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TrustLineEntryExtensionV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntryV1 { @@ -3041,9 +3062,9 @@ export namespace xdr { ext(value?: TrustLineEntryV1Ext): TrustLineEntryV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntryV1; @@ -3053,13 +3074,13 @@ export namespace xdr { static toXDR(value: TrustLineEntryV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryV1; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryV1; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntryV1; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntryV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntry { @@ -3084,9 +3105,9 @@ export namespace xdr { ext(value?: TrustLineEntryExt): TrustLineEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntry; @@ -3096,13 +3117,13 @@ export namespace xdr { static toXDR(value: TrustLineEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntry; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntry; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OfferEntry { @@ -3133,9 +3154,9 @@ export namespace xdr { ext(value?: OfferEntryExt): OfferEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OfferEntry; @@ -3145,13 +3166,13 @@ export namespace xdr { static toXDR(value: OfferEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OfferEntry; + static fromXDR(input: Buffer, format?: 'raw'): OfferEntry; - static fromXDR(input: string, format: "hex" | "base64"): OfferEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): OfferEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class DataEntry { @@ -3170,9 +3191,9 @@ export namespace xdr { ext(value?: DataEntryExt): DataEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): DataEntry; @@ -3182,13 +3203,13 @@ export namespace xdr { static toXDR(value: DataEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DataEntry; + static fromXDR(input: Buffer, format?: 'raw'): DataEntry; - static fromXDR(input: string, format: "hex" | "base64"): DataEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): DataEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimantV0 { @@ -3201,9 +3222,9 @@ export namespace xdr { predicate(value?: ClaimPredicate): ClaimPredicate; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimantV0; @@ -3213,13 +3234,13 @@ export namespace xdr { static toXDR(value: ClaimantV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimantV0; + static fromXDR(input: Buffer, format?: 'raw'): ClaimantV0; - static fromXDR(input: string, format: "hex" | "base64"): ClaimantV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimantV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimableBalanceEntryExtensionV1 { @@ -3229,14 +3250,14 @@ export namespace xdr { }); ext( - value?: ClaimableBalanceEntryExtensionV1Ext + value?: ClaimableBalanceEntryExtensionV1Ext, ): ClaimableBalanceEntryExtensionV1Ext; flags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimableBalanceEntryExtensionV1; @@ -3248,17 +3269,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): ClaimableBalanceEntryExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimableBalanceEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimableBalanceEntry { @@ -3280,9 +3301,9 @@ export namespace xdr { ext(value?: ClaimableBalanceEntryExt): ClaimableBalanceEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimableBalanceEntry; @@ -3292,16 +3313,16 @@ export namespace xdr { static toXDR(value: ClaimableBalanceEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceEntry; + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceEntry; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimableBalanceEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolConstantProductParameters { @@ -3313,15 +3334,15 @@ export namespace xdr { fee(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolConstantProductParameters; static write( value: LiquidityPoolConstantProductParameters, - io: Buffer + io: Buffer, ): void; static isValid(value: LiquidityPoolConstantProductParameters): boolean; @@ -3330,17 +3351,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): LiquidityPoolConstantProductParameters; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolConstantProductParameters; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolEntryConstantProduct { @@ -3353,7 +3374,7 @@ export namespace xdr { }); params( - value?: LiquidityPoolConstantProductParameters + value?: LiquidityPoolConstantProductParameters, ): LiquidityPoolConstantProductParameters; reserveA(value?: Int64): Int64; @@ -3364,9 +3385,9 @@ export namespace xdr { poolSharesTrustLineCount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolEntryConstantProduct; @@ -3378,17 +3399,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): LiquidityPoolEntryConstantProduct; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolEntryConstantProduct; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolEntry { @@ -3401,9 +3422,9 @@ export namespace xdr { body(value?: LiquidityPoolEntryBody): LiquidityPoolEntryBody; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolEntry; @@ -3413,27 +3434,37 @@ export namespace xdr { static toXDR(value: LiquidityPoolEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolEntry; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolEntry; - static fromXDR(input: string, format: "hex" | "base64"): LiquidityPoolEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): LiquidityPoolEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ContractDataEntry { - constructor(attributes: { contractId: Buffer; key: ScVal; val: ScVal }); + constructor(attributes: { + ext: ExtensionPoint; + contract: ScAddress; + key: ScVal; + durability: ContractDataDurability; + val: ScVal; + }); - contractId(value?: Buffer): Buffer; + ext(value?: ExtensionPoint): ExtensionPoint; + + contract(value?: ScAddress): ScAddress; key(value?: ScVal): ScVal; + durability(value?: ContractDataDurability): ContractDataDurability; + val(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ContractDataEntry; @@ -3443,13 +3474,13 @@ export namespace xdr { static toXDR(value: ContractDataEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractDataEntry; + static fromXDR(input: Buffer, format?: 'raw'): ContractDataEntry; - static fromXDR(input: string, format: "hex" | "base64"): ContractDataEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractDataEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ContractCodeEntry { @@ -3465,9 +3496,9 @@ export namespace xdr { code(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ContractCodeEntry; @@ -3477,247 +3508,41 @@ export namespace xdr { static toXDR(value: ContractCodeEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractCodeEntry; + static fromXDR(input: Buffer, format?: 'raw'): ContractCodeEntry; - static fromXDR(input: string, format: "hex" | "base64"): ContractCodeEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractCodeEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ConfigSettingContractComputeV0 { - constructor(attributes: { - ledgerMaxInstructions: Int64; - txMaxInstructions: Int64; - feeRatePerInstructionsIncrement: Int64; - memoryLimit: number; - }); + class ExpirationEntry { + constructor(attributes: { keyHash: Buffer; expirationLedgerSeq: number }); - ledgerMaxInstructions(value?: Int64): Int64; + keyHash(value?: Buffer): Buffer; - txMaxInstructions(value?: Int64): Int64; + expirationLedgerSeq(value?: number): number; - feeRatePerInstructionsIncrement(value?: Int64): Int64; + toXDR(format?: 'raw'): Buffer; - memoryLimit(value?: number): number; + toXDR(format: 'hex' | 'base64'): string; - toXDR(format?: "raw"): Buffer; + static read(io: Buffer): ExpirationEntry; - toXDR(format: "hex" | "base64"): string; + static write(value: ExpirationEntry, io: Buffer): void; - static read(io: Buffer): ConfigSettingContractComputeV0; + static isValid(value: ExpirationEntry): boolean; - static write(value: ConfigSettingContractComputeV0, io: Buffer): void; + static toXDR(value: ExpirationEntry): Buffer; - static isValid(value: ConfigSettingContractComputeV0): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ExpirationEntry; - static toXDR(value: ConfigSettingContractComputeV0): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): ExpirationEntry; - static fromXDR( - input: Buffer, - format?: "raw" - ): ConfigSettingContractComputeV0; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): ConfigSettingContractComputeV0; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ConfigSettingContractLedgerCostV0 { - constructor(attributes: { - ledgerMaxReadLedgerEntries: number; - ledgerMaxReadBytes: number; - ledgerMaxWriteLedgerEntries: number; - ledgerMaxWriteBytes: number; - txMaxReadLedgerEntries: number; - txMaxReadBytes: number; - txMaxWriteLedgerEntries: number; - txMaxWriteBytes: number; - feeReadLedgerEntry: Int64; - feeWriteLedgerEntry: Int64; - feeRead1Kb: Int64; - feeWrite1Kb: Int64; - bucketListSizeBytes: Int64; - bucketListFeeRateLow: Int64; - bucketListFeeRateHigh: Int64; - bucketListGrowthFactor: number; - }); - - ledgerMaxReadLedgerEntries(value?: number): number; - - ledgerMaxReadBytes(value?: number): number; - - ledgerMaxWriteLedgerEntries(value?: number): number; - - ledgerMaxWriteBytes(value?: number): number; - - txMaxReadLedgerEntries(value?: number): number; - - txMaxReadBytes(value?: number): number; - - txMaxWriteLedgerEntries(value?: number): number; - - txMaxWriteBytes(value?: number): number; - - feeReadLedgerEntry(value?: Int64): Int64; - - feeWriteLedgerEntry(value?: Int64): Int64; - - feeRead1Kb(value?: Int64): Int64; - - feeWrite1Kb(value?: Int64): Int64; - - bucketListSizeBytes(value?: Int64): Int64; - - bucketListFeeRateLow(value?: Int64): Int64; - - bucketListFeeRateHigh(value?: Int64): Int64; - - bucketListGrowthFactor(value?: number): number; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ConfigSettingContractLedgerCostV0; - - static write(value: ConfigSettingContractLedgerCostV0, io: Buffer): void; - - static isValid(value: ConfigSettingContractLedgerCostV0): boolean; - - static toXDR(value: ConfigSettingContractLedgerCostV0): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): ConfigSettingContractLedgerCostV0; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): ConfigSettingContractLedgerCostV0; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ConfigSettingContractHistoricalDataV0 { - constructor(attributes: { feeHistorical1Kb: Int64 }); - - feeHistorical1Kb(value?: Int64): Int64; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ConfigSettingContractHistoricalDataV0; - - static write( - value: ConfigSettingContractHistoricalDataV0, - io: Buffer - ): void; - - static isValid(value: ConfigSettingContractHistoricalDataV0): boolean; - - static toXDR(value: ConfigSettingContractHistoricalDataV0): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): ConfigSettingContractHistoricalDataV0; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): ConfigSettingContractHistoricalDataV0; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ConfigSettingContractMetaDataV0 { - constructor(attributes: { - txMaxExtendedMetaDataSizeBytes: number; - feeExtendedMetaData1Kb: Int64; - }); - - txMaxExtendedMetaDataSizeBytes(value?: number): number; - - feeExtendedMetaData1Kb(value?: Int64): Int64; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ConfigSettingContractMetaDataV0; - - static write(value: ConfigSettingContractMetaDataV0, io: Buffer): void; - - static isValid(value: ConfigSettingContractMetaDataV0): boolean; - - static toXDR(value: ConfigSettingContractMetaDataV0): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): ConfigSettingContractMetaDataV0; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): ConfigSettingContractMetaDataV0; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ConfigSettingContractBandwidthV0 { - constructor(attributes: { - ledgerMaxPropagateSizeBytes: number; - txMaxSizeBytes: number; - feePropagateData1Kb: Int64; - }); - - ledgerMaxPropagateSizeBytes(value?: number): number; - - txMaxSizeBytes(value?: number): number; - - feePropagateData1Kb(value?: Int64): Int64; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ConfigSettingContractBandwidthV0; - - static write(value: ConfigSettingContractBandwidthV0, io: Buffer): void; - - static isValid(value: ConfigSettingContractBandwidthV0): boolean; - - static toXDR(value: ConfigSettingContractBandwidthV0): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): ConfigSettingContractBandwidthV0; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ConfigSettingContractBandwidthV0; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntryExtensionV1 { @@ -3730,9 +3555,9 @@ export namespace xdr { ext(value?: LedgerEntryExtensionV1Ext): LedgerEntryExtensionV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntryExtensionV1; @@ -3742,16 +3567,16 @@ export namespace xdr { static toXDR(value: LedgerEntryExtensionV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExtensionV1; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerEntryExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntry { @@ -3767,9 +3592,9 @@ export namespace xdr { ext(value?: LedgerEntryExt): LedgerEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntry; @@ -3779,13 +3604,13 @@ export namespace xdr { static toXDR(value: LedgerEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntry; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntry; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyAccount { @@ -3793,9 +3618,9 @@ export namespace xdr { accountId(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyAccount; @@ -3805,13 +3630,13 @@ export namespace xdr { static toXDR(value: LedgerKeyAccount): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyAccount; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyAccount; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyAccount; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyAccount; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyTrustLine { @@ -3821,9 +3646,9 @@ export namespace xdr { asset(value?: TrustLineAsset): TrustLineAsset; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyTrustLine; @@ -3833,13 +3658,13 @@ export namespace xdr { static toXDR(value: LedgerKeyTrustLine): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyTrustLine; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyTrustLine; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyTrustLine; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyTrustLine; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyOffer { @@ -3849,9 +3674,9 @@ export namespace xdr { offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyOffer; @@ -3861,13 +3686,13 @@ export namespace xdr { static toXDR(value: LedgerKeyOffer): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyOffer; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyOffer; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyOffer; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyOffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyData { @@ -3880,9 +3705,9 @@ export namespace xdr { dataName(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyData; @@ -3892,13 +3717,13 @@ export namespace xdr { static toXDR(value: LedgerKeyData): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyData; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyData; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKeyData; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyData; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyClaimableBalance { @@ -3906,9 +3731,9 @@ export namespace xdr { balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyClaimableBalance; @@ -3918,16 +3743,16 @@ export namespace xdr { static toXDR(value: LedgerKeyClaimableBalance): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyClaimableBalance; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyClaimableBalance; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerKeyClaimableBalance; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyLiquidityPool { @@ -3935,9 +3760,9 @@ export namespace xdr { liquidityPoolId(value?: PoolId): PoolId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyLiquidityPool; @@ -3947,28 +3772,34 @@ export namespace xdr { static toXDR(value: LedgerKeyLiquidityPool): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyLiquidityPool; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyLiquidityPool; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerKeyLiquidityPool; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyContractData { - constructor(attributes: { contractId: Buffer; key: ScVal }); + constructor(attributes: { + contract: ScAddress; + key: ScVal; + durability: ContractDataDurability; + }); - contractId(value?: Buffer): Buffer; + contract(value?: ScAddress): ScAddress; key(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + durability(value?: ContractDataDurability): ContractDataDurability; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyContractData; @@ -3978,16 +3809,16 @@ export namespace xdr { static toXDR(value: LedgerKeyContractData): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyContractData; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyContractData; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerKeyContractData; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyContractCode { @@ -3995,9 +3826,9 @@ export namespace xdr { hash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyContractCode; @@ -4007,16 +3838,16 @@ export namespace xdr { static toXDR(value: LedgerKeyContractCode): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyContractCode; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyContractCode; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerKeyContractCode; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKeyConfigSetting { @@ -4024,9 +3855,9 @@ export namespace xdr { configSettingId(value?: ConfigSettingId): ConfigSettingId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKeyConfigSetting; @@ -4036,16 +3867,45 @@ export namespace xdr { static toXDR(value: LedgerKeyConfigSetting): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKeyConfigSetting; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyConfigSetting; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerKeyConfigSetting; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class LedgerKeyExpiration { + constructor(attributes: { keyHash: Buffer }); + + keyHash(value?: Buffer): Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerKeyExpiration; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static write(value: LedgerKeyExpiration, io: Buffer): void; + + static isValid(value: LedgerKeyExpiration): boolean; + + static toXDR(value: LedgerKeyExpiration): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyExpiration; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): LedgerKeyExpiration; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerCloseValueSignature { @@ -4055,9 +3915,9 @@ export namespace xdr { signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerCloseValueSignature; @@ -4067,16 +3927,16 @@ export namespace xdr { static toXDR(value: LedgerCloseValueSignature): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseValueSignature; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseValueSignature; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerCloseValueSignature; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class StellarValue { @@ -4095,9 +3955,9 @@ export namespace xdr { ext(value?: StellarValueExt): StellarValueExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): StellarValue; @@ -4107,13 +3967,13 @@ export namespace xdr { static toXDR(value: StellarValue): Buffer; - static fromXDR(input: Buffer, format?: "raw"): StellarValue; + static fromXDR(input: Buffer, format?: 'raw'): StellarValue; - static fromXDR(input: string, format: "hex" | "base64"): StellarValue; + static fromXDR(input: string, format: 'hex' | 'base64'): StellarValue; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeaderExtensionV1 { @@ -4123,9 +3983,9 @@ export namespace xdr { ext(value?: LedgerHeaderExtensionV1Ext): LedgerHeaderExtensionV1Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeaderExtensionV1; @@ -4135,16 +3995,16 @@ export namespace xdr { static toXDR(value: LedgerHeaderExtensionV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExtensionV1; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExtensionV1; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerHeaderExtensionV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeader { @@ -4196,9 +4056,9 @@ export namespace xdr { ext(value?: LedgerHeaderExt): LedgerHeaderExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeader; @@ -4208,13 +4068,13 @@ export namespace xdr { static toXDR(value: LedgerHeader): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeader; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeader; - static fromXDR(input: string, format: "hex" | "base64"): LedgerHeader; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerHeader; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ConfigUpgradeSetKey { @@ -4224,9 +4084,9 @@ export namespace xdr { contentHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ConfigUpgradeSetKey; @@ -4236,16 +4096,16 @@ export namespace xdr { static toXDR(value: ConfigUpgradeSetKey): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ConfigUpgradeSetKey; + static fromXDR(input: Buffer, format?: 'raw'): ConfigUpgradeSetKey; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ConfigUpgradeSetKey; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ConfigUpgradeSet { @@ -4253,9 +4113,9 @@ export namespace xdr { updatedEntry(value?: ConfigSettingEntry[]): ConfigSettingEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ConfigUpgradeSet; @@ -4265,13 +4125,13 @@ export namespace xdr { static toXDR(value: ConfigUpgradeSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ConfigUpgradeSet; + static fromXDR(input: Buffer, format?: 'raw'): ConfigUpgradeSet; - static fromXDR(input: string, format: "hex" | "base64"): ConfigUpgradeSet; + static fromXDR(input: string, format: 'hex' | 'base64'): ConfigUpgradeSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BucketMetadata { @@ -4281,9 +4141,9 @@ export namespace xdr { ext(value?: BucketMetadataExt): BucketMetadataExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BucketMetadata; @@ -4293,13 +4153,13 @@ export namespace xdr { static toXDR(value: BucketMetadata): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BucketMetadata; + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadata; - static fromXDR(input: string, format: "hex" | "base64"): BucketMetadata; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadata; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TxSetComponentTxsMaybeDiscountedFee { @@ -4312,9 +4172,9 @@ export namespace xdr { txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TxSetComponentTxsMaybeDiscountedFee; @@ -4326,17 +4186,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): TxSetComponentTxsMaybeDiscountedFee; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TxSetComponentTxsMaybeDiscountedFee; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionSet { @@ -4349,9 +4209,9 @@ export namespace xdr { txes(value?: TransactionEnvelope[]): TransactionEnvelope[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionSet; @@ -4361,13 +4221,13 @@ export namespace xdr { static toXDR(value: TransactionSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionSet; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSet; - static fromXDR(input: string, format: "hex" | "base64"): TransactionSet; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionSetV1 { @@ -4380,9 +4240,9 @@ export namespace xdr { phases(value?: TransactionPhase[]): TransactionPhase[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionSetV1; @@ -4392,13 +4252,13 @@ export namespace xdr { static toXDR(value: TransactionSetV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionSetV1; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSetV1; - static fromXDR(input: string, format: "hex" | "base64"): TransactionSetV1; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionSetV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionResultPair { @@ -4411,9 +4271,9 @@ export namespace xdr { result(value?: TransactionResult): TransactionResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionResultPair; @@ -4423,16 +4283,16 @@ export namespace xdr { static toXDR(value: TransactionResultPair): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultPair; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultPair; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionResultPair; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionResultSet { @@ -4440,9 +4300,9 @@ export namespace xdr { results(value?: TransactionResultPair[]): TransactionResultPair[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionResultSet; @@ -4452,16 +4312,16 @@ export namespace xdr { static toXDR(value: TransactionResultSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultSet; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultSet; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionResultSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionHistoryEntry { @@ -4477,9 +4337,9 @@ export namespace xdr { ext(value?: TransactionHistoryEntryExt): TransactionHistoryEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionHistoryEntry; @@ -4489,16 +4349,16 @@ export namespace xdr { static toXDR(value: TransactionHistoryEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): TransactionHistoryEntry; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionHistoryEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionHistoryResultEntry { @@ -4513,12 +4373,12 @@ export namespace xdr { txResultSet(value?: TransactionResultSet): TransactionResultSet; ext( - value?: TransactionHistoryResultEntryExt + value?: TransactionHistoryResultEntryExt, ): TransactionHistoryResultEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionHistoryResultEntry; @@ -4530,122 +4390,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): TransactionHistoryResultEntry; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionHistoryResultEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class TransactionResultPairV2 { - constructor(attributes: { - transactionHash: Buffer; - hashOfMetaHashes: Buffer; - }); - - transactionHash(value?: Buffer): Buffer; - - hashOfMetaHashes(value?: Buffer): Buffer; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): TransactionResultPairV2; - - static write(value: TransactionResultPairV2, io: Buffer): void; - - static isValid(value: TransactionResultPairV2): boolean; - - static toXDR(value: TransactionResultPairV2): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): TransactionResultPairV2; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionResultPairV2; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class TransactionResultSetV2 { - constructor(attributes: { results: TransactionResultPairV2[] }); - - results(value?: TransactionResultPairV2[]): TransactionResultPairV2[]; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): TransactionResultSetV2; - - static write(value: TransactionResultSetV2, io: Buffer): void; - - static isValid(value: TransactionResultSetV2): boolean; - - static toXDR(value: TransactionResultSetV2): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): TransactionResultSetV2; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionResultSetV2; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class TransactionHistoryResultEntryV2 { - constructor(attributes: { - ledgerSeq: number; - txResultSet: TransactionResultSetV2; - ext: TransactionHistoryResultEntryV2Ext; - }); - - ledgerSeq(value?: number): number; - - txResultSet(value?: TransactionResultSetV2): TransactionResultSetV2; - - ext( - value?: TransactionHistoryResultEntryV2Ext - ): TransactionHistoryResultEntryV2Ext; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): TransactionHistoryResultEntryV2; - - static write(value: TransactionHistoryResultEntryV2, io: Buffer): void; - - static isValid(value: TransactionHistoryResultEntryV2): boolean; - - static toXDR(value: TransactionHistoryResultEntryV2): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): TransactionHistoryResultEntryV2; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionHistoryResultEntryV2; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeaderHistoryEntry { @@ -4661,9 +4416,9 @@ export namespace xdr { ext(value?: LedgerHeaderHistoryEntryExt): LedgerHeaderHistoryEntryExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeaderHistoryEntry; @@ -4673,16 +4428,16 @@ export namespace xdr { static toXDR(value: LedgerHeaderHistoryEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderHistoryEntry; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerHeaderHistoryEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerScpMessages { @@ -4692,9 +4447,9 @@ export namespace xdr { messages(value?: ScpEnvelope[]): ScpEnvelope[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerScpMessages; @@ -4704,13 +4459,13 @@ export namespace xdr { static toXDR(value: LedgerScpMessages): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerScpMessages; + static fromXDR(input: Buffer, format?: 'raw'): LedgerScpMessages; - static fromXDR(input: string, format: "hex" | "base64"): LedgerScpMessages; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerScpMessages; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpHistoryEntryV0 { @@ -4723,9 +4478,9 @@ export namespace xdr { ledgerMessages(value?: LedgerScpMessages): LedgerScpMessages; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpHistoryEntryV0; @@ -4735,13 +4490,13 @@ export namespace xdr { static toXDR(value: ScpHistoryEntryV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpHistoryEntryV0; + static fromXDR(input: Buffer, format?: 'raw'): ScpHistoryEntryV0; - static fromXDR(input: string, format: "hex" | "base64"): ScpHistoryEntryV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpHistoryEntryV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OperationMeta { @@ -4749,9 +4504,9 @@ export namespace xdr { changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OperationMeta; @@ -4761,13 +4516,13 @@ export namespace xdr { static toXDR(value: OperationMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationMeta; + static fromXDR(input: Buffer, format?: 'raw'): OperationMeta; - static fromXDR(input: string, format: "hex" | "base64"): OperationMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionMetaV1 { @@ -4780,9 +4535,9 @@ export namespace xdr { operations(value?: OperationMeta[]): OperationMeta[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionMetaV1; @@ -4792,13 +4547,13 @@ export namespace xdr { static toXDR(value: TransactionMetaV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionMetaV1; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV1; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMetaV1; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionMetaV2 { @@ -4814,9 +4569,9 @@ export namespace xdr { txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionMetaV2; @@ -4826,13 +4581,13 @@ export namespace xdr { static toXDR(value: TransactionMetaV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV2; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMetaV2; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ContractEventV0 { @@ -4842,9 +4597,9 @@ export namespace xdr { data(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ContractEventV0; @@ -4854,13 +4609,13 @@ export namespace xdr { static toXDR(value: ContractEventV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractEventV0; + static fromXDR(input: Buffer, format?: 'raw'): ContractEventV0; - static fromXDR(input: string, format: "hex" | "base64"): ContractEventV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEventV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ContractEvent { @@ -4879,9 +4634,9 @@ export namespace xdr { body(value?: ContractEventBody): ContractEventBody; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ContractEvent; @@ -4891,13 +4646,13 @@ export namespace xdr { static toXDR(value: ContractEvent): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractEvent; + static fromXDR(input: Buffer, format?: 'raw'): ContractEvent; - static fromXDR(input: string, format: "hex" | "base64"): ContractEvent; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEvent; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class DiagnosticEvent { @@ -4910,9 +4665,9 @@ export namespace xdr { event(value?: ContractEvent): ContractEvent; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): DiagnosticEvent; @@ -4922,100 +4677,79 @@ export namespace xdr { static toXDR(value: DiagnosticEvent): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DiagnosticEvent; + static fromXDR(input: Buffer, format?: 'raw'): DiagnosticEvent; - static fromXDR(input: string, format: "hex" | "base64"): DiagnosticEvent; + static fromXDR(input: string, format: 'hex' | 'base64'): DiagnosticEvent; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class OperationDiagnosticEvents { - constructor(attributes: { events: DiagnosticEvent[] }); - - events(value?: DiagnosticEvent[]): DiagnosticEvent[]; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): OperationDiagnosticEvents; - - static write(value: OperationDiagnosticEvents, io: Buffer): void; - - static isValid(value: OperationDiagnosticEvents): boolean; - - static toXDR(value: OperationDiagnosticEvents): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): OperationDiagnosticEvents; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): OperationDiagnosticEvents; + class SorobanTransactionMeta { + constructor(attributes: { + ext: ExtensionPoint; + events: ContractEvent[]; + returnValue: ScVal; + diagnosticEvents: DiagnosticEvent[]; + }); - static validateXDR(input: Buffer, format?: "raw"): boolean; + ext(value?: ExtensionPoint): ExtensionPoint; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + events(value?: ContractEvent[]): ContractEvent[]; - class OperationEvents { - constructor(attributes: { events: ContractEvent[] }); + returnValue(value?: ScVal): ScVal; - events(value?: ContractEvent[]): ContractEvent[]; + diagnosticEvents(value?: DiagnosticEvent[]): DiagnosticEvent[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): OperationEvents; + static read(io: Buffer): SorobanTransactionMeta; - static write(value: OperationEvents, io: Buffer): void; + static write(value: SorobanTransactionMeta, io: Buffer): void; - static isValid(value: OperationEvents): boolean; + static isValid(value: SorobanTransactionMeta): boolean; - static toXDR(value: OperationEvents): Buffer; + static toXDR(value: SorobanTransactionMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationEvents; + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionMeta; - static fromXDR(input: string, format: "hex" | "base64"): OperationEvents; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionMetaV3 { constructor(attributes: { + ext: ExtensionPoint; txChangesBefore: LedgerEntryChange[]; operations: OperationMeta[]; txChangesAfter: LedgerEntryChange[]; - events: OperationEvents[]; - txResult: TransactionResult; - hashes: Buffer[]; - diagnosticEvents: OperationDiagnosticEvents[]; + sorobanMeta: null | SorobanTransactionMeta; }); + ext(value?: ExtensionPoint): ExtensionPoint; + txChangesBefore(value?: LedgerEntryChange[]): LedgerEntryChange[]; operations(value?: OperationMeta[]): OperationMeta[]; txChangesAfter(value?: LedgerEntryChange[]): LedgerEntryChange[]; - events(value?: OperationEvents[]): OperationEvents[]; - - txResult(value?: TransactionResult): TransactionResult; - - hashes(value?: Buffer[]): Buffer[]; + sorobanMeta( + value?: null | SorobanTransactionMeta, + ): null | SorobanTransactionMeta; - diagnosticEvents( - value?: OperationDiagnosticEvents[] - ): OperationDiagnosticEvents[]; + toXDR(format?: 'raw'): Buffer; - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionMetaV3; @@ -5025,87 +4759,84 @@ export namespace xdr { static toXDR(value: TransactionMetaV3): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionMetaV3; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMetaV3; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMetaV3; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMetaV3; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultMeta { - constructor(attributes: { - result: TransactionResultPair; - feeProcessing: LedgerEntryChange[]; - txApplyProcessing: TransactionMeta; - }); - - result(value?: TransactionResultPair): TransactionResultPair; + class InvokeHostFunctionSuccessPreImage { + constructor(attributes: { returnValue: ScVal; events: ContractEvent[] }); - feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; + returnValue(value?: ScVal): ScVal; - txApplyProcessing(value?: TransactionMeta): TransactionMeta; + events(value?: ContractEvent[]): ContractEvent[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultMeta; + static read(io: Buffer): InvokeHostFunctionSuccessPreImage; - static write(value: TransactionResultMeta, io: Buffer): void; + static write(value: InvokeHostFunctionSuccessPreImage, io: Buffer): void; - static isValid(value: TransactionResultMeta): boolean; + static isValid(value: InvokeHostFunctionSuccessPreImage): boolean; - static toXDR(value: TransactionResultMeta): Buffer; + static toXDR(value: InvokeHostFunctionSuccessPreImage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultMeta; + static fromXDR( + input: Buffer, + format?: 'raw', + ): InvokeHostFunctionSuccessPreImage; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionResultMeta; + format: 'hex' | 'base64', + ): InvokeHostFunctionSuccessPreImage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionResultMetaV2 { + class TransactionResultMeta { constructor(attributes: { - result: TransactionResultPairV2; + result: TransactionResultPair; feeProcessing: LedgerEntryChange[]; txApplyProcessing: TransactionMeta; }); - result(value?: TransactionResultPairV2): TransactionResultPairV2; + result(value?: TransactionResultPair): TransactionResultPair; feeProcessing(value?: LedgerEntryChange[]): LedgerEntryChange[]; txApplyProcessing(value?: TransactionMeta): TransactionMeta; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): TransactionResultMetaV2; + static read(io: Buffer): TransactionResultMeta; - static write(value: TransactionResultMetaV2, io: Buffer): void; + static write(value: TransactionResultMeta, io: Buffer): void; - static isValid(value: TransactionResultMetaV2): boolean; + static isValid(value: TransactionResultMeta): boolean; - static toXDR(value: TransactionResultMetaV2): Buffer; + static toXDR(value: TransactionResultMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultMeta; static fromXDR( input: string, - format: "hex" | "base64" - ): TransactionResultMetaV2; + format: 'hex' | 'base64', + ): TransactionResultMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class UpgradeEntryMeta { @@ -5118,9 +4849,9 @@ export namespace xdr { changes(value?: LedgerEntryChange[]): LedgerEntryChange[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): UpgradeEntryMeta; @@ -5130,13 +4861,13 @@ export namespace xdr { static toXDR(value: UpgradeEntryMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UpgradeEntryMeta; + static fromXDR(input: Buffer, format?: 'raw'): UpgradeEntryMeta; - static fromXDR(input: string, format: "hex" | "base64"): UpgradeEntryMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): UpgradeEntryMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerCloseMetaV0 { @@ -5158,9 +4889,9 @@ export namespace xdr { scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerCloseMetaV0; @@ -5170,13 +4901,13 @@ export namespace xdr { static toXDR(value: LedgerCloseMetaV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMetaV0; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV0; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMetaV0; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerCloseMetaV1 { @@ -5198,9 +4929,9 @@ export namespace xdr { scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerCloseMetaV1; @@ -5210,37 +4941,49 @@ export namespace xdr { static toXDR(value: LedgerCloseMetaV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMetaV1; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMetaV1; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerCloseMetaV2 { constructor(attributes: { + ext: ExtensionPoint; ledgerHeader: LedgerHeaderHistoryEntry; txSet: GeneralizedTransactionSet; - txProcessing: TransactionResultMetaV2[]; + txProcessing: TransactionResultMeta[]; upgradesProcessing: UpgradeEntryMeta[]; scpInfo: ScpHistoryEntry[]; + totalByteSizeOfBucketList: Uint64; + evictedTemporaryLedgerKeys: LedgerKey[]; + evictedPersistentLedgerEntries: LedgerEntry[]; }); + ext(value?: ExtensionPoint): ExtensionPoint; + ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; - txProcessing(value?: TransactionResultMetaV2[]): TransactionResultMetaV2[]; + txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - toXDR(format?: "raw"): Buffer; + totalByteSizeOfBucketList(value?: Uint64): Uint64; - toXDR(format: "hex" | "base64"): string; + evictedTemporaryLedgerKeys(value?: LedgerKey[]): LedgerKey[]; + + evictedPersistentLedgerEntries(value?: LedgerEntry[]): LedgerEntry[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerCloseMetaV2; @@ -5250,13 +4993,13 @@ export namespace xdr { static toXDR(value: LedgerCloseMetaV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMetaV2; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Error { @@ -5266,9 +5009,9 @@ export namespace xdr { msg(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Error; @@ -5278,13 +5021,13 @@ export namespace xdr { static toXDR(value: Error): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Error; + static fromXDR(input: Buffer, format?: 'raw'): Error; - static fromXDR(input: string, format: "hex" | "base64"): Error; + static fromXDR(input: string, format: 'hex' | 'base64'): Error; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SendMore { @@ -5292,9 +5035,9 @@ export namespace xdr { numMessages(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SendMore; @@ -5304,13 +5047,41 @@ export namespace xdr { static toXDR(value: SendMore): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SendMore; + static fromXDR(input: Buffer, format?: 'raw'): SendMore; + + static fromXDR(input: string, format: 'hex' | 'base64'): SendMore; - static fromXDR(input: string, format: "hex" | "base64"): SendMore; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SendMoreExtended { + constructor(attributes: { numMessages: number; numBytes: number }); + + numMessages(value?: number): number; + + numBytes(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SendMoreExtended; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static write(value: SendMoreExtended, io: Buffer): void; + + static isValid(value: SendMoreExtended): boolean; + + static toXDR(value: SendMoreExtended): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SendMoreExtended; + + static fromXDR(input: string, format: 'hex' | 'base64'): SendMoreExtended; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AuthCert { @@ -5326,9 +5097,9 @@ export namespace xdr { sig(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AuthCert; @@ -5338,13 +5109,13 @@ export namespace xdr { static toXDR(value: AuthCert): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AuthCert; + static fromXDR(input: Buffer, format?: 'raw'): AuthCert; - static fromXDR(input: string, format: "hex" | "base64"): AuthCert; + static fromXDR(input: string, format: 'hex' | 'base64'): AuthCert; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Hello { @@ -5378,9 +5149,9 @@ export namespace xdr { nonce(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Hello; @@ -5390,13 +5161,13 @@ export namespace xdr { static toXDR(value: Hello): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Hello; + static fromXDR(input: Buffer, format?: 'raw'): Hello; - static fromXDR(input: string, format: "hex" | "base64"): Hello; + static fromXDR(input: string, format: 'hex' | 'base64'): Hello; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Auth { @@ -5404,9 +5175,9 @@ export namespace xdr { flags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Auth; @@ -5416,13 +5187,13 @@ export namespace xdr { static toXDR(value: Auth): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Auth; + static fromXDR(input: Buffer, format?: 'raw'): Auth; - static fromXDR(input: string, format: "hex" | "base64"): Auth; + static fromXDR(input: string, format: 'hex' | 'base64'): Auth; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PeerAddress { @@ -5438,9 +5209,9 @@ export namespace xdr { numFailures(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PeerAddress; @@ -5450,13 +5221,13 @@ export namespace xdr { static toXDR(value: PeerAddress): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PeerAddress; + static fromXDR(input: Buffer, format?: 'raw'): PeerAddress; - static fromXDR(input: string, format: "hex" | "base64"): PeerAddress; + static fromXDR(input: string, format: 'hex' | 'base64'): PeerAddress; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class DontHave { @@ -5466,9 +5237,9 @@ export namespace xdr { reqHash(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): DontHave; @@ -5478,13 +5249,13 @@ export namespace xdr { static toXDR(value: DontHave): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DontHave; + static fromXDR(input: Buffer, format?: 'raw'): DontHave; - static fromXDR(input: string, format: "hex" | "base64"): DontHave; + static fromXDR(input: string, format: 'hex' | 'base64'): DontHave; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SurveyRequestMessage { @@ -5506,9 +5277,9 @@ export namespace xdr { commandType(value?: SurveyMessageCommandType): SurveyMessageCommandType; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SurveyRequestMessage; @@ -5518,16 +5289,16 @@ export namespace xdr { static toXDR(value: SurveyRequestMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SurveyRequestMessage; + static fromXDR(input: Buffer, format?: 'raw'): SurveyRequestMessage; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SurveyRequestMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SignedSurveyRequestMessage { @@ -5540,9 +5311,9 @@ export namespace xdr { request(value?: SurveyRequestMessage): SurveyRequestMessage; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SignedSurveyRequestMessage; @@ -5552,16 +5323,16 @@ export namespace xdr { static toXDR(value: SignedSurveyRequestMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SignedSurveyRequestMessage; + static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyRequestMessage; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SignedSurveyRequestMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SurveyResponseMessage { @@ -5583,9 +5354,9 @@ export namespace xdr { encryptedBody(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SurveyResponseMessage; @@ -5595,16 +5366,16 @@ export namespace xdr { static toXDR(value: SurveyResponseMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SurveyResponseMessage; + static fromXDR(input: Buffer, format?: 'raw'): SurveyResponseMessage; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SurveyResponseMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SignedSurveyResponseMessage { @@ -5617,9 +5388,9 @@ export namespace xdr { response(value?: SurveyResponseMessage): SurveyResponseMessage; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SignedSurveyResponseMessage; @@ -5629,16 +5400,16 @@ export namespace xdr { static toXDR(value: SignedSurveyResponseMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SignedSurveyResponseMessage; + static fromXDR(input: Buffer, format?: 'raw'): SignedSurveyResponseMessage; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SignedSurveyResponseMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PeerStats { @@ -5690,9 +5461,9 @@ export namespace xdr { duplicateFetchMessageRecv(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PeerStats; @@ -5702,13 +5473,13 @@ export namespace xdr { static toXDR(value: PeerStats): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PeerStats; + static fromXDR(input: Buffer, format?: 'raw'): PeerStats; - static fromXDR(input: string, format: "hex" | "base64"): PeerStats; + static fromXDR(input: string, format: 'hex' | 'base64'): PeerStats; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TopologyResponseBodyV0 { @@ -5727,9 +5498,9 @@ export namespace xdr { totalOutboundPeerCount(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TopologyResponseBodyV0; @@ -5739,16 +5510,16 @@ export namespace xdr { static toXDR(value: TopologyResponseBodyV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TopologyResponseBodyV0; + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV0; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TopologyResponseBodyV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TopologyResponseBodyV1 { @@ -5773,9 +5544,9 @@ export namespace xdr { maxOutboundPeerCount(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TopologyResponseBodyV1; @@ -5785,16 +5556,16 @@ export namespace xdr { static toXDR(value: TopologyResponseBodyV1): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TopologyResponseBodyV1; + static fromXDR(input: Buffer, format?: 'raw'): TopologyResponseBodyV1; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TopologyResponseBodyV1; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FloodAdvert { @@ -5802,9 +5573,9 @@ export namespace xdr { txHashes(value?: Hash[]): Hash[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FloodAdvert; @@ -5814,13 +5585,13 @@ export namespace xdr { static toXDR(value: FloodAdvert): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FloodAdvert; + static fromXDR(input: Buffer, format?: 'raw'): FloodAdvert; - static fromXDR(input: string, format: "hex" | "base64"): FloodAdvert; + static fromXDR(input: string, format: 'hex' | 'base64'): FloodAdvert; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FloodDemand { @@ -5828,9 +5599,9 @@ export namespace xdr { txHashes(value?: Hash[]): Hash[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FloodDemand; @@ -5840,13 +5611,13 @@ export namespace xdr { static toXDR(value: FloodDemand): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FloodDemand; + static fromXDR(input: Buffer, format?: 'raw'): FloodDemand; - static fromXDR(input: string, format: "hex" | "base64"): FloodDemand; + static fromXDR(input: string, format: 'hex' | 'base64'): FloodDemand; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AuthenticatedMessageV0 { @@ -5862,9 +5633,9 @@ export namespace xdr { mac(value?: HmacSha256Mac): HmacSha256Mac; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AuthenticatedMessageV0; @@ -5874,16 +5645,16 @@ export namespace xdr { static toXDR(value: AuthenticatedMessageV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AuthenticatedMessageV0; + static fromXDR(input: Buffer, format?: 'raw'): AuthenticatedMessageV0; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AuthenticatedMessageV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class MuxedAccountMed25519 { @@ -5893,9 +5664,9 @@ export namespace xdr { ed25519(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): MuxedAccountMed25519; @@ -5905,16 +5676,16 @@ export namespace xdr { static toXDR(value: MuxedAccountMed25519): Buffer; - static fromXDR(input: Buffer, format?: "raw"): MuxedAccountMed25519; + static fromXDR(input: Buffer, format?: 'raw'): MuxedAccountMed25519; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): MuxedAccountMed25519; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class DecoratedSignature { @@ -5924,9 +5695,9 @@ export namespace xdr { signature(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): DecoratedSignature; @@ -5936,41 +5707,13 @@ export namespace xdr { static toXDR(value: DecoratedSignature): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DecoratedSignature; - - static fromXDR(input: string, format: "hex" | "base64"): DecoratedSignature; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class LedgerFootprint { - constructor(attributes: { readOnly: LedgerKey[]; readWrite: LedgerKey[] }); - - readOnly(value?: LedgerKey[]): LedgerKey[]; - - readWrite(value?: LedgerKey[]): LedgerKey[]; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): LedgerFootprint; - - static write(value: LedgerFootprint, io: Buffer): void; - - static isValid(value: LedgerFootprint): boolean; - - static toXDR(value: LedgerFootprint): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): LedgerFootprint; + static fromXDR(input: Buffer, format?: 'raw'): DecoratedSignature; - static fromXDR(input: string, format: "hex" | "base64"): LedgerFootprint; + static fromXDR(input: string, format: 'hex' | 'base64'): DecoratedSignature; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreateAccountOp { @@ -5980,9 +5723,9 @@ export namespace xdr { startingBalance(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreateAccountOp; @@ -5992,13 +5735,13 @@ export namespace xdr { static toXDR(value: CreateAccountOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateAccountOp; + static fromXDR(input: Buffer, format?: 'raw'): CreateAccountOp; - static fromXDR(input: string, format: "hex" | "base64"): CreateAccountOp; + static fromXDR(input: string, format: 'hex' | 'base64'): CreateAccountOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PaymentOp { @@ -6014,9 +5757,9 @@ export namespace xdr { amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PaymentOp; @@ -6026,13 +5769,13 @@ export namespace xdr { static toXDR(value: PaymentOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PaymentOp; + static fromXDR(input: Buffer, format?: 'raw'): PaymentOp; - static fromXDR(input: string, format: "hex" | "base64"): PaymentOp; + static fromXDR(input: string, format: 'hex' | 'base64'): PaymentOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictReceiveOp { @@ -6057,9 +5800,9 @@ export namespace xdr { path(value?: Asset[]): Asset[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictReceiveOp; @@ -6069,16 +5812,16 @@ export namespace xdr { static toXDR(value: PathPaymentStrictReceiveOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictReceiveOp; + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictReceiveOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictReceiveOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictSendOp { @@ -6103,9 +5846,9 @@ export namespace xdr { path(value?: Asset[]): Asset[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictSendOp; @@ -6115,16 +5858,16 @@ export namespace xdr { static toXDR(value: PathPaymentStrictSendOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictSendOp; + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictSendOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictSendOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageSellOfferOp { @@ -6146,9 +5889,9 @@ export namespace xdr { offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageSellOfferOp; @@ -6158,13 +5901,13 @@ export namespace xdr { static toXDR(value: ManageSellOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageSellOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): ManageSellOfferOp; - static fromXDR(input: string, format: "hex" | "base64"): ManageSellOfferOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageSellOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageBuyOfferOp { @@ -6186,9 +5929,9 @@ export namespace xdr { offerId(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageBuyOfferOp; @@ -6198,13 +5941,13 @@ export namespace xdr { static toXDR(value: ManageBuyOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageBuyOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): ManageBuyOfferOp; - static fromXDR(input: string, format: "hex" | "base64"): ManageBuyOfferOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageBuyOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreatePassiveSellOfferOp { @@ -6223,9 +5966,9 @@ export namespace xdr { price(value?: Price): Price; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreatePassiveSellOfferOp; @@ -6235,16 +5978,16 @@ export namespace xdr { static toXDR(value: CreatePassiveSellOfferOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreatePassiveSellOfferOp; + static fromXDR(input: Buffer, format?: 'raw'): CreatePassiveSellOfferOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): CreatePassiveSellOfferOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SetOptionsOp { @@ -6278,9 +6021,9 @@ export namespace xdr { signer(value?: null | Signer): null | Signer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SetOptionsOp; @@ -6290,13 +6033,13 @@ export namespace xdr { static toXDR(value: SetOptionsOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetOptionsOp; + static fromXDR(input: Buffer, format?: 'raw'): SetOptionsOp; - static fromXDR(input: string, format: "hex" | "base64"): SetOptionsOp; + static fromXDR(input: string, format: 'hex' | 'base64'): SetOptionsOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ChangeTrustOp { @@ -6306,9 +6049,9 @@ export namespace xdr { limit(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ChangeTrustOp; @@ -6318,13 +6061,13 @@ export namespace xdr { static toXDR(value: ChangeTrustOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustOp; + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustOp; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AllowTrustOp { @@ -6340,9 +6083,9 @@ export namespace xdr { authorize(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AllowTrustOp; @@ -6352,13 +6095,13 @@ export namespace xdr { static toXDR(value: AllowTrustOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AllowTrustOp; + static fromXDR(input: Buffer, format?: 'raw'): AllowTrustOp; - static fromXDR(input: string, format: "hex" | "base64"): AllowTrustOp; + static fromXDR(input: string, format: 'hex' | 'base64'): AllowTrustOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageDataOp { @@ -6371,9 +6114,9 @@ export namespace xdr { dataValue(value?: null | Buffer): null | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageDataOp; @@ -6383,13 +6126,13 @@ export namespace xdr { static toXDR(value: ManageDataOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageDataOp; + static fromXDR(input: Buffer, format?: 'raw'): ManageDataOp; - static fromXDR(input: string, format: "hex" | "base64"): ManageDataOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageDataOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BumpSequenceOp { @@ -6397,9 +6140,9 @@ export namespace xdr { bumpTo(value?: SequenceNumber): SequenceNumber; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BumpSequenceOp; @@ -6409,13 +6152,13 @@ export namespace xdr { static toXDR(value: BumpSequenceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BumpSequenceOp; + static fromXDR(input: Buffer, format?: 'raw'): BumpSequenceOp; - static fromXDR(input: string, format: "hex" | "base64"): BumpSequenceOp; + static fromXDR(input: string, format: 'hex' | 'base64'): BumpSequenceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreateClaimableBalanceOp { @@ -6431,9 +6174,9 @@ export namespace xdr { claimants(value?: Claimant[]): Claimant[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreateClaimableBalanceOp; @@ -6443,16 +6186,16 @@ export namespace xdr { static toXDR(value: CreateClaimableBalanceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateClaimableBalanceOp; + static fromXDR(input: Buffer, format?: 'raw'): CreateClaimableBalanceOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): CreateClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimClaimableBalanceOp { @@ -6460,9 +6203,9 @@ export namespace xdr { balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimClaimableBalanceOp; @@ -6472,16 +6215,16 @@ export namespace xdr { static toXDR(value: ClaimClaimableBalanceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimClaimableBalanceOp; + static fromXDR(input: Buffer, format?: 'raw'): ClaimClaimableBalanceOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BeginSponsoringFutureReservesOp { @@ -6489,9 +6232,9 @@ export namespace xdr { sponsoredId(value?: AccountId): AccountId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BeginSponsoringFutureReservesOp; @@ -6503,17 +6246,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): BeginSponsoringFutureReservesOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): BeginSponsoringFutureReservesOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class RevokeSponsorshipOpSigner { @@ -6523,9 +6266,9 @@ export namespace xdr { signerKey(value?: SignerKey): SignerKey; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): RevokeSponsorshipOpSigner; @@ -6535,16 +6278,16 @@ export namespace xdr { static toXDR(value: RevokeSponsorshipOpSigner): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipOpSigner; + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipOpSigner; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): RevokeSponsorshipOpSigner; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClawbackOp { @@ -6560,9 +6303,9 @@ export namespace xdr { amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClawbackOp; @@ -6572,13 +6315,13 @@ export namespace xdr { static toXDR(value: ClawbackOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClawbackOp; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackOp; - static fromXDR(input: string, format: "hex" | "base64"): ClawbackOp; + static fromXDR(input: string, format: 'hex' | 'base64'): ClawbackOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClawbackClaimableBalanceOp { @@ -6586,9 +6329,9 @@ export namespace xdr { balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClawbackClaimableBalanceOp; @@ -6598,16 +6341,16 @@ export namespace xdr { static toXDR(value: ClawbackClaimableBalanceOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClawbackClaimableBalanceOp; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackClaimableBalanceOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClawbackClaimableBalanceOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SetTrustLineFlagsOp { @@ -6626,9 +6369,9 @@ export namespace xdr { setFlags(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SetTrustLineFlagsOp; @@ -6638,16 +6381,16 @@ export namespace xdr { static toXDR(value: SetTrustLineFlagsOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetTrustLineFlagsOp; + static fromXDR(input: Buffer, format?: 'raw'): SetTrustLineFlagsOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SetTrustLineFlagsOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolDepositOp { @@ -6669,9 +6412,9 @@ export namespace xdr { maxPrice(value?: Price): Price; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolDepositOp; @@ -6681,16 +6424,16 @@ export namespace xdr { static toXDR(value: LiquidityPoolDepositOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolDepositOp; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolDepositOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolDepositOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolWithdrawOp { @@ -6709,9 +6452,9 @@ export namespace xdr { minAmountB(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolWithdrawOp; @@ -6721,96 +6464,65 @@ export namespace xdr { static toXDR(value: LiquidityPoolWithdrawOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolWithdrawOp; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolWithdrawOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolWithdrawOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class InstallContractCodeArgs { - constructor(attributes: { code: Buffer }); - - code(value?: Buffer): Buffer; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): InstallContractCodeArgs; - - static write(value: InstallContractCodeArgs, io: Buffer): void; - - static isValid(value: InstallContractCodeArgs): boolean; - - static toXDR(value: InstallContractCodeArgs): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): InstallContractCodeArgs; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR( - input: string, - format: "hex" | "base64" - ): InstallContractCodeArgs; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ContractIdFromEd25519PublicKey { - constructor(attributes: { key: Buffer; signature: Buffer; salt: Buffer }); + class ContractIdPreimageFromAddress { + constructor(attributes: { address: ScAddress; salt: Buffer }); - key(value?: Buffer): Buffer; - - signature(value?: Buffer): Buffer; + address(value?: ScAddress): ScAddress; salt(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ContractIdFromEd25519PublicKey; + static read(io: Buffer): ContractIdPreimageFromAddress; - static write(value: ContractIdFromEd25519PublicKey, io: Buffer): void; + static write(value: ContractIdPreimageFromAddress, io: Buffer): void; - static isValid(value: ContractIdFromEd25519PublicKey): boolean; + static isValid(value: ContractIdPreimageFromAddress): boolean; - static toXDR(value: ContractIdFromEd25519PublicKey): Buffer; + static toXDR(value: ContractIdPreimageFromAddress): Buffer; static fromXDR( input: Buffer, - format?: "raw" - ): ContractIdFromEd25519PublicKey; + format?: 'raw', + ): ContractIdPreimageFromAddress; static fromXDR( input: string, - format: "hex" | "base64" - ): ContractIdFromEd25519PublicKey; + format: 'hex' | 'base64', + ): ContractIdPreimageFromAddress; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreateContractArgs { constructor(attributes: { - contractId: ContractId; - source: ScContractExecutable; + contractIdPreimage: ContractIdPreimage; + executable: ContractExecutable; }); - contractId(value?: ContractId): ContractId; + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; - source(value?: ScContractExecutable): ScContractExecutable; + executable(value?: ContractExecutable): ContractExecutable; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreateContractArgs; @@ -6820,460 +6532,409 @@ export namespace xdr { static toXDR(value: CreateContractArgs): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateContractArgs; + static fromXDR(input: Buffer, format?: 'raw'): CreateContractArgs; - static fromXDR(input: string, format: "hex" | "base64"): CreateContractArgs; + static fromXDR(input: string, format: 'hex' | 'base64'): CreateContractArgs; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class AuthorizedInvocation { + class InvokeContractArgs { constructor(attributes: { - contractId: Buffer; + contractAddress: ScAddress; functionName: string | Buffer; args: ScVal[]; - subInvocations: AuthorizedInvocation[]; }); - contractId(value?: Buffer): Buffer; + contractAddress(value?: ScAddress): ScAddress; functionName(value?: string | Buffer): string | Buffer; args(value?: ScVal[]): ScVal[]; - subInvocations(value?: AuthorizedInvocation[]): AuthorizedInvocation[]; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): AuthorizedInvocation; - - static write(value: AuthorizedInvocation, io: Buffer): void; - - static isValid(value: AuthorizedInvocation): boolean; - - static toXDR(value: AuthorizedInvocation): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): AuthorizedInvocation; + toXDR(format?: 'raw'): Buffer; - static fromXDR( - input: string, - format: "hex" | "base64" - ): AuthorizedInvocation; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class AddressWithNonce { - constructor(attributes: { address: ScAddress; nonce: Uint64 }); - - address(value?: ScAddress): ScAddress; + toXDR(format: 'hex' | 'base64'): string; - nonce(value?: Uint64): Uint64; + static read(io: Buffer): InvokeContractArgs; - toXDR(format?: "raw"): Buffer; + static write(value: InvokeContractArgs, io: Buffer): void; - toXDR(format: "hex" | "base64"): string; + static isValid(value: InvokeContractArgs): boolean; - static read(io: Buffer): AddressWithNonce; + static toXDR(value: InvokeContractArgs): Buffer; - static write(value: AddressWithNonce, io: Buffer): void; + static fromXDR(input: Buffer, format?: 'raw'): InvokeContractArgs; - static isValid(value: AddressWithNonce): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): InvokeContractArgs; - static toXDR(value: AddressWithNonce): Buffer; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: Buffer, format?: "raw"): AddressWithNonce; - - static fromXDR(input: string, format: "hex" | "base64"): AddressWithNonce; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ContractAuth { + class SorobanAuthorizedInvocation { constructor(attributes: { - addressWithNonce: null | AddressWithNonce; - rootInvocation: AuthorizedInvocation; - signatureArgs: ScVal[]; + function: SorobanAuthorizedFunction; + subInvocations: SorobanAuthorizedInvocation[]; }); - addressWithNonce(value?: null | AddressWithNonce): null | AddressWithNonce; - - rootInvocation(value?: AuthorizedInvocation): AuthorizedInvocation; + function(value?: SorobanAuthorizedFunction): SorobanAuthorizedFunction; - signatureArgs(value?: ScVal[]): ScVal[]; + subInvocations( + value?: SorobanAuthorizedInvocation[], + ): SorobanAuthorizedInvocation[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ContractAuth; + static read(io: Buffer): SorobanAuthorizedInvocation; - static write(value: ContractAuth, io: Buffer): void; + static write(value: SorobanAuthorizedInvocation, io: Buffer): void; - static isValid(value: ContractAuth): boolean; + static isValid(value: SorobanAuthorizedInvocation): boolean; - static toXDR(value: ContractAuth): Buffer; + static toXDR(value: SorobanAuthorizedInvocation): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractAuth; + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizedInvocation; - static fromXDR(input: string, format: "hex" | "base64"): ContractAuth; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanAuthorizedInvocation; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class InvokeHostFunctionOp { + class SorobanAddressCredentials { constructor(attributes: { - function: HostFunction; - footprint: LedgerFootprint; - auth: ContractAuth[]; + address: ScAddress; + nonce: Int64; + signatureExpirationLedger: number; + signature: ScVal; }); - function(value?: HostFunction): HostFunction; + address(value?: ScAddress): ScAddress; - footprint(value?: LedgerFootprint): LedgerFootprint; + nonce(value?: Int64): Int64; - auth(value?: ContractAuth[]): ContractAuth[]; + signatureExpirationLedger(value?: number): number; - toXDR(format?: "raw"): Buffer; + signature(value?: ScVal): ScVal; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; - static read(io: Buffer): InvokeHostFunctionOp; + toXDR(format: 'hex' | 'base64'): string; - static write(value: InvokeHostFunctionOp, io: Buffer): void; + static read(io: Buffer): SorobanAddressCredentials; - static isValid(value: InvokeHostFunctionOp): boolean; + static write(value: SorobanAddressCredentials, io: Buffer): void; - static toXDR(value: InvokeHostFunctionOp): Buffer; + static isValid(value: SorobanAddressCredentials): boolean; - static fromXDR(input: Buffer, format?: "raw"): InvokeHostFunctionOp; + static toXDR(value: SorobanAddressCredentials): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanAddressCredentials; static fromXDR( input: string, - format: "hex" | "base64" - ): InvokeHostFunctionOp; + format: 'hex' | 'base64', + ): SorobanAddressCredentials; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageOperationId { + class SorobanAuthorizationEntry { constructor(attributes: { - sourceAccount: AccountId; - seqNum: SequenceNumber; - opNum: number; + credentials: SorobanCredentials; + rootInvocation: SorobanAuthorizedInvocation; }); - sourceAccount(value?: AccountId): AccountId; - - seqNum(value?: SequenceNumber): SequenceNumber; + credentials(value?: SorobanCredentials): SorobanCredentials; - opNum(value?: number): number; + rootInvocation( + value?: SorobanAuthorizedInvocation, + ): SorobanAuthorizedInvocation; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageOperationId; + static read(io: Buffer): SorobanAuthorizationEntry; - static write(value: HashIdPreimageOperationId, io: Buffer): void; + static write(value: SorobanAuthorizationEntry, io: Buffer): void; - static isValid(value: HashIdPreimageOperationId): boolean; + static isValid(value: SorobanAuthorizationEntry): boolean; - static toXDR(value: HashIdPreimageOperationId): Buffer; + static toXDR(value: SorobanAuthorizationEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageOperationId; + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizationEntry; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageOperationId; + format: 'hex' | 'base64', + ): SorobanAuthorizationEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageRevokeId { + class InvokeHostFunctionOp { constructor(attributes: { - sourceAccount: AccountId; - seqNum: SequenceNumber; - opNum: number; - liquidityPoolId: PoolId; - asset: Asset; + hostFunction: HostFunction; + auth: SorobanAuthorizationEntry[]; }); - sourceAccount(value?: AccountId): AccountId; - - seqNum(value?: SequenceNumber): SequenceNumber; - - opNum(value?: number): number; - - liquidityPoolId(value?: PoolId): PoolId; + hostFunction(value?: HostFunction): HostFunction; - asset(value?: Asset): Asset; + auth(value?: SorobanAuthorizationEntry[]): SorobanAuthorizationEntry[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageRevokeId; + static read(io: Buffer): InvokeHostFunctionOp; - static write(value: HashIdPreimageRevokeId, io: Buffer): void; + static write(value: InvokeHostFunctionOp, io: Buffer): void; - static isValid(value: HashIdPreimageRevokeId): boolean; + static isValid(value: InvokeHostFunctionOp): boolean; - static toXDR(value: HashIdPreimageRevokeId): Buffer; + static toXDR(value: InvokeHostFunctionOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageRevokeId; + static fromXDR(input: Buffer, format?: 'raw'): InvokeHostFunctionOp; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageRevokeId; + format: 'hex' | 'base64', + ): InvokeHostFunctionOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageEd25519ContractId { - constructor(attributes: { - networkId: Buffer; - ed25519: Buffer; - salt: Buffer; - }); - - networkId(value?: Buffer): Buffer; + class BumpFootprintExpirationOp { + constructor(attributes: { ext: ExtensionPoint; ledgersToExpire: number }); - ed25519(value?: Buffer): Buffer; + ext(value?: ExtensionPoint): ExtensionPoint; - salt(value?: Buffer): Buffer; + ledgersToExpire(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageEd25519ContractId; + static read(io: Buffer): BumpFootprintExpirationOp; - static write(value: HashIdPreimageEd25519ContractId, io: Buffer): void; + static write(value: BumpFootprintExpirationOp, io: Buffer): void; - static isValid(value: HashIdPreimageEd25519ContractId): boolean; + static isValid(value: BumpFootprintExpirationOp): boolean; - static toXDR(value: HashIdPreimageEd25519ContractId): Buffer; + static toXDR(value: BumpFootprintExpirationOp): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): HashIdPreimageEd25519ContractId; + static fromXDR(input: Buffer, format?: 'raw'): BumpFootprintExpirationOp; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageEd25519ContractId; + format: 'hex' | 'base64', + ): BumpFootprintExpirationOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageContractId { - constructor(attributes: { - networkId: Buffer; - contractId: Buffer; - salt: Buffer; - }); - - networkId(value?: Buffer): Buffer; - - contractId(value?: Buffer): Buffer; + class RestoreFootprintOp { + constructor(attributes: { ext: ExtensionPoint }); - salt(value?: Buffer): Buffer; + ext(value?: ExtensionPoint): ExtensionPoint; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageContractId; + static read(io: Buffer): RestoreFootprintOp; - static write(value: HashIdPreimageContractId, io: Buffer): void; + static write(value: RestoreFootprintOp, io: Buffer): void; - static isValid(value: HashIdPreimageContractId): boolean; + static isValid(value: RestoreFootprintOp): boolean; - static toXDR(value: HashIdPreimageContractId): Buffer; + static toXDR(value: RestoreFootprintOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageContractId; + static fromXDR(input: Buffer, format?: 'raw'): RestoreFootprintOp; - static fromXDR( - input: string, - format: "hex" | "base64" - ): HashIdPreimageContractId; + static fromXDR(input: string, format: 'hex' | 'base64'): RestoreFootprintOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageFromAsset { - constructor(attributes: { networkId: Buffer; asset: Asset }); + class HashIdPreimageOperationId { + constructor(attributes: { + sourceAccount: AccountId; + seqNum: SequenceNumber; + opNum: number; + }); - networkId(value?: Buffer): Buffer; + sourceAccount(value?: AccountId): AccountId; - asset(value?: Asset): Asset; + seqNum(value?: SequenceNumber): SequenceNumber; + + opNum(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageFromAsset; + static read(io: Buffer): HashIdPreimageOperationId; - static write(value: HashIdPreimageFromAsset, io: Buffer): void; + static write(value: HashIdPreimageOperationId, io: Buffer): void; - static isValid(value: HashIdPreimageFromAsset): boolean; + static isValid(value: HashIdPreimageOperationId): boolean; - static toXDR(value: HashIdPreimageFromAsset): Buffer; + static toXDR(value: HashIdPreimageOperationId): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageFromAsset; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageOperationId; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageFromAsset; + format: 'hex' | 'base64', + ): HashIdPreimageOperationId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageSourceAccountContractId { + class HashIdPreimageRevokeId { constructor(attributes: { - networkId: Buffer; sourceAccount: AccountId; - salt: Buffer; + seqNum: SequenceNumber; + opNum: number; + liquidityPoolId: PoolId; + asset: Asset; }); - networkId(value?: Buffer): Buffer; - sourceAccount(value?: AccountId): AccountId; - salt(value?: Buffer): Buffer; + seqNum(value?: SequenceNumber): SequenceNumber; - toXDR(format?: "raw"): Buffer; + opNum(value?: number): number; - toXDR(format: "hex" | "base64"): string; + liquidityPoolId(value?: PoolId): PoolId; - static read(io: Buffer): HashIdPreimageSourceAccountContractId; + asset(value?: Asset): Asset; - static write( - value: HashIdPreimageSourceAccountContractId, - io: Buffer - ): void; + toXDR(format?: 'raw'): Buffer; - static isValid(value: HashIdPreimageSourceAccountContractId): boolean; + toXDR(format: 'hex' | 'base64'): string; - static toXDR(value: HashIdPreimageSourceAccountContractId): Buffer; + static read(io: Buffer): HashIdPreimageRevokeId; - static fromXDR( - input: Buffer, - format?: "raw" - ): HashIdPreimageSourceAccountContractId; + static write(value: HashIdPreimageRevokeId, io: Buffer): void; + + static isValid(value: HashIdPreimageRevokeId): boolean; + + static toXDR(value: HashIdPreimageRevokeId): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageRevokeId; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageSourceAccountContractId; + format: 'hex' | 'base64', + ): HashIdPreimageRevokeId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageCreateContractArgs { + class HashIdPreimageContractId { constructor(attributes: { networkId: Buffer; - source: ScContractExecutable; - salt: Buffer; + contractIdPreimage: ContractIdPreimage; }); networkId(value?: Buffer): Buffer; - source(value?: ScContractExecutable): ScContractExecutable; + contractIdPreimage(value?: ContractIdPreimage): ContractIdPreimage; - salt(value?: Buffer): Buffer; - - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageCreateContractArgs; + static read(io: Buffer): HashIdPreimageContractId; - static write(value: HashIdPreimageCreateContractArgs, io: Buffer): void; + static write(value: HashIdPreimageContractId, io: Buffer): void; - static isValid(value: HashIdPreimageCreateContractArgs): boolean; + static isValid(value: HashIdPreimageContractId): boolean; - static toXDR(value: HashIdPreimageCreateContractArgs): Buffer; + static toXDR(value: HashIdPreimageContractId): Buffer; - static fromXDR( - input: Buffer, - format?: "raw" - ): HashIdPreimageCreateContractArgs; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimageContractId; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageCreateContractArgs; + format: 'hex' | 'base64', + ): HashIdPreimageContractId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class HashIdPreimageContractAuth { + class HashIdPreimageSorobanAuthorization { constructor(attributes: { networkId: Buffer; - nonce: Uint64; - invocation: AuthorizedInvocation; + nonce: Int64; + signatureExpirationLedger: number; + invocation: SorobanAuthorizedInvocation; }); networkId(value?: Buffer): Buffer; - nonce(value?: Uint64): Uint64; + nonce(value?: Int64): Int64; + + signatureExpirationLedger(value?: number): number; - invocation(value?: AuthorizedInvocation): AuthorizedInvocation; + invocation( + value?: SorobanAuthorizedInvocation, + ): SorobanAuthorizedInvocation; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): HashIdPreimageContractAuth; + static read(io: Buffer): HashIdPreimageSorobanAuthorization; - static write(value: HashIdPreimageContractAuth, io: Buffer): void; + static write(value: HashIdPreimageSorobanAuthorization, io: Buffer): void; - static isValid(value: HashIdPreimageContractAuth): boolean; + static isValid(value: HashIdPreimageSorobanAuthorization): boolean; - static toXDR(value: HashIdPreimageContractAuth): Buffer; + static toXDR(value: HashIdPreimageSorobanAuthorization): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimageContractAuth; + static fromXDR( + input: Buffer, + format?: 'raw', + ): HashIdPreimageSorobanAuthorization; static fromXDR( input: string, - format: "hex" | "base64" - ): HashIdPreimageContractAuth; + format: 'hex' | 'base64', + ): HashIdPreimageSorobanAuthorization; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TimeBounds { @@ -7283,9 +6944,9 @@ export namespace xdr { maxTime(value?: TimePoint): TimePoint; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TimeBounds; @@ -7295,13 +6956,13 @@ export namespace xdr { static toXDR(value: TimeBounds): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TimeBounds; + static fromXDR(input: Buffer, format?: 'raw'): TimeBounds; - static fromXDR(input: string, format: "hex" | "base64"): TimeBounds; + static fromXDR(input: string, format: 'hex' | 'base64'): TimeBounds; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerBounds { @@ -7311,9 +6972,9 @@ export namespace xdr { maxLedger(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerBounds; @@ -7323,13 +6984,13 @@ export namespace xdr { static toXDR(value: LedgerBounds): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerBounds; + static fromXDR(input: Buffer, format?: 'raw'): LedgerBounds; - static fromXDR(input: string, format: "hex" | "base64"): LedgerBounds; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerBounds; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PreconditionsV2 { @@ -7354,9 +7015,9 @@ export namespace xdr { extraSigners(value?: SignerKey[]): SignerKey[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PreconditionsV2; @@ -7366,29 +7027,131 @@ export namespace xdr { static toXDR(value: PreconditionsV2): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PreconditionsV2; + static fromXDR(input: Buffer, format?: 'raw'): PreconditionsV2; - static fromXDR(input: string, format: "hex" | "base64"): PreconditionsV2; + static fromXDR(input: string, format: 'hex' | 'base64'): PreconditionsV2; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class TransactionV0 { - constructor(attributes: { - sourceAccountEd25519: Buffer; - fee: number; - seqNum: SequenceNumber; - timeBounds: null | TimeBounds; - memo: Memo; - operations: Operation[]; - ext: TransactionV0Ext; - }); + class LedgerFootprint { + constructor(attributes: { readOnly: LedgerKey[]; readWrite: LedgerKey[] }); - sourceAccountEd25519(value?: Buffer): Buffer; + readOnly(value?: LedgerKey[]): LedgerKey[]; - fee(value?: number): number; + readWrite(value?: LedgerKey[]): LedgerKey[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): LedgerFootprint; + + static write(value: LedgerFootprint, io: Buffer): void; + + static isValid(value: LedgerFootprint): boolean; + + static toXDR(value: LedgerFootprint): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): LedgerFootprint; + + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerFootprint; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanResources { + constructor(attributes: { + footprint: LedgerFootprint; + instructions: number; + readBytes: number; + writeBytes: number; + }); + + footprint(value?: LedgerFootprint): LedgerFootprint; + + instructions(value?: number): number; + + readBytes(value?: number): number; + + writeBytes(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanResources; + + static write(value: SorobanResources, io: Buffer): void; + + static isValid(value: SorobanResources): boolean; + + static toXDR(value: SorobanResources): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanResources; + + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanResources; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanTransactionData { + constructor(attributes: { + ext: ExtensionPoint; + resources: SorobanResources; + refundableFee: Int64; + }); + + ext(value?: ExtensionPoint): ExtensionPoint; + + resources(value?: SorobanResources): SorobanResources; + + refundableFee(value?: Int64): Int64; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanTransactionData; + + static write(value: SorobanTransactionData, io: Buffer): void; + + static isValid(value: SorobanTransactionData): boolean; + + static toXDR(value: SorobanTransactionData): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanTransactionData; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanTransactionData; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class TransactionV0 { + constructor(attributes: { + sourceAccountEd25519: Buffer; + fee: number; + seqNum: SequenceNumber; + timeBounds: null | TimeBounds; + memo: Memo; + operations: Operation[]; + ext: TransactionV0Ext; + }); + + sourceAccountEd25519(value?: Buffer): Buffer; + + fee(value?: number): number; seqNum(value?: SequenceNumber): SequenceNumber; @@ -7400,9 +7163,9 @@ export namespace xdr { ext(value?: TransactionV0Ext): TransactionV0Ext; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionV0; @@ -7412,13 +7175,13 @@ export namespace xdr { static toXDR(value: TransactionV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0; - static fromXDR(input: string, format: "hex" | "base64"): TransactionV0; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionV0Envelope { @@ -7431,9 +7194,9 @@ export namespace xdr { signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionV0Envelope; @@ -7443,16 +7206,16 @@ export namespace xdr { static toXDR(value: TransactionV0Envelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0Envelope; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0Envelope; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionV0Envelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Transaction { @@ -7480,9 +7243,9 @@ export namespace xdr { ext(value?: TransactionExt): TransactionExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Transaction; @@ -7492,13 +7255,13 @@ export namespace xdr { static toXDR(value: Transaction): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Transaction; + static fromXDR(input: Buffer, format?: 'raw'): Transaction; - static fromXDR(input: string, format: "hex" | "base64"): Transaction; + static fromXDR(input: string, format: 'hex' | 'base64'): Transaction; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionV1Envelope { @@ -7511,9 +7274,9 @@ export namespace xdr { signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionV1Envelope; @@ -7523,16 +7286,16 @@ export namespace xdr { static toXDR(value: TransactionV1Envelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV1Envelope; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV1Envelope; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionV1Envelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FeeBumpTransaction { @@ -7551,9 +7314,9 @@ export namespace xdr { ext(value?: FeeBumpTransactionExt): FeeBumpTransactionExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FeeBumpTransaction; @@ -7563,13 +7326,13 @@ export namespace xdr { static toXDR(value: FeeBumpTransaction): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransaction; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransaction; - static fromXDR(input: string, format: "hex" | "base64"): FeeBumpTransaction; + static fromXDR(input: string, format: 'hex' | 'base64'): FeeBumpTransaction; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FeeBumpTransactionEnvelope { @@ -7582,9 +7345,9 @@ export namespace xdr { signatures(value?: DecoratedSignature[]): DecoratedSignature[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FeeBumpTransactionEnvelope; @@ -7594,16 +7357,16 @@ export namespace xdr { static toXDR(value: FeeBumpTransactionEnvelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionEnvelope; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionEnvelope; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): FeeBumpTransactionEnvelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionSignaturePayload { @@ -7615,12 +7378,12 @@ export namespace xdr { networkId(value?: Buffer): Buffer; taggedTransaction( - value?: TransactionSignaturePayloadTaggedTransaction + value?: TransactionSignaturePayloadTaggedTransaction, ): TransactionSignaturePayloadTaggedTransaction; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionSignaturePayload; @@ -7630,16 +7393,16 @@ export namespace xdr { static toXDR(value: TransactionSignaturePayload): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionSignaturePayload; + static fromXDR(input: Buffer, format?: 'raw'): TransactionSignaturePayload; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionSignaturePayload; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimOfferAtomV0 { @@ -7664,9 +7427,9 @@ export namespace xdr { amountBought(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimOfferAtomV0; @@ -7676,13 +7439,13 @@ export namespace xdr { static toXDR(value: ClaimOfferAtomV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimOfferAtomV0; + static fromXDR(input: Buffer, format?: 'raw'): ClaimOfferAtomV0; - static fromXDR(input: string, format: "hex" | "base64"): ClaimOfferAtomV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimOfferAtomV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimOfferAtom { @@ -7707,9 +7470,9 @@ export namespace xdr { amountBought(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimOfferAtom; @@ -7719,13 +7482,13 @@ export namespace xdr { static toXDR(value: ClaimOfferAtom): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimOfferAtom; + static fromXDR(input: Buffer, format?: 'raw'): ClaimOfferAtom; - static fromXDR(input: string, format: "hex" | "base64"): ClaimOfferAtom; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimOfferAtom; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimLiquidityAtom { @@ -7747,9 +7510,9 @@ export namespace xdr { amountBought(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimLiquidityAtom; @@ -7759,13 +7522,13 @@ export namespace xdr { static toXDR(value: ClaimLiquidityAtom): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimLiquidityAtom; + static fromXDR(input: Buffer, format?: 'raw'): ClaimLiquidityAtom; - static fromXDR(input: string, format: "hex" | "base64"): ClaimLiquidityAtom; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimLiquidityAtom; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SimplePaymentResult { @@ -7781,9 +7544,9 @@ export namespace xdr { amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SimplePaymentResult; @@ -7793,16 +7556,16 @@ export namespace xdr { static toXDR(value: SimplePaymentResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SimplePaymentResult; + static fromXDR(input: Buffer, format?: 'raw'): SimplePaymentResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SimplePaymentResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictReceiveResultSuccess { @@ -7812,15 +7575,15 @@ export namespace xdr { last(value?: SimplePaymentResult): SimplePaymentResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictReceiveResultSuccess; static write( value: PathPaymentStrictReceiveResultSuccess, - io: Buffer + io: Buffer, ): void; static isValid(value: PathPaymentStrictReceiveResultSuccess): boolean; @@ -7829,17 +7592,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): PathPaymentStrictReceiveResultSuccess; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictReceiveResultSuccess; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictSendResultSuccess { @@ -7849,9 +7612,9 @@ export namespace xdr { last(value?: SimplePaymentResult): SimplePaymentResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictSendResultSuccess; @@ -7863,17 +7626,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): PathPaymentStrictSendResultSuccess; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictSendResultSuccess; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageOfferSuccessResult { @@ -7886,9 +7649,9 @@ export namespace xdr { offer(value?: ManageOfferSuccessResultOffer): ManageOfferSuccessResultOffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageOfferSuccessResult; @@ -7898,16 +7661,16 @@ export namespace xdr { static toXDR(value: ManageOfferSuccessResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageOfferSuccessResult; + static fromXDR(input: Buffer, format?: 'raw'): ManageOfferSuccessResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ManageOfferSuccessResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InflationPayout { @@ -7917,9 +7680,9 @@ export namespace xdr { amount(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InflationPayout; @@ -7929,13 +7692,13 @@ export namespace xdr { static toXDR(value: InflationPayout): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InflationPayout; + static fromXDR(input: Buffer, format?: 'raw'): InflationPayout; - static fromXDR(input: string, format: "hex" | "base64"): InflationPayout; + static fromXDR(input: string, format: 'hex' | 'base64'): InflationPayout; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InnerTransactionResult { @@ -7951,9 +7714,9 @@ export namespace xdr { ext(value?: InnerTransactionResultExt): InnerTransactionResultExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InnerTransactionResult; @@ -7963,16 +7726,16 @@ export namespace xdr { static toXDR(value: InnerTransactionResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResult; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): InnerTransactionResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InnerTransactionResultPair { @@ -7985,9 +7748,9 @@ export namespace xdr { result(value?: InnerTransactionResult): InnerTransactionResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InnerTransactionResultPair; @@ -7997,16 +7760,16 @@ export namespace xdr { static toXDR(value: InnerTransactionResultPair): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultPair; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultPair; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): InnerTransactionResultPair; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionResult { @@ -8022,9 +7785,9 @@ export namespace xdr { ext(value?: TransactionResultExt): TransactionResultExt; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionResult; @@ -8034,13 +7797,13 @@ export namespace xdr { static toXDR(value: TransactionResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResult; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResult; - static fromXDR(input: string, format: "hex" | "base64"): TransactionResult; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SignerKeyEd25519SignedPayload { @@ -8050,9 +7813,9 @@ export namespace xdr { payload(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SignerKeyEd25519SignedPayload; @@ -8064,17 +7827,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): SignerKeyEd25519SignedPayload; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SignerKeyEd25519SignedPayload; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Curve25519Secret { @@ -8082,9 +7845,9 @@ export namespace xdr { key(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Curve25519Secret; @@ -8094,13 +7857,13 @@ export namespace xdr { static toXDR(value: Curve25519Secret): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Curve25519Secret; + static fromXDR(input: Buffer, format?: 'raw'): Curve25519Secret; - static fromXDR(input: string, format: "hex" | "base64"): Curve25519Secret; + static fromXDR(input: string, format: 'hex' | 'base64'): Curve25519Secret; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Curve25519Public { @@ -8108,9 +7871,9 @@ export namespace xdr { key(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Curve25519Public; @@ -8120,13 +7883,13 @@ export namespace xdr { static toXDR(value: Curve25519Public): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Curve25519Public; + static fromXDR(input: Buffer, format?: 'raw'): Curve25519Public; - static fromXDR(input: string, format: "hex" | "base64"): Curve25519Public; + static fromXDR(input: string, format: 'hex' | 'base64'): Curve25519Public; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class HmacSha256Key { @@ -8134,9 +7897,9 @@ export namespace xdr { key(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): HmacSha256Key; @@ -8146,13 +7909,13 @@ export namespace xdr { static toXDR(value: HmacSha256Key): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HmacSha256Key; + static fromXDR(input: Buffer, format?: 'raw'): HmacSha256Key; - static fromXDR(input: string, format: "hex" | "base64"): HmacSha256Key; + static fromXDR(input: string, format: 'hex' | 'base64'): HmacSha256Key; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class HmacSha256Mac { @@ -8160,9 +7923,9 @@ export namespace xdr { mac(value?: Buffer): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): HmacSha256Mac; @@ -8172,13 +7935,13 @@ export namespace xdr { static toXDR(value: HmacSha256Mac): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HmacSha256Mac; + static fromXDR(input: Buffer, format?: 'raw'): HmacSha256Mac; - static fromXDR(input: string, format: "hex" | "base64"): HmacSha256Mac; + static fromXDR(input: string, format: 'hex' | 'base64'): HmacSha256Mac; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class UInt128Parts { @@ -8188,9 +7951,9 @@ export namespace xdr { lo(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): UInt128Parts; @@ -8200,13 +7963,13 @@ export namespace xdr { static toXDR(value: UInt128Parts): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UInt128Parts; + static fromXDR(input: Buffer, format?: 'raw'): UInt128Parts; - static fromXDR(input: string, format: "hex" | "base64"): UInt128Parts; + static fromXDR(input: string, format: 'hex' | 'base64'): UInt128Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Int128Parts { @@ -8216,9 +7979,9 @@ export namespace xdr { lo(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Int128Parts; @@ -8228,13 +7991,13 @@ export namespace xdr { static toXDR(value: Int128Parts): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Int128Parts; + static fromXDR(input: Buffer, format?: 'raw'): Int128Parts; - static fromXDR(input: string, format: "hex" | "base64"): Int128Parts; + static fromXDR(input: string, format: 'hex' | 'base64'): Int128Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class UInt256Parts { @@ -8253,9 +8016,9 @@ export namespace xdr { loLo(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): UInt256Parts; @@ -8265,13 +8028,13 @@ export namespace xdr { static toXDR(value: UInt256Parts): Buffer; - static fromXDR(input: Buffer, format?: "raw"): UInt256Parts; + static fromXDR(input: Buffer, format?: 'raw'): UInt256Parts; - static fromXDR(input: string, format: "hex" | "base64"): UInt256Parts; + static fromXDR(input: string, format: 'hex' | 'base64'): UInt256Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Int256Parts { @@ -8290,9 +8053,9 @@ export namespace xdr { loLo(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Int256Parts; @@ -8302,23 +8065,23 @@ export namespace xdr { static toXDR(value: Int256Parts): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Int256Parts; + static fromXDR(input: Buffer, format?: 'raw'): Int256Parts; - static fromXDR(input: string, format: "hex" | "base64"): Int256Parts; + static fromXDR(input: string, format: 'hex' | 'base64'): Int256Parts; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScNonceKey { - constructor(attributes: { nonceAddress: ScAddress }); + constructor(attributes: { nonce: Int64 }); - nonceAddress(value?: ScAddress): ScAddress; + nonce(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScNonceKey; @@ -8328,13 +8091,44 @@ export namespace xdr { static toXDR(value: ScNonceKey): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScNonceKey; + static fromXDR(input: Buffer, format?: 'raw'): ScNonceKey; - static fromXDR(input: string, format: "hex" | "base64"): ScNonceKey; + static fromXDR(input: string, format: 'hex' | 'base64'): ScNonceKey; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScContractInstance { + constructor(attributes: { + executable: ContractExecutable; + storage: null | ScMapEntry[]; + }); + + executable(value?: ContractExecutable): ContractExecutable; + + storage(value?: null | ScMapEntry[]): null | ScMapEntry[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScContractInstance; + + static write(value: ScContractInstance, io: Buffer): void; + + static isValid(value: ScContractInstance): boolean; + + static toXDR(value: ScContractInstance): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScContractInstance; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScContractInstance; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScMapEntry { @@ -8344,9 +8138,9 @@ export namespace xdr { val(value?: ScVal): ScVal; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScMapEntry; @@ -8356,13 +8150,41 @@ export namespace xdr { static toXDR(value: ScMapEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScMapEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScMapEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScMapEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScMetaV0 { + constructor(attributes: { key: string | Buffer; val: string | Buffer }); + + key(value?: string | Buffer): string | Buffer; + + val(value?: string | Buffer): string | Buffer; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScMetaV0; + + static write(value: ScMetaV0, io: Buffer): void; + + static isValid(value: ScMetaV0): boolean; + + static toXDR(value: ScMetaV0): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): ScMapEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScMetaV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): ScMetaV0; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeOption { @@ -8370,9 +8192,9 @@ export namespace xdr { valueType(value?: ScSpecTypeDef): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeOption; @@ -8382,13 +8204,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeOption): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeOption; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeOption; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeOption; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeOption; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeResult { @@ -8401,9 +8223,9 @@ export namespace xdr { errorType(value?: ScSpecTypeDef): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeResult; @@ -8413,13 +8235,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeResult; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeResult; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeVec { @@ -8427,9 +8249,9 @@ export namespace xdr { elementType(value?: ScSpecTypeDef): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeVec; @@ -8439,13 +8261,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeVec): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeVec; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeVec; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeVec; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeVec; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeMap { @@ -8458,9 +8280,9 @@ export namespace xdr { valueType(value?: ScSpecTypeDef): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeMap; @@ -8470,39 +8292,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeMap): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeMap; - - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeMap; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ScSpecTypeSet { - constructor(attributes: { elementType: ScSpecTypeDef }); - - elementType(value?: ScSpecTypeDef): ScSpecTypeDef; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ScSpecTypeSet; - - static write(value: ScSpecTypeSet, io: Buffer): void; - - static isValid(value: ScSpecTypeSet): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeMap; - static toXDR(value: ScSpecTypeSet): Buffer; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeMap; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeSet; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeSet; - - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeTuple { @@ -8510,9 +8306,9 @@ export namespace xdr { valueTypes(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeTuple; @@ -8522,13 +8318,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeTuple): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeTuple; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeTuple; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeTuple; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeTuple; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeBytesN { @@ -8536,9 +8332,9 @@ export namespace xdr { n(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeBytesN; @@ -8548,13 +8344,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeBytesN): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeBytesN; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeBytesN; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeBytesN; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeBytesN; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeUdt { @@ -8562,9 +8358,9 @@ export namespace xdr { name(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeUdt; @@ -8574,13 +8370,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeUdt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeUdt; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeUdt; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeUdt; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeUdt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecUdtStructFieldV0 { @@ -8596,9 +8392,9 @@ export namespace xdr { type(value?: ScSpecTypeDef): ScSpecTypeDef; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecUdtStructFieldV0; @@ -8608,16 +8404,16 @@ export namespace xdr { static toXDR(value: ScSpecUdtStructFieldV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtStructFieldV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtStructFieldV0; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScSpecUdtStructFieldV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecUdtStructV0 { @@ -8636,9 +8432,9 @@ export namespace xdr { fields(value?: ScSpecUdtStructFieldV0[]): ScSpecUdtStructFieldV0[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecUdtStructV0; @@ -8648,13 +8444,13 @@ export namespace xdr { static toXDR(value: ScSpecUdtStructV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtStructV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtStructV0; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecUdtStructV0; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtStructV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecUdtUnionCaseVoidV0 { @@ -8664,327 +8460,719 @@ export namespace xdr { name(value?: string | Buffer): string | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionCaseVoidV0; + + static write(value: ScSpecUdtUnionCaseVoidV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionCaseVoidV0): boolean; + + static toXDR(value: ScSpecUdtUnionCaseVoidV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseVoidV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtUnionCaseVoidV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtUnionCaseTupleV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionCaseTupleV0; + + static write(value: ScSpecUdtUnionCaseTupleV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionCaseTupleV0): boolean; + + static toXDR(value: ScSpecUdtUnionCaseTupleV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseTupleV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtUnionCaseTupleV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtUnionV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtUnionCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtUnionCaseV0[]): ScSpecUdtUnionCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtUnionV0; + + static write(value: ScSpecUdtUnionV0, io: Buffer): void; + + static isValid(value: ScSpecUdtUnionV0): boolean; + + static toXDR(value: ScSpecUdtUnionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtUnionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtEnumCaseV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + value: number; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + value(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtEnumCaseV0; + + static write(value: ScSpecUdtEnumCaseV0, io: Buffer): void; + + static isValid(value: ScSpecUdtEnumCaseV0): boolean; + + static toXDR(value: ScSpecUdtEnumCaseV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtEnumCaseV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtEnumCaseV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtEnumV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtEnumCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtEnumCaseV0[]): ScSpecUdtEnumCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtEnumV0; + + static write(value: ScSpecUdtEnumV0, io: Buffer): void; + + static isValid(value: ScSpecUdtEnumV0): boolean; + + static toXDR(value: ScSpecUdtEnumV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtEnumV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecUdtEnumV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtErrorEnumCaseV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + value: number; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + value(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtErrorEnumCaseV0; + + static write(value: ScSpecUdtErrorEnumCaseV0, io: Buffer): void; + + static isValid(value: ScSpecUdtErrorEnumCaseV0): boolean; + + static toXDR(value: ScSpecUdtErrorEnumCaseV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtErrorEnumCaseV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtErrorEnumCaseV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecUdtErrorEnumV0 { + constructor(attributes: { + doc: string | Buffer; + lib: string | Buffer; + name: string | Buffer; + cases: ScSpecUdtErrorEnumCaseV0[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + lib(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + cases(value?: ScSpecUdtErrorEnumCaseV0[]): ScSpecUdtErrorEnumCaseV0[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecUdtErrorEnumV0; + + static write(value: ScSpecUdtErrorEnumV0, io: Buffer): void; + + static isValid(value: ScSpecUdtErrorEnumV0): boolean; + + static toXDR(value: ScSpecUdtErrorEnumV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtErrorEnumV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecUdtErrorEnumV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecFunctionInputV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + type: ScSpecTypeDef; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + type(value?: ScSpecTypeDef): ScSpecTypeDef; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecFunctionInputV0; + + static write(value: ScSpecFunctionInputV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionInputV0): boolean; + + static toXDR(value: ScSpecFunctionInputV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionInputV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ScSpecFunctionInputV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScSpecFunctionV0 { + constructor(attributes: { + doc: string | Buffer; + name: string | Buffer; + inputs: ScSpecFunctionInputV0[]; + outputs: ScSpecTypeDef[]; + }); + + doc(value?: string | Buffer): string | Buffer; + + name(value?: string | Buffer): string | Buffer; + + inputs(value?: ScSpecFunctionInputV0[]): ScSpecFunctionInputV0[]; + + outputs(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScSpecFunctionV0; + + static write(value: ScSpecFunctionV0, io: Buffer): void; + + static isValid(value: ScSpecFunctionV0): boolean; + + static toXDR(value: ScSpecFunctionV0): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ScSpecFunctionV0; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecFunctionV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractExecutionLanesV0 { + constructor(attributes: { ledgerMaxTxCount: number }); + + ledgerMaxTxCount(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractExecutionLanesV0; + + static write( + value: ConfigSettingContractExecutionLanesV0, + io: Buffer, + ): void; + + static isValid(value: ConfigSettingContractExecutionLanesV0): boolean; + + static toXDR(value: ConfigSettingContractExecutionLanesV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractExecutionLanesV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractExecutionLanesV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractComputeV0 { + constructor(attributes: { + ledgerMaxInstructions: Int64; + txMaxInstructions: Int64; + feeRatePerInstructionsIncrement: Int64; + txMemoryLimit: number; + }); + + ledgerMaxInstructions(value?: Int64): Int64; + + txMaxInstructions(value?: Int64): Int64; + + feeRatePerInstructionsIncrement(value?: Int64): Int64; + + txMemoryLimit(value?: number): number; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingContractComputeV0; + + static write(value: ConfigSettingContractComputeV0, io: Buffer): void; + + static isValid(value: ConfigSettingContractComputeV0): boolean; + + static toXDR(value: ConfigSettingContractComputeV0): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractComputeV0; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractComputeV0; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingContractLedgerCostV0 { + constructor(attributes: { + ledgerMaxReadLedgerEntries: number; + ledgerMaxReadBytes: number; + ledgerMaxWriteLedgerEntries: number; + ledgerMaxWriteBytes: number; + txMaxReadLedgerEntries: number; + txMaxReadBytes: number; + txMaxWriteLedgerEntries: number; + txMaxWriteBytes: number; + feeReadLedgerEntry: Int64; + feeWriteLedgerEntry: Int64; + feeRead1Kb: Int64; + bucketListTargetSizeBytes: Int64; + writeFee1KbBucketListLow: Int64; + writeFee1KbBucketListHigh: Int64; + bucketListWriteFeeGrowthFactor: number; + }); + + ledgerMaxReadLedgerEntries(value?: number): number; + + ledgerMaxReadBytes(value?: number): number; - toXDR(format: "hex" | "base64"): string; + ledgerMaxWriteLedgerEntries(value?: number): number; - static read(io: Buffer): ScSpecUdtUnionCaseVoidV0; + ledgerMaxWriteBytes(value?: number): number; - static write(value: ScSpecUdtUnionCaseVoidV0, io: Buffer): void; + txMaxReadLedgerEntries(value?: number): number; - static isValid(value: ScSpecUdtUnionCaseVoidV0): boolean; + txMaxReadBytes(value?: number): number; - static toXDR(value: ScSpecUdtUnionCaseVoidV0): Buffer; + txMaxWriteLedgerEntries(value?: number): number; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtUnionCaseVoidV0; + txMaxWriteBytes(value?: number): number; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScSpecUdtUnionCaseVoidV0; + feeReadLedgerEntry(value?: Int64): Int64; - static validateXDR(input: Buffer, format?: "raw"): boolean; + feeWriteLedgerEntry(value?: Int64): Int64; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + feeRead1Kb(value?: Int64): Int64; - class ScSpecUdtUnionCaseTupleV0 { - constructor(attributes: { - doc: string | Buffer; - name: string | Buffer; - type: ScSpecTypeDef[]; - }); + bucketListTargetSizeBytes(value?: Int64): Int64; - doc(value?: string | Buffer): string | Buffer; + writeFee1KbBucketListLow(value?: Int64): Int64; - name(value?: string | Buffer): string | Buffer; + writeFee1KbBucketListHigh(value?: Int64): Int64; - type(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + bucketListWriteFeeGrowthFactor(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecUdtUnionCaseTupleV0; + static read(io: Buffer): ConfigSettingContractLedgerCostV0; - static write(value: ScSpecUdtUnionCaseTupleV0, io: Buffer): void; + static write(value: ConfigSettingContractLedgerCostV0, io: Buffer): void; - static isValid(value: ScSpecUdtUnionCaseTupleV0): boolean; + static isValid(value: ConfigSettingContractLedgerCostV0): boolean; - static toXDR(value: ScSpecUdtUnionCaseTupleV0): Buffer; + static toXDR(value: ConfigSettingContractLedgerCostV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtUnionCaseTupleV0; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractLedgerCostV0; static fromXDR( input: string, - format: "hex" | "base64" - ): ScSpecUdtUnionCaseTupleV0; + format: 'hex' | 'base64', + ): ConfigSettingContractLedgerCostV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecUdtUnionV0 { - constructor(attributes: { - doc: string | Buffer; - lib: string | Buffer; - name: string | Buffer; - cases: ScSpecUdtUnionCaseV0[]; - }); - - doc(value?: string | Buffer): string | Buffer; - - lib(value?: string | Buffer): string | Buffer; - - name(value?: string | Buffer): string | Buffer; + class ConfigSettingContractHistoricalDataV0 { + constructor(attributes: { feeHistorical1Kb: Int64 }); - cases(value?: ScSpecUdtUnionCaseV0[]): ScSpecUdtUnionCaseV0[]; + feeHistorical1Kb(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecUdtUnionV0; + static read(io: Buffer): ConfigSettingContractHistoricalDataV0; - static write(value: ScSpecUdtUnionV0, io: Buffer): void; + static write( + value: ConfigSettingContractHistoricalDataV0, + io: Buffer, + ): void; - static isValid(value: ScSpecUdtUnionV0): boolean; + static isValid(value: ConfigSettingContractHistoricalDataV0): boolean; - static toXDR(value: ScSpecUdtUnionV0): Buffer; + static toXDR(value: ConfigSettingContractHistoricalDataV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtUnionV0; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractHistoricalDataV0; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecUdtUnionV0; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractHistoricalDataV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecUdtEnumCaseV0 { + class ConfigSettingContractEventsV0 { constructor(attributes: { - doc: string | Buffer; - name: string | Buffer; - value: number; + txMaxContractEventsSizeBytes: number; + feeContractEvents1Kb: Int64; }); - doc(value?: string | Buffer): string | Buffer; - - name(value?: string | Buffer): string | Buffer; + txMaxContractEventsSizeBytes(value?: number): number; - value(value?: number): number; + feeContractEvents1Kb(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecUdtEnumCaseV0; + static read(io: Buffer): ConfigSettingContractEventsV0; - static write(value: ScSpecUdtEnumCaseV0, io: Buffer): void; + static write(value: ConfigSettingContractEventsV0, io: Buffer): void; - static isValid(value: ScSpecUdtEnumCaseV0): boolean; + static isValid(value: ConfigSettingContractEventsV0): boolean; - static toXDR(value: ScSpecUdtEnumCaseV0): Buffer; + static toXDR(value: ConfigSettingContractEventsV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtEnumCaseV0; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractEventsV0; static fromXDR( input: string, - format: "hex" | "base64" - ): ScSpecUdtEnumCaseV0; + format: 'hex' | 'base64', + ): ConfigSettingContractEventsV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecUdtEnumV0 { + class ConfigSettingContractBandwidthV0 { constructor(attributes: { - doc: string | Buffer; - lib: string | Buffer; - name: string | Buffer; - cases: ScSpecUdtEnumCaseV0[]; + ledgerMaxTxsSizeBytes: number; + txMaxSizeBytes: number; + feeTxSize1Kb: Int64; }); - doc(value?: string | Buffer): string | Buffer; - - lib(value?: string | Buffer): string | Buffer; + ledgerMaxTxsSizeBytes(value?: number): number; - name(value?: string | Buffer): string | Buffer; + txMaxSizeBytes(value?: number): number; - cases(value?: ScSpecUdtEnumCaseV0[]): ScSpecUdtEnumCaseV0[]; + feeTxSize1Kb(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecUdtEnumV0; + static read(io: Buffer): ConfigSettingContractBandwidthV0; - static write(value: ScSpecUdtEnumV0, io: Buffer): void; + static write(value: ConfigSettingContractBandwidthV0, io: Buffer): void; - static isValid(value: ScSpecUdtEnumV0): boolean; + static isValid(value: ConfigSettingContractBandwidthV0): boolean; - static toXDR(value: ScSpecUdtEnumV0): Buffer; + static toXDR(value: ConfigSettingContractBandwidthV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtEnumV0; + static fromXDR( + input: Buffer, + format?: 'raw', + ): ConfigSettingContractBandwidthV0; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecUdtEnumV0; + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): ConfigSettingContractBandwidthV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecUdtErrorEnumCaseV0 { + class ContractCostParamEntry { constructor(attributes: { - doc: string | Buffer; - name: string | Buffer; - value: number; + ext: ExtensionPoint; + constTerm: Int64; + linearTerm: Int64; }); - doc(value?: string | Buffer): string | Buffer; + ext(value?: ExtensionPoint): ExtensionPoint; - name(value?: string | Buffer): string | Buffer; + constTerm(value?: Int64): Int64; - value(value?: number): number; + linearTerm(value?: Int64): Int64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecUdtErrorEnumCaseV0; + static read(io: Buffer): ContractCostParamEntry; - static write(value: ScSpecUdtErrorEnumCaseV0, io: Buffer): void; + static write(value: ContractCostParamEntry, io: Buffer): void; - static isValid(value: ScSpecUdtErrorEnumCaseV0): boolean; + static isValid(value: ContractCostParamEntry): boolean; - static toXDR(value: ScSpecUdtErrorEnumCaseV0): Buffer; + static toXDR(value: ContractCostParamEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtErrorEnumCaseV0; + static fromXDR(input: Buffer, format?: 'raw'): ContractCostParamEntry; static fromXDR( input: string, - format: "hex" | "base64" - ): ScSpecUdtErrorEnumCaseV0; + format: 'hex' | 'base64', + ): ContractCostParamEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecUdtErrorEnumV0 { + class StateExpirationSettings { constructor(attributes: { - doc: string | Buffer; - lib: string | Buffer; - name: string | Buffer; - cases: ScSpecUdtErrorEnumCaseV0[]; + maxEntryExpiration: number; + minTempEntryExpiration: number; + minPersistentEntryExpiration: number; + persistentRentRateDenominator: Int64; + tempRentRateDenominator: Int64; + maxEntriesToExpire: number; + bucketListSizeWindowSampleSize: number; + evictionScanSize: Uint64; + startingEvictionScanLevel: number; }); - doc(value?: string | Buffer): string | Buffer; - - lib(value?: string | Buffer): string | Buffer; - - name(value?: string | Buffer): string | Buffer; - - cases(value?: ScSpecUdtErrorEnumCaseV0[]): ScSpecUdtErrorEnumCaseV0[]; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; + maxEntryExpiration(value?: number): number; - static read(io: Buffer): ScSpecUdtErrorEnumV0; - - static write(value: ScSpecUdtErrorEnumV0, io: Buffer): void; - - static isValid(value: ScSpecUdtErrorEnumV0): boolean; - - static toXDR(value: ScSpecUdtErrorEnumV0): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtErrorEnumV0; + minTempEntryExpiration(value?: number): number; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScSpecUdtErrorEnumV0; + minPersistentEntryExpiration(value?: number): number; - static validateXDR(input: Buffer, format?: "raw"): boolean; + persistentRentRateDenominator(value?: Int64): Int64; - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } + tempRentRateDenominator(value?: Int64): Int64; - class ScSpecFunctionInputV0 { - constructor(attributes: { - doc: string | Buffer; - name: string | Buffer; - type: ScSpecTypeDef; - }); + maxEntriesToExpire(value?: number): number; - doc(value?: string | Buffer): string | Buffer; + bucketListSizeWindowSampleSize(value?: number): number; - name(value?: string | Buffer): string | Buffer; + evictionScanSize(value?: Uint64): Uint64; - type(value?: ScSpecTypeDef): ScSpecTypeDef; + startingEvictionScanLevel(value?: number): number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecFunctionInputV0; + static read(io: Buffer): StateExpirationSettings; - static write(value: ScSpecFunctionInputV0, io: Buffer): void; + static write(value: StateExpirationSettings, io: Buffer): void; - static isValid(value: ScSpecFunctionInputV0): boolean; + static isValid(value: StateExpirationSettings): boolean; - static toXDR(value: ScSpecFunctionInputV0): Buffer; + static toXDR(value: StateExpirationSettings): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecFunctionInputV0; + static fromXDR(input: Buffer, format?: 'raw'): StateExpirationSettings; static fromXDR( input: string, - format: "hex" | "base64" - ): ScSpecFunctionInputV0; + format: 'hex' | 'base64', + ): StateExpirationSettings; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScSpecFunctionV0 { + class EvictionIterator { constructor(attributes: { - doc: string | Buffer; - name: string | Buffer; - inputs: ScSpecFunctionInputV0[]; - outputs: ScSpecTypeDef[]; + bucketListLevel: number; + isCurrBucket: boolean; + bucketFileOffset: Uint64; }); - doc(value?: string | Buffer): string | Buffer; - - name(value?: string | Buffer): string | Buffer; + bucketListLevel(value?: number): number; - inputs(value?: ScSpecFunctionInputV0[]): ScSpecFunctionInputV0[]; + isCurrBucket(value?: boolean): boolean; - outputs(value?: ScSpecTypeDef[]): ScSpecTypeDef[]; + bucketFileOffset(value?: Uint64): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScSpecFunctionV0; + static read(io: Buffer): EvictionIterator; - static write(value: ScSpecFunctionV0, io: Buffer): void; + static write(value: EvictionIterator, io: Buffer): void; - static isValid(value: ScSpecFunctionV0): boolean; + static isValid(value: EvictionIterator): boolean; - static toXDR(value: ScSpecFunctionV0): Buffer; + static toXDR(value: EvictionIterator): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecFunctionV0; + static fromXDR(input: Buffer, format?: 'raw'): EvictionIterator; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecFunctionV0; + static fromXDR(input: string, format: 'hex' | 'base64'): EvictionIterator; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpStatementPledges { @@ -9003,7 +9191,7 @@ export namespace xdr { static scpStConfirm(value: ScpStatementConfirm): ScpStatementPledges; static scpStExternalize( - value: ScpStatementExternalize + value: ScpStatementExternalize, ): ScpStatementPledges; static scpStNominate(value: ScpNomination): ScpStatementPledges; @@ -9014,9 +9202,9 @@ export namespace xdr { | ScpStatementExternalize | ScpNomination; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpStatementPledges; @@ -9026,16 +9214,16 @@ export namespace xdr { static toXDR(value: ScpStatementPledges): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpStatementPledges; + static fromXDR(input: Buffer, format?: 'raw'): ScpStatementPledges; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScpStatementPledges; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AssetCode { @@ -9051,9 +9239,9 @@ export namespace xdr { value(): Buffer | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AssetCode; @@ -9063,13 +9251,13 @@ export namespace xdr { static toXDR(value: AssetCode): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AssetCode; + static fromXDR(input: Buffer, format?: 'raw'): AssetCode; - static fromXDR(input: string, format: "hex" | "base64"): AssetCode; + static fromXDR(input: string, format: 'hex' | 'base64'): AssetCode; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Asset { @@ -9087,9 +9275,9 @@ export namespace xdr { value(): AlphaNum4 | AlphaNum12 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Asset; @@ -9099,13 +9287,13 @@ export namespace xdr { static toXDR(value: Asset): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Asset; + static fromXDR(input: Buffer, format?: 'raw'): Asset; - static fromXDR(input: string, format: "hex" | "base64"): Asset; + static fromXDR(input: string, format: 'hex' | 'base64'): Asset; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExtensionV2Ext { @@ -9119,9 +9307,9 @@ export namespace xdr { value(): AccountEntryExtensionV3 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExtensionV2Ext; @@ -9131,16 +9319,16 @@ export namespace xdr { static toXDR(value: AccountEntryExtensionV2Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV2Ext; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV2Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AccountEntryExtensionV2Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExtensionV1Ext { @@ -9154,9 +9342,9 @@ export namespace xdr { value(): AccountEntryExtensionV2 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExtensionV1Ext; @@ -9166,16 +9354,16 @@ export namespace xdr { static toXDR(value: AccountEntryExtensionV1Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExtensionV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExtensionV1Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AccountEntryExtensionV1Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountEntryExt { @@ -9189,9 +9377,9 @@ export namespace xdr { value(): AccountEntryExtensionV1 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountEntryExt; @@ -9201,13 +9389,13 @@ export namespace xdr { static toXDR(value: AccountEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): AccountEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): AccountEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): AccountEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineAsset { @@ -9229,9 +9417,9 @@ export namespace xdr { value(): AlphaNum4 | AlphaNum12 | PoolId | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineAsset; @@ -9241,13 +9429,13 @@ export namespace xdr { static toXDR(value: TrustLineAsset): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineAsset; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineAsset; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineAsset; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineAsset; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntryExtensionV2Ext { @@ -9257,9 +9445,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntryExtensionV2Ext; @@ -9269,16 +9457,16 @@ export namespace xdr { static toXDR(value: TrustLineEntryExtensionV2Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExtensionV2Ext; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExtensionV2Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TrustLineEntryExtensionV2Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntryV1Ext { @@ -9292,9 +9480,9 @@ export namespace xdr { value(): TrustLineEntryExtensionV2 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntryV1Ext; @@ -9304,16 +9492,16 @@ export namespace xdr { static toXDR(value: TrustLineEntryV1Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryV1Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TrustLineEntryV1Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TrustLineEntryExt { @@ -9327,9 +9515,9 @@ export namespace xdr { value(): TrustLineEntryV1 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TrustLineEntryExt; @@ -9339,13 +9527,13 @@ export namespace xdr { static toXDR(value: TrustLineEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TrustLineEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): TrustLineEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): TrustLineEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): TrustLineEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OfferEntryExt { @@ -9355,9 +9543,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OfferEntryExt; @@ -9367,13 +9555,13 @@ export namespace xdr { static toXDR(value: OfferEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OfferEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): OfferEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): OfferEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): OfferEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class DataEntryExt { @@ -9383,9 +9571,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): DataEntryExt; @@ -9395,13 +9583,13 @@ export namespace xdr { static toXDR(value: DataEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): DataEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): DataEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): DataEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): DataEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimPredicate { @@ -9438,9 +9626,9 @@ export namespace xdr { | Int64 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimPredicate; @@ -9450,13 +9638,13 @@ export namespace xdr { static toXDR(value: ClaimPredicate): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimPredicate; + static fromXDR(input: Buffer, format?: 'raw'): ClaimPredicate; - static fromXDR(input: string, format: "hex" | "base64"): ClaimPredicate; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimPredicate; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Claimant { @@ -9468,9 +9656,9 @@ export namespace xdr { value(): ClaimantV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Claimant; @@ -9480,13 +9668,13 @@ export namespace xdr { static toXDR(value: Claimant): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Claimant; + static fromXDR(input: Buffer, format?: 'raw'): Claimant; - static fromXDR(input: string, format: "hex" | "base64"): Claimant; + static fromXDR(input: string, format: 'hex' | 'base64'): Claimant; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimableBalanceId { @@ -9498,9 +9686,9 @@ export namespace xdr { value(): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimableBalanceId; @@ -9510,13 +9698,13 @@ export namespace xdr { static toXDR(value: ClaimableBalanceId): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceId; + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceId; - static fromXDR(input: string, format: "hex" | "base64"): ClaimableBalanceId; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimableBalanceId; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimableBalanceEntryExtensionV1Ext { @@ -9526,9 +9714,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimableBalanceEntryExtensionV1Ext; @@ -9540,24 +9728,24 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): ClaimableBalanceEntryExtensionV1Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimableBalanceEntryExtensionV1Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimableBalanceEntryExt { switch(): number; v1( - value?: ClaimableBalanceEntryExtensionV1 + value?: ClaimableBalanceEntryExtensionV1, ): ClaimableBalanceEntryExtensionV1; static 0(): ClaimableBalanceEntryExt; @@ -9566,9 +9754,9 @@ export namespace xdr { value(): ClaimableBalanceEntryExtensionV1 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimableBalanceEntryExt; @@ -9578,34 +9766,34 @@ export namespace xdr { static toXDR(value: ClaimableBalanceEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimableBalanceEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): ClaimableBalanceEntryExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimableBalanceEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolEntryBody { switch(): LiquidityPoolType; constantProduct( - value?: LiquidityPoolEntryConstantProduct + value?: LiquidityPoolEntryConstantProduct, ): LiquidityPoolEntryConstantProduct; static liquidityPoolConstantProduct( - value: LiquidityPoolEntryConstantProduct + value: LiquidityPoolEntryConstantProduct, ): LiquidityPoolEntryBody; value(): LiquidityPoolEntryConstantProduct; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolEntryBody; @@ -9615,99 +9803,16 @@ export namespace xdr { static toXDR(value: LiquidityPoolEntryBody): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolEntryBody; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolEntryBody; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolEntryBody; - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class ConfigSettingEntry { - switch(): ConfigSettingId; - - contractMaxSizeBytes(value?: number): number; - - contractCompute( - value?: ConfigSettingContractComputeV0 - ): ConfigSettingContractComputeV0; - - contractLedgerCost( - value?: ConfigSettingContractLedgerCostV0 - ): ConfigSettingContractLedgerCostV0; - - contractHistoricalData( - value?: ConfigSettingContractHistoricalDataV0 - ): ConfigSettingContractHistoricalDataV0; - - contractMetaData( - value?: ConfigSettingContractMetaDataV0 - ): ConfigSettingContractMetaDataV0; - - contractBandwidth( - value?: ConfigSettingContractBandwidthV0 - ): ConfigSettingContractBandwidthV0; - - contractHostLogicVersion(value?: number): number; - - static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; - - static configSettingContractComputeV0( - value: ConfigSettingContractComputeV0 - ): ConfigSettingEntry; - - static configSettingContractLedgerCostV0( - value: ConfigSettingContractLedgerCostV0 - ): ConfigSettingEntry; - - static configSettingContractHistoricalDataV0( - value: ConfigSettingContractHistoricalDataV0 - ): ConfigSettingEntry; - - static configSettingContractMetaDataV0( - value: ConfigSettingContractMetaDataV0 - ): ConfigSettingEntry; - - static configSettingContractBandwidthV0( - value: ConfigSettingContractBandwidthV0 - ): ConfigSettingEntry; - - static configSettingContractHostLogicVersion( - value: number - ): ConfigSettingEntry; - - value(): - | number - | ConfigSettingContractComputeV0 - | ConfigSettingContractLedgerCostV0 - | ConfigSettingContractHistoricalDataV0 - | ConfigSettingContractMetaDataV0 - | ConfigSettingContractBandwidthV0 - | number; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): ConfigSettingEntry; - - static write(value: ConfigSettingEntry, io: Buffer): void; - - static isValid(value: ConfigSettingEntry): boolean; - - static toXDR(value: ConfigSettingEntry): Buffer; - - static fromXDR(input: Buffer, format?: "raw"): ConfigSettingEntry; - - static fromXDR(input: string, format: "hex" | "base64"): ConfigSettingEntry; - - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntryExtensionV1Ext { @@ -9717,9 +9822,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntryExtensionV1Ext; @@ -9729,16 +9834,16 @@ export namespace xdr { static toXDR(value: LedgerEntryExtensionV1Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExtensionV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExtensionV1Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerEntryExtensionV1Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntryData { @@ -9762,6 +9867,8 @@ export namespace xdr { configSetting(value?: ConfigSettingEntry): ConfigSettingEntry; + expiration(value?: ExpirationEntry): ExpirationEntry; + static account(value: AccountEntry): LedgerEntryData; static trustline(value: TrustLineEntry): LedgerEntryData; @@ -9780,6 +9887,8 @@ export namespace xdr { static configSetting(value: ConfigSettingEntry): LedgerEntryData; + static expiration(value: ExpirationEntry): LedgerEntryData; + value(): | AccountEntry | TrustLineEntry @@ -9789,11 +9898,12 @@ export namespace xdr { | LiquidityPoolEntry | ContractDataEntry | ContractCodeEntry - | ConfigSettingEntry; + | ConfigSettingEntry + | ExpirationEntry; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntryData; @@ -9803,13 +9913,13 @@ export namespace xdr { static toXDR(value: LedgerEntryData): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryData; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryData; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryData; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryData; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntryExt { @@ -9823,9 +9933,9 @@ export namespace xdr { value(): LedgerEntryExtensionV1 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntryExt; @@ -9835,13 +9945,13 @@ export namespace xdr { static toXDR(value: LedgerEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryExt; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryExt; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerKey { @@ -9856,7 +9966,7 @@ export namespace xdr { data(value?: LedgerKeyData): LedgerKeyData; claimableBalance( - value?: LedgerKeyClaimableBalance + value?: LedgerKeyClaimableBalance, ): LedgerKeyClaimableBalance; liquidityPool(value?: LedgerKeyLiquidityPool): LedgerKeyLiquidityPool; @@ -9867,6 +9977,8 @@ export namespace xdr { configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; + expiration(value?: LedgerKeyExpiration): LedgerKeyExpiration; + static account(value: LedgerKeyAccount): LedgerKey; static trustline(value: LedgerKeyTrustLine): LedgerKey; @@ -9885,6 +9997,8 @@ export namespace xdr { static configSetting(value: LedgerKeyConfigSetting): LedgerKey; + static expiration(value: LedgerKeyExpiration): LedgerKey; + value(): | LedgerKeyAccount | LedgerKeyTrustLine @@ -9894,11 +10008,12 @@ export namespace xdr { | LedgerKeyLiquidityPool | LedgerKeyContractData | LedgerKeyContractCode - | LedgerKeyConfigSetting; + | LedgerKeyConfigSetting + | LedgerKeyExpiration; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerKey; @@ -9908,33 +10023,33 @@ export namespace xdr { static toXDR(value: LedgerKey): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerKey; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKey; - static fromXDR(input: string, format: "hex" | "base64"): LedgerKey; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKey; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class StellarValueExt { switch(): StellarValueType; lcValueSignature( - value?: LedgerCloseValueSignature + value?: LedgerCloseValueSignature, ): LedgerCloseValueSignature; static stellarValueBasic(): StellarValueExt; static stellarValueSigned( - value: LedgerCloseValueSignature + value: LedgerCloseValueSignature, ): StellarValueExt; value(): LedgerCloseValueSignature | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): StellarValueExt; @@ -9944,13 +10059,13 @@ export namespace xdr { static toXDR(value: StellarValueExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): StellarValueExt; + static fromXDR(input: Buffer, format?: 'raw'): StellarValueExt; - static fromXDR(input: string, format: "hex" | "base64"): StellarValueExt; + static fromXDR(input: string, format: 'hex' | 'base64'): StellarValueExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeaderExtensionV1Ext { @@ -9960,9 +10075,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeaderExtensionV1Ext; @@ -9972,16 +10087,16 @@ export namespace xdr { static toXDR(value: LedgerHeaderExtensionV1Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExtensionV1Ext; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExtensionV1Ext; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerHeaderExtensionV1Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeaderExt { @@ -9995,9 +10110,9 @@ export namespace xdr { value(): LedgerHeaderExtensionV1 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeaderExt; @@ -10007,13 +10122,13 @@ export namespace xdr { static toXDR(value: LedgerHeaderExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderExt; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderExt; - static fromXDR(input: string, format: "hex" | "base64"): LedgerHeaderExt; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerHeaderExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerUpgrade { @@ -10031,6 +10146,8 @@ export namespace xdr { newConfig(value?: ConfigUpgradeSetKey): ConfigUpgradeSetKey; + newMaxSorobanTxSetSize(value?: number): number; + static ledgerUpgradeVersion(value: number): LedgerUpgrade; static ledgerUpgradeBaseFee(value: number): LedgerUpgrade; @@ -10043,11 +10160,20 @@ export namespace xdr { static ledgerUpgradeConfig(value: ConfigUpgradeSetKey): LedgerUpgrade; - value(): number | number | number | number | number | ConfigUpgradeSetKey; + static ledgerUpgradeMaxSorobanTxSetSize(value: number): LedgerUpgrade; + + value(): + | number + | number + | number + | number + | number + | ConfigUpgradeSetKey + | number; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerUpgrade; @@ -10057,13 +10183,13 @@ export namespace xdr { static toXDR(value: LedgerUpgrade): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerUpgrade; + static fromXDR(input: Buffer, format?: 'raw'): LedgerUpgrade; - static fromXDR(input: string, format: "hex" | "base64"): LedgerUpgrade; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerUpgrade; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BucketMetadataExt { @@ -10073,9 +10199,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BucketMetadataExt; @@ -10085,13 +10211,13 @@ export namespace xdr { static toXDR(value: BucketMetadataExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BucketMetadataExt; + static fromXDR(input: Buffer, format?: 'raw'): BucketMetadataExt; - static fromXDR(input: string, format: "hex" | "base64"): BucketMetadataExt; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketMetadataExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BucketEntry { @@ -10113,9 +10239,9 @@ export namespace xdr { value(): LedgerEntry | LedgerKey | BucketMetadata; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BucketEntry; @@ -10125,31 +10251,31 @@ export namespace xdr { static toXDR(value: BucketEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BucketEntry; + static fromXDR(input: Buffer, format?: 'raw'): BucketEntry; - static fromXDR(input: string, format: "hex" | "base64"): BucketEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): BucketEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TxSetComponent { switch(): TxSetComponentType; txsMaybeDiscountedFee( - value?: TxSetComponentTxsMaybeDiscountedFee + value?: TxSetComponentTxsMaybeDiscountedFee, ): TxSetComponentTxsMaybeDiscountedFee; static txsetCompTxsMaybeDiscountedFee( - value: TxSetComponentTxsMaybeDiscountedFee + value: TxSetComponentTxsMaybeDiscountedFee, ): TxSetComponent; value(): TxSetComponentTxsMaybeDiscountedFee; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TxSetComponent; @@ -10159,13 +10285,13 @@ export namespace xdr { static toXDR(value: TxSetComponent): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TxSetComponent; + static fromXDR(input: Buffer, format?: 'raw'): TxSetComponent; - static fromXDR(input: string, format: "hex" | "base64"): TxSetComponent; + static fromXDR(input: string, format: 'hex' | 'base64'): TxSetComponent; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionPhase { @@ -10177,9 +10303,9 @@ export namespace xdr { value(): TxSetComponent[]; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionPhase; @@ -10189,13 +10315,13 @@ export namespace xdr { static toXDR(value: TransactionPhase): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionPhase; + static fromXDR(input: Buffer, format?: 'raw'): TransactionPhase; - static fromXDR(input: string, format: "hex" | "base64"): TransactionPhase; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionPhase; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class GeneralizedTransactionSet { @@ -10207,9 +10333,9 @@ export namespace xdr { value(): TransactionSetV1; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): GeneralizedTransactionSet; @@ -10219,23 +10345,23 @@ export namespace xdr { static toXDR(value: GeneralizedTransactionSet): Buffer; - static fromXDR(input: Buffer, format?: "raw"): GeneralizedTransactionSet; + static fromXDR(input: Buffer, format?: 'raw'): GeneralizedTransactionSet; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): GeneralizedTransactionSet; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionHistoryEntryExt { switch(): number; generalizedTxSet( - value?: GeneralizedTransactionSet + value?: GeneralizedTransactionSet, ): GeneralizedTransactionSet; static 0(): TransactionHistoryEntryExt; @@ -10244,9 +10370,9 @@ export namespace xdr { value(): GeneralizedTransactionSet | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionHistoryEntryExt; @@ -10256,16 +10382,16 @@ export namespace xdr { static toXDR(value: TransactionHistoryEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionHistoryEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): TransactionHistoryEntryExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionHistoryEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionHistoryResultEntryExt { @@ -10275,9 +10401,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionHistoryResultEntryExt; @@ -10289,51 +10415,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): TransactionHistoryResultEntryExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionHistoryResultEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; - - static validateXDR(input: string, format: "hex" | "base64"): boolean; - } - - class TransactionHistoryResultEntryV2Ext { - switch(): number; - - static 0(): TransactionHistoryResultEntryV2Ext; - - value(): void; - - toXDR(format?: "raw"): Buffer; - - toXDR(format: "hex" | "base64"): string; - - static read(io: Buffer): TransactionHistoryResultEntryV2Ext; - - static write(value: TransactionHistoryResultEntryV2Ext, io: Buffer): void; - - static isValid(value: TransactionHistoryResultEntryV2Ext): boolean; - - static toXDR(value: TransactionHistoryResultEntryV2Ext): Buffer; - - static fromXDR( - input: Buffer, - format?: "raw" - ): TransactionHistoryResultEntryV2Ext; - - static fromXDR( - input: string, - format: "hex" | "base64" - ): TransactionHistoryResultEntryV2Ext; - - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerHeaderHistoryEntryExt { @@ -10343,9 +10435,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerHeaderHistoryEntryExt; @@ -10355,16 +10447,16 @@ export namespace xdr { static toXDR(value: LedgerHeaderHistoryEntryExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerHeaderHistoryEntryExt; + static fromXDR(input: Buffer, format?: 'raw'): LedgerHeaderHistoryEntryExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LedgerHeaderHistoryEntryExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScpHistoryEntry { @@ -10376,9 +10468,9 @@ export namespace xdr { value(): ScpHistoryEntryV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScpHistoryEntry; @@ -10388,13 +10480,13 @@ export namespace xdr { static toXDR(value: ScpHistoryEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScpHistoryEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScpHistoryEntry; - static fromXDR(input: string, format: "hex" | "base64"): ScpHistoryEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): ScpHistoryEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerEntryChange { @@ -10418,9 +10510,9 @@ export namespace xdr { value(): LedgerEntry | LedgerEntry | LedgerKey | LedgerEntry; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerEntryChange; @@ -10430,13 +10522,13 @@ export namespace xdr { static toXDR(value: LedgerEntryChange): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerEntryChange; + static fromXDR(input: Buffer, format?: 'raw'): LedgerEntryChange; - static fromXDR(input: string, format: "hex" | "base64"): LedgerEntryChange; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerEntryChange; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ContractEventBody { @@ -10448,9 +10540,9 @@ export namespace xdr { value(): ContractEventV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ContractEventBody; @@ -10460,13 +10552,13 @@ export namespace xdr { static toXDR(value: ContractEventBody): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractEventBody; + static fromXDR(input: Buffer, format?: 'raw'): ContractEventBody; - static fromXDR(input: string, format: "hex" | "base64"): ContractEventBody; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractEventBody; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionMeta { @@ -10494,9 +10586,9 @@ export namespace xdr { | TransactionMetaV2 | TransactionMetaV3; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionMeta; @@ -10506,13 +10598,13 @@ export namespace xdr { static toXDR(value: TransactionMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionMeta; + static fromXDR(input: Buffer, format?: 'raw'): TransactionMeta; - static fromXDR(input: string, format: "hex" | "base64"): TransactionMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LedgerCloseMeta { @@ -10532,9 +10624,9 @@ export namespace xdr { value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LedgerCloseMeta; @@ -10544,13 +10636,13 @@ export namespace xdr { static toXDR(value: LedgerCloseMeta): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LedgerCloseMeta; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMeta; - static fromXDR(input: string, format: "hex" | "base64"): LedgerCloseMeta; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMeta; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PeerAddressIp { @@ -10566,9 +10658,9 @@ export namespace xdr { value(): Buffer | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PeerAddressIp; @@ -10578,39 +10670,39 @@ export namespace xdr { static toXDR(value: PeerAddressIp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PeerAddressIp; + static fromXDR(input: Buffer, format?: 'raw'): PeerAddressIp; - static fromXDR(input: string, format: "hex" | "base64"): PeerAddressIp; + static fromXDR(input: string, format: 'hex' | 'base64'): PeerAddressIp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SurveyResponseBody { switch(): SurveyMessageResponseType; topologyResponseBodyV0( - value?: TopologyResponseBodyV0 + value?: TopologyResponseBodyV0, ): TopologyResponseBodyV0; topologyResponseBodyV1( - value?: TopologyResponseBodyV1 + value?: TopologyResponseBodyV1, ): TopologyResponseBodyV1; static surveyTopologyResponseV0( - value: TopologyResponseBodyV0 + value: TopologyResponseBodyV0, ): SurveyResponseBody; static surveyTopologyResponseV1( - value: TopologyResponseBodyV1 + value: TopologyResponseBodyV1, ): SurveyResponseBody; value(): TopologyResponseBodyV0 | TopologyResponseBodyV1; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SurveyResponseBody; @@ -10620,13 +10712,13 @@ export namespace xdr { static toXDR(value: SurveyResponseBody): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SurveyResponseBody; + static fromXDR(input: Buffer, format?: 'raw'): SurveyResponseBody; - static fromXDR(input: string, format: "hex" | "base64"): SurveyResponseBody; + static fromXDR(input: string, format: 'hex' | 'base64'): SurveyResponseBody; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class StellarMessage { @@ -10647,17 +10739,17 @@ export namespace xdr { txSet(value?: TransactionSet): TransactionSet; generalizedTxSet( - value?: GeneralizedTransactionSet + value?: GeneralizedTransactionSet, ): GeneralizedTransactionSet; transaction(value?: TransactionEnvelope): TransactionEnvelope; signedSurveyRequestMessage( - value?: SignedSurveyRequestMessage + value?: SignedSurveyRequestMessage, ): SignedSurveyRequestMessage; signedSurveyResponseMessage( - value?: SignedSurveyResponseMessage + value?: SignedSurveyResponseMessage, ): SignedSurveyResponseMessage; qSetHash(value?: Buffer): Buffer; @@ -10670,6 +10762,8 @@ export namespace xdr { sendMoreMessage(value?: SendMore): SendMore; + sendMoreExtendedMessage(value?: SendMoreExtended): SendMoreExtended; + floodAdvert(value?: FloodAdvert): FloodAdvert; floodDemand(value?: FloodDemand): FloodDemand; @@ -10708,6 +10802,8 @@ export namespace xdr { static sendMore(value: SendMore): StellarMessage; + static sendMoreExtended(value: SendMoreExtended): StellarMessage; + static floodAdvert(value: FloodAdvert): StellarMessage; static floodDemand(value: FloodDemand): StellarMessage; @@ -10729,13 +10825,14 @@ export namespace xdr { | ScpEnvelope | number | SendMore + | SendMoreExtended | FloodAdvert | FloodDemand | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): StellarMessage; @@ -10745,13 +10842,13 @@ export namespace xdr { static toXDR(value: StellarMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): StellarMessage; + static fromXDR(input: Buffer, format?: 'raw'): StellarMessage; - static fromXDR(input: string, format: "hex" | "base64"): StellarMessage; + static fromXDR(input: string, format: 'hex' | 'base64'): StellarMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AuthenticatedMessage { @@ -10763,9 +10860,9 @@ export namespace xdr { value(): AuthenticatedMessageV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AuthenticatedMessage; @@ -10775,34 +10872,34 @@ export namespace xdr { static toXDR(value: AuthenticatedMessage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AuthenticatedMessage; + static fromXDR(input: Buffer, format?: 'raw'): AuthenticatedMessage; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): AuthenticatedMessage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolParameters { switch(): LiquidityPoolType; constantProduct( - value?: LiquidityPoolConstantProductParameters + value?: LiquidityPoolConstantProductParameters, ): LiquidityPoolConstantProductParameters; static liquidityPoolConstantProduct( - value: LiquidityPoolConstantProductParameters + value: LiquidityPoolConstantProductParameters, ): LiquidityPoolParameters; value(): LiquidityPoolConstantProductParameters; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolParameters; @@ -10812,16 +10909,16 @@ export namespace xdr { static toXDR(value: LiquidityPoolParameters): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolParameters; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolParameters; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolParameters; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class MuxedAccount { @@ -10837,9 +10934,9 @@ export namespace xdr { value(): Buffer | MuxedAccountMed25519; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): MuxedAccount; @@ -10849,13 +10946,13 @@ export namespace xdr { static toXDR(value: MuxedAccount): Buffer; - static fromXDR(input: Buffer, format?: "raw"): MuxedAccount; + static fromXDR(input: Buffer, format?: 'raw'): MuxedAccount; - static fromXDR(input: string, format: "hex" | "base64"): MuxedAccount; + static fromXDR(input: string, format: 'hex' | 'base64'): MuxedAccount; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ChangeTrustAsset { @@ -10877,9 +10974,9 @@ export namespace xdr { value(): AlphaNum4 | AlphaNum12 | LiquidityPoolParameters | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ChangeTrustAsset; @@ -10889,13 +10986,13 @@ export namespace xdr { static toXDR(value: ChangeTrustAsset): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustAsset; + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustAsset; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustAsset; + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustAsset; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class RevokeSponsorshipOp { @@ -10908,14 +11005,14 @@ export namespace xdr { static revokeSponsorshipLedgerEntry(value: LedgerKey): RevokeSponsorshipOp; static revokeSponsorshipSigner( - value: RevokeSponsorshipOpSigner + value: RevokeSponsorshipOpSigner, ): RevokeSponsorshipOp; value(): LedgerKey | RevokeSponsorshipOpSigner; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): RevokeSponsorshipOp; @@ -10925,86 +11022,80 @@ export namespace xdr { static toXDR(value: RevokeSponsorshipOp): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipOp; + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipOp; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): RevokeSponsorshipOp; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ContractId { - switch(): ContractIdType; + class ContractIdPreimage { + switch(): ContractIdPreimageType; - salt(value?: Buffer): Buffer; - - fromEd25519PublicKey( - value?: ContractIdFromEd25519PublicKey - ): ContractIdFromEd25519PublicKey; - - asset(value?: Asset): Asset; + fromAddress( + value?: ContractIdPreimageFromAddress, + ): ContractIdPreimageFromAddress; - static contractIdFromSourceAccount(value: Buffer): ContractId; + fromAsset(value?: Asset): Asset; - static contractIdFromEd25519PublicKey( - value: ContractIdFromEd25519PublicKey - ): ContractId; + static contractIdPreimageFromAddress( + value: ContractIdPreimageFromAddress, + ): ContractIdPreimage; - static contractIdFromAsset(value: Asset): ContractId; + static contractIdPreimageFromAsset(value: Asset): ContractIdPreimage; - value(): Buffer | ContractIdFromEd25519PublicKey | Asset; + value(): ContractIdPreimageFromAddress | Asset; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ContractId; + static read(io: Buffer): ContractIdPreimage; - static write(value: ContractId, io: Buffer): void; + static write(value: ContractIdPreimage, io: Buffer): void; - static isValid(value: ContractId): boolean; + static isValid(value: ContractIdPreimage): boolean; - static toXDR(value: ContractId): Buffer; + static toXDR(value: ContractIdPreimage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ContractId; + static fromXDR(input: Buffer, format?: 'raw'): ContractIdPreimage; - static fromXDR(input: string, format: "hex" | "base64"): ContractId; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractIdPreimage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class HostFunction { switch(): HostFunctionType; - invokeArgs(value?: ScVal[]): ScVal[]; + invokeContract(value?: InvokeContractArgs): InvokeContractArgs; - createContractArgs(value?: CreateContractArgs): CreateContractArgs; + createContract(value?: CreateContractArgs): CreateContractArgs; - installContractCodeArgs( - value?: InstallContractCodeArgs - ): InstallContractCodeArgs; + wasm(value?: Buffer): Buffer; - static hostFunctionTypeInvokeContract(value: ScVal[]): HostFunction; + static hostFunctionTypeInvokeContract( + value: InvokeContractArgs, + ): HostFunction; static hostFunctionTypeCreateContract( - value: CreateContractArgs + value: CreateContractArgs, ): HostFunction; - static hostFunctionTypeInstallContractCode( - value: InstallContractCodeArgs - ): HostFunction; + static hostFunctionTypeUploadContractWasm(value: Buffer): HostFunction; - value(): ScVal[] | CreateContractArgs | InstallContractCodeArgs; + value(): InvokeContractArgs | CreateContractArgs | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): HostFunction; @@ -11014,13 +11105,88 @@ export namespace xdr { static toXDR(value: HostFunction): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HostFunction; + static fromXDR(input: Buffer, format?: 'raw'): HostFunction; + + static fromXDR(input: string, format: 'hex' | 'base64'): HostFunction; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanAuthorizedFunction { + switch(): SorobanAuthorizedFunctionType; + + contractFn(value?: InvokeContractArgs): InvokeContractArgs; + + createContractHostFn(value?: CreateContractArgs): CreateContractArgs; + + static sorobanAuthorizedFunctionTypeContractFn( + value: InvokeContractArgs, + ): SorobanAuthorizedFunction; + + static sorobanAuthorizedFunctionTypeCreateContractHostFn( + value: CreateContractArgs, + ): SorobanAuthorizedFunction; + + value(): InvokeContractArgs | CreateContractArgs; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanAuthorizedFunction; + + static write(value: SorobanAuthorizedFunction, io: Buffer): void; + + static isValid(value: SorobanAuthorizedFunction): boolean; + + static toXDR(value: SorobanAuthorizedFunction): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): SorobanAuthorizedFunction; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): SorobanAuthorizedFunction; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class SorobanCredentials { + switch(): SorobanCredentialsType; + + address(value?: SorobanAddressCredentials): SorobanAddressCredentials; + + static sorobanCredentialsSourceAccount(): SorobanCredentials; + + static sorobanCredentialsAddress( + value: SorobanAddressCredentials, + ): SorobanCredentials; + + value(): SorobanAddressCredentials | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): SorobanCredentials; + + static write(value: SorobanCredentials, io: Buffer): void; + + static isValid(value: SorobanCredentials): boolean; + + static toXDR(value: SorobanCredentials): Buffer; - static fromXDR(input: string, format: "hex" | "base64"): HostFunction; + static fromXDR(input: Buffer, format?: 'raw'): SorobanCredentials; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static fromXDR(input: string, format: 'hex' | 'base64'): SorobanCredentials; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OperationBody { @@ -11031,13 +11197,13 @@ export namespace xdr { paymentOp(value?: PaymentOp): PaymentOp; pathPaymentStrictReceiveOp( - value?: PathPaymentStrictReceiveOp + value?: PathPaymentStrictReceiveOp, ): PathPaymentStrictReceiveOp; manageSellOfferOp(value?: ManageSellOfferOp): ManageSellOfferOp; createPassiveSellOfferOp( - value?: CreatePassiveSellOfferOp + value?: CreatePassiveSellOfferOp, ): CreatePassiveSellOfferOp; setOptionsOp(value?: SetOptionsOp): SetOptionsOp; @@ -11055,19 +11221,19 @@ export namespace xdr { manageBuyOfferOp(value?: ManageBuyOfferOp): ManageBuyOfferOp; pathPaymentStrictSendOp( - value?: PathPaymentStrictSendOp + value?: PathPaymentStrictSendOp, ): PathPaymentStrictSendOp; createClaimableBalanceOp( - value?: CreateClaimableBalanceOp + value?: CreateClaimableBalanceOp, ): CreateClaimableBalanceOp; claimClaimableBalanceOp( - value?: ClaimClaimableBalanceOp + value?: ClaimClaimableBalanceOp, ): ClaimClaimableBalanceOp; beginSponsoringFutureReservesOp( - value?: BeginSponsoringFutureReservesOp + value?: BeginSponsoringFutureReservesOp, ): BeginSponsoringFutureReservesOp; revokeSponsorshipOp(value?: RevokeSponsorshipOp): RevokeSponsorshipOp; @@ -11075,33 +11241,39 @@ export namespace xdr { clawbackOp(value?: ClawbackOp): ClawbackOp; clawbackClaimableBalanceOp( - value?: ClawbackClaimableBalanceOp + value?: ClawbackClaimableBalanceOp, ): ClawbackClaimableBalanceOp; setTrustLineFlagsOp(value?: SetTrustLineFlagsOp): SetTrustLineFlagsOp; liquidityPoolDepositOp( - value?: LiquidityPoolDepositOp + value?: LiquidityPoolDepositOp, ): LiquidityPoolDepositOp; liquidityPoolWithdrawOp( - value?: LiquidityPoolWithdrawOp + value?: LiquidityPoolWithdrawOp, ): LiquidityPoolWithdrawOp; invokeHostFunctionOp(value?: InvokeHostFunctionOp): InvokeHostFunctionOp; + bumpFootprintExpirationOp( + value?: BumpFootprintExpirationOp, + ): BumpFootprintExpirationOp; + + restoreFootprintOp(value?: RestoreFootprintOp): RestoreFootprintOp; + static createAccount(value: CreateAccountOp): OperationBody; static payment(value: PaymentOp): OperationBody; static pathPaymentStrictReceive( - value: PathPaymentStrictReceiveOp + value: PathPaymentStrictReceiveOp, ): OperationBody; static manageSellOffer(value: ManageSellOfferOp): OperationBody; static createPassiveSellOffer( - value: CreatePassiveSellOfferOp + value: CreatePassiveSellOfferOp, ): OperationBody; static setOptions(value: SetOptionsOp): OperationBody; @@ -11123,13 +11295,13 @@ export namespace xdr { static pathPaymentStrictSend(value: PathPaymentStrictSendOp): OperationBody; static createClaimableBalance( - value: CreateClaimableBalanceOp + value: CreateClaimableBalanceOp, ): OperationBody; static claimClaimableBalance(value: ClaimClaimableBalanceOp): OperationBody; static beginSponsoringFutureReserves( - value: BeginSponsoringFutureReservesOp + value: BeginSponsoringFutureReservesOp, ): OperationBody; static endSponsoringFutureReserves(): OperationBody; @@ -11139,7 +11311,7 @@ export namespace xdr { static clawback(value: ClawbackOp): OperationBody; static clawbackClaimableBalance( - value: ClawbackClaimableBalanceOp + value: ClawbackClaimableBalanceOp, ): OperationBody; static setTrustLineFlags(value: SetTrustLineFlagsOp): OperationBody; @@ -11150,6 +11322,12 @@ export namespace xdr { static invokeHostFunction(value: InvokeHostFunctionOp): OperationBody; + static bumpFootprintExpiration( + value: BumpFootprintExpirationOp, + ): OperationBody; + + static restoreFootprint(value: RestoreFootprintOp): OperationBody; + value(): | CreateAccountOp | PaymentOp @@ -11174,11 +11352,13 @@ export namespace xdr { | LiquidityPoolDepositOp | LiquidityPoolWithdrawOp | InvokeHostFunctionOp + | BumpFootprintExpirationOp + | RestoreFootprintOp | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OperationBody; @@ -11188,13 +11368,13 @@ export namespace xdr { static toXDR(value: OperationBody): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationBody; + static fromXDR(input: Buffer, format?: 'raw'): OperationBody; - static fromXDR(input: string, format: "hex" | "base64"): OperationBody; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationBody; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class HashIdPreimage { @@ -11204,69 +11384,35 @@ export namespace xdr { revokeId(value?: HashIdPreimageRevokeId): HashIdPreimageRevokeId; - ed25519ContractId( - value?: HashIdPreimageEd25519ContractId - ): HashIdPreimageEd25519ContractId; - contractId(value?: HashIdPreimageContractId): HashIdPreimageContractId; - fromAsset(value?: HashIdPreimageFromAsset): HashIdPreimageFromAsset; - - sourceAccountContractId( - value?: HashIdPreimageSourceAccountContractId - ): HashIdPreimageSourceAccountContractId; - - createContractArgs( - value?: HashIdPreimageCreateContractArgs - ): HashIdPreimageCreateContractArgs; - - contractAuth( - value?: HashIdPreimageContractAuth - ): HashIdPreimageContractAuth; + sorobanAuthorization( + value?: HashIdPreimageSorobanAuthorization, + ): HashIdPreimageSorobanAuthorization; static envelopeTypeOpId(value: HashIdPreimageOperationId): HashIdPreimage; static envelopeTypePoolRevokeOpId( - value: HashIdPreimageRevokeId - ): HashIdPreimage; - - static envelopeTypeContractIdFromEd25519( - value: HashIdPreimageEd25519ContractId - ): HashIdPreimage; - - static envelopeTypeContractIdFromContract( - value: HashIdPreimageContractId - ): HashIdPreimage; - - static envelopeTypeContractIdFromAsset( - value: HashIdPreimageFromAsset + value: HashIdPreimageRevokeId, ): HashIdPreimage; - static envelopeTypeContractIdFromSourceAccount( - value: HashIdPreimageSourceAccountContractId + static envelopeTypeContractId( + value: HashIdPreimageContractId, ): HashIdPreimage; - static envelopeTypeCreateContractArgs( - value: HashIdPreimageCreateContractArgs - ): HashIdPreimage; - - static envelopeTypeContractAuth( - value: HashIdPreimageContractAuth + static envelopeTypeSorobanAuthorization( + value: HashIdPreimageSorobanAuthorization, ): HashIdPreimage; value(): | HashIdPreimageOperationId | HashIdPreimageRevokeId - | HashIdPreimageEd25519ContractId | HashIdPreimageContractId - | HashIdPreimageFromAsset - | HashIdPreimageSourceAccountContractId - | HashIdPreimageCreateContractArgs - | HashIdPreimageContractAuth; + | HashIdPreimageSorobanAuthorization; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): HashIdPreimage; @@ -11276,13 +11422,13 @@ export namespace xdr { static toXDR(value: HashIdPreimage): Buffer; - static fromXDR(input: Buffer, format?: "raw"): HashIdPreimage; + static fromXDR(input: Buffer, format?: 'raw'): HashIdPreimage; - static fromXDR(input: string, format: "hex" | "base64"): HashIdPreimage; + static fromXDR(input: string, format: 'hex' | 'base64'): HashIdPreimage; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Memo { @@ -11308,9 +11454,9 @@ export namespace xdr { value(): string | Buffer | Uint64 | Buffer | Buffer | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Memo; @@ -11320,13 +11466,13 @@ export namespace xdr { static toXDR(value: Memo): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Memo; + static fromXDR(input: Buffer, format?: 'raw'): Memo; - static fromXDR(input: string, format: "hex" | "base64"): Memo; + static fromXDR(input: string, format: 'hex' | 'base64'): Memo; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class Preconditions { @@ -11344,9 +11490,9 @@ export namespace xdr { value(): TimeBounds | PreconditionsV2 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): Preconditions; @@ -11356,13 +11502,13 @@ export namespace xdr { static toXDR(value: Preconditions): Buffer; - static fromXDR(input: Buffer, format?: "raw"): Preconditions; + static fromXDR(input: Buffer, format?: 'raw'): Preconditions; - static fromXDR(input: string, format: "hex" | "base64"): Preconditions; + static fromXDR(input: string, format: 'hex' | 'base64'): Preconditions; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionV0Ext { @@ -11372,9 +11518,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionV0Ext; @@ -11384,25 +11530,29 @@ export namespace xdr { static toXDR(value: TransactionV0Ext): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionV0Ext; + static fromXDR(input: Buffer, format?: 'raw'): TransactionV0Ext; - static fromXDR(input: string, format: "hex" | "base64"): TransactionV0Ext; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionV0Ext; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionExt { switch(): number; + sorobanData(value?: SorobanTransactionData): SorobanTransactionData; + static 0(): TransactionExt; - value(): void; + static 1(value: SorobanTransactionData): TransactionExt; - toXDR(format?: "raw"): Buffer; + value(): SorobanTransactionData | void; - toXDR(format: "hex" | "base64"): string; + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionExt; @@ -11412,13 +11562,13 @@ export namespace xdr { static toXDR(value: TransactionExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionExt; + static fromXDR(input: Buffer, format?: 'raw'): TransactionExt; - static fromXDR(input: string, format: "hex" | "base64"): TransactionExt; + static fromXDR(input: string, format: 'hex' | 'base64'): TransactionExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FeeBumpTransactionInnerTx { @@ -11427,14 +11577,14 @@ export namespace xdr { v1(value?: TransactionV1Envelope): TransactionV1Envelope; static envelopeTypeTx( - value: TransactionV1Envelope + value: TransactionV1Envelope, ): FeeBumpTransactionInnerTx; value(): TransactionV1Envelope; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FeeBumpTransactionInnerTx; @@ -11444,16 +11594,16 @@ export namespace xdr { static toXDR(value: FeeBumpTransactionInnerTx): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionInnerTx; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionInnerTx; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): FeeBumpTransactionInnerTx; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class FeeBumpTransactionExt { @@ -11463,9 +11613,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): FeeBumpTransactionExt; @@ -11475,16 +11625,16 @@ export namespace xdr { static toXDR(value: FeeBumpTransactionExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): FeeBumpTransactionExt; + static fromXDR(input: Buffer, format?: 'raw'): FeeBumpTransactionExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): FeeBumpTransactionExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionEnvelope { @@ -11501,7 +11651,7 @@ export namespace xdr { static envelopeTypeTx(value: TransactionV1Envelope): TransactionEnvelope; static envelopeTypeTxFeeBump( - value: FeeBumpTransactionEnvelope + value: FeeBumpTransactionEnvelope, ): TransactionEnvelope; value(): @@ -11509,9 +11659,9 @@ export namespace xdr { | TransactionV1Envelope | FeeBumpTransactionEnvelope; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionEnvelope; @@ -11521,16 +11671,16 @@ export namespace xdr { static toXDR(value: TransactionEnvelope): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionEnvelope; + static fromXDR(input: Buffer, format?: 'raw'): TransactionEnvelope; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionEnvelope; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionSignaturePayloadTaggedTransaction { @@ -11541,45 +11691,45 @@ export namespace xdr { feeBump(value?: FeeBumpTransaction): FeeBumpTransaction; static envelopeTypeTx( - value: Transaction + value: Transaction, ): TransactionSignaturePayloadTaggedTransaction; static envelopeTypeTxFeeBump( - value: FeeBumpTransaction + value: FeeBumpTransaction, ): TransactionSignaturePayloadTaggedTransaction; value(): Transaction | FeeBumpTransaction; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionSignaturePayloadTaggedTransaction; static write( value: TransactionSignaturePayloadTaggedTransaction, - io: Buffer + io: Buffer, ): void; static isValid( - value: TransactionSignaturePayloadTaggedTransaction + value: TransactionSignaturePayloadTaggedTransaction, ): boolean; static toXDR(value: TransactionSignaturePayloadTaggedTransaction): Buffer; static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): TransactionSignaturePayloadTaggedTransaction; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionSignaturePayloadTaggedTransaction; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimAtom { @@ -11599,9 +11749,9 @@ export namespace xdr { value(): ClaimOfferAtomV0 | ClaimOfferAtom | ClaimLiquidityAtom; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimAtom; @@ -11611,13 +11761,13 @@ export namespace xdr { static toXDR(value: ClaimAtom): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimAtom; + static fromXDR(input: Buffer, format?: 'raw'): ClaimAtom; - static fromXDR(input: string, format: "hex" | "base64"): ClaimAtom; + static fromXDR(input: string, format: 'hex' | 'base64'): ClaimAtom; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreateAccountResult { @@ -11635,9 +11785,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreateAccountResult; @@ -11647,16 +11797,16 @@ export namespace xdr { static toXDR(value: CreateAccountResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateAccountResult; + static fromXDR(input: Buffer, format?: 'raw'): CreateAccountResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): CreateAccountResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PaymentResult { @@ -11684,9 +11834,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PaymentResult; @@ -11696,26 +11846,26 @@ export namespace xdr { static toXDR(value: PaymentResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PaymentResult; + static fromXDR(input: Buffer, format?: 'raw'): PaymentResult; - static fromXDR(input: string, format: "hex" | "base64"): PaymentResult; + static fromXDR(input: string, format: 'hex' | 'base64'): PaymentResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictReceiveResult { switch(): PathPaymentStrictReceiveResultCode; success( - value?: PathPaymentStrictReceiveResultSuccess + value?: PathPaymentStrictReceiveResultSuccess, ): PathPaymentStrictReceiveResultSuccess; noIssuer(value?: Asset): Asset; static pathPaymentStrictReceiveSuccess( - value: PathPaymentStrictReceiveResultSuccess + value: PathPaymentStrictReceiveResultSuccess, ): PathPaymentStrictReceiveResult; static pathPaymentStrictReceiveMalformed(): PathPaymentStrictReceiveResult; @@ -11735,7 +11885,7 @@ export namespace xdr { static pathPaymentStrictReceiveLineFull(): PathPaymentStrictReceiveResult; static pathPaymentStrictReceiveNoIssuer( - value: Asset + value: Asset, ): PathPaymentStrictReceiveResult; static pathPaymentStrictReceiveTooFewOffers(): PathPaymentStrictReceiveResult; @@ -11746,9 +11896,9 @@ export namespace xdr { value(): PathPaymentStrictReceiveResultSuccess | Asset | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictReceiveResult; @@ -11760,30 +11910,30 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): PathPaymentStrictReceiveResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictReceiveResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PathPaymentStrictSendResult { switch(): PathPaymentStrictSendResultCode; success( - value?: PathPaymentStrictSendResultSuccess + value?: PathPaymentStrictSendResultSuccess, ): PathPaymentStrictSendResultSuccess; noIssuer(value?: Asset): Asset; static pathPaymentStrictSendSuccess( - value: PathPaymentStrictSendResultSuccess + value: PathPaymentStrictSendResultSuccess, ): PathPaymentStrictSendResult; static pathPaymentStrictSendMalformed(): PathPaymentStrictSendResult; @@ -11803,7 +11953,7 @@ export namespace xdr { static pathPaymentStrictSendLineFull(): PathPaymentStrictSendResult; static pathPaymentStrictSendNoIssuer( - value: Asset + value: Asset, ): PathPaymentStrictSendResult; static pathPaymentStrictSendTooFewOffers(): PathPaymentStrictSendResult; @@ -11814,9 +11964,9 @@ export namespace xdr { value(): PathPaymentStrictSendResultSuccess | Asset | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PathPaymentStrictSendResult; @@ -11826,16 +11976,16 @@ export namespace xdr { static toXDR(value: PathPaymentStrictSendResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PathPaymentStrictSendResult; + static fromXDR(input: Buffer, format?: 'raw'): PathPaymentStrictSendResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): PathPaymentStrictSendResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageOfferSuccessResultOffer { @@ -11851,9 +12001,9 @@ export namespace xdr { value(): OfferEntry | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageOfferSuccessResultOffer; @@ -11865,17 +12015,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): ManageOfferSuccessResultOffer; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ManageOfferSuccessResultOffer; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageSellOfferResult { @@ -11884,7 +12034,7 @@ export namespace xdr { success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; static manageSellOfferSuccess( - value: ManageOfferSuccessResult + value: ManageOfferSuccessResult, ): ManageSellOfferResult; static manageSellOfferMalformed(): ManageSellOfferResult; @@ -11913,9 +12063,9 @@ export namespace xdr { value(): ManageOfferSuccessResult | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageSellOfferResult; @@ -11925,16 +12075,16 @@ export namespace xdr { static toXDR(value: ManageSellOfferResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageSellOfferResult; + static fromXDR(input: Buffer, format?: 'raw'): ManageSellOfferResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ManageSellOfferResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageBuyOfferResult { @@ -11943,7 +12093,7 @@ export namespace xdr { success(value?: ManageOfferSuccessResult): ManageOfferSuccessResult; static manageBuyOfferSuccess( - value: ManageOfferSuccessResult + value: ManageOfferSuccessResult, ): ManageBuyOfferResult; static manageBuyOfferMalformed(): ManageBuyOfferResult; @@ -11972,9 +12122,9 @@ export namespace xdr { value(): ManageOfferSuccessResult | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageBuyOfferResult; @@ -11984,16 +12134,16 @@ export namespace xdr { static toXDR(value: ManageBuyOfferResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageBuyOfferResult; + static fromXDR(input: Buffer, format?: 'raw'): ManageBuyOfferResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ManageBuyOfferResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SetOptionsResult { @@ -12023,9 +12173,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SetOptionsResult; @@ -12035,13 +12185,13 @@ export namespace xdr { static toXDR(value: SetOptionsResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetOptionsResult; + static fromXDR(input: Buffer, format?: 'raw'): SetOptionsResult; - static fromXDR(input: string, format: "hex" | "base64"): SetOptionsResult; + static fromXDR(input: string, format: 'hex' | 'base64'): SetOptionsResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ChangeTrustResult { @@ -12067,9 +12217,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ChangeTrustResult; @@ -12079,13 +12229,13 @@ export namespace xdr { static toXDR(value: ChangeTrustResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ChangeTrustResult; + static fromXDR(input: Buffer, format?: 'raw'): ChangeTrustResult; - static fromXDR(input: string, format: "hex" | "base64"): ChangeTrustResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ChangeTrustResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AllowTrustResult { @@ -12107,9 +12257,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AllowTrustResult; @@ -12119,13 +12269,13 @@ export namespace xdr { static toXDR(value: AllowTrustResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AllowTrustResult; + static fromXDR(input: Buffer, format?: 'raw'): AllowTrustResult; - static fromXDR(input: string, format: "hex" | "base64"): AllowTrustResult; + static fromXDR(input: string, format: 'hex' | 'base64'): AllowTrustResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class AccountMergeResult { @@ -12151,9 +12301,9 @@ export namespace xdr { value(): Int64 | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): AccountMergeResult; @@ -12163,13 +12313,13 @@ export namespace xdr { static toXDR(value: AccountMergeResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): AccountMergeResult; + static fromXDR(input: Buffer, format?: 'raw'): AccountMergeResult; - static fromXDR(input: string, format: "hex" | "base64"): AccountMergeResult; + static fromXDR(input: string, format: 'hex' | 'base64'): AccountMergeResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InflationResult { @@ -12183,9 +12333,9 @@ export namespace xdr { value(): InflationPayout[] | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InflationResult; @@ -12195,13 +12345,13 @@ export namespace xdr { static toXDR(value: InflationResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InflationResult; + static fromXDR(input: Buffer, format?: 'raw'): InflationResult; - static fromXDR(input: string, format: "hex" | "base64"): InflationResult; + static fromXDR(input: string, format: 'hex' | 'base64'): InflationResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ManageDataResult { @@ -12219,9 +12369,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ManageDataResult; @@ -12231,13 +12381,13 @@ export namespace xdr { static toXDR(value: ManageDataResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ManageDataResult; + static fromXDR(input: Buffer, format?: 'raw'): ManageDataResult; - static fromXDR(input: string, format: "hex" | "base64"): ManageDataResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ManageDataResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BumpSequenceResult { @@ -12249,9 +12399,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BumpSequenceResult; @@ -12261,13 +12411,13 @@ export namespace xdr { static toXDR(value: BumpSequenceResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): BumpSequenceResult; + static fromXDR(input: Buffer, format?: 'raw'): BumpSequenceResult; - static fromXDR(input: string, format: "hex" | "base64"): BumpSequenceResult; + static fromXDR(input: string, format: 'hex' | 'base64'): BumpSequenceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class CreateClaimableBalanceResult { @@ -12276,7 +12426,7 @@ export namespace xdr { balanceId(value?: ClaimableBalanceId): ClaimableBalanceId; static createClaimableBalanceSuccess( - value: ClaimableBalanceId + value: ClaimableBalanceId, ): CreateClaimableBalanceResult; static createClaimableBalanceMalformed(): CreateClaimableBalanceResult; @@ -12291,9 +12441,9 @@ export namespace xdr { value(): ClaimableBalanceId | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): CreateClaimableBalanceResult; @@ -12303,16 +12453,16 @@ export namespace xdr { static toXDR(value: CreateClaimableBalanceResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): CreateClaimableBalanceResult; + static fromXDR(input: Buffer, format?: 'raw'): CreateClaimableBalanceResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): CreateClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClaimClaimableBalanceResult { @@ -12332,9 +12482,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClaimClaimableBalanceResult; @@ -12344,16 +12494,16 @@ export namespace xdr { static toXDR(value: ClaimClaimableBalanceResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClaimClaimableBalanceResult; + static fromXDR(input: Buffer, format?: 'raw'): ClaimClaimableBalanceResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClaimClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class BeginSponsoringFutureReservesResult { @@ -12369,9 +12519,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): BeginSponsoringFutureReservesResult; @@ -12383,17 +12533,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): BeginSponsoringFutureReservesResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): BeginSponsoringFutureReservesResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class EndSponsoringFutureReservesResult { @@ -12405,9 +12555,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): EndSponsoringFutureReservesResult; @@ -12419,17 +12569,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): EndSponsoringFutureReservesResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): EndSponsoringFutureReservesResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class RevokeSponsorshipResult { @@ -12449,9 +12599,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): RevokeSponsorshipResult; @@ -12461,16 +12611,16 @@ export namespace xdr { static toXDR(value: RevokeSponsorshipResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): RevokeSponsorshipResult; + static fromXDR(input: Buffer, format?: 'raw'): RevokeSponsorshipResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): RevokeSponsorshipResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClawbackResult { @@ -12488,9 +12638,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClawbackResult; @@ -12500,13 +12650,13 @@ export namespace xdr { static toXDR(value: ClawbackResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ClawbackResult; + static fromXDR(input: Buffer, format?: 'raw'): ClawbackResult; - static fromXDR(input: string, format: "hex" | "base64"): ClawbackResult; + static fromXDR(input: string, format: 'hex' | 'base64'): ClawbackResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ClawbackClaimableBalanceResult { @@ -12522,9 +12672,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ClawbackClaimableBalanceResult; @@ -12536,17 +12686,17 @@ export namespace xdr { static fromXDR( input: Buffer, - format?: "raw" + format?: 'raw', ): ClawbackClaimableBalanceResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ClawbackClaimableBalanceResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SetTrustLineFlagsResult { @@ -12566,9 +12716,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SetTrustLineFlagsResult; @@ -12578,16 +12728,16 @@ export namespace xdr { static toXDR(value: SetTrustLineFlagsResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SetTrustLineFlagsResult; + static fromXDR(input: Buffer, format?: 'raw'): SetTrustLineFlagsResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): SetTrustLineFlagsResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolDepositResult { @@ -12611,9 +12761,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolDepositResult; @@ -12623,16 +12773,16 @@ export namespace xdr { static toXDR(value: LiquidityPoolDepositResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolDepositResult; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolDepositResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolDepositResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class LiquidityPoolWithdrawResult { @@ -12652,9 +12802,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): LiquidityPoolWithdrawResult; @@ -12664,34 +12814,40 @@ export namespace xdr { static toXDR(value: LiquidityPoolWithdrawResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): LiquidityPoolWithdrawResult; + static fromXDR(input: Buffer, format?: 'raw'): LiquidityPoolWithdrawResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): LiquidityPoolWithdrawResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InvokeHostFunctionResult { switch(): InvokeHostFunctionResultCode; - success(value?: ScVal): ScVal; + success(value?: Buffer): Buffer; - static invokeHostFunctionSuccess(value: ScVal): InvokeHostFunctionResult; + static invokeHostFunctionSuccess(value: Buffer): InvokeHostFunctionResult; static invokeHostFunctionMalformed(): InvokeHostFunctionResult; static invokeHostFunctionTrapped(): InvokeHostFunctionResult; - value(): ScVal | void; + static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResult; + + static invokeHostFunctionEntryExpired(): InvokeHostFunctionResult; - toXDR(format?: "raw"): Buffer; + static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResult; - toXDR(format: "hex" | "base64"): string; + value(): Buffer | void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InvokeHostFunctionResult; @@ -12701,16 +12857,93 @@ export namespace xdr { static toXDR(value: InvokeHostFunctionResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InvokeHostFunctionResult; + static fromXDR(input: Buffer, format?: 'raw'): InvokeHostFunctionResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): InvokeHostFunctionResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class BumpFootprintExpirationResult { + switch(): BumpFootprintExpirationResultCode; + + static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResult; + + static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResult; + + static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResult; + + static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResult; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): BumpFootprintExpirationResult; + + static write(value: BumpFootprintExpirationResult, io: Buffer): void; + + static isValid(value: BumpFootprintExpirationResult): boolean; + + static toXDR(value: BumpFootprintExpirationResult): Buffer; + + static fromXDR( + input: Buffer, + format?: 'raw', + ): BumpFootprintExpirationResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): BumpFootprintExpirationResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class RestoreFootprintResult { + switch(): RestoreFootprintResultCode; + + static restoreFootprintSuccess(): RestoreFootprintResult; + + static restoreFootprintMalformed(): RestoreFootprintResult; + + static restoreFootprintResourceLimitExceeded(): RestoreFootprintResult; + + static restoreFootprintInsufficientRefundableFee(): RestoreFootprintResult; + + value(): void; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): RestoreFootprintResult; + + static write(value: RestoreFootprintResult, io: Buffer): void; + + static isValid(value: RestoreFootprintResult): boolean; + + static toXDR(value: RestoreFootprintResult): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): RestoreFootprintResult; + + static fromXDR( + input: string, + format: 'hex' | 'base64', + ): RestoreFootprintResult; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OperationResultTr { @@ -12721,13 +12954,13 @@ export namespace xdr { paymentResult(value?: PaymentResult): PaymentResult; pathPaymentStrictReceiveResult( - value?: PathPaymentStrictReceiveResult + value?: PathPaymentStrictReceiveResult, ): PathPaymentStrictReceiveResult; manageSellOfferResult(value?: ManageSellOfferResult): ManageSellOfferResult; createPassiveSellOfferResult( - value?: ManageSellOfferResult + value?: ManageSellOfferResult, ): ManageSellOfferResult; setOptionsResult(value?: SetOptionsResult): SetOptionsResult; @@ -12747,63 +12980,71 @@ export namespace xdr { manageBuyOfferResult(value?: ManageBuyOfferResult): ManageBuyOfferResult; pathPaymentStrictSendResult( - value?: PathPaymentStrictSendResult + value?: PathPaymentStrictSendResult, ): PathPaymentStrictSendResult; createClaimableBalanceResult( - value?: CreateClaimableBalanceResult + value?: CreateClaimableBalanceResult, ): CreateClaimableBalanceResult; claimClaimableBalanceResult( - value?: ClaimClaimableBalanceResult + value?: ClaimClaimableBalanceResult, ): ClaimClaimableBalanceResult; beginSponsoringFutureReservesResult( - value?: BeginSponsoringFutureReservesResult + value?: BeginSponsoringFutureReservesResult, ): BeginSponsoringFutureReservesResult; endSponsoringFutureReservesResult( - value?: EndSponsoringFutureReservesResult + value?: EndSponsoringFutureReservesResult, ): EndSponsoringFutureReservesResult; revokeSponsorshipResult( - value?: RevokeSponsorshipResult + value?: RevokeSponsorshipResult, ): RevokeSponsorshipResult; clawbackResult(value?: ClawbackResult): ClawbackResult; clawbackClaimableBalanceResult( - value?: ClawbackClaimableBalanceResult + value?: ClawbackClaimableBalanceResult, ): ClawbackClaimableBalanceResult; setTrustLineFlagsResult( - value?: SetTrustLineFlagsResult + value?: SetTrustLineFlagsResult, ): SetTrustLineFlagsResult; liquidityPoolDepositResult( - value?: LiquidityPoolDepositResult + value?: LiquidityPoolDepositResult, ): LiquidityPoolDepositResult; liquidityPoolWithdrawResult( - value?: LiquidityPoolWithdrawResult + value?: LiquidityPoolWithdrawResult, ): LiquidityPoolWithdrawResult; invokeHostFunctionResult( - value?: InvokeHostFunctionResult + value?: InvokeHostFunctionResult, ): InvokeHostFunctionResult; + bumpFootprintExpirationResult( + value?: BumpFootprintExpirationResult, + ): BumpFootprintExpirationResult; + + restoreFootprintResult( + value?: RestoreFootprintResult, + ): RestoreFootprintResult; + static createAccount(value: CreateAccountResult): OperationResultTr; static payment(value: PaymentResult): OperationResultTr; static pathPaymentStrictReceive( - value: PathPaymentStrictReceiveResult + value: PathPaymentStrictReceiveResult, ): OperationResultTr; static manageSellOffer(value: ManageSellOfferResult): OperationResultTr; static createPassiveSellOffer( - value: ManageSellOfferResult + value: ManageSellOfferResult, ): OperationResultTr; static setOptions(value: SetOptionsResult): OperationResultTr; @@ -12823,23 +13064,23 @@ export namespace xdr { static manageBuyOffer(value: ManageBuyOfferResult): OperationResultTr; static pathPaymentStrictSend( - value: PathPaymentStrictSendResult + value: PathPaymentStrictSendResult, ): OperationResultTr; static createClaimableBalance( - value: CreateClaimableBalanceResult + value: CreateClaimableBalanceResult, ): OperationResultTr; static claimClaimableBalance( - value: ClaimClaimableBalanceResult + value: ClaimClaimableBalanceResult, ): OperationResultTr; static beginSponsoringFutureReserves( - value: BeginSponsoringFutureReservesResult + value: BeginSponsoringFutureReservesResult, ): OperationResultTr; static endSponsoringFutureReserves( - value: EndSponsoringFutureReservesResult + value: EndSponsoringFutureReservesResult, ): OperationResultTr; static revokeSponsorship(value: RevokeSponsorshipResult): OperationResultTr; @@ -12847,23 +13088,29 @@ export namespace xdr { static clawback(value: ClawbackResult): OperationResultTr; static clawbackClaimableBalance( - value: ClawbackClaimableBalanceResult + value: ClawbackClaimableBalanceResult, ): OperationResultTr; static setTrustLineFlags(value: SetTrustLineFlagsResult): OperationResultTr; static liquidityPoolDeposit( - value: LiquidityPoolDepositResult + value: LiquidityPoolDepositResult, ): OperationResultTr; static liquidityPoolWithdraw( - value: LiquidityPoolWithdrawResult + value: LiquidityPoolWithdrawResult, ): OperationResultTr; static invokeHostFunction( - value: InvokeHostFunctionResult + value: InvokeHostFunctionResult, + ): OperationResultTr; + + static bumpFootprintExpiration( + value: BumpFootprintExpirationResult, ): OperationResultTr; + static restoreFootprint(value: RestoreFootprintResult): OperationResultTr; + value(): | CreateAccountResult | PaymentResult @@ -12889,11 +13136,13 @@ export namespace xdr { | SetTrustLineFlagsResult | LiquidityPoolDepositResult | LiquidityPoolWithdrawResult - | InvokeHostFunctionResult; + | InvokeHostFunctionResult + | BumpFootprintExpirationResult + | RestoreFootprintResult; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OperationResultTr; @@ -12903,13 +13152,13 @@ export namespace xdr { static toXDR(value: OperationResultTr): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationResultTr; + static fromXDR(input: Buffer, format?: 'raw'): OperationResultTr; - static fromXDR(input: string, format: "hex" | "base64"): OperationResultTr; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationResultTr; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class OperationResult { @@ -12933,9 +13182,9 @@ export namespace xdr { value(): OperationResultTr | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): OperationResult; @@ -12945,13 +13194,13 @@ export namespace xdr { static toXDR(value: OperationResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): OperationResult; + static fromXDR(input: Buffer, format?: 'raw'): OperationResult; - static fromXDR(input: string, format: "hex" | "base64"): OperationResult; + static fromXDR(input: string, format: 'hex' | 'base64'): OperationResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InnerTransactionResultResult { @@ -12991,11 +13240,13 @@ export namespace xdr { static txMalformed(): InnerTransactionResultResult; + static txSorobanInvalid(): InnerTransactionResultResult; + value(): OperationResult[] | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InnerTransactionResultResult; @@ -13005,16 +13256,16 @@ export namespace xdr { static toXDR(value: InnerTransactionResultResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultResult; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): InnerTransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class InnerTransactionResultExt { @@ -13024,9 +13275,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): InnerTransactionResultExt; @@ -13036,33 +13287,33 @@ export namespace xdr { static toXDR(value: InnerTransactionResultExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): InnerTransactionResultExt; + static fromXDR(input: Buffer, format?: 'raw'): InnerTransactionResultExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): InnerTransactionResultExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionResultResult { switch(): TransactionResultCode; innerResultPair( - value?: InnerTransactionResultPair + value?: InnerTransactionResultPair, ): InnerTransactionResultPair; results(value?: OperationResult[]): OperationResult[]; static txFeeBumpInnerSuccess( - value: InnerTransactionResultPair + value: InnerTransactionResultPair, ): TransactionResultResult; static txFeeBumpInnerFailed( - value: InnerTransactionResultPair + value: InnerTransactionResultPair, ): TransactionResultResult; static txSuccess(value: OperationResult[]): TransactionResultResult; @@ -13097,11 +13348,13 @@ export namespace xdr { static txMalformed(): TransactionResultResult; + static txSorobanInvalid(): TransactionResultResult; + value(): InnerTransactionResultPair | OperationResult[] | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionResultResult; @@ -13111,16 +13364,16 @@ export namespace xdr { static toXDR(value: TransactionResultResult): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultResult; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultResult; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionResultResult; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class TransactionResultExt { @@ -13130,9 +13383,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): TransactionResultExt; @@ -13142,16 +13395,16 @@ export namespace xdr { static toXDR(value: TransactionResultExt): Buffer; - static fromXDR(input: Buffer, format?: "raw"): TransactionResultExt; + static fromXDR(input: Buffer, format?: 'raw'): TransactionResultExt; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): TransactionResultExt; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ExtensionPoint { @@ -13161,9 +13414,9 @@ export namespace xdr { value(): void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ExtensionPoint; @@ -13173,13 +13426,13 @@ export namespace xdr { static toXDR(value: ExtensionPoint): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ExtensionPoint; + static fromXDR(input: Buffer, format?: 'raw'): ExtensionPoint; - static fromXDR(input: string, format: "hex" | "base64"): ExtensionPoint; + static fromXDR(input: string, format: 'hex' | 'base64'): ExtensionPoint; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class PublicKey { @@ -13191,9 +13444,9 @@ export namespace xdr { value(): Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): PublicKey; @@ -13203,13 +13456,13 @@ export namespace xdr { static toXDR(value: PublicKey): Buffer; - static fromXDR(input: Buffer, format?: "raw"): PublicKey; + static fromXDR(input: Buffer, format?: 'raw'): PublicKey; - static fromXDR(input: string, format: "hex" | "base64"): PublicKey; + static fromXDR(input: string, format: 'hex' | 'base64'): PublicKey; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class SignerKey { @@ -13222,7 +13475,7 @@ export namespace xdr { hashX(value?: Buffer): Buffer; ed25519SignedPayload( - value?: SignerKeyEd25519SignedPayload + value?: SignerKeyEd25519SignedPayload, ): SignerKeyEd25519SignedPayload; static signerKeyTypeEd25519(value: Buffer): SignerKey; @@ -13232,14 +13485,14 @@ export namespace xdr { static signerKeyTypeHashX(value: Buffer): SignerKey; static signerKeyTypeEd25519SignedPayload( - value: SignerKeyEd25519SignedPayload + value: SignerKeyEd25519SignedPayload, ): SignerKey; value(): Buffer | Buffer | Buffer | SignerKeyEd25519SignedPayload; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): SignerKey; @@ -13249,122 +13502,95 @@ export namespace xdr { static toXDR(value: SignerKey): Buffer; - static fromXDR(input: Buffer, format?: "raw"): SignerKey; + static fromXDR(input: Buffer, format?: 'raw'): SignerKey; - static fromXDR(input: string, format: "hex" | "base64"): SignerKey; + static fromXDR(input: string, format: 'hex' | 'base64'): SignerKey; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScStatus { - switch(): ScStatusType; - - unknownCode(value?: ScUnknownErrorCode): ScUnknownErrorCode; - - valCode(value?: ScHostValErrorCode): ScHostValErrorCode; - - objCode(value?: ScHostObjErrorCode): ScHostObjErrorCode; - - fnCode(value?: ScHostFnErrorCode): ScHostFnErrorCode; - - storageCode(value?: ScHostStorageErrorCode): ScHostStorageErrorCode; - - contextCode(value?: ScHostContextErrorCode): ScHostContextErrorCode; - - vmCode(value?: ScVmErrorCode): ScVmErrorCode; + class ScError { + switch(): ScErrorType; contractCode(value?: number): number; - authCode(value?: ScHostAuthErrorCode): ScHostAuthErrorCode; + code(value?: ScErrorCode): ScErrorCode; - static sstOk(): ScStatus; + static sceContract(value: number): ScError; - static sstUnknownError(value: ScUnknownErrorCode): ScStatus; + static sceWasmVm(value: ScErrorCode): ScError; - static sstHostValueError(value: ScHostValErrorCode): ScStatus; + static sceContext(value: ScErrorCode): ScError; - static sstHostObjectError(value: ScHostObjErrorCode): ScStatus; + static sceStorage(value: ScErrorCode): ScError; - static sstHostFunctionError(value: ScHostFnErrorCode): ScStatus; + static sceObject(value: ScErrorCode): ScError; - static sstHostStorageError(value: ScHostStorageErrorCode): ScStatus; + static sceCrypto(value: ScErrorCode): ScError; - static sstHostContextError(value: ScHostContextErrorCode): ScStatus; + static sceEvents(value: ScErrorCode): ScError; - static sstVmError(value: ScVmErrorCode): ScStatus; + static sceBudget(value: ScErrorCode): ScError; - static sstContractError(value: number): ScStatus; + static sceValue(value: ScErrorCode): ScError; - static sstHostAuthError(value: ScHostAuthErrorCode): ScStatus; + static sceAuth(value: ScErrorCode): ScError; - value(): - | ScUnknownErrorCode - | ScHostValErrorCode - | ScHostObjErrorCode - | ScHostFnErrorCode - | ScHostStorageErrorCode - | ScHostContextErrorCode - | ScVmErrorCode - | number - | ScHostAuthErrorCode - | void; + value(): number | ScErrorCode; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScStatus; + static read(io: Buffer): ScError; - static write(value: ScStatus, io: Buffer): void; + static write(value: ScError, io: Buffer): void; - static isValid(value: ScStatus): boolean; + static isValid(value: ScError): boolean; - static toXDR(value: ScStatus): Buffer; + static toXDR(value: ScError): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScStatus; + static fromXDR(input: Buffer, format?: 'raw'): ScError; - static fromXDR(input: string, format: "hex" | "base64"): ScStatus; + static fromXDR(input: string, format: 'hex' | 'base64'): ScError; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ScContractExecutable { - switch(): ScContractExecutableType; + class ContractExecutable { + switch(): ContractExecutableType; - wasmId(value?: Buffer): Buffer; + wasmHash(value?: Buffer): Buffer; - static sccontractExecutableWasmRef(value: Buffer): ScContractExecutable; + static contractExecutableWasm(value: Buffer): ContractExecutable; - static sccontractExecutableToken(): ScContractExecutable; + static contractExecutableToken(): ContractExecutable; value(): Buffer | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ScContractExecutable; + static read(io: Buffer): ContractExecutable; - static write(value: ScContractExecutable, io: Buffer): void; + static write(value: ContractExecutable, io: Buffer): void; - static isValid(value: ScContractExecutable): boolean; + static isValid(value: ContractExecutable): boolean; - static toXDR(value: ScContractExecutable): Buffer; + static toXDR(value: ContractExecutable): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScContractExecutable; + static fromXDR(input: Buffer, format?: 'raw'): ContractExecutable; - static fromXDR( - input: string, - format: "hex" | "base64" - ): ScContractExecutable; + static fromXDR(input: string, format: 'hex' | 'base64'): ContractExecutable; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScAddress { @@ -13380,9 +13606,9 @@ export namespace xdr { value(): AccountId | Buffer; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScAddress; @@ -13392,13 +13618,13 @@ export namespace xdr { static toXDR(value: ScAddress): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScAddress; + static fromXDR(input: Buffer, format?: 'raw'): ScAddress; - static fromXDR(input: string, format: "hex" | "base64"): ScAddress; + static fromXDR(input: string, format: 'hex' | 'base64'): ScAddress; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScVal { @@ -13406,7 +13632,7 @@ export namespace xdr { b(value?: boolean): boolean; - error(value?: ScStatus): ScStatus; + error(value?: ScError): ScError; u32(value?: number): number; @@ -13438,17 +13664,17 @@ export namespace xdr { map(value?: null | ScMapEntry[]): null | ScMapEntry[]; - exec(value?: ScContractExecutable): ScContractExecutable; - address(value?: ScAddress): ScAddress; nonceKey(value?: ScNonceKey): ScNonceKey; + instance(value?: ScContractInstance): ScContractInstance; + static scvBool(value: boolean): ScVal; static scvVoid(): ScVal; - static scvStatus(value: ScStatus): ScVal; + static scvError(value: ScError): ScVal; static scvU32(value: number): ScVal; @@ -13480,17 +13706,17 @@ export namespace xdr { static scvMap(value: null | ScMapEntry[]): ScVal; - static scvContractExecutable(value: ScContractExecutable): ScVal; - static scvAddress(value: ScAddress): ScVal; - static scvLedgerKeyContractExecutable(): ScVal; + static scvLedgerKeyContractInstance(): ScVal; static scvLedgerKeyNonce(value: ScNonceKey): ScVal; + static scvContractInstance(value: ScContractInstance): ScVal; + value(): | boolean - | ScStatus + | ScError | number | number | Uint64 @@ -13510,14 +13736,14 @@ export namespace xdr { | ScVal[] | null | ScMapEntry[] - | ScContractExecutable | ScAddress | ScNonceKey + | ScContractInstance | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScVal; @@ -13527,13 +13753,13 @@ export namespace xdr { static toXDR(value: ScVal): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScVal; + static fromXDR(input: Buffer, format?: 'raw'): ScVal; - static fromXDR(input: string, format: "hex" | "base64"): ScVal; + static fromXDR(input: string, format: 'hex' | 'base64'): ScVal; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScEnvMetaEntry { @@ -13545,9 +13771,9 @@ export namespace xdr { value(): Uint64; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScEnvMetaEntry; @@ -13557,13 +13783,43 @@ export namespace xdr { static toXDR(value: ScEnvMetaEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScEnvMetaEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScEnvMetaEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScEnvMetaEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ScMetaEntry { + switch(): ScMetaKind; + + v0(value?: ScMetaV0): ScMetaV0; + + static scMetaV0(value: ScMetaV0): ScMetaEntry; + + value(): ScMetaV0; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ScMetaEntry; + + static write(value: ScMetaEntry, io: Buffer): void; - static fromXDR(input: string, format: "hex" | "base64"): ScEnvMetaEntry; + static isValid(value: ScMetaEntry): boolean; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static toXDR(value: ScMetaEntry): Buffer; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static fromXDR(input: Buffer, format?: 'raw'): ScMetaEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScMetaEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecTypeDef { @@ -13577,8 +13833,6 @@ export namespace xdr { map(value?: ScSpecTypeMap): ScSpecTypeMap; - set(value?: ScSpecTypeSet): ScSpecTypeSet; - tuple(value?: ScSpecTypeTuple): ScSpecTypeTuple; bytesN(value?: ScSpecTypeBytesN): ScSpecTypeBytesN; @@ -13591,7 +13845,7 @@ export namespace xdr { static scSpecTypeVoid(): ScSpecTypeDef; - static scSpecTypeStatus(): ScSpecTypeDef; + static scSpecTypeError(): ScSpecTypeDef; static scSpecTypeU32(): ScSpecTypeDef; @@ -13629,8 +13883,6 @@ export namespace xdr { static scSpecTypeMap(value: ScSpecTypeMap): ScSpecTypeDef; - static scSpecTypeSet(value: ScSpecTypeSet): ScSpecTypeDef; - static scSpecTypeTuple(value: ScSpecTypeTuple): ScSpecTypeDef; static scSpecTypeBytesN(value: ScSpecTypeBytesN): ScSpecTypeDef; @@ -13642,15 +13894,14 @@ export namespace xdr { | ScSpecTypeResult | ScSpecTypeVec | ScSpecTypeMap - | ScSpecTypeSet | ScSpecTypeTuple | ScSpecTypeBytesN | ScSpecTypeUdt | void; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecTypeDef; @@ -13660,13 +13911,13 @@ export namespace xdr { static toXDR(value: ScSpecTypeDef): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecTypeDef; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecTypeDef; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecTypeDef; + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecTypeDef; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecUdtUnionCaseV0 { @@ -13677,18 +13928,18 @@ export namespace xdr { tupleCase(value?: ScSpecUdtUnionCaseTupleV0): ScSpecUdtUnionCaseTupleV0; static scSpecUdtUnionCaseVoidV0( - value: ScSpecUdtUnionCaseVoidV0 + value: ScSpecUdtUnionCaseVoidV0, ): ScSpecUdtUnionCaseV0; static scSpecUdtUnionCaseTupleV0( - value: ScSpecUdtUnionCaseTupleV0 + value: ScSpecUdtUnionCaseTupleV0, ): ScSpecUdtUnionCaseV0; value(): ScSpecUdtUnionCaseVoidV0 | ScSpecUdtUnionCaseTupleV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecUdtUnionCaseV0; @@ -13698,16 +13949,16 @@ export namespace xdr { static toXDR(value: ScSpecUdtUnionCaseV0): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecUdtUnionCaseV0; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecUdtUnionCaseV0; static fromXDR( input: string, - format: "hex" | "base64" + format: 'hex' | 'base64', ): ScSpecUdtUnionCaseV0; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } class ScSpecEntry { @@ -13740,9 +13991,9 @@ export namespace xdr { | ScSpecUdtEnumV0 | ScSpecUdtErrorEnumV0; - toXDR(format?: "raw"): Buffer; + toXDR(format?: 'raw'): Buffer; - toXDR(format: "hex" | "base64"): string; + toXDR(format: 'hex' | 'base64'): string; static read(io: Buffer): ScSpecEntry; @@ -13752,12 +14003,152 @@ export namespace xdr { static toXDR(value: ScSpecEntry): Buffer; - static fromXDR(input: Buffer, format?: "raw"): ScSpecEntry; + static fromXDR(input: Buffer, format?: 'raw'): ScSpecEntry; + + static fromXDR(input: string, format: 'hex' | 'base64'): ScSpecEntry; + + static validateXDR(input: Buffer, format?: 'raw'): boolean; + + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; + } + + class ConfigSettingEntry { + switch(): ConfigSettingId; + + contractMaxSizeBytes(value?: number): number; + + contractCompute( + value?: ConfigSettingContractComputeV0, + ): ConfigSettingContractComputeV0; + + contractLedgerCost( + value?: ConfigSettingContractLedgerCostV0, + ): ConfigSettingContractLedgerCostV0; + + contractHistoricalData( + value?: ConfigSettingContractHistoricalDataV0, + ): ConfigSettingContractHistoricalDataV0; + + contractEvents( + value?: ConfigSettingContractEventsV0, + ): ConfigSettingContractEventsV0; + + contractBandwidth( + value?: ConfigSettingContractBandwidthV0, + ): ConfigSettingContractBandwidthV0; + + contractCostParamsCpuInsns( + value?: ContractCostParamEntry[], + ): ContractCostParamEntry[]; + + contractCostParamsMemBytes( + value?: ContractCostParamEntry[], + ): ContractCostParamEntry[]; + + contractDataKeySizeBytes(value?: number): number; + + contractDataEntrySizeBytes(value?: number): number; + + stateExpirationSettings( + value?: StateExpirationSettings, + ): StateExpirationSettings; + + contractExecutionLanes( + value?: ConfigSettingContractExecutionLanesV0, + ): ConfigSettingContractExecutionLanesV0; + + bucketListSizeWindow(value?: Uint64[]): Uint64[]; + + evictionIterator(value?: EvictionIterator): EvictionIterator; + + static configSettingContractMaxSizeBytes(value: number): ConfigSettingEntry; + + static configSettingContractComputeV0( + value: ConfigSettingContractComputeV0, + ): ConfigSettingEntry; + + static configSettingContractLedgerCostV0( + value: ConfigSettingContractLedgerCostV0, + ): ConfigSettingEntry; + + static configSettingContractHistoricalDataV0( + value: ConfigSettingContractHistoricalDataV0, + ): ConfigSettingEntry; + + static configSettingContractEventsV0( + value: ConfigSettingContractEventsV0, + ): ConfigSettingEntry; + + static configSettingContractBandwidthV0( + value: ConfigSettingContractBandwidthV0, + ): ConfigSettingEntry; + + static configSettingContractCostParamsCpuInstructions( + value: ContractCostParamEntry[], + ): ConfigSettingEntry; + + static configSettingContractCostParamsMemoryBytes( + value: ContractCostParamEntry[], + ): ConfigSettingEntry; + + static configSettingContractDataKeySizeBytes( + value: number, + ): ConfigSettingEntry; + + static configSettingContractDataEntrySizeBytes( + value: number, + ): ConfigSettingEntry; + + static configSettingStateExpiration( + value: StateExpirationSettings, + ): ConfigSettingEntry; + + static configSettingContractExecutionLanes( + value: ConfigSettingContractExecutionLanesV0, + ): ConfigSettingEntry; + + static configSettingBucketlistSizeWindow( + value: Uint64[], + ): ConfigSettingEntry; + + static configSettingEvictionIterator( + value: EvictionIterator, + ): ConfigSettingEntry; + + value(): + | number + | ConfigSettingContractComputeV0 + | ConfigSettingContractLedgerCostV0 + | ConfigSettingContractHistoricalDataV0 + | ConfigSettingContractEventsV0 + | ConfigSettingContractBandwidthV0 + | ContractCostParamEntry[] + | ContractCostParamEntry[] + | number + | number + | StateExpirationSettings + | ConfigSettingContractExecutionLanesV0 + | Uint64[] + | EvictionIterator; + + toXDR(format?: 'raw'): Buffer; + + toXDR(format: 'hex' | 'base64'): string; + + static read(io: Buffer): ConfigSettingEntry; + + static write(value: ConfigSettingEntry, io: Buffer): void; + + static isValid(value: ConfigSettingEntry): boolean; + + static toXDR(value: ConfigSettingEntry): Buffer; + + static fromXDR(input: Buffer, format?: 'raw'): ConfigSettingEntry; - static fromXDR(input: string, format: "hex" | "base64"): ScSpecEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): ConfigSettingEntry; - static validateXDR(input: Buffer, format?: "raw"): boolean; + static validateXDR(input: Buffer, format?: 'raw'): boolean; - static validateXDR(input: string, format: "hex" | "base64"): boolean; + static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } } diff --git a/types/test.ts b/types/test.ts index f54672625..2b5fcb4c2 100644 --- a/types/test.ts +++ b/types/test.ts @@ -348,3 +348,10 @@ const sk = StellarSdk.xdr.SignerKey.signerKeyTypeEd25519SignedPayload( ); StellarSdk.SignerKey.encodeSignerKey(sk); // $ExpectType string StellarSdk.SignerKey.decodeAddress(sourceKey.publicKey()); // $ExpectType SignerKey + +new StellarSdk.ScInt(1234); // $ExpectType ScInt +new StellarSdk.ScInt('1234'); // $ExpectType ScInt +new StellarSdk.ScInt(BigInt(1234)); // $ExpectType ScInt +(['i64', 'u64', 'i128', 'u128', 'i256', 'u256'] as StellarSdk.ScIntType[]).forEach((type) => { + new StellarSdk.ScInt(1234, { type }); // $ExpectType ScInt +}); diff --git a/types/xdr.d.ts b/types/xdr.d.ts index 2eb8791bf..4007789b7 100644 --- a/types/xdr.d.ts +++ b/types/xdr.d.ts @@ -1 +1 @@ -export * from './curr'; +export * from './next'; diff --git a/xdr/curr/Stellar-contract-config-setting.x b/xdr/curr/Stellar-contract-config-setting.x new file mode 100644 index 000000000..9512f0c4d --- /dev/null +++ b/xdr/curr/Stellar-contract-config-setting.x @@ -0,0 +1,246 @@ +%#include "xdr/Stellar-types.h" + +namespace stellar { +// General “Soroban execution lane” settings +struct ConfigSettingContractExecutionLanesV0 +{ + // maximum number of Soroban transactions per ledger + uint32 ledgerMaxTxCount; +}; + +// "Compute" settings for contracts (instructions and memory). +struct ConfigSettingContractComputeV0 +{ + // Maximum instructions per ledger + int64 ledgerMaxInstructions; + // Maximum instructions per transaction + int64 txMaxInstructions; + // Cost of 10000 instructions + int64 feeRatePerInstructionsIncrement; + + // Memory limit per transaction. Unlike instructions, there is no fee + // for memory, just the limit. + uint32 txMemoryLimit; +}; + +// Ledger access settings for contracts. +struct ConfigSettingContractLedgerCostV0 +{ + // Maximum number of ledger entry read operations per ledger + uint32 ledgerMaxReadLedgerEntries; + // Maximum number of bytes that can be read per ledger + uint32 ledgerMaxReadBytes; + // Maximum number of ledger entry write operations per ledger + uint32 ledgerMaxWriteLedgerEntries; + // Maximum number of bytes that can be written per ledger + uint32 ledgerMaxWriteBytes; + + // Maximum number of ledger entry read operations per transaction + uint32 txMaxReadLedgerEntries; + // Maximum number of bytes that can be read per transaction + uint32 txMaxReadBytes; + // Maximum number of ledger entry write operations per transaction + uint32 txMaxWriteLedgerEntries; + // Maximum number of bytes that can be written per transaction + uint32 txMaxWriteBytes; + + int64 feeReadLedgerEntry; // Fee per ledger entry read + int64 feeWriteLedgerEntry; // Fee per ledger entry write + + int64 feeRead1KB; // Fee for reading 1KB + + // The following parameters determine the write fee per 1KB. + // Write fee grows linearly until bucket list reaches this size + int64 bucketListTargetSizeBytes; + // Fee per 1KB write when the bucket list is empty + int64 writeFee1KBBucketListLow; + // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` + int64 writeFee1KBBucketListHigh; + // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` + uint32 bucketListWriteFeeGrowthFactor; +}; + +// Historical data (pushed to core archives) settings for contracts. +struct ConfigSettingContractHistoricalDataV0 +{ + int64 feeHistorical1KB; // Fee for storing 1KB in archives +}; + +// Contract event-related settings. +struct ConfigSettingContractEventsV0 +{ + // Maximum size of events that a contract call can emit. + uint32 txMaxContractEventsSizeBytes; + // Fee for generating 1KB of contract events. + int64 feeContractEvents1KB; +}; + +// Bandwidth related data settings for contracts. +// We consider bandwidth to only be consumed by the transaction envelopes, hence +// this concerns only transaction sizes. +struct ConfigSettingContractBandwidthV0 +{ + // Maximum sum of all transaction sizes in the ledger in bytes + uint32 ledgerMaxTxsSizeBytes; + // Maximum size in bytes for a transaction + uint32 txMaxSizeBytes; + + // Fee for 1 KB of transaction size + int64 feeTxSize1KB; +}; + +enum ContractCostType { + // Cost of running 1 wasm instruction + WasmInsnExec = 0, + // Cost of growing wasm linear memory by 1 page + WasmMemAlloc = 1, + // Cost of allocating a chuck of host memory (in bytes) + HostMemAlloc = 2, + // Cost of copying a chuck of bytes into a pre-allocated host memory + HostMemCpy = 3, + // Cost of comparing two slices of host memory + HostMemCmp = 4, + // Cost of a host function dispatch, not including the actual work done by + // the function nor the cost of VM invocation machinary + DispatchHostFunction = 5, + // Cost of visiting a host object from the host object storage. Exists to + // make sure some baseline cost coverage, i.e. repeatly visiting objects + // by the guest will always incur some charges. + VisitObject = 6, + // Cost of serializing an xdr object to bytes + ValSer = 7, + // Cost of deserializing an xdr object from bytes + ValDeser = 8, + // Cost of computing the sha256 hash from bytes + ComputeSha256Hash = 9, + // Cost of computing the ed25519 pubkey from bytes + ComputeEd25519PubKey = 10, + // Cost of accessing an entry in a Map. + MapEntry = 11, + // Cost of accessing an entry in a Vec + VecEntry = 12, + // Cost of verifying ed25519 signature of a payload. + VerifyEd25519Sig = 13, + // Cost of reading a slice of vm linear memory + VmMemRead = 14, + // Cost of writing to a slice of vm linear memory + VmMemWrite = 15, + // Cost of instantiation a VM from wasm bytes code. + VmInstantiation = 16, + // Cost of instantiation a VM from a cached state. + VmCachedInstantiation = 17, + // Cost of invoking a function on the VM. If the function is a host function, + // additional cost will be covered by `DispatchHostFunction`. + InvokeVmFunction = 18, + // Cost of computing a keccak256 hash from bytes. + ComputeKeccak256Hash = 19, + // Cost of computing an ECDSA secp256k1 pubkey from bytes. + ComputeEcdsaSecp256k1Key = 20, + // Cost of computing an ECDSA secp256k1 signature from bytes. + ComputeEcdsaSecp256k1Sig = 21, + // Cost of recovering an ECDSA secp256k1 key from a signature. + RecoverEcdsaSecp256k1Key = 22, + // Cost of int256 addition (`+`) and subtraction (`-`) operations + Int256AddSub = 23, + // Cost of int256 multiplication (`*`) operation + Int256Mul = 24, + // Cost of int256 division (`/`) operation + Int256Div = 25, + // Cost of int256 power (`exp`) operation + Int256Pow = 26, + // Cost of int256 shift (`shl`, `shr`) operation + Int256Shift = 27 +}; + +struct ContractCostParamEntry { + // use `ext` to add more terms (e.g. higher order polynomials) in the future + ExtensionPoint ext; + + int64 constTerm; + int64 linearTerm; +}; + +struct StateExpirationSettings { + uint32 maxEntryExpiration; + uint32 minTempEntryExpiration; + uint32 minPersistentEntryExpiration; + + // rent_fee = wfee_rate_average / rent_rate_denominator_for_type + int64 persistentRentRateDenominator; + int64 tempRentRateDenominator; + + // max number of entries that emit expiration meta in a single ledger + uint32 maxEntriesToExpire; + + // Number of snapshots to use when calculating average BucketList size + uint32 bucketListSizeWindowSampleSize; + + // Maximum number of bytes that we scan for eviction per ledger + uint64 evictionScanSize; + + // Lowest BucketList level to be scanned to evict entries + uint32 startingEvictionScanLevel; +}; + +struct EvictionIterator { + uint32 bucketListLevel; + bool isCurrBucket; + uint64 bucketFileOffset; +}; + +// limits the ContractCostParams size to 20kB +const CONTRACT_COST_COUNT_LIMIT = 1024; + +typedef ContractCostParamEntry ContractCostParams; + +// Identifiers of all the network settings. +enum ConfigSettingID +{ + CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, + CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, + CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, + CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, + CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4, + CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, + CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6, + CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, + CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, + CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, + CONFIG_SETTING_STATE_EXPIRATION = 10, + CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, + CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, + CONFIG_SETTING_EVICTION_ITERATOR = 13 +}; + +union ConfigSettingEntry switch (ConfigSettingID configSettingID) +{ +case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: + uint32 contractMaxSizeBytes; +case CONFIG_SETTING_CONTRACT_COMPUTE_V0: + ConfigSettingContractComputeV0 contractCompute; +case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: + ConfigSettingContractLedgerCostV0 contractLedgerCost; +case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: + ConfigSettingContractHistoricalDataV0 contractHistoricalData; +case CONFIG_SETTING_CONTRACT_EVENTS_V0: + ConfigSettingContractEventsV0 contractEvents; +case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: + ConfigSettingContractBandwidthV0 contractBandwidth; +case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: + ContractCostParams contractCostParamsCpuInsns; +case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: + ContractCostParams contractCostParamsMemBytes; +case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: + uint32 contractDataKeySizeBytes; +case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: + uint32 contractDataEntrySizeBytes; +case CONFIG_SETTING_STATE_EXPIRATION: + StateExpirationSettings stateExpirationSettings; +case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: + ConfigSettingContractExecutionLanesV0 contractExecutionLanes; +case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: + uint64 bucketListSizeWindow<>; +case CONFIG_SETTING_EVICTION_ITERATOR: + EvictionIterator evictionIterator; +}; +} diff --git a/xdr/curr/Stellar-contract-env-meta.x b/xdr/curr/Stellar-contract-env-meta.x new file mode 100644 index 000000000..330726de4 --- /dev/null +++ b/xdr/curr/Stellar-contract-env-meta.x @@ -0,0 +1,23 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +// The contract spec XDR is highly experimental, incomplete, and still being +// iterated on. Breaking changes expected. + +% #include "xdr/Stellar-types.h" +namespace stellar +{ + +enum SCEnvMetaKind +{ + SC_ENV_META_KIND_INTERFACE_VERSION = 0 +}; + +union SCEnvMetaEntry switch (SCEnvMetaKind kind) +{ +case SC_ENV_META_KIND_INTERFACE_VERSION: + uint64 interfaceVersion; +}; + +} diff --git a/xdr/curr/Stellar-contract-meta.x b/xdr/curr/Stellar-contract-meta.x new file mode 100644 index 000000000..16eb5f9e2 --- /dev/null +++ b/xdr/curr/Stellar-contract-meta.x @@ -0,0 +1,29 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +// The contract meta XDR is highly experimental, incomplete, and still being +// iterated on. Breaking changes expected. + +% #include "xdr/Stellar-types.h" +namespace stellar +{ + +struct SCMetaV0 +{ + string key<>; + string val<>; +}; + +enum SCMetaKind +{ + SC_META_V0 = 0 +}; + +union SCMetaEntry switch (SCMetaKind kind) +{ +case SC_META_V0: + SCMetaV0 v0; +}; + +} diff --git a/xdr/curr/Stellar-contract-spec.x b/xdr/curr/Stellar-contract-spec.x new file mode 100644 index 000000000..6988a6338 --- /dev/null +++ b/xdr/curr/Stellar-contract-spec.x @@ -0,0 +1,242 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +// The contract Contractspec XDR is highly experimental, incomplete, and still being +// iterated on. Breaking changes expected. + +% #include "xdr/Stellar-types.h" +% #include "xdr/Stellar-contract.h" +namespace stellar +{ + +const SC_SPEC_DOC_LIMIT = 1024; + +enum SCSpecType +{ + SC_SPEC_TYPE_VAL = 0, + + // Types with no parameters. + SC_SPEC_TYPE_BOOL = 1, + SC_SPEC_TYPE_VOID = 2, + SC_SPEC_TYPE_ERROR = 3, + SC_SPEC_TYPE_U32 = 4, + SC_SPEC_TYPE_I32 = 5, + SC_SPEC_TYPE_U64 = 6, + SC_SPEC_TYPE_I64 = 7, + SC_SPEC_TYPE_TIMEPOINT = 8, + SC_SPEC_TYPE_DURATION = 9, + SC_SPEC_TYPE_U128 = 10, + SC_SPEC_TYPE_I128 = 11, + SC_SPEC_TYPE_U256 = 12, + SC_SPEC_TYPE_I256 = 13, + SC_SPEC_TYPE_BYTES = 14, + SC_SPEC_TYPE_STRING = 16, + SC_SPEC_TYPE_SYMBOL = 17, + SC_SPEC_TYPE_ADDRESS = 19, + + // Types with parameters. + SC_SPEC_TYPE_OPTION = 1000, + SC_SPEC_TYPE_RESULT = 1001, + SC_SPEC_TYPE_VEC = 1002, + SC_SPEC_TYPE_MAP = 1004, + SC_SPEC_TYPE_TUPLE = 1005, + SC_SPEC_TYPE_BYTES_N = 1006, + + // User defined types. + SC_SPEC_TYPE_UDT = 2000 +}; + +struct SCSpecTypeOption +{ + SCSpecTypeDef valueType; +}; + +struct SCSpecTypeResult +{ + SCSpecTypeDef okType; + SCSpecTypeDef errorType; +}; + +struct SCSpecTypeVec +{ + SCSpecTypeDef elementType; +}; + +struct SCSpecTypeMap +{ + SCSpecTypeDef keyType; + SCSpecTypeDef valueType; +}; + +struct SCSpecTypeTuple +{ + SCSpecTypeDef valueTypes<12>; +}; + +struct SCSpecTypeBytesN +{ + uint32 n; +}; + +struct SCSpecTypeUDT +{ + string name<60>; +}; + +union SCSpecTypeDef switch (SCSpecType type) +{ +case SC_SPEC_TYPE_VAL: +case SC_SPEC_TYPE_BOOL: +case SC_SPEC_TYPE_VOID: +case SC_SPEC_TYPE_ERROR: +case SC_SPEC_TYPE_U32: +case SC_SPEC_TYPE_I32: +case SC_SPEC_TYPE_U64: +case SC_SPEC_TYPE_I64: +case SC_SPEC_TYPE_TIMEPOINT: +case SC_SPEC_TYPE_DURATION: +case SC_SPEC_TYPE_U128: +case SC_SPEC_TYPE_I128: +case SC_SPEC_TYPE_U256: +case SC_SPEC_TYPE_I256: +case SC_SPEC_TYPE_BYTES: +case SC_SPEC_TYPE_STRING: +case SC_SPEC_TYPE_SYMBOL: +case SC_SPEC_TYPE_ADDRESS: + void; +case SC_SPEC_TYPE_OPTION: + SCSpecTypeOption option; +case SC_SPEC_TYPE_RESULT: + SCSpecTypeResult result; +case SC_SPEC_TYPE_VEC: + SCSpecTypeVec vec; +case SC_SPEC_TYPE_MAP: + SCSpecTypeMap map; +case SC_SPEC_TYPE_TUPLE: + SCSpecTypeTuple tuple; +case SC_SPEC_TYPE_BYTES_N: + SCSpecTypeBytesN bytesN; +case SC_SPEC_TYPE_UDT: + SCSpecTypeUDT udt; +}; + +struct SCSpecUDTStructFieldV0 +{ + string doc; + string name<30>; + SCSpecTypeDef type; +}; + +struct SCSpecUDTStructV0 +{ + string doc; + string lib<80>; + string name<60>; + SCSpecUDTStructFieldV0 fields<40>; +}; + +struct SCSpecUDTUnionCaseVoidV0 +{ + string doc; + string name<60>; +}; + +struct SCSpecUDTUnionCaseTupleV0 +{ + string doc; + string name<60>; + SCSpecTypeDef type<12>; +}; + +enum SCSpecUDTUnionCaseV0Kind +{ + SC_SPEC_UDT_UNION_CASE_VOID_V0 = 0, + SC_SPEC_UDT_UNION_CASE_TUPLE_V0 = 1 +}; + +union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind) +{ +case SC_SPEC_UDT_UNION_CASE_VOID_V0: + SCSpecUDTUnionCaseVoidV0 voidCase; +case SC_SPEC_UDT_UNION_CASE_TUPLE_V0: + SCSpecUDTUnionCaseTupleV0 tupleCase; +}; + +struct SCSpecUDTUnionV0 +{ + string doc; + string lib<80>; + string name<60>; + SCSpecUDTUnionCaseV0 cases<50>; +}; + +struct SCSpecUDTEnumCaseV0 +{ + string doc; + string name<60>; + uint32 value; +}; + +struct SCSpecUDTEnumV0 +{ + string doc; + string lib<80>; + string name<60>; + SCSpecUDTEnumCaseV0 cases<50>; +}; + +struct SCSpecUDTErrorEnumCaseV0 +{ + string doc; + string name<60>; + uint32 value; +}; + +struct SCSpecUDTErrorEnumV0 +{ + string doc; + string lib<80>; + string name<60>; + SCSpecUDTErrorEnumCaseV0 cases<50>; +}; + +struct SCSpecFunctionInputV0 +{ + string doc; + string name<30>; + SCSpecTypeDef type; +}; + +struct SCSpecFunctionV0 +{ + string doc; + SCSymbol name; + SCSpecFunctionInputV0 inputs<10>; + SCSpecTypeDef outputs<1>; +}; + +enum SCSpecEntryKind +{ + SC_SPEC_ENTRY_FUNCTION_V0 = 0, + SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, + SC_SPEC_ENTRY_UDT_UNION_V0 = 2, + SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, + SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 +}; + +union SCSpecEntry switch (SCSpecEntryKind kind) +{ +case SC_SPEC_ENTRY_FUNCTION_V0: + SCSpecFunctionV0 functionV0; +case SC_SPEC_ENTRY_UDT_STRUCT_V0: + SCSpecUDTStructV0 udtStructV0; +case SC_SPEC_ENTRY_UDT_UNION_V0: + SCSpecUDTUnionV0 udtUnionV0; +case SC_SPEC_ENTRY_UDT_ENUM_V0: + SCSpecUDTEnumV0 udtEnumV0; +case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: + SCSpecUDTErrorEnumV0 udtErrorEnumV0; +}; + +} diff --git a/xdr/curr/Stellar-contract.x b/xdr/curr/Stellar-contract.x new file mode 100644 index 000000000..7c7469c7e --- /dev/null +++ b/xdr/curr/Stellar-contract.x @@ -0,0 +1,282 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +% #include "xdr/Stellar-types.h" +namespace stellar +{ + +// We fix a maximum of 128 value types in the system for two reasons: we want to +// keep the codes relatively small (<= 8 bits) when bit-packing values into a +// u64 at the environment interface level, so that we keep many bits for +// payloads (small strings, small numeric values, object handles); and then we +// actually want to go one step further and ensure (for code-size) that our +// codes fit in a single ULEB128-code byte, which means we can only use 7 bits. +// +// We also reserve several type codes from this space because we want to _reuse_ +// the SCValType codes at the environment interface level (or at least not +// exceed its number-space) but there are more types at that level, assigned to +// optimizations/special case representations of values abstract at this level. + +enum SCValType +{ + SCV_BOOL = 0, + SCV_VOID = 1, + SCV_ERROR = 2, + + // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. + SCV_U32 = 3, + SCV_I32 = 4, + + // 64 bits is naturally supported by both WASM and XDR also. + SCV_U64 = 5, + SCV_I64 = 6, + + // Time-related u64 subtypes with their own functions and formatting. + SCV_TIMEPOINT = 7, + SCV_DURATION = 8, + + // 128 bits is naturally supported by Rust and we use it for Soroban + // fixed-point arithmetic prices / balances / similar "quantities". These + // are represented in XDR as a pair of 2 u64s. + SCV_U128 = 9, + SCV_I128 = 10, + + // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine + // word, so for interop use we include this even though it requires a small + // amount of Rust guest and/or host library code. + SCV_U256 = 11, + SCV_I256 = 12, + + // Bytes come in 3 flavors, 2 of which have meaningfully different + // formatting and validity-checking / domain-restriction. + SCV_BYTES = 13, + SCV_STRING = 14, + SCV_SYMBOL = 15, + + // Vecs and maps are just polymorphic containers of other ScVals. + SCV_VEC = 16, + SCV_MAP = 17, + + // Address is the universal identifier for contracts and classic + // accounts. + SCV_ADDRESS = 18, + + // The following are the internal SCVal variants that are not + // exposed to the contracts. + SCV_CONTRACT_INSTANCE = 19, + + // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique + // symbolic SCVals used as the key for ledger entries for a contract's + // instance and an address' nonce, respectively. + SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20, + SCV_LEDGER_KEY_NONCE = 21 +}; + +enum SCErrorType +{ + SCE_CONTRACT = 0, // Contract-specific, user-defined codes. + SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode. + SCE_CONTEXT = 2, // Errors in the contract's host context. + SCE_STORAGE = 3, // Errors accessing host storage. + SCE_OBJECT = 4, // Errors working with host objects. + SCE_CRYPTO = 5, // Errors in cryptographic operations. + SCE_EVENTS = 6, // Errors while emitting events. + SCE_BUDGET = 7, // Errors relating to budget limits. + SCE_VALUE = 8, // Errors working with host values or SCVals. + SCE_AUTH = 9 // Errors from the authentication subsystem. +}; + +enum SCErrorCode +{ + SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero). + SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds. + SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data. + SCEC_MISSING_VALUE = 3, // Some value was required but not provided. + SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed. + SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit. + SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not. + SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic. + SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected. + SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected. +}; + +// Smart contract errors are split into a type (SCErrorType) and a code. When an +// error is of type SCE_CONTRACT it carries a user-defined uint32 code that +// Soroban assigns no specific meaning to. In all other cases, the type +// specifies a subsystem of the Soroban host where the error originated, and the +// accompanying code is an SCErrorCode, each of which specifies a slightly more +// precise class of errors within that subsystem. +// +// Error types and codes are not maximally precise; there is a tradeoff between +// precision and flexibility in the implementation, and the granularity here is +// chosen to be adequate for most purposes while not placing a burden on future +// system evolution and maintenance. When additional precision is needed for +// debugging, Soroban can be run with diagnostic events enabled. + +union SCError switch (SCErrorType type) +{ +case SCE_CONTRACT: + uint32 contractCode; +case SCE_WASM_VM: +case SCE_CONTEXT: +case SCE_STORAGE: +case SCE_OBJECT: +case SCE_CRYPTO: +case SCE_EVENTS: +case SCE_BUDGET: +case SCE_VALUE: +case SCE_AUTH: + SCErrorCode code; +}; + +struct UInt128Parts { + uint64 hi; + uint64 lo; +}; + +// A signed int128 has a high sign bit and 127 value bits. We break it into a +// signed high int64 (that carries the sign bit and the high 63 value bits) and +// a low unsigned uint64 that carries the low 64 bits. This will sort in +// generated code in the same order the underlying int128 sorts. +struct Int128Parts { + int64 hi; + uint64 lo; +}; + +struct UInt256Parts { + uint64 hi_hi; + uint64 hi_lo; + uint64 lo_hi; + uint64 lo_lo; +}; + +// A signed int256 has a high sign bit and 255 value bits. We break it into a +// signed high int64 (that carries the sign bit and the high 63 value bits) and +// three low unsigned `uint64`s that carry the lower bits. This will sort in +// generated code in the same order the underlying int256 sorts. +struct Int256Parts { + int64 hi_hi; + uint64 hi_lo; + uint64 lo_hi; + uint64 lo_lo; +}; + +enum ContractExecutableType +{ + CONTRACT_EXECUTABLE_WASM = 0, + CONTRACT_EXECUTABLE_TOKEN = 1 +}; + +union ContractExecutable switch (ContractExecutableType type) +{ +case CONTRACT_EXECUTABLE_WASM: + Hash wasm_hash; +case CONTRACT_EXECUTABLE_TOKEN: + void; +}; + +enum SCAddressType +{ + SC_ADDRESS_TYPE_ACCOUNT = 0, + SC_ADDRESS_TYPE_CONTRACT = 1 +}; + +union SCAddress switch (SCAddressType type) +{ +case SC_ADDRESS_TYPE_ACCOUNT: + AccountID accountId; +case SC_ADDRESS_TYPE_CONTRACT: + Hash contractId; +}; + +%struct SCVal; +%struct SCMapEntry; + +const SCSYMBOL_LIMIT = 32; + +typedef SCVal SCVec<>; +typedef SCMapEntry SCMap<>; + +typedef opaque SCBytes<>; +typedef string SCString<>; +typedef string SCSymbol; + +struct SCNonceKey { + int64 nonce; +}; + +struct SCContractInstance { + ContractExecutable executable; + SCMap* storage; +}; + +union SCVal switch (SCValType type) +{ + +case SCV_BOOL: + bool b; +case SCV_VOID: + void; +case SCV_ERROR: + SCError error; + +case SCV_U32: + uint32 u32; +case SCV_I32: + int32 i32; + +case SCV_U64: + uint64 u64; +case SCV_I64: + int64 i64; +case SCV_TIMEPOINT: + TimePoint timepoint; +case SCV_DURATION: + Duration duration; + +case SCV_U128: + UInt128Parts u128; +case SCV_I128: + Int128Parts i128; + +case SCV_U256: + UInt256Parts u256; +case SCV_I256: + Int256Parts i256; + +case SCV_BYTES: + SCBytes bytes; +case SCV_STRING: + SCString str; +case SCV_SYMBOL: + SCSymbol sym; + +// Vec and Map are recursive so need to live +// behind an option, due to xdrpp limitations. +case SCV_VEC: + SCVec *vec; +case SCV_MAP: + SCMap *map; + +case SCV_ADDRESS: + SCAddress address; + +// Special SCVals reserved for system-constructed contract-data +// ledger keys, not generally usable elsewhere. +case SCV_LEDGER_KEY_CONTRACT_INSTANCE: + void; +case SCV_LEDGER_KEY_NONCE: + SCNonceKey nonce_key; + +case SCV_CONTRACT_INSTANCE: + SCContractInstance instance; +}; + +struct SCMapEntry +{ + SCVal key; + SCVal val; +}; + +} diff --git a/xdr/curr/Stellar-ledger-entries.x b/xdr/curr/Stellar-ledger-entries.x index 3eb578f16..f06648400 100644 --- a/xdr/curr/Stellar-ledger-entries.x +++ b/xdr/curr/Stellar-ledger-entries.x @@ -3,17 +3,16 @@ // of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 %#include "xdr/Stellar-types.h" +%#include "xdr/Stellar-contract.h" +%#include "xdr/Stellar-contract-config-setting.h" namespace stellar { -typedef PublicKey AccountID; typedef opaque Thresholds[4]; typedef string string32<32>; typedef string string64<64>; typedef int64 SequenceNumber; -typedef uint64 TimePoint; -typedef uint64 Duration; typedef opaque DataValue<64>; typedef Hash PoolID; // SHA256(LiquidityPoolParameters) @@ -98,7 +97,11 @@ enum LedgerEntryType OFFER = 2, DATA = 3, CLAIMABLE_BALANCE = 4, - LIQUIDITY_POOL = 5 + LIQUIDITY_POOL = 5, + CONTRACT_DATA = 6, + CONTRACT_CODE = 7, + CONFIG_SETTING = 8, + EXPIRATION = 9 }; struct Signer @@ -491,6 +494,33 @@ struct LiquidityPoolEntry body; }; +enum ContractDataDurability { + TEMPORARY = 0, + PERSISTENT = 1 +}; + +struct ContractDataEntry { + ExtensionPoint ext; + + SCAddress contract; + SCVal key; + ContractDataDurability durability; + SCVal val; +}; + +struct ContractCodeEntry { + ExtensionPoint ext; + + Hash hash; + opaque code<>; +}; + +struct ExpirationEntry { + // Hash of the LedgerKey that is associated with this ExpirationEntry + Hash keyHash; + uint32 expirationLedgerSeq; +}; + struct LedgerEntryExtensionV1 { SponsorshipDescriptor sponsoringID; @@ -521,6 +551,14 @@ struct LedgerEntry ClaimableBalanceEntry claimableBalance; case LIQUIDITY_POOL: LiquidityPoolEntry liquidityPool; + case CONTRACT_DATA: + ContractDataEntry contractData; + case CONTRACT_CODE: + ContractCodeEntry contractCode; + case CONFIG_SETTING: + ConfigSettingEntry configSetting; + case EXPIRATION: + ExpirationEntry expiration; } data; @@ -575,6 +613,29 @@ case LIQUIDITY_POOL: { PoolID liquidityPoolID; } liquidityPool; +case CONTRACT_DATA: + struct + { + SCAddress contract; + SCVal key; + ContractDataDurability durability; + } contractData; +case CONTRACT_CODE: + struct + { + Hash hash; + } contractCode; +case CONFIG_SETTING: + struct + { + ConfigSettingID configSettingID; + } configSetting; +case EXPIRATION: + struct + { + // Hash of the LedgerKey that is associated with this ExpirationEntry + Hash keyHash; + } expiration; }; // list of all envelope types used in the application @@ -589,6 +650,8 @@ enum EnvelopeType ENVELOPE_TYPE_SCPVALUE = 4, ENVELOPE_TYPE_TX_FEE_BUMP = 5, ENVELOPE_TYPE_OP_ID = 6, - ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7 + ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, + ENVELOPE_TYPE_CONTRACT_ID = 8, + ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 }; } diff --git a/xdr/curr/Stellar-ledger.x b/xdr/curr/Stellar-ledger.x index 9c2cbcee5..a1bbac4b6 100644 --- a/xdr/curr/Stellar-ledger.x +++ b/xdr/curr/Stellar-ledger.x @@ -122,7 +122,14 @@ enum LedgerUpgradeType LEDGER_UPGRADE_BASE_FEE = 2, LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, LEDGER_UPGRADE_BASE_RESERVE = 4, - LEDGER_UPGRADE_FLAGS = 5 + LEDGER_UPGRADE_FLAGS = 5, + LEDGER_UPGRADE_CONFIG = 6, + LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 +}; + +struct ConfigUpgradeSetKey { + Hash contractID; + Hash contentHash; }; union LedgerUpgrade switch (LedgerUpgradeType type) @@ -137,6 +144,17 @@ case LEDGER_UPGRADE_BASE_RESERVE: uint32 newBaseReserve; // update baseReserve case LEDGER_UPGRADE_FLAGS: uint32 newFlags; // update flags +case LEDGER_UPGRADE_CONFIG: + // Update arbitrary `ConfigSetting` entries identified by the key. + ConfigUpgradeSetKey newConfig; +case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: + // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without + // using `LEDGER_UPGRADE_CONFIG`. + uint32 newMaxSorobanTxSetSize; +}; + +struct ConfigUpgradeSet { + ConfigSettingEntry updatedEntry<>; }; /* Entries used to define the bucket list */ @@ -348,6 +366,74 @@ struct TransactionMetaV2 // applied if any }; +enum ContractEventType +{ + SYSTEM = 0, + CONTRACT = 1, + DIAGNOSTIC = 2 +}; + +struct ContractEvent +{ + // We can use this to add more fields, or because it + // is first, to change ContractEvent into a union. + ExtensionPoint ext; + + Hash* contractID; + ContractEventType type; + + union switch (int v) + { + case 0: + struct + { + SCVal topics<>; + SCVal data; + } v0; + } + body; +}; + +struct DiagnosticEvent +{ + bool inSuccessfulContractCall; + ContractEvent event; +}; + +struct SorobanTransactionMeta +{ + ExtensionPoint ext; + + ContractEvent events<>; // custom events populated by the + // contracts themselves. + SCVal returnValue; // return value of the host fn invocation + + // Diagnostics events that are not hashed. + // This will contain all contract and diagnostic events. Even ones + // that were emitted in a failed contract call. + DiagnosticEvent diagnosticEvents<>; +}; + +struct TransactionMetaV3 +{ + ExtensionPoint ext; + + LedgerEntryChanges txChangesBefore; // tx level changes before operations + // are applied if any + OperationMeta operations<>; // meta for each operation + LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // applied if any + SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for + // Soroban transactions). +}; + +// This is in Stellar-ledger.x to due to a circular dependency +struct InvokeHostFunctionSuccessPreImage +{ + SCVal returnValue; + ContractEvent events<>; +}; + // this is the meta produced when applying transactions // it does not include pre-apply updates such as fees union TransactionMeta switch (int v) @@ -358,6 +444,8 @@ case 1: TransactionMetaV1 v1; case 2: TransactionMetaV2 v2; +case 3: + TransactionMetaV3 v3; }; // This struct groups together changes on a per transaction basis @@ -414,11 +502,46 @@ struct LedgerCloseMetaV1 SCPHistoryEntry scpInfo<>; }; +struct LedgerCloseMetaV2 +{ + // We forgot to add an ExtensionPoint in v1 but at least + // we can add one now in v2. + ExtensionPoint ext; + + LedgerHeaderHistoryEntry ledgerHeader; + + GeneralizedTransactionSet txSet; + + // NB: transactions are sorted in apply order here + // fees for all transactions are processed first + // followed by applying transactions + TransactionResultMeta txProcessing<>; + + // upgrades are applied last + UpgradeEntryMeta upgradesProcessing<>; + + // other misc information attached to the ledger close + SCPHistoryEntry scpInfo<>; + + // Size in bytes of BucketList, to support downstream + // systems calculating storage fees correctly. + uint64 totalByteSizeOfBucketList; + + // Expired temp keys that are being evicted at this ledger. + LedgerKey evictedTemporaryLedgerKeys<>; + + // Expired restorable ledger entries that are being + // evicted at this ledger. + LedgerEntry evictedPersistentLedgerEntries<>; +}; + union LedgerCloseMeta switch (int v) { case 0: LedgerCloseMetaV0 v0; case 1: LedgerCloseMetaV1 v1; +case 2: + LedgerCloseMetaV2 v2; }; } diff --git a/xdr/curr/Stellar-overlay.x b/xdr/curr/Stellar-overlay.x index 64fd97a6c..4c964736d 100644 --- a/xdr/curr/Stellar-overlay.x +++ b/xdr/curr/Stellar-overlay.x @@ -27,6 +27,12 @@ struct SendMore uint32 numMessages; }; +struct SendMoreExtended +{ + uint32 numMessages; + uint32 numBytes; +}; + struct AuthCert { Curve25519Public pubkey; @@ -47,16 +53,14 @@ struct Hello uint256 nonce; }; - -// During the roll-out phrase, pull mode will be optional. +// During the roll-out phrase, nodes can disable flow control in bytes. // Therefore, we need a way to communicate with other nodes -// that we want/don't want pull mode. -// However, the goal is for everyone to enable it by default, -// so we don't want to introduce a new member variable. -// For now, we'll use the `flags` field (originally named -// `unused`) in `Auth`. -// 100 is just a number that is not 0. -const AUTH_MSG_FLAG_PULL_MODE_REQUESTED = 100; +// that we want/don't want flow control in bytes. +// We use the `flags` field in the Auth message with a special value +// set to communicate this. Note that AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 0 +// AND AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 100 (as previously +// that value was used for other purposes). +const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200; struct Auth { @@ -83,7 +87,7 @@ struct PeerAddress uint32 numFailures; }; -// Next ID: 18 +// Next ID: 21 enum MessageType { ERROR_MSG = 0, @@ -112,6 +116,8 @@ enum MessageType SURVEY_RESPONSE = 15, SEND_MORE = 16, + SEND_MORE_EXTENDED = 20, + FLOOD_ADVERT = 18, FLOOD_DEMAND = 19 }; @@ -127,6 +133,12 @@ enum SurveyMessageCommandType SURVEY_TOPOLOGY = 0 }; +enum SurveyMessageResponseType +{ + SURVEY_TOPOLOGY_RESPONSE_V0 = 0, + SURVEY_TOPOLOGY_RESPONSE_V1 = 1 +}; + struct SurveyRequestMessage { NodeID surveyorPeerID; @@ -181,7 +193,7 @@ struct PeerStats typedef PeerStats PeerStatList<25>; -struct TopologyResponseBody +struct TopologyResponseBodyV0 { PeerStatList inboundPeers; PeerStatList outboundPeers; @@ -190,10 +202,24 @@ struct TopologyResponseBody uint32 totalOutboundPeerCount; }; -union SurveyResponseBody switch (SurveyMessageCommandType type) +struct TopologyResponseBodyV1 { -case SURVEY_TOPOLOGY: - TopologyResponseBody topologyResponseBody; + PeerStatList inboundPeers; + PeerStatList outboundPeers; + + uint32 totalInboundPeerCount; + uint32 totalOutboundPeerCount; + + uint32 maxInboundPeerCount; + uint32 maxOutboundPeerCount; +}; + +union SurveyResponseBody switch (SurveyMessageResponseType type) +{ +case SURVEY_TOPOLOGY_RESPONSE_V0: + TopologyResponseBodyV0 topologyResponseBodyV0; +case SURVEY_TOPOLOGY_RESPONSE_V1: + TopologyResponseBodyV1 topologyResponseBodyV1; }; const TX_ADVERT_VECTOR_MAX_SIZE = 1000; @@ -254,7 +280,8 @@ case GET_SCP_STATE: uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest case SEND_MORE: SendMore sendMoreMessage; - +case SEND_MORE_EXTENDED: + SendMoreExtended sendMoreExtendedMessage; // Pull mode case FLOOD_ADVERT: FloodAdvert floodAdvert; diff --git a/xdr/curr/Stellar-transaction.x b/xdr/curr/Stellar-transaction.x index 23918226d..2e3c22b31 100644 --- a/xdr/curr/Stellar-transaction.x +++ b/xdr/curr/Stellar-transaction.x @@ -2,11 +2,15 @@ // under the Apache License, Version 2.0. See the COPYING file at the root // of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 +%#include "xdr/Stellar-contract.h" %#include "xdr/Stellar-ledger-entries.h" namespace stellar { +// maximum number of operations per transaction +const MAX_OPS_PER_TX = 100; + union LiquidityPoolParameters switch (LiquidityPoolType type) { case LIQUIDITY_POOL_CONSTANT_PRODUCT: @@ -57,7 +61,10 @@ enum OperationType CLAWBACK_CLAIMABLE_BALANCE = 20, SET_TRUST_LINE_FLAGS = 21, LIQUIDITY_POOL_DEPOSIT = 22, - LIQUIDITY_POOL_WITHDRAW = 23 + LIQUIDITY_POOL_WITHDRAW = 23, + INVOKE_HOST_FUNCTION = 24, + BUMP_FOOTPRINT_EXPIRATION = 25, + RESTORE_FOOTPRINT = 26 }; /* CreateAccount @@ -465,6 +472,141 @@ struct LiquidityPoolWithdrawOp int64 minAmountB; // minimum amount of second asset to withdraw }; +enum HostFunctionType +{ + HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, + HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, + HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 +}; + +enum ContractIDPreimageType +{ + CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0, + CONTRACT_ID_PREIMAGE_FROM_ASSET = 1 +}; + +union ContractIDPreimage switch (ContractIDPreimageType type) +{ +case CONTRACT_ID_PREIMAGE_FROM_ADDRESS: + struct + { + SCAddress address; + uint256 salt; + } fromAddress; +case CONTRACT_ID_PREIMAGE_FROM_ASSET: + Asset fromAsset; +}; + +struct CreateContractArgs +{ + ContractIDPreimage contractIDPreimage; + ContractExecutable executable; +}; + +struct InvokeContractArgs { + SCAddress contractAddress; + SCSymbol functionName; + SCVal args<>; +}; + +union HostFunction switch (HostFunctionType type) +{ +case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: + InvokeContractArgs invokeContract; +case HOST_FUNCTION_TYPE_CREATE_CONTRACT: + CreateContractArgs createContract; +case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: + opaque wasm<>; +}; + +enum SorobanAuthorizedFunctionType +{ + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 +}; + +union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) +{ +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: + InvokeContractArgs contractFn; +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: + CreateContractArgs createContractHostFn; +}; + +struct SorobanAuthorizedInvocation +{ + SorobanAuthorizedFunction function; + SorobanAuthorizedInvocation subInvocations<>; +}; + +struct SorobanAddressCredentials +{ + SCAddress address; + int64 nonce; + uint32 signatureExpirationLedger; + SCVal signature; +}; + +enum SorobanCredentialsType +{ + SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0, + SOROBAN_CREDENTIALS_ADDRESS = 1 +}; + +union SorobanCredentials switch (SorobanCredentialsType type) +{ +case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT: + void; +case SOROBAN_CREDENTIALS_ADDRESS: + SorobanAddressCredentials address; +}; + +/* Unit of authorization data for Soroban. + + Represents an authorization for executing the tree of authorized contract + and/or host function calls by the user defined by `credentials`. +*/ +struct SorobanAuthorizationEntry +{ + SorobanCredentials credentials; + SorobanAuthorizedInvocation rootInvocation; +}; + +/* Upload WASM, create, and invoke contracts in Soroban. + + Threshold: med + Result: InvokeHostFunctionResult +*/ +struct InvokeHostFunctionOp +{ + // Host function to invoke. + HostFunction hostFunction; + // Per-address authorizations for this host function. + SorobanAuthorizationEntry auth<>; +}; + +/* Bump the expiration ledger of the entries specified in the readOnly footprint + so they'll expire at least ledgersToExpire ledgers from lcl. + + Threshold: med + Result: BumpFootprintExpirationResult +*/ +struct BumpFootprintExpirationOp +{ + ExtensionPoint ext; + uint32 ledgersToExpire; +}; + +/* Restore the expired or evicted entries specified in the readWrite footprint. + + Threshold: med + Result: RestoreFootprintOp +*/ +struct RestoreFootprintOp +{ + ExtensionPoint ext; +}; + /* An operation is the lowest unit of work that a transaction does */ struct Operation { @@ -523,6 +665,12 @@ struct Operation LiquidityPoolDepositOp liquidityPoolDepositOp; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; + case INVOKE_HOST_FUNCTION: + InvokeHostFunctionOp invokeHostFunctionOp; + case BUMP_FOOTPRINT_EXPIRATION: + BumpFootprintExpirationOp bumpFootprintExpirationOp; + case RESTORE_FOOTPRINT: + RestoreFootprintOp restoreFootprintOp; } body; }; @@ -540,11 +688,25 @@ case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: struct { AccountID sourceAccount; - SequenceNumber seqNum; + SequenceNumber seqNum; uint32 opNum; PoolID liquidityPoolID; Asset asset; } revokeID; +case ENVELOPE_TYPE_CONTRACT_ID: + struct + { + Hash networkID; + ContractIDPreimage contractIDPreimage; + } contractID; +case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: + struct + { + Hash networkID; + int64 nonce; + uint32 signatureExpirationLedger; + SorobanAuthorizedInvocation invocation; + } sorobanAuthorization; }; enum MemoType @@ -632,8 +794,36 @@ case PRECOND_V2: PreconditionsV2 v2; }; -// maximum number of operations per transaction -const MAX_OPS_PER_TX = 100; +// Ledger key sets touched by a smart contract transaction. +struct LedgerFootprint +{ + LedgerKey readOnly<>; + LedgerKey readWrite<>; +}; + +// Resource limits for a Soroban transaction. +// The transaction will fail if it exceeds any of these limits. +struct SorobanResources +{ + // The ledger footprint of the transaction. + LedgerFootprint footprint; + // The maximum number of instructions this transaction can use + uint32 instructions; + + // The maximum number of bytes this transaction can read from ledger + uint32 readBytes; + // The maximum number of bytes this transaction can write to ledger + uint32 writeBytes; +}; + +// The transaction extension for Soroban. +struct SorobanTransactionData +{ + ExtensionPoint ext; + SorobanResources resources; + // Portion of transaction `fee` allocated to refundable fees. + int64 refundableFee; +}; // TransactionV0 is a transaction with the AccountID discriminant stripped off, // leaving a raw ed25519 public key to identify the source account. This is used @@ -695,6 +885,8 @@ struct Transaction { case 0: void; + case 1: + SorobanTransactionData sorobanData; } ext; }; @@ -1588,6 +1780,73 @@ case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: void; }; +enum InvokeHostFunctionResultCode +{ + // codes considered as "success" for the operation + INVOKE_HOST_FUNCTION_SUCCESS = 0, + + // codes considered as "failure" for the operation + INVOKE_HOST_FUNCTION_MALFORMED = -1, + INVOKE_HOST_FUNCTION_TRAPPED = -2, + INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, + INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 +}; + +union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) +{ +case INVOKE_HOST_FUNCTION_SUCCESS: + Hash success; // sha256(InvokeHostFunctionSuccessPreImage) +case INVOKE_HOST_FUNCTION_MALFORMED: +case INVOKE_HOST_FUNCTION_TRAPPED: +case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: +case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: +case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: + void; +}; + +enum BumpFootprintExpirationResultCode +{ + // codes considered as "success" for the operation + BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + + // codes considered as "failure" for the operation + BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, + BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, + BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 +}; + +union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) +{ +case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + void; +case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: +case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: +case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + void; +}; + +enum RestoreFootprintResultCode +{ + // codes considered as "success" for the operation + RESTORE_FOOTPRINT_SUCCESS = 0, + + // codes considered as "failure" for the operation + RESTORE_FOOTPRINT_MALFORMED = -1, + RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, + RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 +}; + +union RestoreFootprintResult switch (RestoreFootprintResultCode code) +{ +case RESTORE_FOOTPRINT_SUCCESS: + void; +case RESTORE_FOOTPRINT_MALFORMED: +case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED: +case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE: + void; +}; + /* High level Operation Result */ enum OperationResultCode { @@ -1654,6 +1913,12 @@ case opINNER: LiquidityPoolDepositResult liquidityPoolDepositResult; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; + case INVOKE_HOST_FUNCTION: + InvokeHostFunctionResult invokeHostFunctionResult; + case BUMP_FOOTPRINT_EXPIRATION: + BumpFootprintExpirationResult bumpFootprintExpirationResult; + case RESTORE_FOOTPRINT: + RestoreFootprintResult restoreFootprintResult; } tr; case opBAD_AUTH: @@ -1684,12 +1949,12 @@ enum TransactionResultCode txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction txINTERNAL_ERROR = -11, // an unknown error occurred - txNOT_SUPPORTED = -12, // transaction type not supported - txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed - txBAD_SPONSORSHIP = -14, // sponsorship not confirmed - txBAD_MIN_SEQ_AGE_OR_GAP = - -15, // minSeqAge or minSeqLedgerGap conditions not met - txMALFORMED = -16 // precondition is invalid + txNOT_SUPPORTED = -12, // transaction type not supported + txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed + txBAD_SPONSORSHIP = -14, // sponsorship not confirmed + txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met + txMALFORMED = -16, // precondition is invalid + txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met }; // InnerTransactionResult must be binary compatible with TransactionResult @@ -1720,6 +1985,7 @@ struct InnerTransactionResult case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: + case txSOROBAN_INVALID: void; } result; @@ -1766,6 +2032,7 @@ struct TransactionResult case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: + case txSOROBAN_INVALID: void; } result; diff --git a/xdr/curr/Stellar-types.x b/xdr/curr/Stellar-types.x index c3a1ebe2c..d71bf0d49 100644 --- a/xdr/curr/Stellar-types.x +++ b/xdr/curr/Stellar-types.x @@ -14,6 +14,9 @@ typedef int int32; typedef unsigned hyper uint64; typedef hyper int64; +typedef uint64 TimePoint; +typedef uint64 Duration; + // An ExtensionPoint is always marshaled as a 32-bit 0 value. At a // later point, it can be replaced by a different union so as to // extend a structure. @@ -79,6 +82,7 @@ typedef opaque Signature<64>; typedef opaque SignatureHint[4]; typedef PublicKey NodeID; +typedef PublicKey AccountID; struct Curve25519Secret { diff --git a/xdr/next/Stellar-contract-config-setting.x b/xdr/next/Stellar-contract-config-setting.x new file mode 100644 index 000000000..9512f0c4d --- /dev/null +++ b/xdr/next/Stellar-contract-config-setting.x @@ -0,0 +1,246 @@ +%#include "xdr/Stellar-types.h" + +namespace stellar { +// General “Soroban execution lane” settings +struct ConfigSettingContractExecutionLanesV0 +{ + // maximum number of Soroban transactions per ledger + uint32 ledgerMaxTxCount; +}; + +// "Compute" settings for contracts (instructions and memory). +struct ConfigSettingContractComputeV0 +{ + // Maximum instructions per ledger + int64 ledgerMaxInstructions; + // Maximum instructions per transaction + int64 txMaxInstructions; + // Cost of 10000 instructions + int64 feeRatePerInstructionsIncrement; + + // Memory limit per transaction. Unlike instructions, there is no fee + // for memory, just the limit. + uint32 txMemoryLimit; +}; + +// Ledger access settings for contracts. +struct ConfigSettingContractLedgerCostV0 +{ + // Maximum number of ledger entry read operations per ledger + uint32 ledgerMaxReadLedgerEntries; + // Maximum number of bytes that can be read per ledger + uint32 ledgerMaxReadBytes; + // Maximum number of ledger entry write operations per ledger + uint32 ledgerMaxWriteLedgerEntries; + // Maximum number of bytes that can be written per ledger + uint32 ledgerMaxWriteBytes; + + // Maximum number of ledger entry read operations per transaction + uint32 txMaxReadLedgerEntries; + // Maximum number of bytes that can be read per transaction + uint32 txMaxReadBytes; + // Maximum number of ledger entry write operations per transaction + uint32 txMaxWriteLedgerEntries; + // Maximum number of bytes that can be written per transaction + uint32 txMaxWriteBytes; + + int64 feeReadLedgerEntry; // Fee per ledger entry read + int64 feeWriteLedgerEntry; // Fee per ledger entry write + + int64 feeRead1KB; // Fee for reading 1KB + + // The following parameters determine the write fee per 1KB. + // Write fee grows linearly until bucket list reaches this size + int64 bucketListTargetSizeBytes; + // Fee per 1KB write when the bucket list is empty + int64 writeFee1KBBucketListLow; + // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` + int64 writeFee1KBBucketListHigh; + // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` + uint32 bucketListWriteFeeGrowthFactor; +}; + +// Historical data (pushed to core archives) settings for contracts. +struct ConfigSettingContractHistoricalDataV0 +{ + int64 feeHistorical1KB; // Fee for storing 1KB in archives +}; + +// Contract event-related settings. +struct ConfigSettingContractEventsV0 +{ + // Maximum size of events that a contract call can emit. + uint32 txMaxContractEventsSizeBytes; + // Fee for generating 1KB of contract events. + int64 feeContractEvents1KB; +}; + +// Bandwidth related data settings for contracts. +// We consider bandwidth to only be consumed by the transaction envelopes, hence +// this concerns only transaction sizes. +struct ConfigSettingContractBandwidthV0 +{ + // Maximum sum of all transaction sizes in the ledger in bytes + uint32 ledgerMaxTxsSizeBytes; + // Maximum size in bytes for a transaction + uint32 txMaxSizeBytes; + + // Fee for 1 KB of transaction size + int64 feeTxSize1KB; +}; + +enum ContractCostType { + // Cost of running 1 wasm instruction + WasmInsnExec = 0, + // Cost of growing wasm linear memory by 1 page + WasmMemAlloc = 1, + // Cost of allocating a chuck of host memory (in bytes) + HostMemAlloc = 2, + // Cost of copying a chuck of bytes into a pre-allocated host memory + HostMemCpy = 3, + // Cost of comparing two slices of host memory + HostMemCmp = 4, + // Cost of a host function dispatch, not including the actual work done by + // the function nor the cost of VM invocation machinary + DispatchHostFunction = 5, + // Cost of visiting a host object from the host object storage. Exists to + // make sure some baseline cost coverage, i.e. repeatly visiting objects + // by the guest will always incur some charges. + VisitObject = 6, + // Cost of serializing an xdr object to bytes + ValSer = 7, + // Cost of deserializing an xdr object from bytes + ValDeser = 8, + // Cost of computing the sha256 hash from bytes + ComputeSha256Hash = 9, + // Cost of computing the ed25519 pubkey from bytes + ComputeEd25519PubKey = 10, + // Cost of accessing an entry in a Map. + MapEntry = 11, + // Cost of accessing an entry in a Vec + VecEntry = 12, + // Cost of verifying ed25519 signature of a payload. + VerifyEd25519Sig = 13, + // Cost of reading a slice of vm linear memory + VmMemRead = 14, + // Cost of writing to a slice of vm linear memory + VmMemWrite = 15, + // Cost of instantiation a VM from wasm bytes code. + VmInstantiation = 16, + // Cost of instantiation a VM from a cached state. + VmCachedInstantiation = 17, + // Cost of invoking a function on the VM. If the function is a host function, + // additional cost will be covered by `DispatchHostFunction`. + InvokeVmFunction = 18, + // Cost of computing a keccak256 hash from bytes. + ComputeKeccak256Hash = 19, + // Cost of computing an ECDSA secp256k1 pubkey from bytes. + ComputeEcdsaSecp256k1Key = 20, + // Cost of computing an ECDSA secp256k1 signature from bytes. + ComputeEcdsaSecp256k1Sig = 21, + // Cost of recovering an ECDSA secp256k1 key from a signature. + RecoverEcdsaSecp256k1Key = 22, + // Cost of int256 addition (`+`) and subtraction (`-`) operations + Int256AddSub = 23, + // Cost of int256 multiplication (`*`) operation + Int256Mul = 24, + // Cost of int256 division (`/`) operation + Int256Div = 25, + // Cost of int256 power (`exp`) operation + Int256Pow = 26, + // Cost of int256 shift (`shl`, `shr`) operation + Int256Shift = 27 +}; + +struct ContractCostParamEntry { + // use `ext` to add more terms (e.g. higher order polynomials) in the future + ExtensionPoint ext; + + int64 constTerm; + int64 linearTerm; +}; + +struct StateExpirationSettings { + uint32 maxEntryExpiration; + uint32 minTempEntryExpiration; + uint32 minPersistentEntryExpiration; + + // rent_fee = wfee_rate_average / rent_rate_denominator_for_type + int64 persistentRentRateDenominator; + int64 tempRentRateDenominator; + + // max number of entries that emit expiration meta in a single ledger + uint32 maxEntriesToExpire; + + // Number of snapshots to use when calculating average BucketList size + uint32 bucketListSizeWindowSampleSize; + + // Maximum number of bytes that we scan for eviction per ledger + uint64 evictionScanSize; + + // Lowest BucketList level to be scanned to evict entries + uint32 startingEvictionScanLevel; +}; + +struct EvictionIterator { + uint32 bucketListLevel; + bool isCurrBucket; + uint64 bucketFileOffset; +}; + +// limits the ContractCostParams size to 20kB +const CONTRACT_COST_COUNT_LIMIT = 1024; + +typedef ContractCostParamEntry ContractCostParams; + +// Identifiers of all the network settings. +enum ConfigSettingID +{ + CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, + CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, + CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, + CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, + CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4, + CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, + CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6, + CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, + CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, + CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, + CONFIG_SETTING_STATE_EXPIRATION = 10, + CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, + CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, + CONFIG_SETTING_EVICTION_ITERATOR = 13 +}; + +union ConfigSettingEntry switch (ConfigSettingID configSettingID) +{ +case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: + uint32 contractMaxSizeBytes; +case CONFIG_SETTING_CONTRACT_COMPUTE_V0: + ConfigSettingContractComputeV0 contractCompute; +case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: + ConfigSettingContractLedgerCostV0 contractLedgerCost; +case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: + ConfigSettingContractHistoricalDataV0 contractHistoricalData; +case CONFIG_SETTING_CONTRACT_EVENTS_V0: + ConfigSettingContractEventsV0 contractEvents; +case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: + ConfigSettingContractBandwidthV0 contractBandwidth; +case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: + ContractCostParams contractCostParamsCpuInsns; +case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: + ContractCostParams contractCostParamsMemBytes; +case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: + uint32 contractDataKeySizeBytes; +case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: + uint32 contractDataEntrySizeBytes; +case CONFIG_SETTING_STATE_EXPIRATION: + StateExpirationSettings stateExpirationSettings; +case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: + ConfigSettingContractExecutionLanesV0 contractExecutionLanes; +case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: + uint64 bucketListSizeWindow<>; +case CONFIG_SETTING_EVICTION_ITERATOR: + EvictionIterator evictionIterator; +}; +} diff --git a/xdr/next/Stellar-contract-meta.x b/xdr/next/Stellar-contract-meta.x new file mode 100644 index 000000000..16eb5f9e2 --- /dev/null +++ b/xdr/next/Stellar-contract-meta.x @@ -0,0 +1,29 @@ +// Copyright 2022 Stellar Development Foundation and contributors. Licensed +// under the Apache License, Version 2.0. See the COPYING file at the root +// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0 + +// The contract meta XDR is highly experimental, incomplete, and still being +// iterated on. Breaking changes expected. + +% #include "xdr/Stellar-types.h" +namespace stellar +{ + +struct SCMetaV0 +{ + string key<>; + string val<>; +}; + +enum SCMetaKind +{ + SC_META_V0 = 0 +}; + +union SCMetaEntry switch (SCMetaKind kind) +{ +case SC_META_V0: + SCMetaV0 v0; +}; + +} diff --git a/xdr/next/Stellar-contract-spec.x b/xdr/next/Stellar-contract-spec.x index 8431e226f..6988a6338 100644 --- a/xdr/next/Stellar-contract-spec.x +++ b/xdr/next/Stellar-contract-spec.x @@ -19,7 +19,7 @@ enum SCSpecType // Types with no parameters. SC_SPEC_TYPE_BOOL = 1, SC_SPEC_TYPE_VOID = 2, - SC_SPEC_TYPE_STATUS = 3, + SC_SPEC_TYPE_ERROR = 3, SC_SPEC_TYPE_U32 = 4, SC_SPEC_TYPE_I32 = 5, SC_SPEC_TYPE_U64 = 6, @@ -39,7 +39,6 @@ enum SCSpecType SC_SPEC_TYPE_OPTION = 1000, SC_SPEC_TYPE_RESULT = 1001, SC_SPEC_TYPE_VEC = 1002, - SC_SPEC_TYPE_SET = 1003, SC_SPEC_TYPE_MAP = 1004, SC_SPEC_TYPE_TUPLE = 1005, SC_SPEC_TYPE_BYTES_N = 1006, @@ -70,11 +69,6 @@ struct SCSpecTypeMap SCSpecTypeDef valueType; }; -struct SCSpecTypeSet -{ - SCSpecTypeDef elementType; -}; - struct SCSpecTypeTuple { SCSpecTypeDef valueTypes<12>; @@ -95,7 +89,7 @@ union SCSpecTypeDef switch (SCSpecType type) case SC_SPEC_TYPE_VAL: case SC_SPEC_TYPE_BOOL: case SC_SPEC_TYPE_VOID: -case SC_SPEC_TYPE_STATUS: +case SC_SPEC_TYPE_ERROR: case SC_SPEC_TYPE_U32: case SC_SPEC_TYPE_I32: case SC_SPEC_TYPE_U64: @@ -119,8 +113,6 @@ case SC_SPEC_TYPE_VEC: SCSpecTypeVec vec; case SC_SPEC_TYPE_MAP: SCSpecTypeMap map; -case SC_SPEC_TYPE_SET: - SCSpecTypeSet set; case SC_SPEC_TYPE_TUPLE: SCSpecTypeTuple tuple; case SC_SPEC_TYPE_BYTES_N: diff --git a/xdr/next/Stellar-contract.x b/xdr/next/Stellar-contract.x index 6084cdbe2..7c7469c7e 100644 --- a/xdr/next/Stellar-contract.x +++ b/xdr/next/Stellar-contract.x @@ -22,7 +22,7 @@ enum SCValType { SCV_BOOL = 0, SCV_VOID = 1, - SCV_STATUS = 2, + SCV_ERROR = 2, // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. SCV_U32 = 3, @@ -38,8 +38,7 @@ enum SCValType // 128 bits is naturally supported by Rust and we use it for Soroban // fixed-point arithmetic prices / balances / similar "quantities". These - // are represented in XDR as a pair of 2 u64s, unlike {u,i}256 which is - // represented as an array of 32 bytes. + // are represented in XDR as a pair of 2 u64s. SCV_U128 = 9, SCV_I128 = 10, @@ -49,9 +48,6 @@ enum SCValType SCV_U256 = 11, SCV_I256 = 12, - // TODO: possibly allocate subtypes of i64, i128 and/or u256 for - // fixed-precision with a specific number of decimals. - // Bytes come in 3 flavors, 2 of which have meaningfully different // formatting and validity-checking / domain-restriction. SCV_BYTES = 13, @@ -62,143 +58,76 @@ enum SCValType SCV_VEC = 16, SCV_MAP = 17, - // SCContractExecutable and SCAddressType are types that gets used separately from - // SCVal so we do not flatten their structures into separate SCVal cases. - SCV_CONTRACT_EXECUTABLE = 18, - SCV_ADDRESS = 19, - - // SCV_LEDGER_KEY_CONTRACT_EXECUTABLE and SCV_LEDGER_KEY_NONCE are unique - // symbolic SCVals used as the key for ledger entries for a contract's code - // and an address' nonce, respectively. - SCV_LEDGER_KEY_CONTRACT_EXECUTABLE = 20, - SCV_LEDGER_KEY_NONCE = 21 -}; - -enum SCStatusType -{ - SST_OK = 0, - SST_UNKNOWN_ERROR = 1, - SST_HOST_VALUE_ERROR = 2, - SST_HOST_OBJECT_ERROR = 3, - SST_HOST_FUNCTION_ERROR = 4, - SST_HOST_STORAGE_ERROR = 5, - SST_HOST_CONTEXT_ERROR = 6, - SST_VM_ERROR = 7, - SST_CONTRACT_ERROR = 8, - SST_HOST_AUTH_ERROR = 9 - // TODO: add more -}; - -enum SCHostValErrorCode -{ - HOST_VALUE_UNKNOWN_ERROR = 0, - HOST_VALUE_RESERVED_TAG_VALUE = 1, - HOST_VALUE_UNEXPECTED_VAL_TYPE = 2, - HOST_VALUE_U63_OUT_OF_RANGE = 3, - HOST_VALUE_U32_OUT_OF_RANGE = 4, - HOST_VALUE_STATIC_UNKNOWN = 5, - HOST_VALUE_MISSING_OBJECT = 6, - HOST_VALUE_SYMBOL_TOO_LONG = 7, - HOST_VALUE_SYMBOL_BAD_CHAR = 8, - HOST_VALUE_SYMBOL_CONTAINS_NON_UTF8 = 9, - HOST_VALUE_BITSET_TOO_MANY_BITS = 10, - HOST_VALUE_STATUS_UNKNOWN = 11 -}; - -enum SCHostObjErrorCode -{ - HOST_OBJECT_UNKNOWN_ERROR = 0, - HOST_OBJECT_UNKNOWN_REFERENCE = 1, - HOST_OBJECT_UNEXPECTED_TYPE = 2, - HOST_OBJECT_OBJECT_COUNT_EXCEEDS_U32_MAX = 3, - HOST_OBJECT_OBJECT_NOT_EXIST = 4, - HOST_OBJECT_VEC_INDEX_OUT_OF_BOUND = 5, - HOST_OBJECT_CONTRACT_HASH_WRONG_LENGTH = 6 -}; + // Address is the universal identifier for contracts and classic + // accounts. + SCV_ADDRESS = 18, -enum SCHostFnErrorCode -{ - HOST_FN_UNKNOWN_ERROR = 0, - HOST_FN_UNEXPECTED_HOST_FUNCTION_ACTION = 1, - HOST_FN_INPUT_ARGS_WRONG_LENGTH = 2, - HOST_FN_INPUT_ARGS_WRONG_TYPE = 3, - HOST_FN_INPUT_ARGS_INVALID = 4 -}; + // The following are the internal SCVal variants that are not + // exposed to the contracts. + SCV_CONTRACT_INSTANCE = 19, -enum SCHostStorageErrorCode -{ - HOST_STORAGE_UNKNOWN_ERROR = 0, - HOST_STORAGE_EXPECT_CONTRACT_DATA = 1, - HOST_STORAGE_READWRITE_ACCESS_TO_READONLY_ENTRY = 2, - HOST_STORAGE_ACCESS_TO_UNKNOWN_ENTRY = 3, - HOST_STORAGE_MISSING_KEY_IN_GET = 4, - HOST_STORAGE_GET_ON_DELETED_KEY = 5 + // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique + // symbolic SCVals used as the key for ledger entries for a contract's + // instance and an address' nonce, respectively. + SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20, + SCV_LEDGER_KEY_NONCE = 21 }; -enum SCHostAuthErrorCode +enum SCErrorType { - HOST_AUTH_UNKNOWN_ERROR = 0, - HOST_AUTH_NONCE_ERROR = 1, - HOST_AUTH_DUPLICATE_AUTHORIZATION = 2, - HOST_AUTH_NOT_AUTHORIZED = 3 + SCE_CONTRACT = 0, // Contract-specific, user-defined codes. + SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode. + SCE_CONTEXT = 2, // Errors in the contract's host context. + SCE_STORAGE = 3, // Errors accessing host storage. + SCE_OBJECT = 4, // Errors working with host objects. + SCE_CRYPTO = 5, // Errors in cryptographic operations. + SCE_EVENTS = 6, // Errors while emitting events. + SCE_BUDGET = 7, // Errors relating to budget limits. + SCE_VALUE = 8, // Errors working with host values or SCVals. + SCE_AUTH = 9 // Errors from the authentication subsystem. }; -enum SCHostContextErrorCode +enum SCErrorCode { - HOST_CONTEXT_UNKNOWN_ERROR = 0, - HOST_CONTEXT_NO_CONTRACT_RUNNING = 1 + SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero). + SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds. + SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data. + SCEC_MISSING_VALUE = 3, // Some value was required but not provided. + SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed. + SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit. + SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not. + SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic. + SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected. + SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected. }; -enum SCVmErrorCode { - VM_UNKNOWN = 0, - VM_VALIDATION = 1, - VM_INSTANTIATION = 2, - VM_FUNCTION = 3, - VM_TABLE = 4, - VM_MEMORY = 5, - VM_GLOBAL = 6, - VM_VALUE = 7, - VM_TRAP_UNREACHABLE = 8, - VM_TRAP_MEMORY_ACCESS_OUT_OF_BOUNDS = 9, - VM_TRAP_TABLE_ACCESS_OUT_OF_BOUNDS = 10, - VM_TRAP_ELEM_UNINITIALIZED = 11, - VM_TRAP_DIVISION_BY_ZERO = 12, - VM_TRAP_INTEGER_OVERFLOW = 13, - VM_TRAP_INVALID_CONVERSION_TO_INT = 14, - VM_TRAP_STACK_OVERFLOW = 15, - VM_TRAP_UNEXPECTED_SIGNATURE = 16, - VM_TRAP_MEM_LIMIT_EXCEEDED = 17, - VM_TRAP_CPU_LIMIT_EXCEEDED = 18 -}; - -enum SCUnknownErrorCode -{ - UNKNOWN_ERROR_GENERAL = 0, - UNKNOWN_ERROR_XDR = 1 -}; +// Smart contract errors are split into a type (SCErrorType) and a code. When an +// error is of type SCE_CONTRACT it carries a user-defined uint32 code that +// Soroban assigns no specific meaning to. In all other cases, the type +// specifies a subsystem of the Soroban host where the error originated, and the +// accompanying code is an SCErrorCode, each of which specifies a slightly more +// precise class of errors within that subsystem. +// +// Error types and codes are not maximally precise; there is a tradeoff between +// precision and flexibility in the implementation, and the granularity here is +// chosen to be adequate for most purposes while not placing a burden on future +// system evolution and maintenance. When additional precision is needed for +// debugging, Soroban can be run with diagnostic events enabled. -union SCStatus switch (SCStatusType type) +union SCError switch (SCErrorType type) { -case SST_OK: - void; -case SST_UNKNOWN_ERROR: - SCUnknownErrorCode unknownCode; -case SST_HOST_VALUE_ERROR: - SCHostValErrorCode valCode; -case SST_HOST_OBJECT_ERROR: - SCHostObjErrorCode objCode; -case SST_HOST_FUNCTION_ERROR: - SCHostFnErrorCode fnCode; -case SST_HOST_STORAGE_ERROR: - SCHostStorageErrorCode storageCode; -case SST_HOST_CONTEXT_ERROR: - SCHostContextErrorCode contextCode; -case SST_VM_ERROR: - SCVmErrorCode vmCode; -case SST_CONTRACT_ERROR: +case SCE_CONTRACT: uint32 contractCode; -case SST_HOST_AUTH_ERROR: - SCHostAuthErrorCode authCode; +case SCE_WASM_VM: +case SCE_CONTEXT: +case SCE_STORAGE: +case SCE_OBJECT: +case SCE_CRYPTO: +case SCE_EVENTS: +case SCE_BUDGET: +case SCE_VALUE: +case SCE_AUTH: + SCErrorCode code; }; struct UInt128Parts { @@ -233,17 +162,17 @@ struct Int256Parts { uint64 lo_lo; }; -enum SCContractExecutableType +enum ContractExecutableType { - SCCONTRACT_EXECUTABLE_WASM_REF = 0, - SCCONTRACT_EXECUTABLE_TOKEN = 1 + CONTRACT_EXECUTABLE_WASM = 0, + CONTRACT_EXECUTABLE_TOKEN = 1 }; -union SCContractExecutable switch (SCContractExecutableType type) +union ContractExecutable switch (ContractExecutableType type) { -case SCCONTRACT_EXECUTABLE_WASM_REF: - Hash wasm_id; -case SCCONTRACT_EXECUTABLE_TOKEN: +case CONTRACT_EXECUTABLE_WASM: + Hash wasm_hash; +case CONTRACT_EXECUTABLE_TOKEN: void; }; @@ -264,18 +193,22 @@ case SC_ADDRESS_TYPE_CONTRACT: %struct SCVal; %struct SCMapEntry; -const SCVAL_LIMIT = 256000; const SCSYMBOL_LIMIT = 32; -typedef SCVal SCVec; -typedef SCMapEntry SCMap; +typedef SCVal SCVec<>; +typedef SCMapEntry SCMap<>; -typedef opaque SCBytes; -typedef string SCString; +typedef opaque SCBytes<>; +typedef string SCString<>; typedef string SCSymbol; struct SCNonceKey { - SCAddress nonce_address; + int64 nonce; +}; + +struct SCContractInstance { + ContractExecutable executable; + SCMap* storage; }; union SCVal switch (SCValType type) @@ -285,8 +218,8 @@ case SCV_BOOL: bool b; case SCV_VOID: void; -case SCV_STATUS: - SCStatus error; +case SCV_ERROR: + SCError error; case SCV_U32: uint32 u32; @@ -326,17 +259,18 @@ case SCV_VEC: case SCV_MAP: SCMap *map; -case SCV_CONTRACT_EXECUTABLE: - SCContractExecutable exec; case SCV_ADDRESS: SCAddress address; // Special SCVals reserved for system-constructed contract-data // ledger keys, not generally usable elsewhere. -case SCV_LEDGER_KEY_CONTRACT_EXECUTABLE: +case SCV_LEDGER_KEY_CONTRACT_INSTANCE: void; case SCV_LEDGER_KEY_NONCE: SCNonceKey nonce_key; + +case SCV_CONTRACT_INSTANCE: + SCContractInstance instance; }; struct SCMapEntry diff --git a/xdr/next/Stellar-ledger-entries.x b/xdr/next/Stellar-ledger-entries.x index 5a9c5d097..f06648400 100644 --- a/xdr/next/Stellar-ledger-entries.x +++ b/xdr/next/Stellar-ledger-entries.x @@ -4,6 +4,7 @@ %#include "xdr/Stellar-types.h" %#include "xdr/Stellar-contract.h" +%#include "xdr/Stellar-contract-config-setting.h" namespace stellar { @@ -99,7 +100,8 @@ enum LedgerEntryType LIQUIDITY_POOL = 5, CONTRACT_DATA = 6, CONTRACT_CODE = 7, - CONFIG_SETTING = 8 + CONFIG_SETTING = 8, + EXPIRATION = 9 }; struct Signer @@ -492,9 +494,17 @@ struct LiquidityPoolEntry body; }; +enum ContractDataDurability { + TEMPORARY = 0, + PERSISTENT = 1 +}; + struct ContractDataEntry { - Hash contractID; + ExtensionPoint ext; + + SCAddress contract; SCVal key; + ContractDataDurability durability; SCVal val; }; @@ -502,118 +512,13 @@ struct ContractCodeEntry { ExtensionPoint ext; Hash hash; - opaque code; -}; - -// Identifiers of all the network settings. -enum ConfigSettingID -{ - CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, - CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, - CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, - CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, - CONFIG_SETTING_CONTRACT_META_DATA_V0 = 4, - CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, - CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION = 6 -}; - -// "Compute" settings for contracts (instructions and memory). -struct ConfigSettingContractComputeV0 -{ - // Maximum instructions per ledger - int64 ledgerMaxInstructions; - // Maximum instructions per transaction - int64 txMaxInstructions; - // Cost of 10000 instructions - int64 feeRatePerInstructionsIncrement; - - // Memory limit per contract/host function invocation. Unlike - // instructions, there is no fee for memory and it's not - // accumulated between operations - the same limit is applied - // to every operation. - uint32 memoryLimit; + opaque code<>; }; -// Ledger access settings for contracts. -struct ConfigSettingContractLedgerCostV0 -{ - // Maximum number of ledger entry read operations per ledger - uint32 ledgerMaxReadLedgerEntries; - // Maximum number of bytes that can be read per ledger - uint32 ledgerMaxReadBytes; - // Maximum number of ledger entry write operations per ledger - uint32 ledgerMaxWriteLedgerEntries; - // Maximum number of bytes that can be written per ledger - uint32 ledgerMaxWriteBytes; - - // Maximum number of ledger entry read operations per transaction - uint32 txMaxReadLedgerEntries; - // Maximum number of bytes that can be read per transaction - uint32 txMaxReadBytes; - // Maximum number of ledger entry write operations per transaction - uint32 txMaxWriteLedgerEntries; - // Maximum number of bytes that can be written per transaction - uint32 txMaxWriteBytes; - - int64 feeReadLedgerEntry; // Fee per ledger entry read - int64 feeWriteLedgerEntry; // Fee per ledger entry write - - int64 feeRead1KB; // Fee for reading 1KB - int64 feeWrite1KB; // Fee for writing 1KB - - // Bucket list fees grow slowly up to that size - int64 bucketListSizeBytes; - // Fee rate in stroops when the bucket list is empty - int64 bucketListFeeRateLow; - // Fee rate in stroops when the bucket list reached bucketListSizeBytes - int64 bucketListFeeRateHigh; - // Rate multiplier for any additional data past the first bucketListSizeBytes - uint32 bucketListGrowthFactor; -}; - -// Historical data (pushed to core archives) settings for contracts. -struct ConfigSettingContractHistoricalDataV0 -{ - int64 feeHistorical1KB; // Fee for storing 1KB in archives -}; - -// Meta data (pushed to downstream systems) settings for contracts. -struct ConfigSettingContractMetaDataV0 -{ - // Maximum size of extended meta data produced by a transaction - uint32 txMaxExtendedMetaDataSizeBytes; - // Fee for generating 1KB of extended meta data - int64 feeExtendedMetaData1KB; -}; - -// Bandwidth related data settings for contracts -struct ConfigSettingContractBandwidthV0 -{ - // Maximum size in bytes to propagate per ledger - uint32 ledgerMaxPropagateSizeBytes; - // Maximum size in bytes for a transaction - uint32 txMaxSizeBytes; - - // Fee for propagating 1KB of data - int64 feePropagateData1KB; -}; - -union ConfigSettingEntry switch (ConfigSettingID configSettingID) -{ -case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: - uint32 contractMaxSizeBytes; -case CONFIG_SETTING_CONTRACT_COMPUTE_V0: - ConfigSettingContractComputeV0 contractCompute; -case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: - ConfigSettingContractLedgerCostV0 contractLedgerCost; -case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: - ConfigSettingContractHistoricalDataV0 contractHistoricalData; -case CONFIG_SETTING_CONTRACT_META_DATA_V0: - ConfigSettingContractMetaDataV0 contractMetaData; -case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: - ConfigSettingContractBandwidthV0 contractBandwidth; -case CONFIG_SETTING_CONTRACT_HOST_LOGIC_VERSION: - uint32 contractHostLogicVersion; +struct ExpirationEntry { + // Hash of the LedgerKey that is associated with this ExpirationEntry + Hash keyHash; + uint32 expirationLedgerSeq; }; struct LedgerEntryExtensionV1 @@ -652,6 +557,8 @@ struct LedgerEntry ContractCodeEntry contractCode; case CONFIG_SETTING: ConfigSettingEntry configSetting; + case EXPIRATION: + ExpirationEntry expiration; } data; @@ -709,8 +616,9 @@ case LIQUIDITY_POOL: case CONTRACT_DATA: struct { - Hash contractID; + SCAddress contract; SCVal key; + ContractDataDurability durability; } contractData; case CONTRACT_CODE: struct @@ -722,6 +630,12 @@ case CONFIG_SETTING: { ConfigSettingID configSettingID; } configSetting; +case EXPIRATION: + struct + { + // Hash of the LedgerKey that is associated with this ExpirationEntry + Hash keyHash; + } expiration; }; // list of all envelope types used in the application @@ -737,11 +651,7 @@ enum EnvelopeType ENVELOPE_TYPE_TX_FEE_BUMP = 5, ENVELOPE_TYPE_OP_ID = 6, ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, - ENVELOPE_TYPE_CONTRACT_ID_FROM_ED25519 = 8, - ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT = 9, - ENVELOPE_TYPE_CONTRACT_ID_FROM_ASSET = 10, - ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE_ACCOUNT = 11, - ENVELOPE_TYPE_CREATE_CONTRACT_ARGS = 12, - ENVELOPE_TYPE_CONTRACT_AUTH = 13 + ENVELOPE_TYPE_CONTRACT_ID = 8, + ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 }; } diff --git a/xdr/next/Stellar-ledger.x b/xdr/next/Stellar-ledger.x index 79d3d45d3..a1bbac4b6 100644 --- a/xdr/next/Stellar-ledger.x +++ b/xdr/next/Stellar-ledger.x @@ -47,17 +47,13 @@ struct StellarValue ext; }; -const MASK_LEDGER_HEADER_FLAGS = 0x7F; +const MASK_LEDGER_HEADER_FLAGS = 0x7; enum LedgerHeaderFlags { DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, - DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4, - DISABLE_CONTRACT_CREATE = 0x8, - DISABLE_CONTRACT_UPDATE = 0x10, - DISABLE_CONTRACT_REMOVE = 0x20, - DISABLE_CONTRACT_INVOKE = 0x40 + DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 }; struct LedgerHeaderExtensionV1 @@ -127,7 +123,8 @@ enum LedgerUpgradeType LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, LEDGER_UPGRADE_BASE_RESERVE = 4, LEDGER_UPGRADE_FLAGS = 5, - LEDGER_UPGRADE_CONFIG = 6 + LEDGER_UPGRADE_CONFIG = 6, + LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 }; struct ConfigUpgradeSetKey { @@ -148,7 +145,12 @@ case LEDGER_UPGRADE_BASE_RESERVE: case LEDGER_UPGRADE_FLAGS: uint32 newFlags; // update flags case LEDGER_UPGRADE_CONFIG: + // Update arbitrary `ConfigSetting` entries identified by the key. ConfigUpgradeSetKey newConfig; +case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: + // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without + // using `LEDGER_UPGRADE_CONFIG`. + uint32 newMaxSorobanTxSetSize; }; struct ConfigUpgradeSet { @@ -280,32 +282,6 @@ struct TransactionHistoryResultEntry ext; }; -struct TransactionResultPairV2 -{ - Hash transactionHash; - Hash hashOfMetaHashes; // hash of hashes in TransactionMetaV3 - // TransactionResult is in the meta -}; - -struct TransactionResultSetV2 -{ - TransactionResultPairV2 results<>; -}; - -struct TransactionHistoryResultEntryV2 -{ - uint32 ledgerSeq; - TransactionResultSetV2 txResultSet; - - // reserved for future use - union switch (int v) - { - case 0: - void; - } - ext; -}; - struct LedgerHeaderHistoryEntry { Hash hash; @@ -411,7 +387,7 @@ struct ContractEvent case 0: struct { - SCVec topics; + SCVal topics<>; SCVal data; } v0; } @@ -424,34 +400,38 @@ struct DiagnosticEvent ContractEvent event; }; -struct OperationDiagnosticEvents +struct SorobanTransactionMeta { - DiagnosticEvent events<>; -}; + ExtensionPoint ext; -struct OperationEvents -{ - ContractEvent events<>; + ContractEvent events<>; // custom events populated by the + // contracts themselves. + SCVal returnValue; // return value of the host fn invocation + + // Diagnostics events that are not hashed. + // This will contain all contract and diagnostic events. Even ones + // that were emitted in a failed contract call. + DiagnosticEvent diagnosticEvents<>; }; struct TransactionMetaV3 { - LedgerEntryChanges txChangesBefore; // tx level changes before operations - // are applied if any - OperationMeta operations<>; // meta for each operation - LedgerEntryChanges txChangesAfter; // tx level changes after operations are - // applied if any - OperationEvents events<>; // custom events populated by the - // contracts themselves. One list per operation. - TransactionResult txResult; + ExtensionPoint ext; - Hash hashes[3]; // stores sha256(txChangesBefore, operations, txChangesAfter), - // sha256(events), and sha256(txResult) + LedgerEntryChanges txChangesBefore; // tx level changes before operations + // are applied if any + OperationMeta operations<>; // meta for each operation + LedgerEntryChanges txChangesAfter; // tx level changes after operations are + // applied if any + SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for + // Soroban transactions). +}; - // Diagnostics events that are not hashed. One list per operation. - // This will contain all contract and diagnostic events. Even ones - // that were emitted in a failed contract call. - OperationDiagnosticEvents diagnosticEvents<>; +// This is in Stellar-ledger.x to due to a circular dependency +struct InvokeHostFunctionSuccessPreImage +{ + SCVal returnValue; + ContractEvent events<>; }; // this is the meta produced when applying transactions @@ -478,13 +458,6 @@ struct TransactionResultMeta TransactionMeta txApplyProcessing; }; -struct TransactionResultMetaV2 -{ - TransactionResultPairV2 result; - LedgerEntryChanges feeProcessing; - TransactionMeta txApplyProcessing; -}; - // this represents a single upgrade that was performed as part of a ledger // upgrade struct UpgradeEntryMeta @@ -529,23 +502,37 @@ struct LedgerCloseMetaV1 SCPHistoryEntry scpInfo<>; }; -// only difference between V1 and V2 is this uses TransactionResultMetaV2 struct LedgerCloseMetaV2 { + // We forgot to add an ExtensionPoint in v1 but at least + // we can add one now in v2. + ExtensionPoint ext; + LedgerHeaderHistoryEntry ledgerHeader; - + GeneralizedTransactionSet txSet; // NB: transactions are sorted in apply order here // fees for all transactions are processed first // followed by applying transactions - TransactionResultMetaV2 txProcessing<>; + TransactionResultMeta txProcessing<>; // upgrades are applied last UpgradeEntryMeta upgradesProcessing<>; // other misc information attached to the ledger close SCPHistoryEntry scpInfo<>; + + // Size in bytes of BucketList, to support downstream + // systems calculating storage fees correctly. + uint64 totalByteSizeOfBucketList; + + // Expired temp keys that are being evicted at this ledger. + LedgerKey evictedTemporaryLedgerKeys<>; + + // Expired restorable ledger entries that are being + // evicted at this ledger. + LedgerEntry evictedPersistentLedgerEntries<>; }; union LedgerCloseMeta switch (int v) diff --git a/xdr/next/Stellar-overlay.x b/xdr/next/Stellar-overlay.x index 8203258c8..4c964736d 100644 --- a/xdr/next/Stellar-overlay.x +++ b/xdr/next/Stellar-overlay.x @@ -27,6 +27,12 @@ struct SendMore uint32 numMessages; }; +struct SendMoreExtended +{ + uint32 numMessages; + uint32 numBytes; +}; + struct AuthCert { Curve25519Public pubkey; @@ -47,16 +53,14 @@ struct Hello uint256 nonce; }; - -// During the roll-out phrase, pull mode will be optional. +// During the roll-out phrase, nodes can disable flow control in bytes. // Therefore, we need a way to communicate with other nodes -// that we want/don't want pull mode. -// However, the goal is for everyone to enable it by default, -// so we don't want to introduce a new member variable. -// For now, we'll use the `flags` field (originally named -// `unused`) in `Auth`. -// 100 is just a number that is not 0. -const AUTH_MSG_FLAG_PULL_MODE_REQUESTED = 100; +// that we want/don't want flow control in bytes. +// We use the `flags` field in the Auth message with a special value +// set to communicate this. Note that AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 0 +// AND AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED != 100 (as previously +// that value was used for other purposes). +const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200; struct Auth { @@ -83,7 +87,7 @@ struct PeerAddress uint32 numFailures; }; -// Next ID: 18 +// Next ID: 21 enum MessageType { ERROR_MSG = 0, @@ -112,6 +116,8 @@ enum MessageType SURVEY_RESPONSE = 15, SEND_MORE = 16, + SEND_MORE_EXTENDED = 20, + FLOOD_ADVERT = 18, FLOOD_DEMAND = 19 }; @@ -274,7 +280,8 @@ case GET_SCP_STATE: uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest case SEND_MORE: SendMore sendMoreMessage; - +case SEND_MORE_EXTENDED: + SendMoreExtended sendMoreExtendedMessage; // Pull mode case FLOOD_ADVERT: FloodAdvert floodAdvert; diff --git a/xdr/next/Stellar-transaction.x b/xdr/next/Stellar-transaction.x index 2b0b05872..2e3c22b31 100644 --- a/xdr/next/Stellar-transaction.x +++ b/xdr/next/Stellar-transaction.x @@ -8,6 +8,9 @@ namespace stellar { +// maximum number of operations per transaction +const MAX_OPS_PER_TX = 100; + union LiquidityPoolParameters switch (LiquidityPoolType type) { case LIQUIDITY_POOL_CONSTANT_PRODUCT: @@ -33,13 +36,6 @@ struct DecoratedSignature Signature signature; // actual signature }; -// Ledger key sets touched by a smart contract transaction. -struct LedgerFootprint -{ - LedgerKey readOnly<>; - LedgerKey readWrite<>; -}; - enum OperationType { CREATE_ACCOUNT = 0, @@ -66,7 +62,9 @@ enum OperationType SET_TRUST_LINE_FLAGS = 21, LIQUIDITY_POOL_DEPOSIT = 22, LIQUIDITY_POOL_WITHDRAW = 23, - INVOKE_HOST_FUNCTION = 24 + INVOKE_HOST_FUNCTION = 24, + BUMP_FOOTPRINT_EXPIRATION = 25, + RESTORE_FOOTPRINT = 26 }; /* CreateAccount @@ -478,88 +476,135 @@ enum HostFunctionType { HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, - HOST_FUNCTION_TYPE_INSTALL_CONTRACT_CODE = 2 + HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 }; -enum ContractIDType +enum ContractIDPreimageType { - CONTRACT_ID_FROM_SOURCE_ACCOUNT = 0, - CONTRACT_ID_FROM_ED25519_PUBLIC_KEY = 1, - CONTRACT_ID_FROM_ASSET = 2 + CONTRACT_ID_PREIMAGE_FROM_ADDRESS = 0, + CONTRACT_ID_PREIMAGE_FROM_ASSET = 1 }; -enum ContractIDPublicKeyType -{ - CONTRACT_ID_PUBLIC_KEY_SOURCE_ACCOUNT = 0, - CONTRACT_ID_PUBLIC_KEY_ED25519 = 1 -}; - -struct InstallContractCodeArgs -{ - opaque code; -}; - -union ContractID switch (ContractIDType type) +union ContractIDPreimage switch (ContractIDPreimageType type) { -case CONTRACT_ID_FROM_SOURCE_ACCOUNT: - uint256 salt; -case CONTRACT_ID_FROM_ED25519_PUBLIC_KEY: - struct +case CONTRACT_ID_PREIMAGE_FROM_ADDRESS: + struct { - uint256 key; - Signature signature; + SCAddress address; uint256 salt; - } fromEd25519PublicKey; -case CONTRACT_ID_FROM_ASSET: - Asset asset; + } fromAddress; +case CONTRACT_ID_PREIMAGE_FROM_ASSET: + Asset fromAsset; }; struct CreateContractArgs { - ContractID contractID; - SCContractExecutable source; + ContractIDPreimage contractIDPreimage; + ContractExecutable executable; +}; + +struct InvokeContractArgs { + SCAddress contractAddress; + SCSymbol functionName; + SCVal args<>; }; union HostFunction switch (HostFunctionType type) { case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: - SCVec invokeArgs; + InvokeContractArgs invokeContract; case HOST_FUNCTION_TYPE_CREATE_CONTRACT: - CreateContractArgs createContractArgs; -case HOST_FUNCTION_TYPE_INSTALL_CONTRACT_CODE: - InstallContractCodeArgs installContractCodeArgs; + CreateContractArgs createContract; +case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: + opaque wasm<>; }; -struct AuthorizedInvocation +enum SorobanAuthorizedFunctionType { - Hash contractID; - SCSymbol functionName; - SCVec args; - AuthorizedInvocation subInvocations<>; + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN = 0, + SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN = 1 +}; + +union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type) +{ +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN: + InvokeContractArgs contractFn; +case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN: + CreateContractArgs createContractHostFn; +}; + +struct SorobanAuthorizedInvocation +{ + SorobanAuthorizedFunction function; + SorobanAuthorizedInvocation subInvocations<>; }; -struct AddressWithNonce +struct SorobanAddressCredentials { SCAddress address; - uint64 nonce; + int64 nonce; + uint32 signatureExpirationLedger; + SCVal signature; }; -struct ContractAuth +enum SorobanCredentialsType { - AddressWithNonce* addressWithNonce; // not present for invoker - AuthorizedInvocation rootInvocation; - SCVec signatureArgs; + SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0, + SOROBAN_CREDENTIALS_ADDRESS = 1 }; +union SorobanCredentials switch (SorobanCredentialsType type) +{ +case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT: + void; +case SOROBAN_CREDENTIALS_ADDRESS: + SorobanAddressCredentials address; +}; + +/* Unit of authorization data for Soroban. + + Represents an authorization for executing the tree of authorized contract + and/or host function calls by the user defined by `credentials`. +*/ +struct SorobanAuthorizationEntry +{ + SorobanCredentials credentials; + SorobanAuthorizedInvocation rootInvocation; +}; + +/* Upload WASM, create, and invoke contracts in Soroban. + + Threshold: med + Result: InvokeHostFunctionResult +*/ struct InvokeHostFunctionOp { - // The host function to invoke - HostFunction function; - // The footprint for this invocation - LedgerFootprint footprint; - // Per-address authorizations for this host fn - // Currently only supported for INVOKE_CONTRACT function - ContractAuth auth<>; + // Host function to invoke. + HostFunction hostFunction; + // Per-address authorizations for this host function. + SorobanAuthorizationEntry auth<>; +}; + +/* Bump the expiration ledger of the entries specified in the readOnly footprint + so they'll expire at least ledgersToExpire ledgers from lcl. + + Threshold: med + Result: BumpFootprintExpirationResult +*/ +struct BumpFootprintExpirationOp +{ + ExtensionPoint ext; + uint32 ledgersToExpire; +}; + +/* Restore the expired or evicted entries specified in the readWrite footprint. + + Threshold: med + Result: RestoreFootprintOp +*/ +struct RestoreFootprintOp +{ + ExtensionPoint ext; }; /* An operation is the lowest unit of work that a transaction does */ @@ -622,6 +667,10 @@ struct Operation LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; case INVOKE_HOST_FUNCTION: InvokeHostFunctionOp invokeHostFunctionOp; + case BUMP_FOOTPRINT_EXPIRATION: + BumpFootprintExpirationOp bumpFootprintExpirationOp; + case RESTORE_FOOTPRINT: + RestoreFootprintOp restoreFootprintOp; } body; }; @@ -639,52 +688,25 @@ case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: struct { AccountID sourceAccount; - SequenceNumber seqNum; + SequenceNumber seqNum; uint32 opNum; PoolID liquidityPoolID; Asset asset; } revokeID; -case ENVELOPE_TYPE_CONTRACT_ID_FROM_ED25519: - struct - { - Hash networkID; - uint256 ed25519; - uint256 salt; - } ed25519ContractID; -case ENVELOPE_TYPE_CONTRACT_ID_FROM_CONTRACT: +case ENVELOPE_TYPE_CONTRACT_ID: struct { Hash networkID; - Hash contractID; - uint256 salt; + ContractIDPreimage contractIDPreimage; } contractID; -case ENVELOPE_TYPE_CONTRACT_ID_FROM_ASSET: - struct - { - Hash networkID; - Asset asset; - } fromAsset; -case ENVELOPE_TYPE_CONTRACT_ID_FROM_SOURCE_ACCOUNT: - struct - { - Hash networkID; - AccountID sourceAccount; - uint256 salt; - } sourceAccountContractID; -case ENVELOPE_TYPE_CREATE_CONTRACT_ARGS: +case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: struct { Hash networkID; - SCContractExecutable source; - uint256 salt; - } createContractArgs; -case ENVELOPE_TYPE_CONTRACT_AUTH: - struct - { - Hash networkID; - uint64 nonce; - AuthorizedInvocation invocation; - } contractAuth; + int64 nonce; + uint32 signatureExpirationLedger; + SorobanAuthorizedInvocation invocation; + } sorobanAuthorization; }; enum MemoType @@ -772,8 +794,36 @@ case PRECOND_V2: PreconditionsV2 v2; }; -// maximum number of operations per transaction -const MAX_OPS_PER_TX = 100; +// Ledger key sets touched by a smart contract transaction. +struct LedgerFootprint +{ + LedgerKey readOnly<>; + LedgerKey readWrite<>; +}; + +// Resource limits for a Soroban transaction. +// The transaction will fail if it exceeds any of these limits. +struct SorobanResources +{ + // The ledger footprint of the transaction. + LedgerFootprint footprint; + // The maximum number of instructions this transaction can use + uint32 instructions; + + // The maximum number of bytes this transaction can read from ledger + uint32 readBytes; + // The maximum number of bytes this transaction can write to ledger + uint32 writeBytes; +}; + +// The transaction extension for Soroban. +struct SorobanTransactionData +{ + ExtensionPoint ext; + SorobanResources resources; + // Portion of transaction `fee` allocated to refundable fees. + int64 refundableFee; +}; // TransactionV0 is a transaction with the AccountID discriminant stripped off, // leaving a raw ed25519 public key to identify the source account. This is used @@ -835,6 +885,8 @@ struct Transaction { case 0: void; + case 1: + SorobanTransactionData sorobanData; } ext; }; @@ -1735,15 +1787,63 @@ enum InvokeHostFunctionResultCode // codes considered as "failure" for the operation INVOKE_HOST_FUNCTION_MALFORMED = -1, - INVOKE_HOST_FUNCTION_TRAPPED = -2 + INVOKE_HOST_FUNCTION_TRAPPED = -2, + INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, + INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 }; union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) { case INVOKE_HOST_FUNCTION_SUCCESS: - SCVal success; + Hash success; // sha256(InvokeHostFunctionSuccessPreImage) case INVOKE_HOST_FUNCTION_MALFORMED: case INVOKE_HOST_FUNCTION_TRAPPED: +case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: +case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: +case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: + void; +}; + +enum BumpFootprintExpirationResultCode +{ + // codes considered as "success" for the operation + BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + + // codes considered as "failure" for the operation + BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, + BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, + BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 +}; + +union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) +{ +case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + void; +case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: +case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: +case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + void; +}; + +enum RestoreFootprintResultCode +{ + // codes considered as "success" for the operation + RESTORE_FOOTPRINT_SUCCESS = 0, + + // codes considered as "failure" for the operation + RESTORE_FOOTPRINT_MALFORMED = -1, + RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, + RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 +}; + +union RestoreFootprintResult switch (RestoreFootprintResultCode code) +{ +case RESTORE_FOOTPRINT_SUCCESS: + void; +case RESTORE_FOOTPRINT_MALFORMED: +case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED: +case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE: void; }; @@ -1815,6 +1915,10 @@ case opINNER: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; case INVOKE_HOST_FUNCTION: InvokeHostFunctionResult invokeHostFunctionResult; + case BUMP_FOOTPRINT_EXPIRATION: + BumpFootprintExpirationResult bumpFootprintExpirationResult; + case RESTORE_FOOTPRINT: + RestoreFootprintResult restoreFootprintResult; } tr; case opBAD_AUTH: @@ -1845,12 +1949,12 @@ enum TransactionResultCode txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction txINTERNAL_ERROR = -11, // an unknown error occurred - txNOT_SUPPORTED = -12, // transaction type not supported - txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed - txBAD_SPONSORSHIP = -14, // sponsorship not confirmed - txBAD_MIN_SEQ_AGE_OR_GAP = - -15, // minSeqAge or minSeqLedgerGap conditions not met - txMALFORMED = -16 // precondition is invalid + txNOT_SUPPORTED = -12, // transaction type not supported + txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed + txBAD_SPONSORSHIP = -14, // sponsorship not confirmed + txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met + txMALFORMED = -16, // precondition is invalid + txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met }; // InnerTransactionResult must be binary compatible with TransactionResult @@ -1881,6 +1985,7 @@ struct InnerTransactionResult case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: + case txSOROBAN_INVALID: void; } result; @@ -1927,6 +2032,7 @@ struct TransactionResult case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: + case txSOROBAN_INVALID: void; } result; diff --git a/yarn.lock b/yarn.lock index 3100c47ca..c096170a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@aashutoshrathi/word-wrap@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" + integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -10,10 +15,10 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/cli@^7.21.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.22.5.tgz#eb323bd69f50297792c2b7c205a97306a305d703" - integrity sha512-N5d7MjzwsQ2wppwjhrsicVDhJSqF9labEP/swYiHhio4Ca2XjEehpgPmerjnLQl7BPE59BLud0PTWGYwqFl/cQ== +"@babel/cli@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.22.15.tgz#22ed82d76745a43caa60a89917bedb7c9b5bd145" + integrity sha512-prtg5f6zCERIaECeTZzd2fMtVjlfjhUcO+fBLQ6DXXdq5FljN+excVitJ2nogsusdf31LeqkjAfXZ7Xq+HmN8g== dependencies: "@jridgewell/trace-mapping" "^0.3.17" commander "^4.0.1" @@ -26,61 +31,62 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" - integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== +"@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== dependencies: - "@babel/highlight" "^7.22.5" + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.5.tgz#b1f6c86a02d85d2dd3368a2b67c09add8cd0c255" - integrity sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA== +"@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" + integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/core@^7.12.0", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.5.tgz#d67d9747ecf26ee7ecd3ebae1ee22225fe902a89" - integrity sha512-SBuTAjg91A3eKOvD+bPEz3LlhHZRNu1nFOVts9lzDJTXshHTjII0BAtDS3Y2DAkdZdDKWVZGVwkDfc4Clxn1dg== +"@babel/core@^7.12.3", "@babel/core@^7.22.17", "@babel/core@^7.7.5": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.22.17.tgz#2f9b0b395985967203514b24ee50f9fd0639c866" + integrity sha512-2EENLmhpwplDux5PSsZnSbnSkB3tZ6QTksgO25xwEL7pIDcNOMhF5v/s6RzwjMZzZzw9Ofc30gHv5ChCC8pifQ== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.5" - "@babel/helper-module-transforms" "^7.22.5" - "@babel/helpers" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.22.15" + "@babel/helper-compilation-targets" "^7.22.15" + "@babel/helper-module-transforms" "^7.22.17" + "@babel/helpers" "^7.22.15" + "@babel/parser" "^7.22.16" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.22.17" + "@babel/types" "^7.22.17" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.2" - semver "^6.3.0" + json5 "^2.2.3" + semver "^6.3.1" -"@babel/eslint-parser@^7.21.3": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.5.tgz#fa032503b9e2d188e25b1b95d29e8b8431042d78" - integrity sha512-C69RWYNYtrgIRE5CmTd77ZiLDXqgBipahJc/jHP3sLcAGj6AJzxNIuKNpVnICqbyK7X3pFUfEvL++rvtbQpZkQ== +"@babel/eslint-parser@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz#263f059c476e29ca4972481a17b8b660cb025a34" + integrity sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg== dependencies: "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" eslint-visitor-keys "^2.1.0" - semver "^6.3.0" + semver "^6.3.1" -"@babel/eslint-plugin@^7.19.1": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.22.5.tgz#47407d8c9e527b62ff75ee11e4baa6de3da7cf0e" - integrity sha512-lDXW06rf1sXywWWw+UdS/iYxRjrqhH4AXdPeKE4+fEgEoGBXcdIDQ+uCJOUcvCb0jCTvfwHOSXkwnfd24EAkLQ== +"@babel/eslint-plugin@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/eslint-plugin/-/eslint-plugin-7.22.10.tgz#b84e0f029b8f78604c3f6797cd6208cad46fbcf5" + integrity sha512-SRZcvo3fnO5h79B9DZSV6LG2vHH7OWsSNp1huFLHsXKyytRG413byQk9zxW1VcPOhnzfx2VIUz+8aGbiE7fOkA== dependencies: eslint-rule-composer "^0.3.0" -"@babel/generator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.5.tgz#1e7bf768688acfb05cf30b2369ef855e82d984f7" - integrity sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA== +"@babel/generator@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.15.tgz#1564189c7ec94cb8f77b5e8a90c4d200d21b2339" + integrity sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -93,58 +99,57 @@ "@babel/types" "^7.22.5" "@babel/helper-builder-binary-assignment-operator-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.5.tgz#a3f4758efdd0190d8927fcffd261755937c71878" - integrity sha512-m1EP3lVOPptR+2DwD125gziZNcmoNSHGmJROKoy87loWUQyJaVXDgpmruWqDARZSmtYQ+Dl25okU8+qhVzuykw== + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz#5426b109cf3ad47b91120f8328d8ab1be8b0b956" + integrity sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz#fc7319fc54c5e2fa14b2909cf3c5fd3046813e02" - integrity sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw== +"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" + integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== dependencies: - "@babel/compat-data" "^7.22.5" - "@babel/helper-validator-option" "^7.22.5" - browserslist "^4.21.3" + "@babel/compat-data" "^7.22.9" + "@babel/helper-validator-option" "^7.22.15" + browserslist "^4.21.9" lru-cache "^5.1.1" - semver "^6.3.0" + semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz#2192a1970ece4685fbff85b48da2c32fcb130b7c" - integrity sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q== +"@babel/helper-create-class-features-plugin@^7.22.11", "@babel/helper-create-class-features-plugin@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz#97a61b385e57fe458496fad19f8e63b63c867de4" + integrity sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" - "@babel/helper-member-expression-to-functions" "^7.22.5" + "@babel/helper-member-expression-to-functions" "^7.22.15" "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.5" - semver "^6.3.0" + "@babel/helper-split-export-declaration" "^7.22.6" + semver "^6.3.1" "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.5.tgz#bb2bf0debfe39b831986a4efbf4066586819c6e4" - integrity sha512-1VpEFOIbMRaXyDeUwUfmTIxExLwQ+zkW+Bh5zXpApA3oQedBx9v/updixWxnx/bZpKw7u8VxWjb/qWpIcmPq8A== + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1" + integrity sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" regexpu-core "^5.3.1" - semver "^6.3.0" + semver "^6.3.1" -"@babel/helper-define-polyfill-provider@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.0.tgz#487053f103110f25b9755c5980e031e93ced24d8" - integrity sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg== +"@babel/helper-define-polyfill-provider@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz#82c825cadeeeee7aad237618ebbe8fa1710015d7" + integrity sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw== dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-compilation-targets" "^7.22.6" + "@babel/helper-plugin-utils" "^7.22.5" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" - semver "^6.1.2" "@babel/helper-environment-visitor@^7.22.5": version "7.22.5" @@ -166,33 +171,30 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-member-expression-to-functions@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" - integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ== +"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.15.tgz#b95a144896f6d491ca7863576f820f3628818621" + integrity sha512-qLNsZbgrNh0fDQBCPocSL8guki1hcPvltGDv/NxvUoABwFq7GkKSu1nRXeJkVZc+wJvne2E0RKQz+2SQrz6eAA== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-module-imports@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" - integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== +"@babel/helper-module-imports@^7.22.15", "@babel/helper-module-imports@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: - "@babel/types" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz#0f65daa0716961b6e96b164034e737f60a80d2ef" - integrity sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw== +"@babel/helper-module-transforms@^7.22.15", "@babel/helper-module-transforms@^7.22.17", "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.22.9": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.17.tgz#7edf129097a51ccc12443adbc6320e90eab76693" + integrity sha512-XouDDhQESrLHTpnBtCKExJdyY4gJCdrvH2Pyv8r8kovX2U8G0dRUOT45T9XlbLtuu9CLXP15eusnkprhoPV5iQ== dependencies: "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" + "@babel/helper-module-imports" "^7.22.15" "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.15" "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" @@ -201,32 +203,28 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== -"@babel/helper-remap-async-to-generator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz#14a38141a7bf2165ad38da61d61cf27b43015da2" - integrity sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g== +"@babel/helper-remap-async-to-generator@^7.22.5", "@babel/helper-remap-async-to-generator@^7.22.9": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.17.tgz#dabaa50622b3b4670bd6546fc8db23eb12d89da0" + integrity sha512-bxH77R5gjH3Nkde6/LuncQoLaP16THYPscurp1S8z7S9ZgezCyV3G8Hc+TZiCmY8pz4fp8CvKSgtJMW0FkLAxA== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-wrap-function" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/helper-wrap-function" "^7.22.17" -"@babel/helper-replace-supers@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz#71bc5fb348856dea9fdc4eafd7e2e49f585145dc" - integrity sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg== +"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": + version "7.22.9" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779" + integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg== dependencies: "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-member-expression-to-functions" "^7.22.5" "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" "@babel/helper-simple-access@^7.22.5": version "7.22.5" @@ -242,10 +240,10 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz#88cf11050edb95ed08d596f7a044462189127a08" - integrity sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ== +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: "@babel/types" "^7.22.5" @@ -254,78 +252,69 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== +"@babel/helper-validator-identifier@^7.22.15", "@babel/helper-validator-identifier@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz#601fa28e4cc06786c18912dca138cec73b882044" + integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ== -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== +"@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== -"@babel/helper-wrap-function@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz#44d205af19ed8d872b4eefb0d2fa65f45eb34f06" - integrity sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw== +"@babel/helper-wrap-function@^7.22.17": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.17.tgz#222ac3ff9cc8f9b617cc1e5db75c0b538e722801" + integrity sha512-nAhoheCMlrqU41tAojw9GpVEKDlTS8r3lzFmF0lP52LwblCPbuFSO7nGIZoIcoU5NIm1ABrna0cJExE4Ay6l2Q== dependencies: "@babel/helper-function-name" "^7.22.5" - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.22.17" -"@babel/helpers@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.5.tgz#74bb4373eb390d1ceed74a15ef97767e63120820" - integrity sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q== +"@babel/helpers@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.15.tgz#f09c3df31e86e3ea0b7ff7556d85cdebd47ea6f1" + integrity sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw== dependencies: - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.22.15" + "@babel/types" "^7.22.15" -"@babel/highlight@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" - integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== +"@babel/highlight@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.13.tgz#9cda839e5d3be9ca9e8c26b6dd69e7548f0cbf16" + integrity sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ== dependencies: "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.0.0" + chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.14.7", "@babel/parser@^7.20.15", "@babel/parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.5.tgz#721fd042f3ce1896238cf1b341c77eb7dee7dbea" - integrity sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q== +"@babel/parser@^7.14.7", "@babel/parser@^7.20.15", "@babel/parser@^7.22.15", "@babel/parser@^7.22.16": + version "7.22.16" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.16.tgz#180aead7f247305cce6551bea2720934e2fa2c95" + integrity sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" - integrity sha512-NP1M5Rf+u2Gw9qfSO4ihjcTGW5zXTi36ITLd4/EoAcEhIZ0yjMqmftDNl3QC19CX7olhrjpyU454g/2W7X0jvQ== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" + integrity sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz#fef09f9499b1f1c930da8a0c419db42167d792ca" - integrity sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz#2aeb91d337d4e1a1e7ce85b76a37f5301781200f" + integrity sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.22.5" + "@babel/plugin-transform-optional-chaining" "^7.22.15" "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" integrity sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w== -"@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" - integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -460,14 +449,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-async-generator-functions@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.5.tgz#7336356d23380eda9a56314974f053a020dab0c3" - integrity sha512-gGOEvFzm3fWoyD5uZq7vVTD57pPJ3PczPUD/xCFGjzBpUosnklmXyKnGQbbbGs1NPNPskFex0j93yKbHt0cHyg== +"@babel/plugin-transform-async-generator-functions@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz#3b153af4a6b779f340d5b80d3f634f55820aefa3" + integrity sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w== dependencies: "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-remap-async-to-generator" "^7.22.5" + "@babel/helper-remap-async-to-generator" "^7.22.9" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-transform-async-to-generator@^7.22.5": @@ -486,10 +475,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoping@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz#8bfc793b3a4b2742c0983fadc1480d843ecea31b" - integrity sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg== +"@babel/plugin-transform-block-scoping@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.15.tgz#494eb82b87b5f8b1d8f6f28ea74078ec0a10a841" + integrity sha512-G1czpdJBZCtngoK1sJgloLiOHUnkb/bLZwqVZD8kXmq0ZnVfTTWUcs9OWtp0mBtYJ+4LQY1fllqBkOIPhXmFmw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -501,28 +490,28 @@ "@babel/helper-create-class-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-class-static-block@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.5.tgz#3e40c46f048403472d6f4183116d5e46b1bff5ba" - integrity sha512-SPToJ5eYZLxlnp1UzdARpOGeC2GbHvr9d/UV0EukuVx8atktg194oe+C5BqQ8jRTkgLRVOPYeXRSBg1IlMoVRA== +"@babel/plugin-transform-class-static-block@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz#dc8cc6e498f55692ac6b4b89e56d87cec766c974" + integrity sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g== dependencies: - "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.11" "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-transform-classes@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz#635d4e98da741fad814984639f4c0149eb0135e1" - integrity sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ== +"@babel/plugin-transform-classes@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz#aaf4753aee262a232bbc95451b4bdf9599c65a0b" + integrity sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.5" + "@babel/helper-compilation-targets" "^7.22.15" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-optimise-call-expression" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.5" + "@babel/helper-replace-supers" "^7.22.9" + "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.22.5": @@ -533,14 +522,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/template" "^7.22.5" -"@babel/plugin-transform-destructuring@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz#d3aca7438f6c26c78cdd0b0ba920a336001b27cc" - integrity sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ== +"@babel/plugin-transform-destructuring@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.15.tgz#e7404ea5bb3387073b9754be654eecb578324694" + integrity sha512-HzG8sFl1ZVGTme74Nw+X01XsUTqERVQ6/RLHo3XjGRzm7XD6QTtfS3NJotVgCGy8BzkDqRjRBD8dAyJn5TuvSQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-dotall-regex@^7.22.5", "@babel/plugin-transform-dotall-regex@^7.4.4": +"@babel/plugin-transform-dotall-regex@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz#dbb4f0e45766eb544e193fb00e65a1dd3b2a4165" integrity sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw== @@ -555,10 +544,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-dynamic-import@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.5.tgz#d6908a8916a810468c4edff73b5b75bda6ad393e" - integrity sha512-0MC3ppTB1AMxd8fXjSrbPa7LT9hrImt+/fcj+Pg5YMD7UQyWp/02+JWpdnCymmsXwIx5Z+sYn1bwCn4ZJNvhqQ== +"@babel/plugin-transform-dynamic-import@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz#2c7722d2a5c01839eaf31518c6ff96d408e447aa" + integrity sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" @@ -571,18 +560,18 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-export-namespace-from@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.5.tgz#57c41cb1d0613d22f548fddd8b288eedb9973a5b" - integrity sha512-X4hhm7FRnPgd4nDA4b/5V280xCx6oL7Oob5+9qVS5C13Zq4bh1qq7LU0GgRU6b5dBWBvhGaXYVB4AcN6+ol6vg== +"@babel/plugin-transform-export-namespace-from@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz#b3c84c8f19880b6c7440108f8929caf6056db26c" + integrity sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-transform-for-of@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" - integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== +"@babel/plugin-transform-for-of@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz#f64b4ccc3a4f131a996388fae7680b472b306b29" + integrity sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -595,10 +584,10 @@ "@babel/helper-function-name" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-json-strings@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.5.tgz#14b64352fdf7e1f737eed68de1a1468bd2a77ec0" - integrity sha512-DuCRB7fu8MyTLbEQd1ew3R85nx/88yMoqo2uPSjevMj3yoN7CDM8jkgrY0wmVxfJZyJ/B9fE1iq7EQppWQmR5A== +"@babel/plugin-transform-json-strings@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz#689a34e1eed1928a40954e37f74509f48af67835" + integrity sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-json-strings" "^7.8.3" @@ -610,10 +599,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-logical-assignment-operators@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.5.tgz#66ae5f068fd5a9a5dc570df16f56c2a8462a9d6c" - integrity sha512-MQQOUW1KL8X0cDWfbwYP+TbVbZm16QmQXJQ+vndPtH/BoO0lOKpVoEDMI7+PskYxH+IiE0tS8xZye0qr1lGzSA== +"@babel/plugin-transform-logical-assignment-operators@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz#24c522a61688bde045b7d9bc3c2597a4d948fc9c" + integrity sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" @@ -633,22 +622,22 @@ "@babel/helper-module-transforms" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" - integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== +"@babel/plugin-transform-modules-commonjs@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.15.tgz#b11810117ed4ee7691b29bd29fd9f3f98276034f" + integrity sha512-jWL4eh90w0HQOTKP2MoXXUpVxilxsB2Vl4ji69rSjS3EcZ/v4sBmn+A3NpepuJzBhOaEBbR7udonlHHn5DWidg== dependencies: - "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-systemjs@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz#18c31410b5e579a0092638f95c896c2a98a5d496" - integrity sha512-emtEpoaTMsOs6Tzz+nbmcePl6AKVtS1yC4YNAeMun9U8YCsgadPNxnOPQ8GhHFB2qdx+LZu9LgoC0Lthuu05DQ== +"@babel/plugin-transform-modules-systemjs@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.11.tgz#3386be5875d316493b517207e8f1931d93154bb1" + integrity sha512-rIqHmHoMEOhI3VkVf5jQ15l539KrwhzqcBO6wdCNWPWc/JWt9ILNYNUssbRpeq0qWns8svuw8LnMNCvWBIJ8wA== dependencies: "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-module-transforms" "^7.22.5" + "@babel/helper-module-transforms" "^7.22.9" "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-validator-identifier" "^7.22.5" @@ -675,32 +664,32 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz#f8872c65776e0b552e0849d7596cddd416c3e381" - integrity sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA== +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz#debef6c8ba795f5ac67cd861a81b744c5d38d9fc" + integrity sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-transform-numeric-separator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.5.tgz#57226a2ed9e512b9b446517ab6fa2d17abb83f58" - integrity sha512-NbslED1/6M+sXiwwtcAB/nieypGw02Ejf4KtDeMkCEpP6gWFMX1wI9WKYua+4oBneCCEmulOkRpwywypVZzs/g== +"@babel/plugin-transform-numeric-separator@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz#498d77dc45a6c6db74bb829c02a01c1d719cbfbd" + integrity sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-transform-object-rest-spread@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.5.tgz#9686dc3447df4753b0b2a2fae7e8bc33cdc1f2e1" - integrity sha512-Kk3lyDmEslH9DnvCDA1s1kkd3YWQITiBOHngOtDL9Pt6BZjzqb6hiOlb8VfjiiQJ2unmegBqZu0rx5RxJb5vmQ== +"@babel/plugin-transform-object-rest-spread@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz#21a95db166be59b91cde48775310c0df6e1da56f" + integrity sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q== dependencies: - "@babel/compat-data" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.5" + "@babel/compat-data" "^7.22.9" + "@babel/helper-compilation-targets" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.22.5" + "@babel/plugin-transform-parameters" "^7.22.15" "@babel/plugin-transform-object-super@^7.22.5": version "7.22.5" @@ -710,27 +699,27 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-replace-supers" "^7.22.5" -"@babel/plugin-transform-optional-catch-binding@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.5.tgz#842080be3076703be0eaf32ead6ac8174edee333" - integrity sha512-pH8orJahy+hzZje5b8e2QIlBWQvGpelS76C63Z+jhZKsmzfNaPQ+LaW6dcJ9bxTpo1mtXbgHwy765Ro3jftmUg== +"@babel/plugin-transform-optional-catch-binding@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz#461cc4f578a127bb055527b3e77404cad38c08e0" + integrity sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-transform-optional-chaining@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz#1003762b9c14295501beb41be72426736bedd1e0" - integrity sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ== +"@babel/plugin-transform-optional-chaining@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz#d7a5996c2f7ca4ad2ad16dbb74444e5c4385b1ba" + integrity sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-parameters@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz#c3542dd3c39b42c8069936e48717a8d179d63a18" - integrity sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg== +"@babel/plugin-transform-parameters@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz#719ca82a01d177af358df64a514d64c2e3edb114" + integrity sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -742,13 +731,13 @@ "@babel/helper-create-class-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-private-property-in-object@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.5.tgz#07a77f28cbb251546a43d175a1dda4cf3ef83e32" - integrity sha512-/9xnaTTJcVoBtSSmrVyhtSvO3kbqS2ODoh2juEU72c3aYonNF0OMGiaz2gjukyKM2wBBYJP38S4JiE0Wfb5VMQ== +"@babel/plugin-transform-private-property-in-object@^7.22.11": + version "7.22.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz#ad45c4fc440e9cb84c718ed0906d96cf40f9a4e1" + integrity sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-create-class-features-plugin" "^7.22.5" + "@babel/helper-create-class-features-plugin" "^7.22.11" "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" @@ -759,13 +748,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-regenerator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz#cd8a68b228a5f75fa01420e8cc2fc400f0fc32aa" - integrity sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw== +"@babel/plugin-transform-regenerator@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz#8ceef3bd7375c4db7652878b0241b2be5d0c3cca" + integrity sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" - regenerator-transform "^0.15.1" + regenerator-transform "^0.15.2" "@babel/plugin-transform-reserved-words@^7.22.5": version "7.22.5" @@ -810,10 +799,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-unicode-escapes@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.5.tgz#ce0c248522b1cb22c7c992d88301a5ead70e806c" - integrity sha512-biEmVg1IYB/raUO5wT1tgfacCef15Fbzhkx493D3urBI++6hpJ+RFG4SrWMn0NEZLfvilqKf3QDrRVZHo08FYg== +"@babel/plugin-transform-unicode-escapes@^7.22.10": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz#c723f380f40a2b2f57a62df24c9005834c8616d9" + integrity sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -841,17 +830,17 @@ "@babel/helper-create-regexp-features-plugin" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/preset-env@^7.21.4": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.5.tgz#3da66078b181f3d62512c51cf7014392c511504e" - integrity sha512-fj06hw89dpiZzGZtxn+QybifF07nNiZjZ7sazs2aVDcysAZVGjW7+7iFYxg6GLNM47R/thYfLdrXc+2f11Vi9A== +"@babel/preset-env@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.22.15.tgz#142716f8e00bc030dae5b2ac6a46fbd8b3e18ff8" + integrity sha512-tZFHr54GBkHk6hQuVA8w4Fmq+MSPsfvMG0vPnOYyTnJpyfMqybL8/MbNCPRT9zc2KBO2pe4tq15g6Uno4Jpoag== dependencies: - "@babel/compat-data" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.5" + "@babel/compat-data" "^7.22.9" + "@babel/helper-compilation-targets" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-validator-option" "^7.22.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.22.15" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.22.15" "@babel/plugin-proposal-private-property-in-object" "7.21.0-placeholder-for-preset-env.2" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" @@ -872,76 +861,74 @@ "@babel/plugin-syntax-top-level-await" "^7.14.5" "@babel/plugin-syntax-unicode-sets-regex" "^7.18.6" "@babel/plugin-transform-arrow-functions" "^7.22.5" - "@babel/plugin-transform-async-generator-functions" "^7.22.5" + "@babel/plugin-transform-async-generator-functions" "^7.22.15" "@babel/plugin-transform-async-to-generator" "^7.22.5" "@babel/plugin-transform-block-scoped-functions" "^7.22.5" - "@babel/plugin-transform-block-scoping" "^7.22.5" + "@babel/plugin-transform-block-scoping" "^7.22.15" "@babel/plugin-transform-class-properties" "^7.22.5" - "@babel/plugin-transform-class-static-block" "^7.22.5" - "@babel/plugin-transform-classes" "^7.22.5" + "@babel/plugin-transform-class-static-block" "^7.22.11" + "@babel/plugin-transform-classes" "^7.22.15" "@babel/plugin-transform-computed-properties" "^7.22.5" - "@babel/plugin-transform-destructuring" "^7.22.5" + "@babel/plugin-transform-destructuring" "^7.22.15" "@babel/plugin-transform-dotall-regex" "^7.22.5" "@babel/plugin-transform-duplicate-keys" "^7.22.5" - "@babel/plugin-transform-dynamic-import" "^7.22.5" + "@babel/plugin-transform-dynamic-import" "^7.22.11" "@babel/plugin-transform-exponentiation-operator" "^7.22.5" - "@babel/plugin-transform-export-namespace-from" "^7.22.5" - "@babel/plugin-transform-for-of" "^7.22.5" + "@babel/plugin-transform-export-namespace-from" "^7.22.11" + "@babel/plugin-transform-for-of" "^7.22.15" "@babel/plugin-transform-function-name" "^7.22.5" - "@babel/plugin-transform-json-strings" "^7.22.5" + "@babel/plugin-transform-json-strings" "^7.22.11" "@babel/plugin-transform-literals" "^7.22.5" - "@babel/plugin-transform-logical-assignment-operators" "^7.22.5" + "@babel/plugin-transform-logical-assignment-operators" "^7.22.11" "@babel/plugin-transform-member-expression-literals" "^7.22.5" "@babel/plugin-transform-modules-amd" "^7.22.5" - "@babel/plugin-transform-modules-commonjs" "^7.22.5" - "@babel/plugin-transform-modules-systemjs" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.22.15" + "@babel/plugin-transform-modules-systemjs" "^7.22.11" "@babel/plugin-transform-modules-umd" "^7.22.5" "@babel/plugin-transform-named-capturing-groups-regex" "^7.22.5" "@babel/plugin-transform-new-target" "^7.22.5" - "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.5" - "@babel/plugin-transform-numeric-separator" "^7.22.5" - "@babel/plugin-transform-object-rest-spread" "^7.22.5" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.11" + "@babel/plugin-transform-numeric-separator" "^7.22.11" + "@babel/plugin-transform-object-rest-spread" "^7.22.15" "@babel/plugin-transform-object-super" "^7.22.5" - "@babel/plugin-transform-optional-catch-binding" "^7.22.5" - "@babel/plugin-transform-optional-chaining" "^7.22.5" - "@babel/plugin-transform-parameters" "^7.22.5" + "@babel/plugin-transform-optional-catch-binding" "^7.22.11" + "@babel/plugin-transform-optional-chaining" "^7.22.15" + "@babel/plugin-transform-parameters" "^7.22.15" "@babel/plugin-transform-private-methods" "^7.22.5" - "@babel/plugin-transform-private-property-in-object" "^7.22.5" + "@babel/plugin-transform-private-property-in-object" "^7.22.11" "@babel/plugin-transform-property-literals" "^7.22.5" - "@babel/plugin-transform-regenerator" "^7.22.5" + "@babel/plugin-transform-regenerator" "^7.22.10" "@babel/plugin-transform-reserved-words" "^7.22.5" "@babel/plugin-transform-shorthand-properties" "^7.22.5" "@babel/plugin-transform-spread" "^7.22.5" "@babel/plugin-transform-sticky-regex" "^7.22.5" "@babel/plugin-transform-template-literals" "^7.22.5" "@babel/plugin-transform-typeof-symbol" "^7.22.5" - "@babel/plugin-transform-unicode-escapes" "^7.22.5" + "@babel/plugin-transform-unicode-escapes" "^7.22.10" "@babel/plugin-transform-unicode-property-regex" "^7.22.5" "@babel/plugin-transform-unicode-regex" "^7.22.5" "@babel/plugin-transform-unicode-sets-regex" "^7.22.5" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.22.5" - babel-plugin-polyfill-corejs2 "^0.4.3" - babel-plugin-polyfill-corejs3 "^0.8.1" - babel-plugin-polyfill-regenerator "^0.5.0" - core-js-compat "^3.30.2" - semver "^6.3.0" - -"@babel/preset-modules@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" - integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + "@babel/preset-modules" "0.1.6-no-external-plugins" + "@babel/types" "^7.22.15" + babel-plugin-polyfill-corejs2 "^0.4.5" + babel-plugin-polyfill-corejs3 "^0.8.3" + babel-plugin-polyfill-regenerator "^0.5.2" + core-js-compat "^3.31.0" + semver "^6.3.1" + +"@babel/preset-modules@0.1.6-no-external-plugins": + version "0.1.6-no-external-plugins" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" + integrity sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/register@^7.21.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.22.5.tgz#e4d8d0f615ea3233a27b5c6ada6750ee59559939" - integrity sha512-vV6pm/4CijSQ8Y47RH5SopXzursN35RQINfGJkmOlcpAtGuf94miFvIPhCKGQN7WGIcsgG1BHEX2KVdTYwTwUQ== +"@babel/register@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.22.15.tgz#c2c294a361d59f5fa7bcc8b97ef7319c32ecaec7" + integrity sha512-V3Q3EqoQdn65RCgTLwauZaTfd1ShhwPmbBv+1dkZV/HpCGMKVyn6oFcRlI7RaKqiDQjX2Qd3AuoEguBgdjIKlg== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" @@ -955,44 +942,44 @@ integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.8.4": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" - integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" + integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== dependencies: - regenerator-runtime "^0.13.11" + regenerator-runtime "^0.14.0" -"@babel/template@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== +"@babel/template@^7.22.15", "@babel/template@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" -"@babel/traverse@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.5.tgz#44bd276690db6f4940fdb84e1cb4abd2f729ccd1" - integrity sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ== +"@babel/traverse@^7.22.15", "@babel/traverse@^7.22.17": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.17.tgz#b23c203ab3707e3be816043081b4a994fcacec44" + integrity sha512-xK4Uwm0JnAMvxYZxOVecss85WxTEIbTa7bnGyf/+EgCL5Zt3U7htUpEOWv9detPlamGKuRzCqw74xVglDWpPdg== dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/generator" "^7.22.5" + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.22.15" "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-function-name" "^7.22.5" "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.22.16" + "@babel/types" "^7.22.17" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.22.5", "@babel/types@^7.4.4": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" - integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== +"@babel/types@^7.22.15", "@babel/types@^7.22.17", "@babel/types@^7.22.5", "@babel/types@^7.4.4": + version "7.22.17" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.17.tgz#f753352c4610ffddf9c8bc6823f9ff03e2303eee" + integrity sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg== dependencies: "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.15" to-fast-properties "^2.0.0" "@colors/colors@1.5.0": @@ -1007,27 +994,27 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@definitelytyped/dts-critic@^0.0.163": - version "0.0.163" - resolved "https://registry.yarnpkg.com/@definitelytyped/dts-critic/-/dts-critic-0.0.163.tgz#51750eddefd781daf481f8e4d4d277b7bd51fc87" - integrity sha512-HsTvylj8x2gQaawsOCcN2Xk2Cx0wgV9kaj83hgsO9SITZSPd7dA0UkHyNRadbMkMwqNDKcnizcmWdz0+0gIo8A== +"@definitelytyped/dts-critic@^0.0.177": + version "0.0.177" + resolved "https://registry.yarnpkg.com/@definitelytyped/dts-critic/-/dts-critic-0.0.177.tgz#0c8b2d9772c1f27242c47f0866fa66267d7854b2" + integrity sha512-EcKoBzaHMX4MwnPmg1yVNKkTG50ZWoLpPocejl0+AoWZNfk0f1T5/YTcabQ/pC7vrMlN6+C9EufTOs82gJ9ZIA== dependencies: - "@definitelytyped/header-parser" "^0.0.163" + "@definitelytyped/header-parser" "^0.0.177" command-exists "^1.2.8" rimraf "^3.0.2" - semver "^6.2.0" + semver "^7.5.2" tmp "^0.2.1" yargs "^15.3.1" -"@definitelytyped/dtslint@^0.0.163": - version "0.0.163" - resolved "https://registry.yarnpkg.com/@definitelytyped/dtslint/-/dtslint-0.0.163.tgz#d31f7c01f2f829d69ab0b3c46801d5547860236d" - integrity sha512-U0uw7Zu0QdYSuBMYgxvRYjkhkeulTEg8vDgJ7TiYQUv/wODeujSAmGahQn51E5hOlSMYUw7A9utdbUukxE02SQ== +"@definitelytyped/dtslint@^0.0.177": + version "0.0.177" + resolved "https://registry.yarnpkg.com/@definitelytyped/dtslint/-/dtslint-0.0.177.tgz#0a83ce54a6ff212617f8eea44dce9b22f1862df5" + integrity sha512-ocla41rNWXp9ZyuxhgtFHG+YKkNB1ZKBgFxEHZlRcoFxeiYRsMNe2OSMlubhUUEs7K7A83Vy7WyntNW1DwmEWg== dependencies: - "@definitelytyped/dts-critic" "^0.0.163" - "@definitelytyped/header-parser" "^0.0.163" - "@definitelytyped/typescript-versions" "^0.0.163" - "@definitelytyped/utils" "^0.0.163" + "@definitelytyped/dts-critic" "^0.0.177" + "@definitelytyped/header-parser" "^0.0.177" + "@definitelytyped/typescript-versions" "^0.0.177" + "@definitelytyped/utils" "^0.0.177" "@typescript-eslint/eslint-plugin" "^5.55.0" "@typescript-eslint/parser" "^5.55.0" "@typescript-eslint/types" "^5.56.0" @@ -1040,26 +1027,26 @@ tslint "5.14.0" yargs "^15.1.0" -"@definitelytyped/header-parser@^0.0.163": - version "0.0.163" - resolved "https://registry.yarnpkg.com/@definitelytyped/header-parser/-/header-parser-0.0.163.tgz#fdf5589a048e89b2a2adbd33d5d3d78ecd2a2ec6" - integrity sha512-Jr+/q+ESfc7uWldz/j11BfpjIN/gB4WmwhFENhWaMwM0W/9p0ShF+OiUqGhk2Q3Iz8v/oyWzSsxyxgasg9kCxQ== +"@definitelytyped/header-parser@^0.0.177": + version "0.0.177" + resolved "https://registry.yarnpkg.com/@definitelytyped/header-parser/-/header-parser-0.0.177.tgz#b9d2762800acc395237d6acc4458bcf640487f6e" + integrity sha512-siVtuvnQxXr4KhD14VV7AzFR0Xb+qcRxJWRQ4AogGkPakd5/ufljAXJ6fBq6HRB57Vy4MmgV9R0irfcMhdaK1A== dependencies: - "@definitelytyped/typescript-versions" "^0.0.163" + "@definitelytyped/typescript-versions" "^0.0.177" "@types/parsimmon" "^1.10.1" parsimmon "^1.13.0" -"@definitelytyped/typescript-versions@^0.0.163": - version "0.0.163" - resolved "https://registry.yarnpkg.com/@definitelytyped/typescript-versions/-/typescript-versions-0.0.163.tgz#b3e018057a0437740102850de2c093c8cddd9e6f" - integrity sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A== +"@definitelytyped/typescript-versions@^0.0.177": + version "0.0.177" + resolved "https://registry.yarnpkg.com/@definitelytyped/typescript-versions/-/typescript-versions-0.0.177.tgz#4ca225debaaad05f0df855c140b63f664a3a9791" + integrity sha512-PcSKwrB0zhpFq9KadHU7iVkqszg/4TqDlF+xrXNsMpFk523RC7S7HXdPNR3j55774fwvoIRudMbr96v2J+WNKg== -"@definitelytyped/utils@^0.0.163": - version "0.0.163" - resolved "https://registry.yarnpkg.com/@definitelytyped/utils/-/utils-0.0.163.tgz#1fb26bf5cf22a00c16924fcb115fe76a46817972" - integrity sha512-6MX5TxaQbG/j2RkCWbcbLvv+YNipKqY0eQJafDhwC/RprUocpg+uYVNlH8XzdKRWOGJ0pq7SZOsJD4C3A01ZXg== +"@definitelytyped/utils@^0.0.177": + version "0.0.177" + resolved "https://registry.yarnpkg.com/@definitelytyped/utils/-/utils-0.0.177.tgz#c6e53cdb7b639a532371587691e11e78fe057484" + integrity sha512-okfO4lAV3rRnvCYYqfPT3ZSqfM4Wwg+02ClzszV5AV0htYKiDn8KpdfM73Fm2DCoqeKuKlMPmtc5VtuRK6vCRg== dependencies: - "@definitelytyped/typescript-versions" "^0.0.163" + "@definitelytyped/typescript-versions" "^0.0.177" "@qiwi/npm-registry-client" "^8.9.1" "@types/node" "^14.14.35" charm "^1.0.2" @@ -1080,19 +1067,19 @@ dependencies: eslint-visitor-keys "^3.3.0" -"@eslint-community/regexpp@^4.4.0": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" - integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== +"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1": + version "4.8.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.8.1.tgz#8c4bb756cc2aa7eaf13cfa5e69c83afb3260c20c" + integrity sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ== -"@eslint/eslintrc@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" - integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== +"@eslint/eslintrc@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" + integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.2" + espree "^9.6.0" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -1100,15 +1087,15 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.42.0": - version "8.42.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" - integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== +"@eslint/js@8.49.0": + version "8.49.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.49.0.tgz#86f79756004a97fa4df866835093f1df3d03c333" + integrity sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w== -"@humanwhocodes/config-array@^0.11.10": - version "0.11.10" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" - integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ== +"@humanwhocodes/config-array@^0.11.11": + version "0.11.11" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844" + integrity sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA== dependencies: "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" @@ -1145,19 +1132,19 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/schemas@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" - integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== dependencies: - "@sinclair/typebox" "^0.25.16" + "@sinclair/typebox" "^0.27.8" -"@jest/types@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" - integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== dependencies: - "@jest/schemas" "^29.4.3" + "@jest/schemas" "^29.6.3" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" @@ -1173,12 +1160,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== - -"@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== @@ -1189,19 +1171,14 @@ integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== "@jridgewell/source-map@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.3.tgz#8108265659d4c33e72ffe14e33d6cc5eb59f2fda" - integrity sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg== + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" + integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== dependencies: "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@1.4.14": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -1215,12 +1192,12 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.18" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" - integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== + version "0.3.19" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" + integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@jsdoc/salty@^0.2.1": version "0.2.5" @@ -1262,6 +1239,18 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pkgr/utils@^2.3.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc" + integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw== + dependencies: + cross-spawn "^7.0.3" + fast-glob "^3.3.0" + is-glob "^4.0.3" + open "^9.1.0" + picocolors "^1.0.0" + tslib "^2.6.0" + "@qiwi/npm-registry-client@^8.9.1": version "8.9.1" resolved "https://registry.yarnpkg.com/@qiwi/npm-registry-client/-/npm-registry-client-8.9.1.tgz#1769f6501a436ec39c496ca0a9a2fab9db7718df" @@ -1281,10 +1270,10 @@ optionalDependencies: npmlog "2 || ^3.1.0 || ^4.0.0" -"@sinclair/typebox@^0.25.16": - version "0.25.24" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" - integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== "@sinonjs/commons@^2.0.0": version "2.0.0" @@ -1300,10 +1289,10 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^10.0.2", "@sinonjs/fake-timers@^10.1.0": - version "10.2.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.2.0.tgz#b3e322a34c5f26e3184e7f6115695f299c1b1194" - integrity sha512-OPwQlEdg40HAj5KNF8WW6q2KG4Z+cBCZb3m4ninfTZKaBmbIJodviQsDBoYMPHkOyJJMHnOJo5j2+LKDOhOACg== +"@sinonjs/fake-timers@^10.0.2", "@sinonjs/fake-timers@^10.3.0": + version "10.3.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== dependencies: "@sinonjs/commons" "^3.0.0" @@ -1352,9 +1341,9 @@ integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== "@types/cors@^2.8.12": - version "2.8.13" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.13.tgz#b8ade22ba455a1b8cb3b5d3f35910fd204f84f94" - integrity sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA== + version "2.8.14" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.14.tgz#94eeb1c95eda6a8ab54870a3bf88854512f43a92" + integrity sha512-RXHUvNWYICtbP6s18PnOCaqToK8y14DnLd75c6HfyKf228dxy7pHNOQkxPtvXKp/hINFMDjbYzsj63nnpPMSRQ== dependencies: "@types/node" "*" @@ -1367,9 +1356,9 @@ "@types/estree" "*" "@types/eslint@*", "@types/eslint@^8.37.0": - version "8.40.2" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.40.2.tgz#2833bc112d809677864a4b0e7d1de4f04d7dac2d" - integrity sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ== + version "8.44.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.44.2.tgz#0d21c505f98a89b8dd4d37fa162b09da6089199a" + integrity sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg== dependencies: "@types/estree" "*" "@types/json-schema" "*" @@ -1409,9 +1398,9 @@ integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== "@types/linkify-it@*": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" - integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.3.tgz#15a0712296c5041733c79efe233ba17ae5a7587b" + integrity sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g== "@types/markdown-it@^12.2.3": version "12.2.3" @@ -1426,15 +1415,15 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== -"@types/node@*", "@types/node@>=10.0.0", "@types/node@^20.1.4": - version "20.3.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe" - integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg== +"@types/node@*", "@types/node@>=10.0.0", "@types/node@^20.6.0": + version "20.6.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" + integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== "@types/node@^14.14.35": - version "14.18.51" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.51.tgz#cb90935b89c641201c3d07a595c3e22d1cfaa417" - integrity sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA== + version "14.18.59" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.59.tgz#2b61a51d875e2a4deb0c6b498ff21a78e691edc6" + integrity sha512-NWJMpBL2Xs3MY93yrD6YrrTKep8eIA6iMnfG4oIc6LrTRlBZgiSCGiY3V/Owlp6umIBLyKb4F8Q7hxWatjYH5A== "@types/parsimmon@^1.10.1": version "1.10.6" @@ -1442,9 +1431,9 @@ integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA== "@types/semver@^7.3.12": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" - integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== + version "7.5.1" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367" + integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg== "@types/yargs-parser@*": version "21.0.0" @@ -1459,89 +1448,134 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5.55.0": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.11.tgz#8d466aa21abea4c3f37129997b198d141f09e76f" - integrity sha512-XxuOfTkCUiOSyBWIvHlUraLw/JT/6Io1365RO6ZuI88STKMavJZPNMU0lFcUTeQXEhHiv64CbxYxBNoDVSmghg== + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db" + integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.59.11" - "@typescript-eslint/type-utils" "5.59.11" - "@typescript-eslint/utils" "5.59.11" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/type-utils" "5.62.0" + "@typescript-eslint/utils" "5.62.0" debug "^4.3.4" - grapheme-splitter "^1.0.4" + graphemer "^1.4.0" ignore "^5.2.0" natural-compare-lite "^1.4.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.55.0", "@typescript-eslint/parser@^5.59.6": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.11.tgz#af7d4b7110e3068ce0b97550736de455e4250103" - integrity sha512-s9ZF3M+Nym6CAZEkJJeO2TFHHDsKAM3ecNkLuH4i4s8/RCPnF5JRip2GyviYkeEAcwGMJxkqG9h2dAsnA1nZpA== +"@typescript-eslint/parser@^5.55.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.62.0.tgz#1b63d082d849a2fcae8a569248fbe2ee1b8a56c7" + integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== dependencies: - "@typescript-eslint/scope-manager" "5.59.11" - "@typescript-eslint/types" "5.59.11" - "@typescript-eslint/typescript-estree" "5.59.11" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.59.11": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.11.tgz#5d131a67a19189c42598af9fb2ea1165252001ce" - integrity sha512-dHFOsxoLFtrIcSj5h0QoBT/89hxQONwmn3FOQ0GOQcLOOXm+MIrS8zEAhs4tWl5MraxCY3ZJpaXQQdFMc2Tu+Q== +"@typescript-eslint/parser@^6.7.0": + version "6.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.0.tgz#332fe9c7ecf6783d3250b4c8a960bd4af0995807" + integrity sha512-jZKYwqNpNm5kzPVP5z1JXAuxjtl2uG+5NpaMocFPTNC2EdYIgbXIPImObOkhbONxtFTTdoZstLZefbaK+wXZng== dependencies: - "@typescript-eslint/types" "5.59.11" - "@typescript-eslint/visitor-keys" "5.59.11" + "@typescript-eslint/scope-manager" "6.7.0" + "@typescript-eslint/types" "6.7.0" + "@typescript-eslint/typescript-estree" "6.7.0" + "@typescript-eslint/visitor-keys" "6.7.0" + debug "^4.3.4" -"@typescript-eslint/type-utils@5.59.11": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.11.tgz#5eb67121808a84cb57d65a15f48f5bdda25f2346" - integrity sha512-LZqVY8hMiVRF2a7/swmkStMYSoXMFlzL6sXV6U/2gL5cwnLWQgLEG8tjWPpaE4rMIdZ6VKWwcffPlo1jPfk43g== +"@typescript-eslint/scope-manager@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c" + integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== dependencies: - "@typescript-eslint/typescript-estree" "5.59.11" - "@typescript-eslint/utils" "5.59.11" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + +"@typescript-eslint/scope-manager@6.7.0": + version "6.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.0.tgz#6b3c22187976e2bf5ed0dc0d9095f1f2cbd1d106" + integrity sha512-lAT1Uau20lQyjoLUQ5FUMSX/dS07qux9rYd5FGzKz/Kf8W8ccuvMyldb8hadHdK/qOI7aikvQWqulnEq2nCEYA== + dependencies: + "@typescript-eslint/types" "6.7.0" + "@typescript-eslint/visitor-keys" "6.7.0" + +"@typescript-eslint/type-utils@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz#286f0389c41681376cdad96b309cedd17d70346a" + integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== + dependencies: + "@typescript-eslint/typescript-estree" "5.62.0" + "@typescript-eslint/utils" "5.62.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.59.11", "@typescript-eslint/types@^5.56.0": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.11.tgz#1a9018fe3c565ba6969561f2a49f330cf1fe8db1" - integrity sha512-epoN6R6tkvBYSc+cllrz+c2sOFWkbisJZWkOE+y3xHtvYaOE6Wk6B8e114McRJwFRjGvYdJwLXQH5c9osME/AA== +"@typescript-eslint/types@5.62.0", "@typescript-eslint/types@^5.56.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== + +"@typescript-eslint/types@6.7.0": + version "6.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.0.tgz#8de8ba9cafadc38e89003fe303e219c9250089ae" + integrity sha512-ihPfvOp7pOcN/ysoj0RpBPOx3HQTJTrIN8UZK+WFd3/iDeFHHqeyYxa4hQk4rMhsz9H9mXpR61IzwlBVGXtl9Q== -"@typescript-eslint/typescript-estree@5.59.11", "@typescript-eslint/typescript-estree@^5.55.0": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.11.tgz#b2caaa31725e17c33970c1197bcd54e3c5f42b9f" - integrity sha512-YupOpot5hJO0maupJXixi6l5ETdrITxeo5eBOeuV7RSKgYdU3G5cxO49/9WRnJq9EMrB7AuTSLH/bqOsXi7wPA== +"@typescript-eslint/typescript-estree@5.62.0", "@typescript-eslint/typescript-estree@^5.55.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== dependencies: - "@typescript-eslint/types" "5.59.11" - "@typescript-eslint/visitor-keys" "5.59.11" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.59.11", "@typescript-eslint/utils@^5.55.0": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.11.tgz#9dbff49dc80bfdd9289f9f33548f2e8db3c59ba1" - integrity sha512-didu2rHSOMUdJThLk4aZ1Or8IcO3HzCw/ZvEjTTIfjIrcdd5cvSIwwDy2AOlE7htSNp7QIZ10fLMyRCveesMLg== +"@typescript-eslint/typescript-estree@6.7.0": + version "6.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.0.tgz#20ce2801733bd46f02cc0f141f5b63fbbf2afb63" + integrity sha512-dPvkXj3n6e9yd/0LfojNU8VMUGHWiLuBZvbM6V6QYD+2qxqInE7J+J/ieY2iGwR9ivf/R/haWGkIj04WVUeiSQ== + dependencies: + "@typescript-eslint/types" "6.7.0" + "@typescript-eslint/visitor-keys" "6.7.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@5.62.0", "@typescript-eslint/utils@^5.55.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.59.11" - "@typescript-eslint/types" "5.59.11" - "@typescript-eslint/typescript-estree" "5.59.11" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.59.11": - version "5.59.11" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.11.tgz#dca561ddad169dc27d62396d64f45b2d2c3ecc56" - integrity sha512-KGYniTGG3AMTuKF9QBD7EIrvufkB6O6uX3knP73xbKLMpH+QRPcgnCxjWXSHjMRuOxFLovljqQgQpR0c7GvjoA== +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== dependencies: - "@typescript-eslint/types" "5.59.11" + "@typescript-eslint/types" "5.62.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@6.7.0": + version "6.7.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.0.tgz#34140ac76dfb6316d17012e4469acf3366ad3f44" + integrity sha512-/C1RVgKFDmGMcVGeD8HjKv2bd72oI1KxQDeY8uc66gw9R0OK0eMq48cA+jv9/2Ag6cdrsUGySm1yzYmfz0hxwQ== + dependencies: + "@typescript-eslint/types" "6.7.0" + eslint-visitor-keys "^3.4.1" + "@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24" @@ -1718,10 +1752,10 @@ acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2: - version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" - integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== +acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== aggregate-error@^3.0.0: version "3.1.0" @@ -1750,7 +1784,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1775,12 +1809,12 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== +ansi-escapes@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-5.0.0.tgz#b6a0caf0eef0c41af190e9a749e0c00ec04bb2a6" + integrity sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA== dependencies: - type-fest "^0.21.3" + type-fest "^1.0.2" ansi-regex@^2.0.0: version "2.1.1" @@ -1816,7 +1850,7 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" -ansi-styles@^6.0.0: +ansi-styles@^6.0.0, ansi-styles@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== @@ -1880,14 +1914,14 @@ array-buffer-byte-length@^1.0.0: is-array-buffer "^3.0.1" array-includes@^3.1.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" - integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + version "3.1.7" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.7.tgz#8cd2e01b26f7a3086cbc87271593fe921c62abda" + integrity sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - get-intrinsic "^1.1.3" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" is-string "^1.0.7" array-union@^2.1.0: @@ -1895,26 +1929,50 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array.prototype.findlastindex@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz#b37598438f97b579166940814e2c0493a4f50207" + integrity sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.2.1" + array.prototype.flat@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" - integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz#1476217df8cff17d72ee8f3ba06738db5b387d18" + integrity sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" es-shim-unscopables "^1.0.0" array.prototype.flatmap@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" - integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz#c9a7c6831db8e719d6ce639190146c24bbd3e527" + integrity sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" es-shim-unscopables "^1.0.0" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -1938,25 +1996,21 @@ assert-plus@1.0.0, assert-plus@^1.0.0: integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== assert@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-2.0.0.tgz#95fc1c616d48713510680f2eaf2d10dd22e02d32" - integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== + version "2.1.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" + integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== dependencies: - es6-object-assign "^1.1.0" - is-nan "^1.2.1" - object-is "^1.0.1" - util "^0.12.0" + call-bind "^1.0.2" + is-nan "^1.3.2" + object-is "^1.1.5" + object.assign "^4.1.4" + util "^0.12.5" assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1986,12 +2040,12 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-loader@^9.1.2: - version "9.1.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.2.tgz#a16a080de52d08854ee14570469905a5fc00d39c" - integrity sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA== +babel-loader@^9.1.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.3.tgz#3d0e01b4e69760cc694ee306fe16d358aa1c6f9a" + integrity sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw== dependencies: - find-cache-dir "^3.3.2" + find-cache-dir "^4.0.0" schema-utils "^4.0.0" babel-plugin-istanbul@^6.1.1: @@ -2005,29 +2059,29 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-polyfill-corejs2@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.3.tgz#75044d90ba5043a5fb559ac98496f62f3eb668fd" - integrity sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw== +babel-plugin-polyfill-corejs2@^0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz#8097b4cb4af5b64a1d11332b6fb72ef5e64a054c" + integrity sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg== dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.4.0" - semver "^6.1.1" + "@babel/compat-data" "^7.22.6" + "@babel/helper-define-polyfill-provider" "^0.4.2" + semver "^6.3.1" -babel-plugin-polyfill-corejs3@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.1.tgz#39248263c38191f0d226f928d666e6db1b4b3a8a" - integrity sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q== +babel-plugin-polyfill-corejs3@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz#b4f719d0ad9bb8e0c23e3e630c0c8ec6dd7a1c52" + integrity sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.4.0" - core-js-compat "^3.30.1" + "@babel/helper-define-polyfill-provider" "^0.4.2" + core-js-compat "^3.31.0" -babel-plugin-polyfill-regenerator@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.0.tgz#e7344d88d9ef18a3c47ded99362ae4a757609380" - integrity sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g== +babel-plugin-polyfill-regenerator@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz#80d0f3e1098c080c8b5a65f41e9427af692dc326" + integrity sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA== dependencies: - "@babel/helper-define-polyfill-provider" "^0.4.0" + "@babel/helper-define-polyfill-provider" "^0.4.2" balanced-match@^1.0.0: version "1.0.2" @@ -2056,10 +2110,15 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bignumber.js@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== +big-integer@^1.6.44: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + +bignumber.js@^9.1.2: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== binary-extensions@^2.0.0: version "2.2.0" @@ -2108,6 +2167,13 @@ body-parser@^1.19.0: type-is "~1.6.18" unpipe "1.0.0" +bplist-parser@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" + integrity sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw== + dependencies: + big-integer "^1.6.44" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2201,14 +2267,14 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.14.5, browserslist@^4.21.3, browserslist@^4.21.5: - version "4.21.8" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.8.tgz#db2498e1f4b80ed199c076248a094935860b6017" - integrity sha512-j+7xYe+v+q2Id9qbBeCI8WX5NmZSRe8es1+0xntD/+gaWXznP8tFEkv5IgSaHf5dS1YwVMbX/4W6m937mj+wQw== +browserslist@^4.14.5, browserslist@^4.21.10, browserslist@^4.21.9: + version "4.21.10" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" + integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== dependencies: - caniuse-lite "^1.0.30001502" - electron-to-chromium "^1.4.428" - node-releases "^2.0.12" + caniuse-lite "^1.0.30001517" + electron-to-chromium "^1.4.477" + node-releases "^2.0.13" update-browserslist-db "^1.0.11" buffer-from@^1.0.0: @@ -2252,6 +2318,13 @@ builtins@^1.0.3: resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== +bundle-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/bundle-name/-/bundle-name-3.0.0.tgz#ba59bcc9ac785fb67ccdbf104a2bf60c099f0e1a" + integrity sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw== + dependencies: + run-applescript "^5.0.0" + bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -2290,10 +2363,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001502: - version "1.0.30001502" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001502.tgz#f7e4a76eb1d2d585340f773767be1fefc118dca8" - integrity sha512-AZ+9tFXw1sS0o0jcpJQIXvFTOB/xGiQ4OQ2t98QX3NDn2EZTSRBC801gxrsGgViuq2ak/NLkNgSNEPtCr5lfKg== +caniuse-lite@^1.0.30001517: + version "1.0.30001532" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001532.tgz#c6a4d5d2da6d2b967f0ee5e12e7f680db6ad2fca" + integrity sha512-FbDFnNat3nMnrROzqrsg314zhqN5LGQ1kyyMk2opcrwGbVGpHRhgCWtAgD5YJUqNAiQ+dklreil/c3Qf1dfCTw== caseless@~0.12.0: version "0.12.0" @@ -2307,10 +2380,10 @@ catharsis@^0.9.0: dependencies: lodash "^4.17.15" -chai@^4.3.7: - version "4.3.7" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== +chai@^4.3.8: + version "4.3.8" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.8.tgz#40c59718ad6928da6629c70496fe990b2bb5b17c" + integrity sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" @@ -2320,10 +2393,10 @@ chai@^4.3.7: pathval "^1.1.1" type-detect "^4.0.5" -chalk@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" - integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== +chalk@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== chalk@^1.1.3: version "1.1.3" @@ -2336,7 +2409,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.3.0: +chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2408,20 +2481,12 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== +cli-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-4.0.0.tgz#3cecfe3734bf4fe02a8361cbdc0f6fe28c6a57ea" + integrity sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg== dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" + restore-cursor "^4.0.0" cli-truncate@^3.1.0: version "3.1.0" @@ -2487,7 +2552,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^2.0.14, colorette@^2.0.19: +colorette@^2.0.14, colorette@^2.0.20: version "2.0.20" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== @@ -2509,6 +2574,11 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== +commander@11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" + integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== + commander@2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -2516,7 +2586,7 @@ commander@2.9.0: dependencies: graceful-readlink ">= 1.0.0" -commander@^10.0.0, commander@^10.0.1: +commander@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== @@ -2536,6 +2606,11 @@ commander@~2.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" integrity sha512-J2wnb6TKniXNOtoHS8TSrG9IOQluPrsmyAJ8oCUJOBmv+uLBCyPYAZkD2jFvw2DCzIXNnISIM01NIvr35TkBMQ== +common-path-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0" + integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -2601,12 +2676,12 @@ cookie@~0.4.1: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== -core-js-compat@^3.30.1, core-js-compat@^3.30.2: - version "3.31.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.31.0.tgz#4030847c0766cc0e803dcdfb30055d7ef2064bf1" - integrity sha512-hM7YCu1cU6Opx7MXNu0NuumM0ezNeAeRKadixyiQELWY3vT3De9S4J5ZBMraWV2vZnrE1Cirl0GtFtDtMUXzPw== +core-js-compat@^3.31.0: + version "3.32.2" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.32.2.tgz#8047d1a8b3ac4e639f0d4f66d4431aa3b16e004c" + integrity sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ== dependencies: - browserslist "^4.21.5" + browserslist "^4.21.10" core-util-is@1.0.2: version "1.0.2" @@ -2755,6 +2830,24 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +default-browser-id@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/default-browser-id/-/default-browser-id-3.0.0.tgz#bee7bbbef1f4e75d31f98f4d3f1556a14cea790c" + integrity sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA== + dependencies: + bplist-parser "^0.2.0" + untildify "^4.0.0" + +default-browser@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/default-browser/-/default-browser-4.0.0.tgz#53c9894f8810bf86696de117a6ce9085a3cbc7da" + integrity sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA== + dependencies: + bundle-name "^3.0.0" + default-browser-id "^3.0.0" + execa "^7.1.1" + titleize "^3.0.0" + default-require-extensions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-3.0.1.tgz#bfae00feeaeada68c2ae256c62540f60b80625bd" @@ -2762,6 +2855,11 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" +define-lazy-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz#dbb19adfb746d7fc6d734a06b72f4a00d021255f" + integrity sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg== + define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" @@ -2886,10 +2984,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== -electron-to-chromium@^1.4.428: - version "1.4.429" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.429.tgz#055a2543ba8b1a847bebf521791715ec30f8d97b" - integrity sha512-COua8RvN548KwPFzKMrTjFbmDsQRgdi0zSAhmo70TwC1tfLOSqq8p09n+GkdF5buvzE/NEYn1dP3itbfhun9gg== +electron-to-chromium@^1.4.477: + version "1.4.515" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.515.tgz#f5fec9662106ac5752894af221606cf4db443e70" + integrity sha512-VTq6vjk3kCfG2qdzQRd/i9dIyVVm0dbtZIgFzrLgfB73mXDQT2HPKVRc1EoZcAVUv9XhXAu08DWqJuababdGGg== elliptic@^6.5.3: version "6.5.4" @@ -2926,15 +3024,15 @@ end-of-stream@^1.4.1: dependencies: once "^1.4.0" -engine.io-parser@~5.0.3: - version "5.0.7" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.0.7.tgz#ed5eae76c71f398284c578ab6deafd3ba7e4e4f6" - integrity sha512-P+jDFbvK6lE3n1OL+q9KuzdOFWkkZ/cMV9gol/SbVfpyqfvrfrFTOFJ6fQm2VC3PZHlU3QPhVwmbsCnauHF2MQ== +engine.io-parser@~5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.1.tgz#9f213c77512ff1a6cc0c7a86108a7ffceb16fcfb" + integrity sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ== -engine.io@~6.4.2: - version "6.4.2" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.4.2.tgz#ffeaf68f69b1364b0286badddf15ff633476473f" - integrity sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg== +engine.io@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.5.2.tgz#769348ced9d56bd47bd83d308ec1c3375e85937c" + integrity sha512-IXsMcGpw/xRfjra46sVZVHiSWo/nJ/3g1337q9KNXtS6YRzbW5yIzTCb9DjhrBe7r3GZQR0I4+nq+4ODk5g/cA== dependencies: "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" @@ -2944,10 +3042,10 @@ engine.io@~6.4.2: cookie "~0.4.1" cors "~2.8.5" debug "~4.3.1" - engine.io-parser "~5.0.3" + engine.io-parser "~5.2.1" ws "~8.11.0" -enhanced-resolve@^5.14.1: +enhanced-resolve@^5.15.0: version "5.15.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== @@ -2966,22 +3064,23 @@ entities@~2.1.0: integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== + version "7.10.0" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.10.0.tgz#55146e3909cc5fe63c22da63fb15b05aeac35b13" + integrity sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw== -es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.21.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" - integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== +es-abstract@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.2.0" + get-intrinsic "^1.2.1" get-symbol-description "^1.0.0" globalthis "^1.0.3" gopd "^1.0.1" @@ -3001,19 +3100,23 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: object-inspect "^1.12.3" object-keys "^1.1.1" object.assign "^4.1.4" - regexp.prototype.flags "^1.4.3" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" - which-typed-array "^1.1.9" + which-typed-array "^1.1.10" es-module-lexer@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.0.tgz#6be9c9e0b4543a60cd166ff6f8b4e9dae0b0c16f" - integrity sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA== + version "1.3.1" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.3.1.tgz#c1b0dd5ada807a3b3155315911f364dc4e909db1" + integrity sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q== es-set-tostringtag@^2.0.1: version "2.0.1" @@ -3045,11 +3148,6 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -es6-object-assign@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" - integrity sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw== - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -3085,21 +3183,21 @@ eslint-config-airbnb-base@^15.0.0: object.entries "^1.1.5" semver "^6.3.0" -eslint-config-prettier@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" - integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== +eslint-config-prettier@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#eb25485946dd0c66cd216a46232dc05451518d1f" + integrity sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw== eslint-import-resolver-node@^0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" - integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== + version "0.3.9" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz#d4eaac52b8a2e7c3cd1903eb00f7e053356118ac" + integrity sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g== dependencies: debug "^3.2.7" - is-core-module "^2.11.0" - resolve "^1.22.1" + is-core-module "^2.13.0" + resolve "^1.22.4" -eslint-module-utils@^2.7.4: +eslint-module-utils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== @@ -3114,26 +3212,28 @@ eslint-plugin-es@^3.0.0: eslint-utils "^2.0.0" regexpp "^3.0.0" -eslint-plugin-import@^2.25.2: - version "2.27.5" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" - integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== +eslint-plugin-import@^2.28.1: + version "2.28.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz#63b8b5b3c409bfc75ebaf8fb206b07ab435482c4" + integrity sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A== dependencies: array-includes "^3.1.6" + array.prototype.findlastindex "^1.2.2" array.prototype.flat "^1.3.1" array.prototype.flatmap "^1.3.1" debug "^3.2.7" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.7" - eslint-module-utils "^2.7.4" + eslint-module-utils "^2.8.0" has "^1.0.3" - is-core-module "^2.11.0" + is-core-module "^2.13.0" is-glob "^4.0.3" minimatch "^3.1.2" + object.fromentries "^2.0.6" + object.groupby "^1.0.0" object.values "^1.1.6" - resolve "^1.22.1" - semver "^6.3.0" - tsconfig-paths "^3.14.1" + semver "^6.3.1" + tsconfig-paths "^3.14.2" eslint-plugin-node@^11.1.0: version "11.1.0" @@ -3152,12 +3252,13 @@ eslint-plugin-prefer-import@^0.0.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-import/-/eslint-plugin-prefer-import-0.0.1.tgz#0df4e117da29109ef561d355ec19f41df0ada6f6" integrity sha512-2OKD3Bjgqkn0BvEGRwpEDhjXPSXvT3CXmWIrIavwafOkQE8FLTvFybEBT9dm7P0kHnjlNGv1AfNsL/i/GNDNHA== -eslint-plugin-prettier@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" - integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== +eslint-plugin-prettier@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.0.tgz#6887780ed95f7708340ec79acfdf60c35b9be57a" + integrity sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w== dependencies: prettier-linter-helpers "^1.0.0" + synckit "^0.8.5" eslint-rule-composer@^0.3.0: version "0.3.0" @@ -3172,10 +3273,10 @@ eslint-scope@5.1.1, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" - integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -3197,10 +3298,10 @@ eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" - integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint-webpack-plugin@^4.0.0: version "4.0.1" @@ -3213,27 +3314,27 @@ eslint-webpack-plugin@^4.0.0: normalize-path "^3.0.0" schema-utils "^4.0.0" -eslint@^8.17.0, eslint@^8.37.0: - version "8.42.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291" - integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A== +eslint@^8.17.0, eslint@^8.49.0: + version "8.49.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.49.0.tgz#09d80a89bdb4edee2efcf6964623af1054bf6d42" + integrity sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.3" - "@eslint/js" "8.42.0" - "@humanwhocodes/config-array" "^0.11.10" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.2" + "@eslint/js" "8.49.0" + "@humanwhocodes/config-array" "^0.11.11" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.2.0" - eslint-visitor-keys "^3.4.1" - espree "^9.5.2" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -3243,7 +3344,6 @@ eslint@^8.17.0, eslint@^8.37.0: globals "^13.19.0" graphemer "^1.4.0" ignore "^5.2.0" - import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" @@ -3253,17 +3353,16 @@ eslint@^8.17.0, eslint@^8.37.0: lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" + optionator "^0.9.3" strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.2: - version "9.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" - integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: - acorn "^8.8.0" + acorn "^8.9.0" acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" @@ -3311,6 +3410,11 @@ eventemitter3@^4.0.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -3324,10 +3428,10 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -execa@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-7.1.1.tgz#3eb3c83d239488e7b409d48e8813b76bb55c9c43" - integrity sha512-wH0eMf/UXckdUYnO21+HDztteVv05rq2GXksxT4fCGeHkBhw1DROXh40wcjMcRqDOWE7iPJ4n3M7e2+YFP+76Q== +execa@7.2.0, execa@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-7.2.0.tgz#657e75ba984f42a70f38928cedc87d6f2d4fe4e9" + integrity sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA== dependencies: cross-spawn "^7.0.3" get-stream "^6.0.1" @@ -3339,6 +3443,21 @@ execa@^7.0.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -3364,10 +3483,10 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== +fast-glob@^3.2.9, fast-glob@^3.3.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -3438,7 +3557,7 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-cache-dir@^3.2.0, find-cache-dir@^3.3.2: +find-cache-dir@^3.2.0: version "3.3.2" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== @@ -3447,6 +3566,14 @@ find-cache-dir@^3.2.0, find-cache-dir@^3.3.2: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-cache-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2" + integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg== + dependencies: + common-path-prefix "^3.0.0" + pkg-dir "^7.0.0" + find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" @@ -3470,6 +3597,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + findup@0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" @@ -3479,11 +3614,12 @@ findup@0.1.5: commander "~2.1.0" flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + version "3.1.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.1.0.tgz#0e54ab4a1a60fe87e2946b6b00657f1c99e1af3f" + integrity sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew== dependencies: - flatted "^3.1.0" + flatted "^3.2.7" + keyv "^4.5.3" rimraf "^3.0.2" flat@^5.0.2: @@ -3491,7 +3627,7 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.1.0, flatted@^3.2.7: +flatted@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== @@ -3576,9 +3712,9 @@ fs.realpath@^1.0.0: integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== fstream@^1.0.12: version "1.0.12" @@ -3596,16 +3732,16 @@ function-bind@^1.1.1: integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== function.prototype.name@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" - integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - functions-have-names "^1.2.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -3639,7 +3775,7 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== @@ -3654,7 +3790,7 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== -get-stream@^6.0.1: +get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== @@ -3735,9 +3871,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: - version "13.20.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" - integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + version "13.21.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.21.0.tgz#163aae12f34ef502f5153cfbdd3600f36c63c571" + integrity sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg== dependencies: type-fest "^0.20.2" @@ -3777,11 +3913,6 @@ graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w== -grapheme-splitter@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - graphemer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" @@ -3943,6 +4074,11 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + human-signals@^4.3.0: version "4.3.1" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-4.3.1.tgz#ab7f811e851fca97ffbd2c1fe9a958964de321b2" @@ -3970,7 +4106,7 @@ ignore@^5.1.1, ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -4067,10 +4203,10 @@ is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.11.0, is-core-module@^2.5.0: - version "2.12.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" - integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== +is-core-module@^2.13.0, is-core-module@^2.5.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" + integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== dependencies: has "^1.0.3" @@ -4086,6 +4222,11 @@ is-docker@^2.0.0: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== +is-docker@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-3.0.0.tgz#90093aa3106277d8a77a5910dbae71747e15a200" + integrity sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -4122,7 +4263,14 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-nan@^1.2.1: +is-inside-container@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-inside-container/-/is-inside-container-1.0.0.tgz#e81fba699662eb31dbdaf26766a61d4814717ea4" + integrity sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA== + dependencies: + is-docker "^3.0.0" + +is-nan@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== @@ -4204,15 +4352,11 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: has-symbols "^1.0.2" is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" + which-typed-array "^1.1.11" is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" @@ -4248,6 +4392,11 @@ isarray@0.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -4319,12 +4468,12 @@ istanbul-lib-processinfo@^2.0.2: uuid "^8.3.2" istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== dependencies: istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" + make-dir "^4.0.0" supports-color "^7.1.0" istanbul-lib-source-maps@^4.0.0, istanbul-lib-source-maps@^4.0.1: @@ -4337,19 +4486,19 @@ istanbul-lib-source-maps@^4.0.0, istanbul-lib-source-maps@^4.0.1: source-map "^0.6.1" istanbul-reports@^3.0.2, istanbul-reports@^3.0.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae" - integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" - integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== +jest-util@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.3.tgz#e15c3eac8716440d1ed076f09bc63ace1aebca63" + integrity sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA== dependencies: - "@jest/types" "^29.5.0" + "@jest/types" "^29.6.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" @@ -4366,12 +4515,12 @@ jest-worker@^27.4.5: supports-color "^8.0.0" jest-worker@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" - integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== + version "29.6.4" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.6.4.tgz#f34279f4afc33c872b470d4af21b281ac616abd3" + integrity sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q== dependencies: "@types/node" "*" - jest-util "^29.5.0" + jest-util "^29.6.3" merge-stream "^2.0.0" supports-color "^8.0.0" @@ -4385,10 +4534,10 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-xdr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-2.0.0.tgz#ef24ea27369ab60217c001fd0e27301f6981ba0a" - integrity sha512-4mctWHR47ejNcfpE8/Xl3l2wYqO1Qy09d1pveZRmarUz2BcuU/M8grzadxV6PoN/X0ywOb6cy6117qYUWkfeBA== +js-xdr@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-3.0.0.tgz#fb74275de0ed3cec61269721140a576edf6fca7e" + integrity sha512-tSt6UKJ2L7t+yaQURGkHo9kop9qnVbChTlCu62zNiDbDZQoZb/YjUj2iFJ3lgelhfg9p5bhO2o/QX+g36TPsSQ== js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" @@ -4448,6 +4597,11 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-even-better-errors@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -4492,7 +4646,7 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" -json5@^2.2.2: +json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -4531,10 +4685,10 @@ karma-chrome-launcher@^3.1.0: dependencies: which "^1.2.1" -karma-coverage@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.2.0.tgz#64f838b66b71327802e7f6f6c39d569b7024e40c" - integrity sha512-gPVdoZBNDZ08UCzdMHHhEImKrw1+PAOQOIiffv1YsvxFhBjqvo/SVXNk4tqn1SYqX0BJZT6S/59zgxiBe+9OuA== +karma-coverage@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.2.1.tgz#e1cc074f93ace9dc4fb7e7aeca7135879c2e358c" + integrity sha512-yj7hbequkQP2qOSb20GuNSIyE//PgJWHwC2IydLE6XRtsnaflv+/OSGNssPjobYUlhVVagy99TQpqUt3vAUG7A== dependencies: istanbul-lib-coverage "^3.2.0" istanbul-lib-instrument "^5.1.0" @@ -4572,7 +4726,7 @@ karma-webpack@^5.0.0: minimatch "^3.0.4" webpack-merge "^4.1.5" -karma@^6.4.1: +karma@^6.4.2: version "6.4.2" resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.2.tgz#a983f874cee6f35990c4b2dcc3d274653714de8e" integrity sha512-C6SU/53LB31BEgRg+omznBEMY4SjHU3ricV6zBcAe1EeILKkeScr+fZXtaI5WyDbkVowJxxAI6h73NcFPmXolQ== @@ -4602,6 +4756,13 @@ karma@^6.4.1: ua-parser-js "^0.7.30" yargs "^16.1.1" +keyv@^4.5.3: + version "4.5.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.3.tgz#00873d2b046df737963157bd04f294ca818c9c25" + integrity sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug== + dependencies: + json-buffer "3.0.1" + kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -4634,38 +4795,33 @@ linkify-it@^3.0.1: dependencies: uc.micro "^1.0.1" -lint-staged@^13.2.0: - version "13.2.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.2.2.tgz#5e711d3139c234f73402177be2f8dd312e6508ca" - integrity sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA== +lint-staged@^14.0.1: + version "14.0.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-14.0.1.tgz#57dfa3013a3d60762d9af5d9c83bdb51291a6232" + integrity sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw== dependencies: - chalk "5.2.0" - cli-truncate "^3.1.0" - commander "^10.0.0" - debug "^4.3.4" - execa "^7.0.0" + chalk "5.3.0" + commander "11.0.0" + debug "4.3.4" + execa "7.2.0" lilconfig "2.1.0" - listr2 "^5.0.7" - micromatch "^4.0.5" - normalize-path "^3.0.0" - object-inspect "^1.12.3" - pidtree "^0.6.0" - string-argv "^0.3.1" - yaml "^2.2.2" + listr2 "6.6.1" + micromatch "4.0.5" + pidtree "0.6.0" + string-argv "0.3.2" + yaml "2.3.1" -listr2@^5.0.7: - version "5.0.8" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-5.0.8.tgz#a9379ffeb4bd83a68931a65fb223a11510d6ba23" - integrity sha512-mC73LitKHj9w6v30nLNGPetZIlfpUniNSsxxrbaPcWOjDb92SHPzJPi/t+v1YC/lxKz/AJ9egOjww0qUuFxBpA== +listr2@6.6.1: + version "6.6.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-6.6.1.tgz#08b2329e7e8ba6298481464937099f4a2cd7f95d" + integrity sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg== dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.19" - log-update "^4.0.0" - p-map "^4.0.0" + cli-truncate "^3.1.0" + colorette "^2.0.20" + eventemitter3 "^5.0.1" + log-update "^5.0.1" rfdc "^1.3.0" - rxjs "^7.8.0" - through "^2.3.8" - wrap-ansi "^7.0.0" + wrap-ansi "^8.1.0" loader-runner@^4.2.0: version "4.3.0" @@ -4694,6 +4850,13 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash._baseclone@~4.5.0: version "4.5.7" resolved "https://registry.yarnpkg.com/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz#ce42ade08384ef5d62fa77c30f61a46e686f8434" @@ -4744,15 +4907,16 @@ log-symbols@4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== +log-update@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-5.0.1.tgz#9e928bf70cb183c1f0c9e91d9e6b7115d597ce09" + integrity sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw== dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" + ansi-escapes "^5.0.0" + cli-cursor "^4.0.0" + slice-ansi "^5.0.0" + strip-ansi "^7.0.1" + wrap-ansi "^8.0.1" log4js@^6.4.1: version "6.9.1" @@ -4801,6 +4965,13 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -4861,7 +5032,7 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.4, micromatch@^4.0.5: +micromatch@4.0.5, micromatch@^4.0.4, micromatch@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== @@ -5049,9 +5220,9 @@ nise@^5.1.4: path-to-regexp "^1.7.0" node-gyp-build@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" - integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + version "4.6.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" + integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== node-polyfill-webpack-plugin@^2.0.1: version "2.0.1" @@ -5091,10 +5262,10 @@ node-preload@^0.2.1: dependencies: process-on-spawn "^1.0.0" -node-releases@^2.0.12: - version "2.0.12" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.12.tgz#35627cc224a23bfb06fb3380f2b3afaaa7eb1039" - integrity sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ== +node-releases@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" + integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== "normalize-package-data@~1.0.1 || ^2.0.0 || ^3.0.0": version "3.0.3" @@ -5120,6 +5291,13 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: semver "^7.3.4" validate-npm-package-name "^3.0.0" +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + npm-run-path@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.1.0.tgz#bc62f7f3f6952d9894bd08944ba011a6ee7b7e00" @@ -5190,7 +5368,7 @@ object-inspect@^1.12.3, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-is@^1.0.1: +object-is@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -5214,22 +5392,41 @@ object.assign@^4.1.2, object.assign@^4.1.4: object-keys "^1.1.1" object.entries@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" - integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.7.tgz#2b47760e2a2e3a752f39dd874655c61a7f03c131" + integrity sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +object.fromentries@^2.0.6: + version "2.0.7" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.7.tgz#71e95f441e9a0ea6baf682ecaaf37fa2a8d7e616" + integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + +object.groupby@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.groupby/-/object.groupby-1.0.1.tgz#d41d9f3c8d6c778d9cbac86b4ee9f5af103152ee" + integrity sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" object.values@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" - integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" + integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" on-finished@2.4.1: version "2.4.1" @@ -5252,7 +5449,7 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" -onetime@^5.1.0: +onetime@^5.1.0, onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== @@ -5266,6 +5463,16 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +open@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6" + integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg== + dependencies: + default-browser "^4.0.0" + define-lazy-prop "^3.0.0" + is-inside-container "^1.0.0" + is-wsl "^2.2.0" + opt-cli@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/opt-cli/-/opt-cli-1.5.1.tgz#04db447b13c96b992eb31685266f4ed0d9736dc2" @@ -5276,17 +5483,17 @@ opt-cli@1.5.1: manage-path "2.0.0" spawn-command "0.0.2-1" -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" + integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== dependencies: + "@aashutoshrathi/word-wrap" "^1.2.3" deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" os-browserify@^0.3.0: version "0.3.0" @@ -5307,6 +5514,13 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -5328,6 +5542,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + p-map@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" @@ -5335,13 +5556,6 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -5405,12 +5619,17 @@ path-exists@^4.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^3.1.0: +path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== @@ -5468,7 +5687,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pidtree@^0.6.0: +pidtree@0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== @@ -5479,9 +5698,9 @@ pify@^4.0.1: integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pirates@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-dir@^3.0.0: version "3.0.0" @@ -5497,6 +5716,13 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11" + integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA== + dependencies: + find-up "^6.3.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -5509,10 +5735,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.8.7: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== process-nextick-args@~2.0.0: version "2.0.1" @@ -5570,7 +5796,7 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" -qs@^6.11.0: +qs@^6.11.2: version "6.11.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== @@ -5645,14 +5871,15 @@ readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable util-deprecate "^1.0.1" readable-stream@^4.0.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.4.0.tgz#55ce132d60a988c460d75c631e9ccf6a7229b468" - integrity sha512-kDMOq0qLtxV9f/SQv522h8cxZBqNZXuXNyjyezmfAAuribMyVXziljpQ/uQhfE1XLg2/TLTW2DsnoE4VAi/krg== + version "4.4.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.4.2.tgz#e6aced27ad3b9d726d8308515b9a1b98dc1b9d13" + integrity sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA== dependencies: abort-controller "^3.0.0" buffer "^6.0.3" events "^3.3.0" process "^0.11.10" + string_decoder "^1.3.0" readdirp@~3.6.0: version "3.6.0" @@ -5680,19 +5907,19 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.11: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== -regenerator-transform@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" - integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== +regenerator-transform@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" + integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== dependencies: "@babel/runtime" "^7.8.4" -regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== @@ -5802,19 +6029,19 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== -resolve@^1.10.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.1, resolve@^1.3.2: - version "1.22.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" - integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== +resolve@^1.10.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.22.4, resolve@^1.3.2: + version "1.22.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" + integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== dependencies: - is-core-module "^2.11.0" + is-core-module "^2.13.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== +restore-cursor@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-4.0.0.tgz#519560a4318975096def6e609d44100edaa4ccb9" + integrity sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg== dependencies: onetime "^5.1.0" signal-exit "^3.0.2" @@ -5856,6 +6083,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +run-applescript@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/run-applescript/-/run-applescript-5.0.0.tgz#e11e1c932e055d5c6b40d98374e0268d9b11899c" + integrity sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg== + dependencies: + execa "^5.0.0" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -5863,12 +6097,15 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.8.0: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== +safe-array-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== dependencies: - tslib "^2.1.0" + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + isarray "^2.0.5" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" @@ -5894,26 +6131,26 @@ safe-regex-test@^1.0.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-utils@^3.1.1, schema-utils@^3.1.2: - version "3.2.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.2.0.tgz#7dff4881064a4f22c09f0c6a1457feb820fd0636" - integrity sha512-0zTyLGyDJYd/MBxG1AhJkKa6fpEBds4OQO2ut0w7OYG+ZGhGea09lijvzsqegYSik88zc7cUtIlnnO+/BvD6gQ== +schema-utils@^3.1.1, schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== dependencies: "@types/json-schema" "^7.0.8" ajv "^6.12.5" ajv-keywords "^3.5.2" schema-utils@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.1.0.tgz#4cff1e434c12ed39502378b9a3e24787b37df41d" - integrity sha512-Jw+GZVbP5IggB2WAn6UHI02LBwGmsIeYN/lNbSMZyDziQ7jmtAUrqKqDja+W89YHVs+KL/3IkIMltAklqB1vAw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== dependencies: "@types/json-schema" "^7.0.9" ajv "^8.9.0" ajv-formats "^2.1.1" ajv-keywords "^5.1.0" -"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.7: +"semver@2 >=2.2.1 || 3.x || 4 || 5 || 7", semver@^7.3.4, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -5925,7 +6162,7 @@ semver@^5.3.0, semver@^5.6.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.0, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -5995,7 +6232,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.7: +signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -6006,12 +6243,12 @@ sinon-chai@^3.7.0: integrity sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g== sinon@^15.0.3: - version "15.1.2" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.1.2.tgz#09b5f3abfbd9df6b257d0f05bbb9d1b78a31ae51" - integrity sha512-uG1pU54Fis4EfYOPoEi13fmRHgZNg/u+3aReSEzHsN52Bpf+bMVfsBQS5MjouI+rTuG6UBIINlpuuO2Epr7SiA== + version "15.2.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-15.2.0.tgz#5e44d4bc5a9b5d993871137fd3560bebfac27565" + integrity sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw== dependencies: "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers" "^10.1.0" + "@sinonjs/fake-timers" "^10.3.0" "@sinonjs/samsam" "^8.0.0" diff "^5.1.0" nise "^5.1.4" @@ -6027,24 +6264,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - slice-ansi@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" @@ -6074,14 +6293,15 @@ socket.io-parser@~4.2.4: debug "~4.3.1" socket.io@^4.4.1: - version "4.6.2" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.6.2.tgz#d597db077d4df9cbbdfaa7a9ed8ccc3d49439786" - integrity sha512-Vp+lSks5k0dewYTfwgPT9UeGGd+ht7sCpB7p0e83VgO4X/AHYWhXITMrNk/pg8syY2bpx23ptClCQuHhqi2BgQ== + version "4.7.2" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.7.2.tgz#22557d76c3f3ca48f82e73d68b7add36a22df002" + integrity sha512-bvKVS29/I5fl2FGLNHuXlQaUH/BlzX1IN6S+NKLNZpBsPZIDH+90eQmCs2Railn4YUiww4SzUedJ6+uzwFnKLw== dependencies: accepts "~1.3.4" base64id "~2.0.0" + cors "~2.8.5" debug "~4.3.2" - engine.io "~6.4.2" + engine.io "~6.5.2" socket.io-adapter "~2.5.2" socket.io-parser "~4.2.4" @@ -6217,7 +6437,7 @@ streamroller@^3.1.5: debug "^4.3.4" fs-extra "^8.1.0" -string-argv@^0.3.1: +string-argv@0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== @@ -6240,7 +6460,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^5.0.0: +string-width@^5.0.0, string-width@^5.0.1: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== @@ -6250,31 +6470,31 @@ string-width@^5.0.0: strip-ansi "^7.0.1" string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" @@ -6321,6 +6541,11 @@ strip-bom@^4.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + strip-final-newline@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" @@ -6367,6 +6592,14 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +synckit@^0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3" + integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q== + dependencies: + "@pkgr/utils" "^2.3.1" + tslib "^2.5.0" + taffydb@^2.7.3: version "2.7.3" resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.7.3.tgz#2ad37169629498fca5bc84243096d3cde0ec3a34" @@ -6389,9 +6622,9 @@ tar-stream@^2.1.4: readable-stream "^3.1.1" tar@^6.1.11: - version "6.1.15" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" - integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== + version "6.2.0" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73" + integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -6400,7 +6633,7 @@ tar@^6.1.11: mkdirp "^1.0.3" yallist "^4.0.0" -terser-webpack-plugin@^5.3.7: +terser-webpack-plugin@^5.3.7, terser-webpack-plugin@^5.3.8: version "5.3.9" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1" integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA== @@ -6412,9 +6645,9 @@ terser-webpack-plugin@^5.3.7: terser "^5.16.8" terser@^5.16.8: - version "5.18.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.18.0.tgz#dc811fb8e3481a875d545bda247c8730ee4dc76b" - integrity sha512-pdL757Ig5a0I+owA42l6tIuEycRuM7FPY4n62h44mRLRfnOxJkkOHd6i89dOpwZlpF6JXBwaAHF6yWzFrt+QyA== + version "5.19.4" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.19.4.tgz#941426fa482bf9b40a0308ab2b3cd0cf7c775ebd" + integrity sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -6435,11 +6668,6 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -through@^2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - timers-browserify@^2.0.12: version "2.0.12" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" @@ -6447,6 +6675,11 @@ timers-browserify@^2.0.12: dependencies: setimmediate "^1.0.4" +titleize@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/titleize/-/titleize-3.0.0.tgz#71c12eb7fdd2558aa8a44b0be83b8a76694acd53" + integrity sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ== + tmp@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" @@ -6479,6 +6712,11 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" +ts-api-utils@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" + integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + ts-node@^10.9.1: version "10.9.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" @@ -6498,7 +6736,7 @@ ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tsconfig-paths@^3.14.1: +tsconfig-paths@^3.14.2: version "3.14.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== @@ -6513,10 +6751,10 @@ tslib@^1.8.0, tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" - integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== +tslib@^2.5.0, tslib@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== tslint@5.14.0: version "5.14.0" @@ -6590,16 +6828,16 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - type-fest@^0.8.0: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-fest@^1.0.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== + type-fest@^2.14.0: version "2.19.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" @@ -6613,6 +6851,36 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" @@ -6634,15 +6902,15 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^5.0.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826" - integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw== +typescript@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" + integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== ua-parser-js@^0.7.30: - version "0.7.35" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.35.tgz#8bda4827be4f0b1dda91699a29499575a1f1d307" - integrity sha512-veRf7dawaj9xaWEu9HoTVn5Pggtc/qj+kqTOFvNiN1l0YdxwC1kvel57UCjThjGa3BHBihE8/UJAHI+uQHmd/g== + version "0.7.36" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.36.tgz#382c5d6fc09141b6541be2cae446ecfcec284db2" + integrity sha512-CPPLoCts2p7D8VbybttE3P2ylv0OBZEAy7a12DsulIEcAiMtWJy+PBgMXgWDI80D5UwqE8oQPHYnk13tm38M2Q== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.6" @@ -6697,6 +6965,11 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +untildify@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" + integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== + update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" @@ -6713,19 +6986,19 @@ uri-js@^4.2.2: punycode "^2.1.0" url@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" - integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA== + version "0.11.2" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.2.tgz#02f250a6e0d992b781828cd456d44f49bf2e19dd" + integrity sha512-7yIgNnrST44S7PJ5+jXbdIupfU1nWUdQJBFBeJRclPXiWgCvrSq5Frw8lr/i//n5sqDfzoKmBymMS81l4U/7cg== dependencies: punycode "^1.4.1" - qs "^6.11.0" + qs "^6.11.2" util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@^0.12.0, util@^0.12.4: +util@^0.12.4, util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== @@ -6843,9 +7116,9 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.82.1: - version "5.86.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.86.0.tgz#b0eb81794b62aee0b7e7eb8c5073495217d9fc6d" - integrity sha512-3BOvworZ8SO/D4GVP+GoRC3fVeg5MO4vzmq8TJJEkdmopxyazGDxN8ClqN12uzrZW9Tv8EED8v5VSb6Sqyi0pg== + version "5.88.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e" + integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.0" @@ -6856,7 +7129,7 @@ webpack@^5.82.1: acorn-import-assertions "^1.9.0" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.14.1" + enhanced-resolve "^5.15.0" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" @@ -6866,7 +7139,7 @@ webpack@^5.82.1: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.2" + schema-utils "^3.2.0" tapable "^2.1.1" terser-webpack-plugin "^5.3.7" watchpack "^2.4.0" @@ -6888,17 +7161,16 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.2, which-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" - integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== +which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.2: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" which@^1.2.1: version "1.3.1" @@ -6926,11 +7198,6 @@ wildcard@^2.0.0: resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== -word-wrap@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" - integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== - workerpool@6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" @@ -6954,6 +7221,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -7004,7 +7280,7 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^2.2.2: +yaml@2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== @@ -7076,3 +7352,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==